BREAK DOWN
Tables
// At Begining of every code
$pdocrud = new PDOCrud();
// Main Settings
$pdocrud->dbOrderBy("create_date desc");//descending
$pdocrud->tableHeading("");
$pdocrud->setPK("id");
// Settings that are commonly changed
$pdocrud->recordsPerPage(25);
// Table Buttons
$config["savebtn"] = false; // show save button in crud table (false)
$config["addbtn"] = false; // show add button (false)
$config["editbtn"] = true; // show edit button (true)
$config["viewbtn"] = true; // show view button (true)
$config["delbtn"] = false; // show delete button (false)
$config["inlineEditbtn"] = false; // show inline edit button (false)
$config["tableCellEdit"] = false; // whether to enable the table cell edit (FALSE)
$config["clonebtn"] = false; // show clone row (false)
$config["actionbtn"] = false; // show action buttons (true)
// Option Settings
$config["exportOption"] = true; // show export button (TRUE)
$config["csvBtn"] = true; // show CSV button (TRUE)
$config["excelBtn"] = true; //show excel button (TRUE)
$config["checkboxCol"] = true; // show multi select checkbox column (TRUE)
$config["filter"] = false; // show filters (FALSE)
// Email Settings
$config["emailMode"] = "PHPMAIL"; //whether to use phpemail or smtp.
$config["SMTPHost"] = "ajax";
$config["SMTPPort"] = 25;
$config["SMTPAuth"] = true;
$config["SMTPusername"] = "";
$config["SMTPpassword"] = "";
$config["SMTPSecure"] = "";
$config["SMTPKeepAlive"] = true;
// TABLE VIEW
$pdocrud->crudTableCol(array("id","create_date","campaign_id"));
// Rename Column
$pdocrud->colRename("id", "ID");
$pdocrud->colRename("create_date", "Date");
$pdocrud->colRename("campaign_id", "Campaign");
// Column Types
$pdocrud->fieldTypes("status_v", "select");//change state to select dropdown
$pdocrud->fieldDataBinding("status_v", array("Open Order"=>"Open Order","Shipped"=>"Shipped"), "", "","array");
$pdocrud->fieldTypes("notes_v", "textarea");//change about_yourself 'textarea' to input type text
// Column Formatting
$pdocrud->tableColFormatting("create_date", "date",array("format" =>"m-d-Y"));
$pdocrud->tableColFormatting("file_rx", "url",array("text" =>"View","target"=>'_blank'));
$pdocrud->tableColFormatting("notes_v", "readmore", array("length"=>4,"showreadmore"=>true));
// FILTER-1
$pdocrud->where("column-name", "Pending", "="); // EQUAL TO
//FILTER-2
$pdocrud->where("column-name", "Pending", "!="); // NOT EQUAL TO
//FILTER-3
$pdocrud->where("assigned_agent", "Ashley", "=", "OR" ,"(");
$pdocrud->where("assigned_agent", "YEISHA", "=", "" ,")");
// Search Field
$pdocrud->setSearchCols(array("id","create_date","campaign_id"));
// POP UP FORM IN TABLE - VIEW
$pdocrud->formDisplayInPopup();// call this function to show forms in popup
$pdocrud->formFields(array("id","create_date","campaign_id")); // function to set form fields in both insert and edit
// EDIT POP UP FORM
$pdocrud->editFormFields(array("id","create_date","campaign_id"));
// RENAME FORMS
//$pdocrud->fieldRenameLable("id", "ID");
//$pdocrud->fieldRenameLable("create_date", "Date");
//$pdocrud->fieldRenameLable("campaign_id", "Campaign");
// Form FIELD - Disable Edit
// $pdocrud->fieldDataAttr("id", array("disabled"=>"disabled"));
// ACTION BUTTONS
// Adds chosen column at the end of the url
$action = "https://www.google.com/{Phone}";
$text = 'Thinking ';
$attr = array("title"=>"Redirect");
$pdocrud->enqueueBtnActions("url", $action, "url",$text,"client_id", $attr);
// ACTION Button Samples
// NPI CHECK
$action = "https://npiregistry.cms.hhs.gov/registry/search-results-table?number={pcp_npi}";//pk will be replaced by primary key value
$text = 'NPI ';
$attr = array("title"=>"Redirect");
$pdocrud->enqueueBtnActions("url", $action, "url",$text,"client_id", $attr);
// AT END OF EVERY TABLE VIEW
echo $pdocrud->setLangData("save", "Save")->dbTable("kto_records")->render();
echo $pdocrud->dbTable("users")->render();
Current Filters
// Records - Verification
$pdocrud->where("status_verification", "Pending", "=");
// Records - Passed
$pdocrud->where("status_verification", "Passed", "=");
// Records - PCP-Ready
$pdocrud->where("status_dc", "Pending", "=");
// Records - Pending Faxes
$pdocrud->where("status_dc", "Fax-Pending", "=");
//Records - Calls
$pdocrud->where("call_type", "CN", "=");
$pdocrud->where("assigned_agent", "", "!=");
$pdocrud->where("status_dc", "Refax", "!=");
$pdocrud->where("status_dc", "Denied", "!=");
$pdocrud->where("status_dc", "PCP-Not Theirs", "!=");
$pdocrud->where("status_dc", "Med Release", "!=");
$pdocrud->where("status_dc", "PCP-Incorrect", "!=");
$pdocrud->where("status_dc", "Completed", "!=");
$pdocrud->where("status_dc", "PCP-Incorrect number", "!=");
User Management
// Place at the top of every page
$pdocrud = new PDOCrud();
if ($pdocrud->checkUserSession("userId"))
{
if ($pdocrud->checkUserSession("role", array("100","101","102","121")))
{
}
else
{
header("Location: https://tools.myflex.io/kto/records/no-permission.php");
}
}
else
{
header("Location: https://tools.myflex.io/kto/records/not-authorized.php");
exit();
}