Original Source
https://pdocrud.com/demo/pages/add-plugin
https://pdocrud.com/demo/pages/plugin-file-input
https://pdocrud.com/demo/pages/plugin-color-picker
https://pdocrud.com/demo/pages/plugin-chosen
https://pdocrud.com/demo/pages/plugin-timepicker
https://pdocrud.com/demo/pages/plugin-select2
https://pdocrud.com/demo/pages/plugin-knob
https://pdocrud.com/demo/pages/plugin-datatable
https://pdocrud.com/demo/pages/plugin-jQuery-Word-and-Character-Counter
https://pdocrud.com/demo/pages/plugin-ckeditor
https://pdocrud.com/demo/pages/plugin-summernote
https://pdocrud.com/demo/pages/plugin-calendar
https://pdocrud.com/demo/pages/plugin-bootstrap-tag-input
https://pdocrud.com/demo/pages/plugin-vertical-timeline
https://pdocrud.com/demo/pages/plugin-rateit
https://pdocrud.com/demo/pages/plugin-pwstrength
https://pdocrud.com/demo/pages/plugin-input-mask
https://pdocrud.com/demo/pages/plugin-animate
Add Plugin
$pdocrud = new PDOCrud();
$pdocrud->addPlugin("knob");//to add plugin
echo $pdocrud->dbTable("orders")->render();
echo $pdocrud->loadPluginJsCode("knob",".pdocrud-number");//to add plugin
Current Plugins
$pdocrud = new PDOCrud();
// Plugin - File Input Example
$pdocrud->addPlugin("bootstrap-fileinput-master");//to add plugin
$pdocrud->fieldTypes("product_image", "image");//change field type
$pdocrud->formFields(array("product_name","product_price","product_image"));
echo $pdocrud->loadPluginJsCode("bootstrap-fileinput-master","input[type=file]");//to add plugin call on input[type=file] elements
// Plugin - Color Picker Example
$pdocrud->addPlugin("bootstrap-colorpicker");//to add plugin
$pdocrud->formFields(array("product_name"));
echo $pdocrud->loadPluginJsCode("bootstrap-colorpicker","input[type=text]");//to add plugin call on input[type=text] elements
// Plugin - Chosen Example
$pdocrud->addPlugin("chosen");//to add plugin
$pdocrud->fieldTypes("product_name", "select"); //change donation amount to radio button
$pdocrud->fieldDataBinding("product_name", array("Mobile", "Pendrive", "Harddisk"), "", "", "array"); //add data for radio button
echo $pdocrud->loadPluginJsCode("chosen",".pdocrud-select");//to add plugin call on class .pdocrud-select elements
// Plugin - Time Picker Example
$pdocrud->addPlugin("timepicker");//to add plugin
$pdocrud->formFields(array("product_name"));
echo $pdocrud->loadPluginJsCode("timepicker","input[type=text]");//to add plugin call on input[type=text] elements
// Plugin - Select 2 Example
$pdocrud->addPlugin("select2");//to add plugin
$pdocrud->fieldTypes("order_status", "multiselect");//change gender to radio button
$pdocrud->fieldDataBinding("order_status", array("Completed","Pending"), "", "","array");//add data binding using array
echo $pdocrud->loadPluginJsCode("select2","select");//to add plugin call on select elements
// Plugin - Knob Example
$pdocrud->addPlugin("knob");//to add plugin
$pdocrud->formFields(array("qty_available"));
echo $pdocrud->loadPluginJsCode("knob","input[type=number]");//to add plugin call on input[type=number] elements
//Plugin - Data Table Example - jquery data table plugin (Added in version 2.4)
// jQuery based data table plugin is quite useful in term of no. of function it has. With our script, if you want to use the sql and still want search/sorting/pagination etc functions, you can use this plugin. You will have most of the grid/table functionality using this.
$pdocrud->addPlugin("datatable");//to add plugin
$pdocrud->setQuery("select * from orders");
echo $pdocrud->render("SQL");
echo $pdocrud->loadPluginJsCode("datatable",".pdocrud-table");//to add plugin call on input[type=text] elements
// Plugin - jQuery Word and Character Counter Example
$pdocrud->addPlugin("jQuery-Word-and-Character-Counter");//to add plugin
$pdocrud->formFields(array("product_name"));
echo $pdocrud->loadPluginJsCode("jQuery-Word-and-Character-Counter","input[type=text]");//to add plugin call on input[type=text] elements
// Plugin - ckeditor example (added in version 2.0)
$pdocrud->addPlugin("ckeditor");//to add plugin
// add css class
$pdocrud->fieldCssClass("product_description", array("ckeditor"));
//echo $pdocrud->loadPluginJsCode("ckeditor","cHJvZHVjdHMjJHByb2R1Y3RfZGVzY3JpcHRpb25AM2RzZnNkZioqOTkzNDMyNA==");//to add plugin call on textarea with Id = cHJvZHVjdHMjJHByb2R1Y3RfZGVzY3JpcHRpb25AM2RzZnNkZioqOTkzNDMyNA
// Plugin - Summernote - Super Simple WYSIWYG Editor (Added in v 3.7)
// Summernote is a JavaScript library that helps you create WYSIWYG editors online.
// You can customize the features of summernote similar to other plugin by passing attribute as parameters. You can set $config["preventXSS"] = false to save data in html format.
// Please note that we have removed the image upload feature of summernote to prevent issue related to our image uploading.
$pdocrud->addPlugin("summernote");//to add plugin
$pdocrud->fieldCssClass("product_description", array("summernote"));
echo $pdocrud->loadPluginJsCode("summernote",".summernote");//to add plugin call on textarea with class .summernote
// Plugin - Calendar Example - (added in v 2.3)
// This example also demonstrate how to use plugin that are applied to static html elements like div/span etc instead of form elements
$pdocrud->addPlugin("fullcalendar");
$pdomodel = $pdocrud->getPDOModelObj();
$data["events"] = $pdomodel->executeQuery("select event_id as id, event_title as title, event_date_and_time as start,event_end_date_time as end from eventtable");
$html_data = array("");
echo $pdocrud->render("HTML", $html_data);
echo $pdocrud->loadPluginJsCode("fullcalendar","#fullcalendar",$data);//to add plugin call on input[type=text] elements
// Plugin - Bootstrap Tag Input Example
// Convert any input type text field to tags field. You can write tags and move focus out of the text area to convert the value in tags.
$pdocrud->formFields(array("membership_categories"));
$pdocrud->addPlugin("bootstrap-tag-input");//to add plugin
$pdocrud->fieldAttributes("membership_categories", array("data-role"=>"tagsinput"));
$pdocrud->fieldCssClass("membership_categories", array("tagsinput"));// add css classes
echo $pdocrud->loadPluginJsCode("bootstrap-tag-input",".tagsinput");//to add plugin call on .tagsinput class
// Plugin - Vertical timeline (Added in v 3.6)
// Creates vertical timeline by passing the required data. You can get data in form of array and use it to create the html block.
$pdocrud->addPlugin("vertical-timeline-master");//to add plugin
$data = $pdocrud->getPDOModelObj()->orderBy(array("message_date"))->select("message");//get data to be displayed in time line e.g. getting data from message table
//Create html from data
//You can print_r the $data to understand the column name that needs to be used to create the block.
$block = "";
if(count($data)){
foreach($data as $row){
$block .="
";
}
}
$html_data = array("$block");
echo $pdocrud->render("HTML", $html_data);
// Plugin - Rateit example
$pdocrud->addPlugin("rateit");//to add plugin
$pdocrud->fieldTypes("product_rating", "rateit");
$pdocrud->formFields(array("product_rating"));
$pdocrud->crudTableCol(array("product_id","product_name", "qty_available", "product_rating"));
$pdocrud->tableColFormatting("product_rating", "rateit");
$pdocrud->viewColFormatting("product_rating", "rateit");
echo $pdocrud->dbTable("producttable")->render();
echo $pdocrud->loadPluginJsCode("rateit",".rateit");//to add plugin call on input[type=text] elements
// Plugin - Password Strength example
// Adds a password strength bar below the password field indicating the password strength. Please note that it shows only strength of password, it doesn't prevent submission if password is weak.
$pdocrud->fieldCssClass("password", array("password"));// add css classes to apply plugin later on that css class
$pdocrud->addPlugin("bootstrap-pwstrength");//to add plugin
$pdocrud->formFields(array("first_name","last_name","user_name","password"));
//optional parameters for the bootstrap pwstrength plugin
$params["ui"] = array("showProgressBar"=> "true");
$params["common"] = array("showVerdictsInsideProgressBar"=> "true");
$params["rules"] = array("wordRepetitions"=> "true");
echo $pdocrud->loadPluginJsCode("bootstrap-pwstrength",".password",$params);//to add plugin call on class .password elements
// Plugin - Input Mask Example
// You can define the input mask for element with the help of plugin input mask.
$pdocrud->addPlugin("bootstrap-inputmask");//to add plugin
$pdocrud->formFields(array("product_name"));
$pdocrud->fieldCssClass("product_name", array("product_name"));
//$pdocrud->fieldDataAttr("product_name", array("placeholder"=>"default format is [9-]AAA-999"));//optional
echo $pdocrud->loadPluginJsCode("bootstrap-inputmask",".product_name", array("mask"=> "'[9-]AAA-999'"));//to add plugin call on .product_name elements
// Plugin - Animation
// Adds animation to fields. You can find list of animation here https://daneden.github.io/animate.css/
$pdocrud->addPlugin("animate");//to add plugin animate
echo $pdocrud->dbTable("users")->render("insertform"); // insert form
//lets call animate plugin to all input type text, you can specify .class or #id also there.
//You can find list of animation here https://daneden.github.io/animate.css/
echo $pdocrud->loadPluginJsCode("animate","input[type=text]", array("rubberBand delay-2s infinite"));
echo $pdocrud->dbTable("producttable")->render("insertform");