Skip to content

Instantly share code, notes, and snippets.

View ano's full-sized avatar
🏠
Working from home

Anonga Tisam ano

🏠
Working from home
View GitHub Profile
@ano
ano / ReadMe.md
Last active January 24, 2024 04:44
Formidable Forms Manage Entries Script

Introduction

A single page standalone PHP script to help manage formidable forms data in the front-end.

Usage

Add Entry

To add a see the URL below, note that

  • [z] is the id of the form
@ano
ano / ReadMe.md
Last active March 13, 2023 13:53
Add PHP-CRUD-API to a PHPMaker project

Setup PHP-CRUD-API with a PHPMaker Project

Here's a quick tutorial on how to include REST API documentation into your PHPMaker Project.

  1. Generate your PHPMaker project into a folder e.g. C:\wamp64\www\datamart\docs
  2. Create a folder in the root called api e.g. C:\wamp64\www\datamart\docs\api
  3. Copy and Paste the api.php code and the index.html code into the folder
  4. Find the configuration part of code at the bottom of the api.php and configure it to your needs. The configuration part of code should look like the section of code below:
@ano
ano / ReadMe.md
Last active December 16, 2020 04:24
PHP-CRUD-API make available via a REST API access to MYSQL views. If the view is updateable allow updating via REST API

PHP-CRUD-API MySQL Views

Create a REST API for MYSQL Views and display the appropriate REST API endpoints based on whether the MYSQL database view is updateable or not

@ano
ano / index.php
Last active December 17, 2020 02:38
Formidable Forms display a single entry record
<?php
/** Load WordPress Environment */
define('WP_PATH', './dashboard/');
define('WP_USE_THEMES', false);
require(WP_PATH . 'wp-load.php');
/** Get Edit Link, HTML Table of the record **/
if (isset($_REQUEST["entry_id"])) {
$entry_id = $_REQUEST["entry_id"];
$response['edit_link'] = "./dashboard/?frm_action=edit&entry=" . $entry_id;
@ano
ano / get_function.js
Created October 21, 2020 22:03
Javascript $_GET() - similar in nature to PHP $_GET[]
/**
* Description: Gets a URL parameter value. Similar to PHP $_GET
* @param {string} param
*/
function $_GET(param) {
var vars = {};
window.location.href.replace(location.hash, '').replace(/[?&]+([^=&]+)=?([^&]*)?/gi, // regexp
function (m, key, value) { // callback
vars[key] = value !== undefined ? value : '';
});
@ano
ano / ReadMe.md
Last active October 2, 2020 18:48
Wordpress: Formidable Form Twenty Twenty Theme CSS Style

Instructions

  • Log into Wordress
  • Then click customize > additional CSS
  • Copy and Paste the CSS Code into the textbox
@ano
ano / generate_formidable_sql.php
Last active May 16, 2020 21:32
Generates SQL code for Formidable Form Entries
<?php
/**
* The Formidable-SQL plugin
*
* Generates SQL code for Formidable Form Entries.
*
* @link ano.tisam.com
* @since 1.0.0
* @package Formidable_Sql
*
@ano
ano / index.html
Created April 24, 2020 20:47
One Page Swagger / OpenAPI
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>ServiceDesk Service Swagger</title>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@3.12.1/swagger-ui.css">
</head>
<body>
@ano
ano / sanitize_alphanumeric.php
Created February 20, 2020 03:59
Remove all non alpha numeric characters
<?php
/**
* Remove all non alpha numeric characters except a space
* @param string $string The string to cleanse
* @return string
*/
function alphanumeric( $string ){
return preg_replace('/[^a-zA-Z0-9]/', '', filter_var($string,FILTER_SANITIZE_STRING));
}
@ano
ano / mysql_uuid_to_int.sql
Created February 15, 2020 05:56
MySQL Convert UUID to Integer
/*
The format for converting UUID's to integers is as follows
CONV(LEFT(HEX(`uuid_from_bin` (`uuid_v5` (<a static uuid value>,<the uuid field>))),8),16,10) AS id
MYSQL User Defined Functions
uuid_from_bin
and uuid_v5