This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| CUSTOM_CODE | |
| ----------- | |
| Author: Ano Tisam | |
| Date: 09/03/2015 | |
| Description: Machform customisation to keep lookup fields [checkbox, select, radio] in Child_Forms in sync with data in Parent_Forms | |
| Essentialy mimicing 1:M relational database features in Machform between forms. | |
| Requires PHPMaker, sync.lib.php library, database created by ap_custom_link.sql file. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Detect and Convert URL's into clickable links | |
| function linkify(link, text) { | |
| var urlRegex =/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; | |
| return link.replace(urlRegex, function(url, text) { | |
| return '<a href="' + url + '">'+ text +'</a>'; | |
| }); | |
| } | |
| // Usage | |
| linkify("https://www.google.com", "Search"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function string_to_slug(str) { | |
| str = str.replace(/^\s+|\s+$/g, ""); // trim | |
| str = str.toLowerCase(); | |
| // remove accents, swap ñ for n, etc | |
| var from = "åàáãäâèéëêìíïîòóöôùúüûñç·/_,:;"; | |
| var to = "aaaaaaeeeeiiiioooouuuunc------"; | |
| for (var i = 0, l = from.length; i < l; i++) { | |
| str = str.replace(new RegExp(from.charAt(i), "g"), to.charAt(i)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Demo: https://codepen.io/anonga/full/XBOpJq | |
| * Example Usage: | |
| #html | |
| <table id="left">...</table> | |
| <table id="right">...</table> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * FORM FUNCTIONS | |
| Usage: | |
| # hooks/sql/index.php | |
| //Load machform files | |
| define("BASE_PATH", "../../") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Desciption: Machform password generation service for integration with Zapier | |
| Author: Ano Tisam | |
| Organisation: WHUPI LTD | |
| Website: https://www.whupi.com/ | |
| Date: 12/10/2014 | |
| */ | |
| define("BASE_PATH", "../../../"); //Relative PATH to MACHFORMS ROOT FOLDER | |
| require(BASE_PATH . 'includes/filter-functions.php'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$id": "https://standards.ffa.int/vessel.json", | |
| "$schema": "http://json-schema.org/draft-07/schema#", | |
| "description": "The representation of a vessel", | |
| "type": "object", | |
| "title": "Vessel", | |
| "properties": { | |
| "vessel_name": { | |
| "title": "Vessel Name", | |
| "type": "string", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "last_tab":"9", | |
| "dynamic-css-type":"custom", | |
| "primary-color":"#f45246", | |
| "page-bg":{ | |
| "background-color":"#f0f1f2", | |
| "background-repeat":"", | |
| "background-size":"", | |
| "background-attachment":"", | |
| "background-position":"", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function contains_word($str, $word) | |
| { | |
| return !!preg_match('#\\b' . preg_quote($word, '#') . '\\b#i', $str); | |
| } | |
| //usage | |
| $a = 'How are you?'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Example Usage | |
| */ | |
| $(document).ready(function(){ | |
| var autocomplete_options = { | |
| base: "http://localhost/platform/forms/v11/hooks/api/v2/index.php/", //Base path of the API | |
| form: "ap_form_11330", //The form you are searching | |
| element: "element_1", //The field to search | |
| skip: "element_60", //The field you skip auto population | |
| staticFilters: "order=date_created%2Cdesc&page=1%2C10&transform=true", //Other static filters to apply, see here https://github.com/mevdschee/php-crud-api#list--filter |