Form Buttomn
Form View with Specific Columns
$pdocrud = new PDOCrud();
$pdocrud->setPK("id");
$pdocrud->setViewColumns(array("order_no","order_date","customer_name"));
echo $pdocrud->dbTable("orders")->render("VIEWFORM",array("id" =>"58"));
View Column Formatting (Added in v2.5)
Notes:- Format view columns similar to table col formating.
- You can format view form fields for date, image, html,read more, description and many more other options. date format allows you to pass any standard php date formatting string and data will be formatted according to that. image format makes value as image tag. long description can be made short with some character limit.
- *** IMPORTANT *** Where you see 900 it should be replaced with (div) and brackets.
- *** IMPORTANT *** Where you see 800 it should be replaced with (a) and brackets.
$pdocrud = new PDOCrud();
$pdocrud->setPK("product_id");
// convert to any html like url or any html with actual value passed as {col-name}
$pdocrud->viewColFormatting("product_line", "html", array("type" => "html",
"str" => "(900 style="font-weight:bold" data-attribute="abc-{col-name}">{col-name}(/900)"));
$pdocrud->viewColFormatting("product_name", "html", array("type" => "html",
"str" => "(800 href="http://www.pdocrud.com/?paramater={col-name}" data-attribute="abc-{col-name}">{col-name}(/800)"));
//convert to image column
$pdocrud->viewColFormatting("product_image", "image");
//convert long column text to small text with read more
$pdocrud->viewColFormatting("product_description", "readmore", array("length" => 4, "showreadmore" => true)); //not showing read more
// date formatting (pass date format)
$pdocrud->viewColFormatting("added_date", "date", array("format" => "m-d-Y"));
echo $pdocrud->dbTable("products")->render("VIEWFORM", array("id" => "S10_1678"));
Multi Step Tabs in View Form
Notes:- Divide complete view form in tabs.
- You can divide the form tab wise also. You can show fields in different tabs. Please note that if you need tabs only in forms then you can turn off tabs in view form by setting $config["viewFormTabs"] = false or $pdocrud->setSettings("viewFormTabs",false);
$pdocrud = new PDOCrud();
$pdocrud->FormSteps(array("first_name", "last_name", "email", "phone", "gender","birth_date"), "General Info","tabs");
$pdocrud->FormSteps(array("user_name", "password"), "Login Details","tabs");
$pdocrud->FormSteps(array("address", "city", "state", "country", "zip_code"), "Address","tabs");
$pdocrud->FormSteps(array("hobbies", "educational_status", "about_yourself", "company_name"), "Other","tabs");
$pdocrud->setPK("user_id");
$pdocrud->setSettings("viewFormTabs", true);//set view form tabs enabled
echo $pdocrud->dbTable("users")->render("VIEWFORM",array("id" =>"26"));