<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>phpGrid Edit Form Layout</title> </head> <body> <?php $dg = new C_DataGrid("SELECT * FROM orders", "orderNumber", "orders"); // change column titles $dg->set_col_title("orderNumber", "Order No."); $dg->set_col_title("orderDate", "Order Date"); $dg->set_col_title("shippedDate", "Shipped Date"); $dg->set_col_title("customerNumber", "Customer No."); // hide a column $dg->set_col_hidden("requiredDate"); // enable edit $dg->enable_edit("FORM", "CRUD"); $dg->set_col_property("orderNumber", array("formoptions" => array("rowpos" => 1, "colpos" => 1))); $dg->set_col_property("orderDate", array("formoptions" => array("rowpos" => 1, "colpos" => 2))); $dg->set_col_property("requiredDate", array("formoptions" => array("rowpos" => 2, "colpos" => 1))); $dg->set_col_property("shippedDate", array("formoptions" => array("rowpos" => 2, "colpos" => 2))); $dg->set_col_property("status", array("formoptions" => array("rowpos" => 3, "colpos" => 1))); $dg->set_col_property("customerNumber", array("formoptions" => array("rowpos" => 3, "colpos" => 2))); $dg->set_col_property("comments", array("formoptions" => array("rowpos" => 4, "colpos" => 1))); $dg->set_form_dimension(700, 300); $dg->display(); ?> </body> </html>
<?php //include('../../Glimpse/index.php'); require_once "../conf.php"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Custom Datagrid Column Property</title> </head> <body> <?php $dg = new C_DataGrid("SELECT * FROM orders", "orderNumber", "orders"); $dg->set_row_color('yellow', 'blue', 'lightgray'); $dg->set_col_property("orderNumber", array("name" => "Order Number", "width" => 40)); // display time only $dg->set_col_property("orderDate", array("formatter" => "date", "formatoptions" => array("srcformat" => "ISO8601Short", "newformat" => "g:i A"))); $dg->enable_edit('FORM'); $dg->display(); ?> </body> </html>
$dg->set_col_edittype("FormstackImage3", "disabled"); $dg->set_col_edittype("FormstackImage4", "disabled"); $dg->set_col_edittype("FormstackImage5", "disabled"); $dg->set_col_edittype("FormstackImage6", "disabled"); $dg->set_col_edittype("FormstackImage7", "disabled"); $dg->set_col_edittype("FormstackImage8", "disabled"); $dg->set_col_edittype("BeforeAfter1", "disabled"); $dg->set_col_edittype("BeforeAfter2", "disabled"); $dg->set_col_edittype("BeforeAfter3", "disabled"); $dg->set_col_edittype("BeforeAfter4", "disabled"); $dg->set_col_edittype("Comments", "textarea"); $dg->set_col_edittype("Comments2", "textarea"); // Set image fields to read only. $dg->set_col_readonly("pk, FormstackImage1, FormstackImage2, FormstackImage3, FormstackImage4"); // Set data edit form layout and dimensions $dg->set_col_property("pk", array("formoptions" => array("rowpos" => 1, "colpos" => 1))); $dg->set_col_property("OrderNumber", array("formoptions" => array("rowpos" => 1, "colpos" => 2))); $dg->set_col_property("DateTime", array("formoptions" => array("rowpos" => 1, "colpos" => 3))); $dg->set_col_property("FirstName", array("formoptions" => array("rowpos" => 2, "colpos" => 1))); $dg->set_col_property("LastName", array("formoptions" => array("rowpos" => 2, "colpos" => 2))); $dg->set_col_property("email", array("formoptions" => array("rowpos" => 2, "colpos" => 3))); $dg->set_col_property("Address1", array("formoptions" => array("rowpos" => 3, "colpos" => 1))); $dg->set_col_property("Address2", array("formoptions" => array("rowpos" => 3, "colpos" => 2))); $dg->set_col_property("AddressCity", array("formoptions" => array("rowpos" => 4, "colpos" => 1))); $dg->set_col_property("AddressState", array("formoptions" => array("rowpos" => 4, "colpos" => 2))); $dg->set_col_property("AddressZip", array("formoptions" => array("rowpos" => 4, "colpos" => 3))); $dg->set_col_property("Country", array("formoptions" => array("rowpos" => 4, "colpos" => 4))); $dg->set_col_property("InstallerRating", array("formoptions" => array("rowpos" => 5, "colpos" => 1))); $dg->set_col_property("DoorConstruction", array("formoptions" => array("rowpos" => 5, "colpos" => 2))); $dg->set_col_property("THDStoreNumber", array("formoptions" => array("rowpos" => 7, "colpos" => 1))); $dg->set_col_property("InstallType", array("formoptions" => array("rowpos" => 5, "colpos" => 3)));
<html> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <head> <title> <?php echo iconv('Windows-1253', 'UTF-8', 'Προγράμματα Σχολικών Δραστηριοτήτων $prSxetos'); ?> </title> </head> <body> <?php // declare and prepare phpgrid require_once 'phpgrid/conf.php'; $dg = new C_DataGrid("SELECT id,sch1,titel FROM {$prTable}", "id", "{$prTable}"); $dg->set_locale('el'); $dg->set_caption(mb_convert_encoding("Προγράμματα Σχολικών Δραστηριοτήτων {$prSxetos}", "utf-8", "iso-8859-7")); $dg->set_col_property("id", array("name" => "A/A", "width" => 15)); //$dg ->set_col_property("done", array("name"=>"done", "width"=>15)); //$dg ->set_col_property("agree", array("name"=>"done", "width"=>15)); $dg->set_col_title("id", "A/A"); $dg->set_col_title("sch1", mb_convert_encoding("Όνομα Σχολείου", "utf-8", "iso-8859-7")); $dg->set_col_title("titel", mb_convert_encoding("Τίτλος προγράμματος", "utf-8", "iso-8859-7")); //$dg ->set_col_title("done", mb_convert_encoding("Ξεκίνησε;", "utf-8","iso-8859-7" )); //$dg ->set_col_title("agree", mb_convert_encoding("Δήλ.Ολοκλ.", "utf-8","iso-8859-7" )); $dg->enable_search(true); $dg->set_dimension(1100, 700); $dg->set_pagesize(30); $dg->set_col_dynalink("id", "prog.php", "id"); $dg->set_col_dynalink("titel", "prog.php", "id"); // get data from CAS server if (!$prDebug) { $_SESSION['admin'] = 0;
{ \tvar GraphData1 = []; \tvar GraphData2 = []; \td1 = \$('#products').jqGrid('getCol', 'buyPrice', false); \td2 = \$('#products').jqGrid('getCol', 'MSRP', false); \tnpoints = d1.length; \tfor(var i=0; i < npoints; i++){ \t\tGraphData1[i] = [i+1, parseInt(d1[i])]; \t} _Graph.series[0].data = GraphData1; _Graph.replot({resetAxes:true}); for(var i=0; i < npoints; i++){ GraphData1[i] = [i+1, parseInt(d1[i])]; GraphData2[i] = [i+1, parseInt(d2[i])]; } _Graph2.series[0].data = GraphData1; _Graph2.series[1].data = GraphData2; _Graph2.replot({resetAxes:true}); } ONGRIDLOADCOMPLETE; $dg->add_event("jqGridLoadComplete", $onGridLoadComplete); $dg->set_col_property('MSRP', array('classes' => 'msrp_bg')); $dg->set_col_property('buyPrice', array('classes' => 'buyprice_bg')); $dg->enable_search(true); $dg->display(); ?> </body> </html>