コード例 #1
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
function get_main_grid()
{
    global $myconn, $customers;
    $myconn->query("SET NAMES utf8");
    //execute the query specifical to your database
    $sth = $myconn->prepare('SELECT CustomerID, CompanyName, ContactName, Phone, City FROM customers');
    $sth->execute();
    // get the data as array. Nothe the the customer array
    // is passed in the select command
    $customers = $sth->fetchAll(PDO::FETCH_ASSOC);
    // end of custom code
    //var_dump($customers);
    // create the array connection
    $conn = new jqGridArray();
    // Create the jqGrid instance
    $grid = new jqGridRender($conn);
    // Write the SQL Query
    $grid->SelectCommand = 'SELECT * FROM customers';
    // Set the table to where you update the data
    $grid->table = 'customers';
    // Set output format to json
    $grid->dataType = 'json';
    $grid->setPrimaryKeyId("CustomerID");
    // Let the grid create the model
    $grid->setColModel();
    // Set the url from where we obtain the data
    $grid->setUrl('grid.php');
    // Set some grid options
    $grid->setGridOptions(array("rowNum" => 10, "height" => 250, "rowList" => array(10, 20, 30), "sortname" => "CustomerID"));
    $grid->setColProperty('CustomerID', array("label" => "ID", "width" => 50));
    $grid->setSubGridGrid("subgrid.php");
    // Enable navigator
    $grid->navigator = true;
    // Enable only editing
    $grid->setNavOptions('navigator', array("excel" => false, "add" => false, "edit" => false, "del" => false, "view" => false));
    // Enjoy
    $grid->renderGrid('#grid', '#pager', true, null, null, true, true);
}
コード例 #2
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
// Tell the db that we use utf-8
$conn->query("SET NAMES utf8");
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = 'SELECT OrderID, OrderDate, CustomerID, ShipName, Freight FROM orders';
// Set output format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('grid.php');
// Set some grid options
$grid->setGridOptions(array("rowNum" => 10, "rowList" => array(10, 20, 30), "sortname" => "OrderID"));
// Change some property of the field(s)
$grid->setColProperty("OrderDate", array("formatter" => "date", "formatoptions" => array("srcformat" => "Y-m-d H:i:s", "newformat" => "m/d/Y")));
$grid->setColProperty("ShipName", array("width" => "200"));
// Enable navigator
$grid->navigator = true;
// Enable search
// By default we have multiple search enabled
$grid->setNavOptions('navigator', array("excel" => false, "add" => false, "edit" => false, "del" => false, "view" => false));
// In order to enable the more complex search we should set multipleGroup option
// Also we need show query roo
$grid->setNavOptions('search', array("multipleGroup" => true, "showQuery" => true));
// client side validation when search
$grid->setColProperty('OrderID', array("searchrules" => array("required" => true, "number" => true, "minValue" => 10200)));
$grid->setDatepicker('OrderDate');
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #3
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
$conn = new PDO(DB_DSN, DB_USER, DB_PASSWORD);
// Tell the db that we use utf-8
$conn->query("SET NAMES utf8");
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = 'SELECT a.OrderID, a.OrderDate, a.CustomerID, b.CompanyName, a.Freight, a.ShipName FROM orders a, customers b WHERE a.CustomerID=b.CustomerId';
// set the ouput format to json
$grid->dataType = 'json';
$grid->table = "orders";
$grid->setPrimaryKeyId("OrderID");
// Let the grid create the model
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('grid.php');
// Set grid caption using the option caption
$grid->setGridOptions(array("caption" => "Advanced Autocomplete", "rowNum" => 10, "sortname" => "OrderID", "hoverrows" => true, "rowList" => array(10, 20, 50)));
// Change some property of the field(s)
$grid->setColProperty("OrderID", array("label" => "ID", "width" => 60));
$grid->setColProperty("CustomerID", array("editoptions" => array("readonly" => "readonly")));
$grid->setColProperty("OrderDate", array("formatter" => "date", "formatoptions" => array("srcformat" => "Y-m-d H:i:s", "newformat" => "m/d/Y")));
// set autocomplete. Serch for name and ID, but select a ID
// set it only for editing and not on serch
$grid->setAutocomplete("CompanyName", "#CustomerID", "SELECT CompanyName, CompanyName,CustomerID FROM customers WHERE CompanyName LIKE ? ORDER BY CompanyName", null, true, false);
$grid->datearray = array('OrderDate');
// Enjoy
$grid->navigator = true;
$grid->setNavOptions('navigator', array("search" => false, "excel" => false));
$grid->setNavOptions('edit', array("height" => 'auto', "dataheight" => 'auto'));
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #4
0
ファイル: mne.php プロジェクト: Russell-IO/php-syslog-ng
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = "SELECT name as Mnemonic, seen as Seen, lastseen as LastSeen FROM mne where hidden='false'";
// set the ouput format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('includes/grid/mne.php');
// Set some grid options
$grid->setGridOptions(array("rowNum" => 19, "sortname" => "LastSeen", "sortorder" => "desc", "altRows" => true, "multiselect" => true, "scrollOffset" => 25, "shrinkToFit" => true, "setGridHeight" => "100%", "rowList" => array(20, 40, 60, 75, 100, 500, 750, 1000), "loadComplete" => "js:"));
$grid->setColProperty('Seen', array('width' => '20', 'formatter' => 'js:grid_formatSeen'));
$grid->setColProperty('LastSeen', array('width' => '35', 'formatter' => 'js:easyDate'));
$grid->navigator = true;
$grid->setNavOptions('navigator', array("pdf" => true, "excel" => true, "add" => false, "edit" => false, "del" => false, "view" => false, "search" => true));
$gridComplete = <<<ONCOMPLETE
\tfunction ()
\t{\t
\t setRememberedCheckboxesForDialog('mnemonics','gbox_mnegrid',12,'portlet_Mnemonics');

\t}
ONCOMPLETE;
$grid->setGridEvent('loadComplete', $gridComplete);
$custom = <<<CUSTOM

//---------------------------------------------------------------
// BEGIN: Mnemonic Select Dialog
//---------------------------------------------------------------
\$("#portlet-header_Mnemonics .ui-icon-search").click(function() {
    \$("#mne_dialog").dialog({
コード例 #5
0
ファイル: clr_application.php プロジェクト: sangikumar/IP
$grid->dataType = 'json';
$grid->setColModel();
$grid->setUrl('../grids/clr_application.php');
$grid->addCol(array("name" => "Actions", "formatter" => "actions", "editable" => false, "sortable" => false, "resizable" => false, "fixed" => true, "width" => 60, "formatoptions" => array("keys" => true)), "first");
$grid->setColProperty("id", array("editable" => false, "width" => 40, "fixed" => true, "label" => "ID"));
$grid->setColProperty("url", array("editable" => false, "frozen" => true, "width" => 500, "editoptions" => array("size" => 75, "maxlength" => 200), "formatter" => "link", "formatoptions" => array("target" => "_blank"), "fixed" => true, "editrules" => array("url" => true, "required" => false), "label" => "Url"));
$grid->setColProperty("email", array("editable" => false, "frozen" => true, "width" => 140, "editoptions" => array("size" => 75, "maxlength" => 200), "fixed" => true, "label" => "Email"));
$grid->setColProperty("applicationdate", array("formatter" => "date", "width" => 70, "fixed" => true, "formatoptions" => array("srcformat" => "Y-m-d", "newformat" => "Y-m-d"), "editable" => false, "label" => "Appl Date", "editoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\r\r\n     jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});\r\r\n     jQuery('.ui-datepicker').css({'font-size':'75%'});\r\r\n         },200);}"), "searchoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\r\r\n     jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});\r\r\n     jQuery('.ui-datepicker').css({'font-size':'75%'});\r\r\n         },200);}")));
$grid->setColProperty("autoapply", array("editable" => true, "label" => "Auto Apply", "width" => 50, "fixed" => true, "edittype" => "select"));
$grid->setSelect("autoapply", array("M" => "M"), false, true, true, array("" => "All"));
$grid->setColProperty("candidate", array("editable" => true, "label" => "Candidate", "width" => 50, "fixed" => true, "edittype" => "select"));
$grid->setSelect("candidate", array("Y" => "Y", "N" => "N"), false, true, true, array("" => "All"));
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 400, "caption" => "Crawler Applications", "rownumbers" => true, "rowNum" => 1000, "sortname" => "applicationdate desc, id", "sortorder" => "desc", "toppager" => true, "rowList" => array(1000, 5000, 10000, 25000, 50000)));
$grid->showError = true;
$grid->navigator = true;
$grid->setNavOptions('navigator', array("pdf" => true, "excel" => true, "add" => true, "edit" => true, "del" => false, "view" => true, "search" => true));
$grid->setNavOptions('view', array("width" => 750, "dataheight" => 300, "viewCaption" => "Crawler Applications Management"));
$grid->setNavOptions('add', array("width" => 750, "dataheight" => 300, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Crawler Applications", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 300, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Crawler Applications", "reloadAfterSubmit" => false));
$grid->callGridMethod('#grid', 'setFrozenColumns');
$grid->callGridMethod('#grid', 'gridResize');
global $htmlcode;
$bindkeys = <<<KEYS

\$("#grid").jqGrid('bindKeys', {"onEnter":function( rowid ) {
    alert("You enter a row with id:"+rowid + rowData.name);
} } );
KEYS;
$grid->setJSCode($bindkeys);
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$DB = null;
コード例 #6
0
ファイル: newvendoremail.php プロジェクト: sangikumar/IP
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/ip-includes/gridincludes.php";
$grid = new jqGridRender($DB);
$grid->SelectCommand = 'select distinct CONCAT("www.", SUBSTRING(email FROM instr(email, "@")+1)) url, email, positiondate from (select vendor1email as email, positiondate from position where vendor1email is not null union select vendor2email, positiondate from position where vendor2email is not null union select vendor3email, positiondate from position where vendor3email is not null union select client1email, null from interview where client1email is not null union select client2email, null from interview where client2email is not null union select client3email, null from interview where client3email is not null union select vendor1email, interviewdate from interview where vendor1email is not null union select vendor2email, interviewdate from interview where vendor2email is not null union select vendor3email, interviewdate from interview where vendor3email is not null) e ';
$grid->dataType = 'json';
$grid->setColModel();
$grid->setUrl('../grids/newvendoremail.php');
$grid->setColProperty("url", array("editable" => false, "width" => 300, "fixed" => true, "formatter" => "link", "editrules" => array("url" => true, "required" => false), "label" => "URL"));
$grid->setColProperty("email", array("editable" => true, "width" => 500, "fixed" => true, "formatter" => "email", "editrules" => array("email" => true, "required" => true), "label" => "Email"));
$grid->setColProperty("positiondate", array("editable" => false, "hidden" => true, "label" => "ID"));
// Set alternate background using altRows property
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 250, "caption" => "New Vendor Emails Management", "rownumbers" => true, "rowNum" => 100, "shrinkToFit" => false, "sortname" => "positiondate", "sortorder" => "desc", "toppager" => true, "rowList" => array(10, 100, 500, 1000)));
$grid->showError = true;
$grid->navigator = true;
$grid->setNavOptions('navigator', array("pdf" => true, "excel" => true, "add" => false, "edit" => false, "del" => false, "view" => true, "search" => true));
$grid->setNavOptions('view', array("width" => 750, "dataheight" => 500, "viewCaption" => "New Vendor Email Management"));
$grid->callGridMethod('#grid', 'setFrozenColumns');
$grid->callGridMethod('#grid', 'gridResize');
$bindkeys = <<<KEYS
\$("#grid").jqGrid('bindKeys', {"onEnter":function( rowid ) { alert("You enter a row with id:"+rowid)} } );
KEYS;
$grid->setJSCode($bindkeys);
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$DB = null;
コード例 #7
0
$grid->setColProperty('svi_horario', array("editable" => true, "width" => 67, "label" => "Horario", "edittype" => "select", "editoptions" => array("value" => "Cualquier horario:Cualquier horario;Mañana:Mañana;Tarde:Tarde;Noche:Noche")));
$grid->setColProperty('svi_fecha_salida', array("editable" => true, "width" => 45, "label" => "Salida"));
$grid->setColProperty('svi_noches_hospedaje', array("editable" => true, "width" => 35, "label" => "Noches"));
$grid->setColProperty('svi_monto_peaje', array("editable" => true, "width" => 35, "label" => "Peaje"));
$grid->setColProperty('svi_nombre_hotel', array("editable" => true, "width" => 60, "label" => "Hotel"));
$grid->setColProperty('svi_monto_hospedaje', array("editable" => true, "width" => 40, "label" => "\$ Hotel"));
$grid->setColProperty('svi_hotel', array("editable" => true, "width" => 35, "label" => "Tipo Hab.", "edittype" => "select", "editoptions" => array("value" => "1:Doble;0:Sencilla")));
//$grid->setColProperty("CustomerID",array("editoptions"=>array("value"=>"1:One;2:Two")));
$grid->setColProperty("svi_fecha_salida", array("formatter" => "date", "formatoptions" => array("srcformat" => "Y-m-d", "newformat" => "d/m/Y"), "search" => false, "editable" => true, "editoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\n                    jQuery(elm).datepicker({dateFormat:'dd/mm/yy'});\n                    jQuery('.ui-datepicker').css({'font-size':'85%'});\n                },200);}")));
/*$grid->setColProperty("BirthDate", array(
    "formatter"=>"date",
    "formatoptions"=>array("srcformat"=>"Y-m-d H:i:s","newformat"=>"d/m/Y"),
    "search"=>false,
    "editable"=>true
    )
);*/
/*$grid->setColProperty('BirthDate', 
  array("formatter"=>"date","formatoptions"=>array("srcformat"=>"Y-m-d H:i:s", "newformat"=>"d-m-Y")));*/
//**********Anexadoo ---- $grid->setSelect('FirstName', "SELECT FirstName, FirstName FROM employees");
// Set some grid options
/*$grid->setGridOptions(array(
    "rowNum"=>10,
    "rowList"=>array(10,20,30),
    "sortname"=>"tramites.t_id"
));*/
$grid->navigator = true;
$grid->setNavOptions('navigator', array("add" => false, "edit" => true, "del" => false, "excel" => false, "search" => false, "refresh" => false));
$grid->setNavOptions('edit', array("height" => 150, "dataheight" => "auto"));
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #8
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
\t\t\t\turl: 'city.php',
\t\t\t\tdataType: 'json',
\t\t\t\tdata: {q:cntryval},
\t\t\t\tsuccess : function(response)
\t\t\t\t{
\t\t\t\t\tvar t="";
\t\t\t\t\tjQuery.each(response, function(i,item) {
\t\t\t\t\t\tt += "<option value='"+item.id+"'>"+item.value+"</option>";
\t\t\t\t\t});
\t\t\t\t\tjQuery("#City",formid).append(t).removeAttr("disabled");
\t\t\t\t}
\t\t\t});
\t\t}
\t});
}
INITFORM;
// Enable navigator
$grid->navigator = true;
// Enable only editing
$grid->setNavOptions('navigator', array("excel" => false, "add" => true, "edit" => true, "del" => false, "view" => false, "search" => false));
// Close the dialog after editing
$grid->setNavOptions('edit', array("closeAfterEdit" => true, "editCaption" => "Update Customer", "bSubmit" => "Update", "viewPagerButtons" => false));
// Bind the before show Form event in add and edit mode.
$grid->setNavEvent('edit', 'beforeShowForm', $beforeshow);
$grid->setNavEvent('add', 'beforeShowForm', $beforeshow);
// Bind the initialize Form event in add and edit mode.
$grid->setNavEvent('edit', 'onInitializeForm', $initform);
$grid->setNavEvent('add', 'onInitializeForm', $initform);
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #9
0
// Let the grid create the model
$grid->setColModel(null, null, $labels);
$grid->setColProperty('id', array('hidden' => true));
$grid->setColProperty('disabled', array('width' => '50', "edittype" => "select"));
$grid->setColProperty('body', array("edittype" => "textarea", "editoptions" => array("rows" => 2, "cols" => 40), "width" => 200));
$grid->setColProperty('pattern', array("edittype" => "textarea", "editoptions" => array("rows" => 1, "cols" => 40), "width" => 200));
// Set the url from where we obtain the data
$grid->setUrl('includes/grid/email_alerts.php');
$grid->addCol(array("name" => "Actions", "formatter" => "actions", "editable" => false, "sortable" => false, "resizable" => false, "fixed" => true, "width" => 60, "formatoptions" => array("keys" => true)), "first");
// Set some grid options
$grid->setGridOptions(array("rowNum" => 18, "sortname" => "id", "sortorder" => "asc", "altRows" => true, "rowList" => array(20, 40, 60, 75, 100), "forceFit" => true));
$choices = array("Yes" => "Yes", "No" => "No");
// $grid->setSelect("disabled", $choices , false, false, true, array(""=>"All"));
$grid->setSelect("disabled", $choices, false, true, true, array("" => "All"));
$grid->navigator = true;
$grid->setNavOptions('navigator', array("pdf" => true, "excel" => true, "add" => true, "edit" => false, "del" => false, "view" => false, "search" => true));
$grid->setNavOptions('edit', array("width" => "auto", "height" => "auto", "dataheight" => "auto", "top" => 200, "left" => 200));
$grid->setNavOptions('add', array("width" => "auto", "height" => "auto", "dataheight" => "auto", "top" => 200, "left" => 200));
$custom = <<<CUSTOM


        var modalWidth = \$("#portlet_Email_Alerts").width();
        var modalHeight = \$("#portlet_Email_Alerts").height() - 52;
        \$('#triggergrid').jqGrid('setGridWidth',modalWidth);
        \$('#triggergrid').jqGrid('setGridHeight',modalHeight);
        \$('#triggergrid').fluidGrid({base:'#portlet_Email_Alerts', offset:-25});

\$(window).resize(function()
{
        \$('#triggergrid').fluidGrid({base:'#portlet_Email_Alerts', offset:-25});
});
コード例 #10
0
ファイル: invoiceoverdue.php プロジェクト: sangikumar/IP
$grid->setColProperty("recruiteremail", array("editable" => false, "frozen" => true, "label" => "recruiteremail"));
$grid->setColProperty("manageremail", array("editable" => false, "frozen" => true, "label" => "manageremail"));
$grid->setColProperty("managerphone", array("editable" => false, "frozen" => true, "label" => "managerphone"));
$grid->setColProperty("secondaryname", array("editable" => false, "frozen" => true, "label" => "secondaryname"));
$grid->setColProperty("secondaryemail", array("editable" => false, "frozen" => true, "label" => "secondaryemail"));
$grid->setColProperty("secondaryphone", array("editable" => false, "frozen" => true, "label" => "secondaryphone"));
$grid->setColProperty("status", array("editable" => true, "width" => 70, "hidden" => true, "editrules" => array("edithidden" => true, "required" => false), "fixed" => true, "label" => "Status", "edittype" => "select"));
$grid->setSelect("status", $invoicestatus, false, true, true, array("" => "All"));
$grid->setColProperty("remindertype", array("editable" => true, "width" => 200, "hidden" => true, "editrules" => array("edithidden" => true, "required" => false), "fixed" => true, "label" => "Reminder Type", "edittype" => "select"));
$grid->setSelect("remindertype", array("Open" => "Open", "Warning" => "Warning", "Warn-Candidate" => "Warn-Candidate", "Warn-Client" => "Warn-Client", "Warn-CollectionAgency" => "Warn-CollectionAgency", "Final-Warning" => "Final-Warning"), false, true, true, array("" => "All"));
$grid->setColProperty("amountreceived", array("editable" => true, "width" => 150, "hidden" => true, "editrules" => array("edithidden" => true, "required" => false), "fixed" => true, "formatter" => "currency", "formatoptions" => array("decimalPlaces" => 2, "thousandsSeparator" => ",", "prefix" => "\$"), "label" => "Received"));
$grid->setColProperty("releaseddate", array("formatter" => "date", "width" => 120, "hidden" => true, "editrules" => array("edithidden" => true, "required" => false), "fixed" => true, "formatoptions" => array("srcformat" => "Y-m-d", "newformat" => "Y-m-d"), "editable" => true, "label" => "Released Date", "editoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\n                    \t\t\t\t\t\t\t jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});\n                    \t\t\t\t\t\t\t jQuery('.ui-datepicker').css({'font-size':'75%'});\n                \t\t\t\t\t\t\t\t\t },200);}"), "searchoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\n                    \t\t\t\t\t\t\t jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});\n                    \t\t\t\t\t\t\t jQuery('.ui-datepicker').css({'font-size':'75%'});\n                \t\t\t\t\t\t\t\t\t },200);}")));
$grid->setColProperty("receiveddate", array("formatter" => "date", "width" => 120, "hidden" => true, "editrules" => array("edithidden" => true, "required" => false), "fixed" => true, "formatoptions" => array("srcformat" => "Y-m-d", "newformat" => "Y-m-d"), "editable" => true, "label" => "Received Date", "editoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\n                    \t\t\t\t\t\t\t jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});\n                    \t\t\t\t\t\t\t jQuery('.ui-datepicker').css({'font-size':'75%'});\n                \t\t\t\t\t\t\t\t\t },200);}"), "searchoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\n                    \t\t\t\t\t\t\t jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});\n                    \t\t\t\t\t\t\t jQuery('.ui-datepicker').css({'font-size':'75%'});\n                \t\t\t\t\t\t\t\t\t },200);}")));
$grid->setColProperty("checknumber", array("editable" => true, "frozen" => true, "width" => 100, "hidden" => true, "editrules" => array("edithidden" => true, "required" => false), "fixed" => true, "label" => "Check No."));
$grid->setColProperty("invoiceurl", array("editable" => true, "frozen" => true, "width" => 200, "hidden" => true, "editrules" => array("edithidden" => true, "required" => false), "editoptions" => array("size" => 75, "maxlength" => 200), "formatter" => "link", "formatoptions" => array("target" => "_blank"), "fixed" => true, "editrules" => array("url" => true, "required" => false), "label" => "Invoice Url"));
$grid->setColProperty("checkurl", array("editable" => true, "frozen" => true, "width" => 200, "hidden" => true, "editrules" => array("edithidden" => true, "required" => false), "editoptions" => array("size" => 75, "maxlength" => 200), "formatter" => "link", "formatoptions" => array("target" => "_blank"), "fixed" => true, "editrules" => array("url" => true, "required" => false), "label" => "Check Url"));
$grid->setColProperty("notes", array("editable" => true, "width" => 400, "fixed" => true, "hidden" => true, "edittype" => "textarea", "editrules" => array("edithidden" => true, "required" => false), "editoptions" => array("rows" => 6, "cols" => 60), "label" => "Notes"));
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 250, "caption" => "Invoice Overdue Management", "rownumbers" => true, "rowNum" => 100, "sortname" => "expecteddate", "sortorder" => "desc", "footerrow" => true, "userDataOnFooter" => true, "shrinkToFit" => false, "toppager" => true, "rowList" => array(10, 100, 500)));
$grid->showError = true;
$grid->navigator = true;
$grid->setNavOptions('navigator', array("pdf" => true, "excel" => true, "add" => false, "edit" => true, "del" => false, "view" => true, "search" => true));
$grid->setNavOptions('view', array("width" => 700, "dataheight" => 300, "viewCaption" => "Invoice Overdue Management"));
$grid->setNavOptions('edit', array("width" => 700, "dataheight" => 300, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Invoice", "reloadAfterSubmit" => false));
$grid->callGridMethod('#grid', 'setFrozenColumns');
$grid->callGridMethod('#grid', 'gridResize');
$bindkeys = <<<KEYS
\$("#grid").jqGrid('bindKeys', {"onEnter":function( rowid ) { alert("You enter a row with id:"+rowid)} } );
KEYS;
$grid->setJSCode($bindkeys);
$grid->renderGrid('#grid', '#pager', true, $summaryrows, null, true, true);
$DB = null;
コード例 #11
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
// Tell the db that we use utf-8
$conn->query("SET NAMES utf8");
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = 'SELECT EmployeeID, FirstName, LastName, BirthDate FROM employees';
// Set the table to where you add the data
$grid->table = 'employees';
// Set output format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('grid.php');
$grid->setColProperty('EmployeeID', array("editable" => false));
$grid->setColProperty('BirthDate', array("formatter" => "date", "formatoptions" => array("srcformat" => "Y-m-d H:i:s", "newformat" => "Y-m-d")));
// Set some grid options
$grid->setUserTime("m/d/Y");
$grid->setDatepicker("BirthDate", array("buttonOnly" => false));
$grid->setGridOptions(array("rowNum" => 10, "rowList" => array(10, 20, 30), "sortname" => "EmployeeID"));
// navigator first should be enabled
$grid->navigator = true;
$grid->setNavOptions('navigator', array("add" => false, "edit" => false, "excel" => false, "search" => false, "del" => false, "refresh" => false));
// and just enable the inline
$grid->inlineNav = true;
// disable editing - just adding
$grid->inlineNavOptions('navigator', array("edit" => false));
$grid->callGridMethod("#grid", 'setFrozenColumns');
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #12
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
<?php

require_once '../../../jq-config.php';
// include the jqGrid Class
require_once ABSPATH . "php/jqGrid.php";
// Create the jqGrid instance
$grid = new jqGridRender();
// Lets create the model manually
$Model = array(array("name" => "Integer", "editable" => true, "sorttype" => "integer", "editrules" => array("required" => true, "integer" => true, "minValue" => 100, "maxValue" => 1000)), array("name" => "Number", "editable" => true, "sorttype" => "number", "editrules" => array("required" => true, "number" => true, "minValue" => 0, "maxValue" => 10000)), array("name" => "Currency", "editable" => true, "sorttype" => "number", "editrules" => array("required" => true, "number" => true, "minValue" => 0)), array("name" => "Email", "editable" => true, "formatter" => "email", "editrules" => array("email" => true)), array("name" => "Link", "editable" => true, "width" => 120, "formatter" => "link", "editrules" => array("url" => true)));
// Let the grid create the model
$grid->setColModel($Model);
// Set grid option datatype to be local and editurl to point to dummy file
$grid->setGridOptions(array("datatype" => "local", "editurl" => "dummy.txt"));
//We can add data manually using arrays
$data = array(array("Integer" => 200000, "Number" => 60000000.73, "Currency" => 34.2, "Email" => "*****@*****.**", "Link" => "http://www.yahoo.com"), array("Integer" => 1600000, "Number" => 75200000.23, "Currency" => 245.2, "Email" => "*****@*****.**", "Link" => "http://www.google.com"), array("Integer" => 652693, "Number" => 34534000.33, "Currency" => 18545.2, "Email" => "*****@*****.**", "Link" => "http://www.bing.com"), array("Integer" => 1237, "Number" => 3450.3, "Currency" => 55597545.2, "Email" => "*****@*****.**", "Link" => "http://www.msn.com"));
// Let put it using the callGridMethod
$grid->callGridMethod("#grid", 'addRowData', array("Integer", $data));
$grid->navigator = true;
// Enable only editing
$grid->setNavOptions('navigator', array("excel" => false, "add" => false, "edit" => true, "del" => false, "view" => false, "search" => false));
// Close the dialog after editing
$grid->setNavOptions('edit', array("closeAfterEdit" => true, "reloadAfterSubmit" => false));
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
コード例 #13
0
ファイル: rcmarketing.php プロジェクト: sangikumar/IP
$grid->setColProperty("relocation", array("editable" => true, "width" => 70, "fixed" => true, "label" => "Relocation", "edittype" => "select"));
$grid->setSelect("relocation", $yesno, false, true, true, array("" => "All"));
$grid->setColProperty("closedate", array("formatter" => "date", "width" => 80, "fixed" => true, "formatoptions" => array("srcformat" => "Y-m-d", "newformat" => "Y-m-d"), "editable" => true, "label" => "Close Date", "editoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\n                    \t\t\t\t\t\t\t jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});\n                    \t\t\t\t\t\t\t jQuery('.ui-datepicker').css({'font-size':'75%'});\n                \t\t\t\t\t\t\t\t\t },200);}"), "searchoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\n                    \t\t\t\t\t\t\t jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});\n                    \t\t\t\t\t\t\t jQuery('.ui-datepicker').css({'font-size':'75%'});\n                \t\t\t\t\t\t\t\t\t },200);}")));
$grid->setColProperty("suspensionreason", array("editable" => true, "width" => 70, "fixed" => true, "label" => "Reason", "edittype" => "select"));
$grid->setSelect("suspensionreason", array("B" => "Break", "D" => "Discontinued", "X" => "Defaulted"), false, true, true, array("" => "All"));
$grid->setColProperty("resumelink", array("editable" => false, "width" => 200, "formatter" => "link", "fixed" => true, "editrules" => array("url" => true), "label" => "Resume Link"));
$grid->setColProperty("ipemailid", array("editable" => true, "width" => 150, "fixed" => true, "formatter" => "email", "label" => "IP Email", "edittype" => "select"));
$grid->setSelect("ipemailid", "select '' as id, '' as name from dual union SELECT distinct id, email as name FROM ipemail where email is not null order by name");
$grid->setColProperty("ipphone", array("editable" => false, "width" => 150, "fixed" => true, "label" => "IP Phone"));
$grid->setColProperty("skypeid", array("editable" => false, "width" => 100, "fixed" => true, "label" => "Skype"));
$grid->setColProperty("resumeid", array("editable" => true, "frozen" => true, "width" => 150, "fixed" => true, "label" => "Resume ID", "edittype" => "select"));
$grid->setSelect("resumeid", "select '' as id, '' as name from dual union SELECT distinct cr.id, concat(c.name, ' ', r.resumekey) as name FROM resume r, candidateresume cr, candidate c where r.id = cr.resumeid and c.candidateid = cr.candidateid order by name");
$grid->setColProperty("intro", array("editable" => true, "hidden" => true, "edittype" => "textarea", "editrules" => array("edithidden" => true, "required" => false), "editoptions" => array("rows" => 6, "cols" => 80), "label" => "Intro"));
$grid->setColProperty("notes", array("editable" => true, "hidden" => true, "edittype" => "textarea", "editrules" => array("edithidden" => true, "required" => false), "editoptions" => array("rows" => 6, "cols" => 80), "label" => "Notes"));
// Set alternate background using altRows property
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 500, "caption" => "Marketing List", "rownumbers" => true, "rowNum" => 100, "sortname" => "mmid desc, priority", "sortorder" => "asc", "toppager" => true, "rowList" => array(10, 20, 30, 50, 100, 500)));
//$grid->showError = true;
$grid->navigator = true;
//$grid->toolbarfilter = true;
//$grid->setFilterOptions(array("searchOperators"=>true));
$grid->setNavOptions('navigator', array("pdf" => true, "excel" => true, "add" => false, "edit" => true, "del" => false, "view" => true, "search" => true));
$grid->setNavOptions('view', array("width" => 750, "dataheight" => 500, "viewCaption" => "Marketing Management"));
$grid->callGridMethod('#grid', 'setFrozenColumns');
$grid->callGridMethod('#grid', 'gridResize');
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 500, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Candidate", "reloadAfterSubmit" => false));
$bindkeys = <<<KEYS
\$("#grid").jqGrid('bindKeys', {"onEnter":function( rowid ) { alert("You enter a row with id:"+rowid)} } );
KEYS;
$grid->setJSCode($bindkeys);
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$DB = null;
コード例 #14
0
ファイル: grid.php プロジェクト: jewelhuq/FoodBankBooking
$table = 'products';
$grid->SelectCommand = 'SELECT * FROM ' . $table;
// set the ouput format to XML
$grid->dataType = 'json';
// Let the grid create the model
$grid->setPrimaryKeyId("ProductID");
$grid->setColModel();
$grid->table = $table;
// set labels in the header
$grid->setColProperty("ProductID", array("label" => "ID"));
$grid->setColProperty("ProductName", array("label" => "Name"));
$grid->setColProperty("QuantityPerUnit", array("label" => "Unit"));
$grid->setColProperty("UnitPrice", array("label" => "Unit Price"));
// We can hide some columns
$grid->setColProperty("SupplierID", array("hidden" => true));
$grid->setColProperty("CategoryID", array("hidden" => true));
$grid->setColProperty("UnitsOnOrder", array("hidden" => true));
$grid->setColProperty("ReorderLevel", array("hidden" => true));
$grid->setColProperty("Discontinued", array("hidden" => true));
// Set the url from where we obtain the data
$grid->setUrl('grid.php');
// Set some grid options
$grid->setGridOptions(array("rowNum" => 10, "rowList" => array(10, 20, 30), "sortname" => "CategoryID"));
// Enable toolbar searching
$grid->toolbarfilter = true;
$grid->navigator = true;
$grid->setNavOptions('navigator', array("csv" => true, "pdf" => true));
$grid->setFilterOptions(array("stringResult" => true));
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #15
0
ファイル: rposition.php プロジェクト: sangikumar/IP
$grid->setColProperty("client", array("editable" => true, "width" => 90, "fixed" => true, "editoptions" => array("size" => 75, "maxlength" => 200), "label" => "Client"));
$grid->setAutocomplete("client", null, "select companyname from (select c.companyname from client c union select distinct client from position) p  where companyname like ? ORDER BY companyname", null, true, true);
$grid->setColProperty("vendor2email", array("editable" => true, "width" => 200, "fixed" => true, "formatter" => "email", "editoptions" => array("size" => 75, "maxlength" => 200), "editrules" => array("email" => true, "required" => false), "label" => "Vendor2 Email"));
$grid->setAutocomplete("vendor2email", "#vendor2", "select email, email, vendor2 from (select r.email, (select companyname from vendor where id = r.vendorid) vendor2 from recruiter r union select distinct vendor1email as email, vendor1 from position) p where email like ? ORDER BY email", null, true, true);
$grid->setColProperty("vendor2", array("editable" => true, "width" => 90, "fixed" => true, "editoptions" => array("size" => 75, "maxlength" => 200), "label" => "Vendor2"));
$grid->setColProperty("vendor2", array("editable" => true, "width" => 90, "fixed" => true, "editoptions" => array("size" => 75, "maxlength" => 200), "label" => "Vendor2"));
$grid->setAutocomplete("vendor2", null, "select companyname from (select v.companyname from vendor v union select c.companyname from client c union select distinct vendor1 from position) p  where companyname like ? ORDER BY companyname", null, true, true);
$grid->setColProperty("vendor3email", array("editable" => true, "width" => 200, "fixed" => true, "formatter" => "email", "editoptions" => array("size" => 75, "maxlength" => 200), "editrules" => array("email" => true, "required" => false), "label" => "Vendor3 Email"));
$grid->setAutocomplete("vendor3email", "#vendor3", "select email, email, vendor3 from (select r.email, (select companyname from vendor where id = r.vendorid) vendor3 from recruiter r union select distinct vendor1email as email, vendor1 from position) p where email like ? ORDER BY email", null, true, true);
$grid->setColProperty("vendor2", array("editable" => true, "width" => 90, "fixed" => true, "editoptions" => array("size" => 75, "maxlength" => 200), "label" => "Vendor2"));
$grid->setColProperty("vendor3", array("editable" => true, "width" => 90, "fixed" => true, "editoptions" => array("size" => 75, "maxlength" => 200), "label" => "Vendor3"));
$grid->setAutocomplete("vendor3", null, "select companyname from (select v.companyname from vendor v union select c.companyname from client c union select distinct vendor1 from position) p  where companyname like ? ORDER BY companyname", null, true, true);
$grid->setColProperty("rate", array("editable" => true, "width" => 90, "formatter" => "currency", "formatoptions" => array("decimalPlaces" => 2, "thousandsSeparator" => ",", "prefix" => "\$"), "sorttype" => "currency", "fixed" => true, "label" => "Rate"));
$grid->setColProperty("reference", array("editable" => true, "width" => 90, "fixed" => true, "editoptions" => array("size" => 75, "maxlength" => 200), "label" => "References"));
$grid->setColProperty("notes", array("editable" => true, "width" => 70, "fixed" => true, "edittype" => "textarea", "editoptions" => array("rows" => 6, "cols" => 80), "label" => "Notes"));
// Set alternate background using altRows property
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 250, "caption" => "Position List", "rownumbers" => true, "rowNum" => 100, "shrinkToFit" => false, "sortname" => "positiondate", "sortorder" => "desc", "toppager" => true, "rowList" => array(100, 500, 1000, 5000)));
$grid->showError = true;
$grid->navigator = true;
$grid->setNavOptions('navigator', array("pdf" => true, "excel" => true, "add" => true, "edit" => true, "del" => false, "view" => true, "search" => true));
$grid->setNavOptions('view', array("width" => 750, "dataheight" => 500, "viewCaption" => "Position List"));
$grid->setNavOptions('add', array("width" => 750, "dataheight" => 500, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Position", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 500, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Position", "reloadAfterSubmit" => false));
$grid->callGridMethod('#grid', 'setFrozenColumns');
$grid->callGridMethod('#grid', 'gridResize');
$bindkeys = <<<KEYS
\$("#grid").jqGrid('bindKeys', {"onEnter":function( rowid ) { alert("You enter a row with id:"+rowid)} } );
KEYS;
$grid->setJSCode($bindkeys);
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$DB = null;
コード例 #16
0
ファイル: fakereview.php プロジェクト: sangikumar/IP
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/ip-includes/gridincludes.php";
$grid = new jqGridRender($DB);
$grid->SelectCommand = 'select id, review from fake_review ';
$grid->table = 'fake_review';
$grid->gSQLMaxRows = 100000;
$grid->setPrimaryKeyId('id');
$grid->serialKey = false;
$grid->dataType = 'json';
$grid->setColModel();
$grid->setUrl('../grids/fakereview.php');
$grid->setColProperty("id", array("editable" => false, "hidden" => true, "label" => "ID"));
$grid->setColProperty("review", array("editable" => true, "width" => 400, "fixed" => true, "edittype" => "textarea", "editoptions" => array("rows" => 6, "cols" => 60), "label" => "Reviews"));
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 250, "caption" => "Fake Reviews Management", "rownumbers" => true, "rowNum" => 1000, "shrinkToFit" => false, "sortname" => "id", "sortorder" => "asc", "toppager" => true, "rowList" => array(10, 100, 500, 1000, 10000)));
$grid->showError = true;
$grid->navigator = true;
$grid->setNavOptions('navigator', array("pdf" => true, "excel" => true, "add" => true, "edit" => true, "del" => false, "view" => true, "search" => true));
$grid->setNavOptions('view', array("width" => 750, "dataheight" => 250, "viewCaption" => "Fake Reviews Management"));
$grid->setNavOptions('add', array("width" => 750, "dataheight" => 250, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Fake Review", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 250, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Edit Fake Review", "reloadAfterSubmit" => false));
//$grid->toolbarfilter = true;
$grid->callGridMethod('#grid', 'setFrozenColumns');
$grid->callGridMethod('#grid', 'gridResize');
$bindkeys = <<<KEYS
\$("#grid").jqGrid('bindKeys', {"onEnter":function( rowid ) { alert("You enter a row with id:"+rowid)} } );
KEYS;
$grid->setJSCode($bindkeys);
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$DB = null;
コード例 #17
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
// include the datepicker class
require_once ABSPATH . "php/jqCalendar.php";
// Connection to the server
$conn = new PDO(DB_DSN, DB_USER, DB_PASSWORD);
// Tell the db that we use utf-8
$conn->query("SET NAMES utf8");
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = 'SELECT OrderID, OrderDate, CustomerID, Freight, ShipName FROM orders';
// set the ouput format to json
$grid->dataType = 'json';
$grid->table = "orders";
$grid->setPrimaryKeyId("OrderID");
// Let the grid create the model
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('grid.php');
// Set grid caption using the option caption
$grid->setGridOptions(array("caption" => "This is custom Caption", "rowNum" => 10, "sortname" => "OrderID", "hoverrows" => true, "rowList" => array(10, 20, 50)));
// Change some property of the field(s)
$grid->setColProperty("OrderID", array("label" => "ID", "width" => 60));
$grid->setColProperty("OrderDate", array("formatter" => "date", "formatoptions" => array("srcformat" => "Y-m-d H:i:s", "newformat" => "m/d/Y")));
$grid->setAutocomplete("ShipName", false, "SELECT DISTINCT ShipName FROM orders WHERE ShipName LIKE ? ORDER BY ShipName", null, true, true);
$grid->setDatepicker('OrderDate', null, true, true);
$grid->datearray = array('OrderDate');
// Enjoy
$grid->navigator = true;
$grid->setNavOptions('navigator', array("excel" => false));
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #18
0
ファイル: emptimesheet.php プロジェクト: sangikumar/IP
// set the ouput format to json
$grid->dataType = 'json';
$grid->setUserDate("Y-m-d");
// Let the grid create the model from SQL query
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('../grids/emptimesheet.php');
// Change some property of the field(s)
$grid->setColProperty("id", array("editable" => false, "frozen" => true, "width" => 40, "fixed" => true, "label" => "ID"));
$grid->setColProperty("employeeid", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Employee", "edittype" => "select"));
$grid->setSelect("employeeid", "select '' as id, '' as name from dual union SELECT distinct id, name FROM employee where status = '0Active' order by name");
$grid->setColProperty("startdate", array("formatter" => "date", "width" => 70, "fixed" => true, "formatoptions" => array("srcformat" => "Y-m-d", "newformat" => "Y-m-d"), "editable" => true, "label" => "Start Date <span style='color:red'><b>(Should be Monday)</b></span>", "editoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\n                    \t\t\t\t\t\t\t jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});\n                    \t\t\t\t\t\t\t jQuery('.ui-datepicker').css({'font-size':'75%'});\n                \t\t\t\t\t\t\t\t\t },200);}"), "searchoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\n                    \t\t\t\t\t\t\t jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});\n                    \t\t\t\t\t\t\t jQuery('.ui-datepicker').css({'font-size':'75%'});\n                \t\t\t\t\t\t\t\t\t },200);}")));
$grid->setColProperty("enddate", array("formatter" => "date", "width" => 70, "fixed" => true, "formatoptions" => array("srcformat" => "Y-m-d", "newformat" => "Y-m-d"), "editable" => true, "label" => "End Date <span style='color:red'><b>(Should be Sunday)</b></span>", "editoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\n                    \t\t\t\t\t\t\t jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});\n                    \t\t\t\t\t\t\t jQuery('.ui-datepicker').css({'font-size':'75%'});\n                \t\t\t\t\t\t\t\t\t },200);}"), "searchoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\n                    \t\t\t\t\t\t\t jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});\n                    \t\t\t\t\t\t\t jQuery('.ui-datepicker').css({'font-size':'75%'});\n                \t\t\t\t\t\t\t\t\t },200);}")));
$grid->setColProperty("taskscompleted", array("editable" => true, "hidden" => true, "edittype" => "textarea", "editrules" => array("edithidden" => true, "required" => false), "editoptions" => array("rows" => 10, "cols" => 80), "label" => "Tasks Completed"));
$grid->setColProperty("tasksnextweek", array("editable" => true, "hidden" => true, "edittype" => "textarea", "editrules" => array("edithidden" => true, "required" => false), "editoptions" => array("rows" => 10, "cols" => 80), "label" => "Tasks Next week"));
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 350, "caption" => "Employee Weekly Management", "rownumbers" => true, "rowNum" => 100, "sortname" => "startdate desc, employeeid", "sortorder" => "desc", "toppager" => true, "rowList" => array(10, 100, 500, 1000)));
$grid->showError = true;
$grid->navigator = true;
$grid->setNavOptions('navigator', array("pdf" => true, "excel" => true, "add" => true, "edit" => true, "del" => true, "view" => true, "search" => true));
$grid->setNavOptions('view', array("width" => 800, "dataheight" => 300, "viewCaption" => "Employee Timesheet Management"));
$grid->setNavOptions('add', array("width" => 800, "dataheight" => 300, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Weekly", "bSubmit" => "Add Weekly", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 800, "dataheight" => 300, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Weekly", "bSubmit" => "Update Weekly", "reloadAfterSubmit" => false));
$grid->callGridMethod('#grid', 'setFrozenColumns');
$grid->callGridMethod('#grid', 'gridResize');
$bindkeys = <<<KEYS
\$("#grid").jqGrid('bindKeys', {"onEnter":function( rowid ) { alert("You enter a row with id:"+rowid)} } );
KEYS;
$grid->setJSCode($bindkeys);
//$grid->setSubGridGrid('resumedetail.php');
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$DB = null;
コード例 #19
0
ファイル: remployee.php プロジェクト: sangikumar/IP
$grid->dataType = 'json';
$grid->setColModel();
$grid->setUrl('../grids/remployee.php');
$grid->setColProperty("id", array("editable" => false, "width" => 25, "fixed" => true, "label" => "ID"));
$grid->setColProperty("name", array("editable" => false, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Name"));
$grid->setColProperty("email", array("editable" => false, "width" => 150, "fixed" => true, "formatter" => "email", "editrules" => array("email" => true, "required" => true), "label" => "Email"));
$grid->setColProperty("phone", array("editable" => false, "width" => 90, "fixed" => true, "label" => "Phone"));
$grid->setColProperty("personalemail", array("editable" => false, "width" => 150, "fixed" => true, "formatter" => "email", "editrules" => array("email" => true, "required" => false), "label" => "Personal Email"));
$grid->setColProperty("personalphone", array("editable" => false, "width" => 90, "fixed" => true, "label" => "Personal Phone"));
$grid->setColProperty("mgrid", array("editable" => false, "frozen" => true, "width" => 100, "fixed" => true, "label" => "Manager", "edittype" => "select"));
$grid->setSelect("mgrid", "select '' as id, '' as name from dual union SELECT distinct id, name FROM employee where status = '0Active' order by name");
$grid->setColProperty("dob", array("formatter" => "date", "width" => 70, "fixed" => true, "formatoptions" => array("srcformat" => "Y-m-d", "newformat" => "Y-m-d"), "editable" => false, "label" => "Birth Date", "editoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\n                    \t\t\t\t\t\t\t jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});\n                    \t\t\t\t\t\t\t jQuery('.ui-datepicker').css({'font-size':'75%'});\n                \t\t\t\t\t\t\t\t\t },200);}"), "searchoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\n                    \t\t\t\t\t\t\t jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});\n                    \t\t\t\t\t\t\t jQuery('.ui-datepicker').css({'font-size':'75%'});\n                \t\t\t\t\t\t\t\t\t },200);}")));
$grid->setColProperty("address", array("editable" => false, "width" => 150, "fixed" => true, "label" => "Address"));
$grid->setColProperty("city", array("editable" => false, "width" => 90, "fixed" => true, "label" => "City"));
$grid->setColProperty("state", array("editable" => false, "width" => 90, "fixed" => true, "label" => "State"));
$grid->setColProperty("country", array("editable" => false, "width" => 90, "fixed" => true, "label" => "Country"));
$grid->setColProperty("zip", array("editable" => false, "width" => 90, "fixed" => true, "label" => "Zip"));
$grid->setColProperty("skypeid", array("editable" => false, "width" => 90, "fixed" => true, "label" => "Skype"));
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 400, "caption" => "Employee List", "rownumbers" => true, "rowNum" => 100, "sortname" => "type asc, name", "sortorder" => "asc", "toppager" => true, "rowList" => array(10, 20, 30, 50, 100)));
$grid->showError = true;
$grid->navigator = true;
$grid->setNavOptions('navigator', array("pdf" => false, "excel" => true, "add" => false, "edit" => false, "del" => false, "view" => true, "search" => true));
$grid->setNavOptions('view', array("width" => 750, "dataheight" => 500, "viewCaption" => "Employee List"));
$grid->callGridMethod('#grid', 'setFrozenColumns');
$grid->callGridMethod('#grid', 'gridResize');
$bindkeys = <<<KEYS
\$("#grid").jqGrid('bindKeys', {"onEnter":function( rowid ) { alert("You enter a row with id:"+rowid)} } );
KEYS;
$grid->setJSCode($bindkeys);
$grid->renderGrid('#grid', '#pager', true, $summaryrows, null, true, true);
$DB = null;
コード例 #20
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
require_once ABSPATH . "php/jqAutocomplete.php";
// Connection to the server
$conn = new PDO(DB_DSN, DB_USER, DB_PASSWORD);
// Tell the db that we use utf-8
$conn->query("SET NAMES utf8");
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = 'SELECT OrderID, OrderDate, CustomerID, Freight, ShipName FROM orders';
// set the ouput format to json
$grid->dataType = 'json';
$grid->table = "orders";
$grid->setPrimaryKeyId("OrderID");
// Let the grid create the model
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('grid.php');
// Set grid caption using the option caption
$grid->setGridOptions(array("caption" => "Autocomplete in edit and search dialogs", "rowNum" => 10, "sortname" => "OrderID", "hoverrows" => true, "rowList" => array(10, 20, 50)));
// Change some property of the field(s)
$grid->setColProperty("OrderID", array("label" => "ID", "width" => 60));
$grid->setColProperty("OrderDate", array("formatter" => "date", "formatoptions" => array("srcformat" => "Y-m-d H:i:s", "newformat" => "m/d/Y")));
// set autocomplete. Serch for name and ID, but select a ID
// set it only for editing and not on serch
$grid->setAutocomplete("ShipName", false, "SELECT DISTINCT ShipName FROM orders WHERE ShipName LIKE ? ORDER BY ShipName", null, true, true);
$grid->datearray = array('OrderDate');
// Enjoy
$grid->navigator = true;
$grid->setNavOptions('navigator', array("search" => true, "excel" => false));
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #21
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
//ini_set("display_errors","1");
require_once '../../../jq-config.php';
// include the jqGrid Class
require_once ABSPATH . "php/jqGrid.php";
// include the driver class
require_once ABSPATH . "php/jqGridArray.php";
// create the array connection
$conn = new jqGridArray();
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Create a random array data
for ($i = 0; $i < 1000; $i++) {
    $data1[$i]['id'] = $i + 1;
    $data1[$i]['foo'] = md5(rand(0, 10000));
    $data1[$i]['bar'] = 'bar' . ($i + 1);
}
// Always you can use SELECT * FROM data1
$grid->SelectCommand = "SELECT id, foo, bar FROM data1";
$grid->dataType = 'json';
$grid->setPrimaryKeyId('id');
$grid->setColModel();
// Enable navigator
$grid->setUrl('grid.php');
$grid->setGridOptions(array("rowNum" => 10, "rowList" => array(10, 20, 30), "sortname" => "id"));
$grid->navigator = true;
// Enable search
$grid->setNavOptions('navigator', array("excel" => false, "add" => false, "edit" => false, "del" => false, "view" => false, "csv" => true, "pdf" => true));
// Activate single search
$grid->setNavOptions('search', array("multipleSearch" => false));
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
コード例 #22
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
// Set output format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('grid.php');
// Set some grid options
$grid->setGridOptions(array("rowNum" => 10, "rowList" => array(10, 20, 30), "sortname" => "OrderID"));
// Change some property of the field(s)
$grid->setColProperty("OrderDate", array("formatter" => "date", "formatoptions" => array("srcformat" => "Y-m-d H:i:s", "newformat" => "m/d/Y")));
$grid->setColProperty("ShipName", array("width" => "200"));
// Enable navigator
$grid->navigator = true;
// Enable search
// By default we have multiple search enabled
$grid->setNavOptions('navigator', array("excel" => false, "add" => false, "edit" => false, "del" => false, "view" => false));
$template1 = '{ "groupOp": "AND",
      "rules": [
        { "field": "CustomerID", "op": "bw", "data": "W" },
        { "field": "Freight", "op": "le", "data": "1"}
      ]
}';
$template2 = '{ "groupOp": "AND",
      "rules": [
        { "field": "ShipName", "op": "eq", "data": "Alfreds Futterkiste" },
        { "field": "OrderID", "op": "le", "data": "10800"}
      ]
}';
// In order to enable the more complex search we should set multipleGroup option
// Also we need show query too
$grid->setNavOptions('search', array("multipleGroup" => true, "showQuery" => true, "tmplNames" => array("Template One", "Template Two"), "tmplFilters" => array($template1, $template2)));
コード例 #23
0
// Set output format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('gridEdit1.php');
/* */
$grid->setColProperty('id', array("editable" => false, "label" => "ID"));
$grid->setColProperty('giro', array("editable" => true, "label" => "Giro"));
$grid->setColProperty('fechaV', array("editable" => true, "label" => "Fecha Ven"));
$grid->setColProperty('monto', array("editable" => true, "label" => "Monto"));
$grid->setColProperty('fechaP', array("editable" => true, "label" => "Fecha Pago"));
$grid->setColProperty('producto', array("editable" => true, "label" => "Product"));
$grid->setColProperty('tipo', array("editable" => true, "label" => "Tipo", "width" => 200));
/* $grid->setColProperty('fechaV', 
   array("formatter"=>"date",
       "formatoptions"=>array("srcformat"=>"Y-m-d H:i:s", "newformat"=>"d-m-Y"),
       "editoptions"=>array("dataInit"=>
           "js:function(elm){setTimeout(function(){
               jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});
               jQuery('.ui-datepicker').css({'zIndex':'1200','font-size':'75%'});},100);}")
       )); */
// Set some grid options
$grid->setGridOptions(array("width" => 600, "height" => 'auto', "rowNum" => 10, "scrollrows" => true, "rowList" => array(10, 20, 30), "sortname" => "monto"));
$grid->navigator = true;
$grid->setNavOptions('navigator', array("excel" => false, "add" => false, "edit" => true, "del" => false, "view" => false, "search" => false));
// Close the dialog after editing
$grid->setNavOptions('edit', array("height" => 'auto', "dataheight" => 'auto', "closeAfterEdit" => true));
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #24
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
// Connection to the server
$conn = new PDO(DB_DSN, DB_USER, DB_PASSWORD);
// Tell the db that we use utf-8
$conn->query("SET NAMES utf8");
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = 'SELECT CustomerID, CompanyName, Phone, PostalCode, City FROM customers';
// Set the table to where you update the data
$grid->table = 'customers';
// Set output format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('grid.php');
// Set some grid options
$grid->setGridOptions(array("rowNum" => 10, "rowList" => array(10, 20, 30), "sortname" => "CustomerID"));
// Set the custom code for the fields
$grid->setColProperty('CustomerID', array("editoptions" => array("readonly" => true)));
$grid->setColProperty('Phone', array("formoptions" => array("rowpos" => 1, "colpos" => 2)));
$grid->setColProperty('CompanyName', array("formoptions" => array("label" => "Company", "elmsuffix" => "(required)"), "editrules" => array("required" => true)));
// Enable navigator
$grid->navigator = true;
// Enable only editing
$grid->setNavOptions('navigator', array("excel" => false, "add" => false, "edit" => true, "del" => false, "view" => false, "search" => false));
// Some options for the edit
$grid->setNavOptions('edit', array("closeAfterEdit" => true, "width" => 470, "height" => 170, "dataheight" => 100));
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #25
0
ファイル: email_group.php プロジェクト: sangikumar/IP
$grid->serialKey = false;
// set the ouput format to json
$grid->dataType = 'json';
// Let the grid create the model from SQL query
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('../grids/email_group.php');
// Change some property of the field(s)
$grid->setColProperty("id", array("editable" => false, "hidden" => true, "width" => 25, "fixed" => true, "label" => "ID"));
$grid->setColProperty("name", array("editable" => true, "width" => 100, "fixed" => true, "label" => "Name"));
$grid->setColProperty("dbsql", array("editable" => true, "edittype" => "textarea", "label" => "SQL", "width" => 750, "fixed" => true, "editoptions" => array("rows" => 10, "cols" => 80)));
// Set alternate background using altRows property
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 250, "caption" => "Email Group Management", "rownumbers" => true, "rowNum" => 30, "sortname" => "name", "sortorder" => "asc", "toppager" => true, "rowList" => array(10, 20, 30, 50, 100)));
$grid->showError = true;
$grid->navigator = true;
$grid->setNavOptions('navigator', array("pdf" => true, "excel" => true, "add" => true, "edit" => true, "del" => false, "view" => true, "search" => true));
$grid->setNavOptions('view', array("width" => 750, "dataheight" => 500, "viewCaption" => "Email Group Management"));
$grid->setNavOptions('add', array("width" => 750, "dataheight" => 500, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Course", "bSubmit" => "Add Email Group", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 500, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Course", "bSubmit" => "Update Email Group", "reloadAfterSubmit" => false));
//$grid->toolbarfilter = true;
$grid->callGridMethod('#grid', 'setFrozenColumns');
$grid->callGridMethod('#grid', 'gridResize');
global $htmlcode;
$bindkeys = <<<KEYS

\$("#grid").jqGrid('bindKeys', {"onEnter":function( rowid ) {

                    var rowData = jQuery('#grid').jqGrid ('getRowData', rowid);
} } );
KEYS;
$grid->setJSCode($bindkeys);
コード例 #26
0
ファイル: rec_massemail.php プロジェクト: sangikumar/IP
$grid->SelectCommand = 'select id, email, name, phone, remove_newsletter, lastmoddatetime from rec_massemail ';
$grid->table = 'rec_massemail';
$grid->gSQLMaxRows = 100000;
$grid->setPrimaryKeyId('id');
$grid->serialKey = false;
$grid->dataType = 'json';
$grid->setColModel();
$grid->setUrl('../grids/rec_massemail.php');
$grid->setColProperty("id", array("editable" => false, "hidden" => true, "label" => "ID"));
$grid->setColProperty("email", array("editable" => true, "width" => 200, "editoptions" => array("size" => 75, "maxlength" => 200), "fixed" => true, "formatter" => "email", "editrules" => array("email" => true, "required" => true), "label" => "Email"));
$grid->setColProperty("name", array("editable" => true, "frozen" => true, "width" => 200, "editoptions" => array("size" => 75, "maxlength" => 200), "fixed" => true, "label" => "Name"));
$grid->setColProperty("phone", array("editable" => true, "width" => 400, "fixed" => true, "edittype" => "textarea", "editoptions" => array("rows" => 6, "cols" => 60), "label" => "Phone"));
$grid->setColProperty("remove_newsletter", array("editable" => true, "width" => 70, "fixed" => true, "label" => "Newsletter", "edittype" => "select"));
$grid->setSelect("remove_newsletter", $yesno, false, true, true, array("" => "All"));
$grid->setColProperty("lastmoddatetime", array("editable" => false, "hidden" => false, "label" => "lastmoddatetime"));
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 250, "caption" => "Recruiting Mass Email Management", "rownumbers" => true, "rowNum" => 1000, "shrinkToFit" => false, "sortname" => "lastmoddatetime", "sortorder" => "desc", "toppager" => true, "rowList" => array(10, 100, 500, 1000, 10000)));
$grid->showError = true;
$grid->navigator = true;
$grid->setNavOptions('navigator', array("pdf" => true, "excel" => true, "add" => true, "edit" => true, "del" => false, "view" => true, "search" => true));
$grid->setNavOptions('view', array("width" => 750, "dataheight" => 250, "viewCaption" => "Recruiting Mass Email Management"));
$grid->setNavOptions('add', array("width" => 750, "dataheight" => 250, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Mass Email", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 250, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Mass Email", "reloadAfterSubmit" => false));
//$grid->toolbarfilter = true;
$grid->callGridMethod('#grid', 'setFrozenColumns');
$grid->callGridMethod('#grid', 'gridResize');
$bindkeys = <<<KEYS
\$("#grid").jqGrid('bindKeys', {"onEnter":function( rowid ) { alert("You enter a row with id:"+rowid)} } );
KEYS;
$grid->setJSCode($bindkeys);
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$DB = null;
コード例 #27
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
// include the driver class
require_once ABSPATH . "php/jqGridPdo.php";
// Connection to the server
$conn = new PDO(DB_DSN, DB_USER, DB_PASSWORD);
// Tell the db that we use utf-8
$conn->query("SET NAMES utf8");
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = 'SELECT CustomerID, CompanyName, ContactName, Phone, City FROM customers';
// Set the table to where you update the data
$grid->table = 'customers';
// Set output format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->setPrimaryKeyId('CustomerID');
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('grid.php');
// Set some grid options
$grid->setGridOptions(array("rowNum" => 10, "height" => 250, "gridview" => false, "rowList" => array(10, 20, 30), "sortname" => "CustomerID"));
$grid->setColProperty('CustomerID', array("label" => "ID", "width" => 50));
// Set the parameters for the subgrid
$grid->setSubGrid("subgrid.php", array('OrderID', 'RequiredDate', 'ShipName', 'ShipCity', 'Freight'), array(60, 120, 150, 100, 70), array('left', 'left', 'left', 'left', 'right'));
// Enable navigator
$grid->navigator = true;
// Enable only editing
$grid->setNavOptions('navigator', array("excel" => false, "add" => false, "edit" => false, "del" => false, "view" => false));
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #28
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
require_once '../../../jq-config.php';
// include the jqGrid Class
require_once ABSPATH . "php/jqGrid.php";
// include the driver class
require_once ABSPATH . "php/jqGridPdo.php";
// Connection to the server
$conn = new PDO(DB_DSN, DB_USER, DB_PASSWORD);
// Tell the db that we use utf-8
$conn->query("SET NAMES utf8");
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = 'SELECT OrderID, OrderDate, CustomerID, Freight, ShipName FROM orders';
// set the ouput format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('grid.php');
// Set rownumbering to true and expand a little the width
$grid->setGridOptions(array("rownumbers" => true, "rownumWidth" => 35, "rowNum" => 10, "sortname" => "OrderID", "toppager" => true, "rowList" => array(10, 20, 50)));
// Change some property of the field(s)
$grid->setColProperty("OrderID", array("label" => "ID", "width" => 60));
$grid->setColProperty("OrderDate", array("formatter" => "date", "formatoptions" => array("srcformat" => "Y-m-d H:i:s", "newformat" => "m/d/Y")));
$grid->navigator = true;
// Clone the nav button on top pager
$grid->setNavOptions('navigator', array("cloneToTop" => true, "add" => false, "edit" => false, "del" => false, "excel" => false));
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;