コード例 #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
$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);
// this table is 1252 encoded, so we need to tell the grid
// Set the table data source
$grid->setTable('products');
// set the ouput format to xml since json have problems
$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
//get the height passed as parameter
$height = jqGridUtils::GetParam('gridheigh', '200');
$grid->setGridOptions(array("rowNum" => 10, "rowList" => array(10, 20, 30), "sortname" => "ProductID", "height" => $height, "shrinkToFit" => false, "hoverrows" => true));
$grid->setColProperty("ProductID", array("width" => 80));
// 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));
// Enable toolbar searching
$grid->toolbarfilter = true;
$grid->setFilterOptions(array("stringResult" => true));
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #3
0
ファイル: mne.php プロジェクト: Russell-IO/php-syslog-ng
// 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 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

//---------------------------------------------------------------
コード例 #4
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 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", "caption" => "PDF export with custom header"));
// 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"), "search" => false));
$grid->setColProperty("ShipName", array("width" => "250"));
$grid->setColProperty("Freight", array("label" => "Test", "align" => "right"));
// Enable navigator
$grid->navigator = true;
// Enable pdf export on navigator
$grid->setNavOptions('navigator', array("pdf" => true, "add" => false, "edit" => false, "del" => false, "view" => false, "excel" => false));
$oper = jqGridUtils::GetParam("oper");
// prevent some executions when not excel export
if ($oper == "pdf") {
    $grid->setPdfOptions(array("header" => true, "margin_top" => 27, "header_logo" => "logo.gif", "header_logo_width" => 30, "header_title" => "jqGrid pdf table", "header_string" => "by Trirand Inc - www.trirand.net"));
}
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
コード例 #5
0
ファイル: rec_crawler.php プロジェクト: sangikumar/IP
$grid->SelectCommand = 'select id, site, status, crawl, crawldate from rec_crawler_site';
$grid->table = 'rec_crawler_site';
$grid->setPrimaryKeyId('id');
$grid->serialKey = false;
$grid->dataType = 'json';
$grid->setUserDate("Y-m-d");
$grid->setColModel();
$grid->setUrl('../grids/rec_crawler.php');
$grid->setColProperty("id", array("editable" => false, "frozen" => true, "hidden" => true, "width" => 40, "fixed" => true, "label" => "ID"));
$grid->setColProperty("site", array("editable" => true, "frozen" => true, "width" => 600, "editoptions" => array("size" => 75, "maxlength" => 400), "formatter" => "link", "formatoptions" => array("target" => "_blank"), "fixed" => true, "editrules" => array("url" => true, "required" => false), "label" => "Site"));
$grid->setColProperty("status", array("editable" => true, "width" => 70, "fixed" => true, "label" => "Status", "edittype" => "select"));
$grid->setSelect("status", array("A" => "A", "N" => "N"), false, true, true, array("" => "All"));
$grid->setColProperty("crawl", array("editable" => true, "width" => 120, "fixed" => true, "label" => "Crawl Domain", "edittype" => "select"));
$grid->setSelect("crawl", $yesno, false, true, true, array("" => "All"));
$grid->setColProperty("crawldate", array("formatter" => "date", "width" => 70, "fixed" => true, "formatoptions" => array("srcformat" => "Y-m-d", "newformat" => "Y-m-d"), "editable" => true, "label" => "Crawl 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->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 250, "caption" => "Crawler Site Management", "rownumbers" => true, "rowNum" => 100, "sortname" => "id", "sortorder" => "desc", "toppager" => true, "rowList" => array(10, 20, 30, 50, 100, 500)));
$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" => "Crawler Site Management"));
$grid->setNavOptions('add', array("width" => 750, "dataheight" => 250, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Crawler", "bSubmit" => "Add Crawler Site", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 250, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Crawler", "bSubmit" => "Update Crawler Site", "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;
コード例 #6
0
ファイル: sale.php プロジェクト: sangikumar/IP
$grid->serialKey = false;
$grid->dataType = 'json';
$grid->datearray = array('saledate');
$grid->setUserDate("Y-m-d");
$grid->setColModel();
$grid->setUrl('sale.php');
$grid->setColProperty("id", array("editable" => false, "width" => 25, "hidden" => true, "fixed" => true, "label" => "ID"));
$grid->setColProperty("recruiterid", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Recruiter", "edittype" => "select"));
$grid->setSelect("recruiterid", "select '' as id, '' as name from dual union SELECT id, email as name FROM recruiter order by name");
$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("saledate", array("formatter" => "date", "width" => 70, "fixed" => true, "formatoptions" => array("srcformat" => "Y-m-d", "newformat" => "Y-m-d"), "editable" => true, "label" => "Sale 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("status", array("editable" => true, "width" => 50, "fixed" => true, "label" => "Status", "edittype" => "select"));
$grid->setSelect("status", array("I" => "Initiated", "S" => "Success", "F" => "FollowUp", "R" => "Rejected"), false, true, true, array("" => "All"));
$grid->setColProperty("last", array("editable" => false, "width" => 200, "fixed" => true, "label" => "Last Updated"));
$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" => "Sales Management", "rownumbers" => true, "rowNum" => 100, "sortname" => "lastmoddatetime", "sortorder" => "desc", "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" => 300, "viewCaption" => "Sales Management"));
$grid->setNavOptions('add', array("width" => 750, "dataheight" => 300, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Sale", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 300, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Sale", "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);
$conn = null;
コード例 #7
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;
コード例 #8
0
ファイル: client.php プロジェクト: sangikumar/IP
$grid->setColProperty("zip", array("editable" => true, "width" => 120, "editoptions" => array("size" => 75, "maxlength" => 250), "fixed" => true, "label" => "Zip"));
$grid->setAutocomplete("zip", null, "select name, name from (select zip as name from city) p where name like ? ORDER BY name", null, true, true);
$grid->setColProperty("twitter", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Twitter"));
$grid->setColProperty("facebook", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Facebook"));
$grid->setColProperty("linkedin", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Linkedin"));
$grid->setColProperty("manager1name", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Mgr Name"));
$grid->setColProperty("manager1email", array("editable" => true, "width" => 150, "fixed" => true, "formatter" => "email", "editrules" => array("email" => true, "required" => false), "label" => "Mgr Email"));
$grid->setColProperty("manager1phone", array("editable" => true, "width" => 90, "fixed" => true, "label" => "Mgr Phone"));
$grid->setColProperty("hmname", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Hiring Mgr Name"));
$grid->setColProperty("hmemail", array("editable" => true, "width" => 150, "fixed" => true, "formatter" => "email", "editrules" => array("email" => true, "required" => false), "label" => "Hiring Mgr Email"));
$grid->setColProperty("hmphone", array("editable" => true, "width" => 90, "fixed" => true, "label" => "Hiring Mgr Phone"));
$grid->setColProperty("hrname", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "HR Name"));
$grid->setColProperty("hremail", array("editable" => true, "width" => 150, "fixed" => true, "formatter" => "email", "editrules" => array("email" => true, "required" => false), "label" => "HR Email"));
$grid->setColProperty("hrphone", array("editable" => true, "width" => 90, "fixed" => true, "label" => "HR Phone"));
$grid->setColProperty("notes", array("editable" => true, "width" => 400, "fixed" => true, "edittype" => "textarea", "editoptions" => array("rows" => 6, "cols" => 60), "label" => "Notes"));
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 400, "caption" => "Client Management", "rownumbers" => true, "rowNum" => 100, "sortname" => "companyname", "sortorder" => "asc", "toppager" => true, "rowList" => array(10, 20, 30, 50, 100, 500)));
$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" => "Client Management"));
$grid->setNavOptions('add', array("width" => 750, "dataheight" => 500, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Client", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 500, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Client", "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;
コード例 #9
0
ファイル: software.php プロジェクト: sangikumar/IP
$grid->SelectCommand = 'SELECT id, name, version, softkey, type, status, link, notes FROM software';
$grid->setPrimaryKeyId('id');
$grid->serialKey = false;
$grid->dataType = 'json';
$grid->setColModel();
$grid->setUrl('../grids/software.php');
$grid->setColProperty("id", array("editable" => false, "width" => 25, "hidden" => true, "fixed" => true, "label" => "ID"));
$grid->setColProperty("name", array("editable" => true, "editoptions" => array("size" => 75, "maxlength" => 200), "frozen" => true, "width" => 300, "fixed" => true, "label" => "Name"));
$grid->setColProperty("version", array("editable" => true, "editoptions" => array("size" => 75, "maxlength" => 50), "frozen" => true, "width" => 50, "fixed" => true, "label" => "Version"));
$grid->setColProperty("softkey", array("editable" => true, "editoptions" => array("size" => 75, "maxlength" => 200), "frozen" => true, "width" => 200, "fixed" => true, "label" => "Key"));
$grid->setColProperty("type", array("editable" => true, "width" => 90, "fixed" => true, "label" => "Type", "edittype" => "select"));
$grid->setSelect("type", $softwaretype, false, true, true, array("" => "All"));
$grid->setColProperty("status", array("editable" => true, "width" => 90, "fixed" => true, "label" => "Status", "edittype" => "select"));
$grid->setSelect("status", array("Active" => "Active", "Inactive" => "Inactive"), false, true, true, array("" => "All"));
$grid->setColProperty("link", array("editable" => true, "frozen" => true, "width" => 400, "editoptions" => array("size" => 75, "maxlength" => 200), "formatter" => "link", "fixed" => true, "editrules" => array("url" => true, "required" => false), "label" => "Link"));
$grid->setColProperty("notes", array("editable" => true, "width" => 70, "fixed" => true, "edittype" => "textarea", "editoptions" => array("rows" => 6, "cols" => 80), "label" => "Notes"));
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 250, "caption" => "Software Management", "rownumbers" => true, "rowNum" => 100, "sortname" => "name", "toppager" => true, "rowList" => array(10, 100, 500)));
$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" => 750, "dataheight" => 400, "viewCaption" => "Software Management"));
$grid->setNavOptions('add', array("width" => 750, "dataheight" => 400, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Software", "bSubmit" => "Add Software", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 400, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Software", "bSubmit" => "Update Software", "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;
コード例 #10
0
ファイル: candidateinterviews.php プロジェクト: sangikumar/IP
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/ip-includes/gridincludes.php";
$candidateID = $loggedInUser->candidateid;
$grid = new jqGridRender($DB);
// Write the SQL Query
$q = 'select s.clientname, s.type, s.interviewdate, s.status, u.name manager from interview s, employee u where s.mmid = u.id and s.candidateid = ' . $candidateID;
$grid->SelectCommand = $q;
$grid->serialKey = false;
$grid->dataType = 'json';
$grid->setColModel();
$grid->setUrl('../grids/candidateinterviews.php');
$grid->setColProperty("clientname", array("editable" => false, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Client"));
$grid->setColProperty("type", array("editable" => false, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Type"));
$grid->setColProperty("interviewdate", array("editable" => false, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Interview Date"));
$grid->setColProperty("status", array("editable" => false, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Status"));
$grid->setColProperty("manager", array("editable" => false, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Manager"));
// Set alternate background using altRows property
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 250, "caption" => "Interviews", "rownumbers" => true, "rowNum" => 50, "shrinkToFit" => false, "sortname" => "interviewdate", "sortorder" => "desc", "toppager" => true, "rowList" => array(10, 20, 30, 50, 100, 500)));
$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" => "Interviews"));
$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;
コード例 #11
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;
コード例 #12
0
ファイル: proxy.php プロジェクト: sangikumar/IP
$grid->setColProperty('startdate', array("editable" => false, "width" => 70, "fixed" => true, "formatter" => "date", "label" => "Start Date", "formatoptions" => array("srcformat" => "Y-m-d HH:MM:SS", "newformat" => "m/d/Y"), "searchoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\n\t\t\t\t\t jQuery(elm).datepicker({dateFormat:'yy-mm-dd'});\n\t\t\t\t\t jQuery('.ui-datepicker').css({'font-size':'75%'});\n\t\t\t },200);}")));
$grid->setColProperty("name", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Name"));
$grid->setAutocomplete("name", null, "select name, name from (SELECT distinct name FROM leads union select distinct name from candidate union select distinct name from recruit) p where name like ? ORDER BY name", null, true, true);
$grid->setColProperty("email", array("editable" => true, "width" => 150, "fixed" => true, "formatter" => "email", "editrules" => array("email" => true, "required" => true), "label" => "Email"));
$grid->setAutocomplete("email", null, "select email, email from (SELECT distinct email FROM leads union select distinct email from candidate union select distinct email from recruit) p where email like ? ORDER BY email", null, true, true);
$grid->setColProperty("phone", array("editable" => true, "width" => 90, "fixed" => true, "label" => "Phone"));
$grid->setAutocomplete("phone", null, "select phone, phone from (SELECT distinct phone FROM leads union select distinct phone from candidate union select distinct phone from recruit) p where phone like ? ORDER BY phone", null, true, true);
$grid->setColProperty("wrkemail", array("editable" => true, "width" => 150, "fixed" => true, "formatter" => "email", "editrules" => array("email" => true, "required" => false), "label" => "Wrk Email"));
$grid->setAutocomplete("wrkemail", null, "select wrkemail, wrkemail from (SELECT distinct wrkemail FROM placement) p where wrkemail like ? ORDER BY wrkemail", null, true, true);
$grid->setColProperty("wrkphone", array("editable" => true, "width" => 90, "fixed" => true, "label" => "Wrk Phone"));
$grid->setAutocomplete("wrkphone", null, "select wrkphone, wrkphone from (SELECT distinct wrkphone FROM placement) p where wrkphone like ? ORDER BY wrkphone", null, true, true);
$grid->setColProperty("status", array("editable" => true, "width" => 70, "fixed" => true, "label" => "Status", "edittype" => "select"));
$grid->setSelect("status", $referencestatus, false, true, true, array("" => "All"));
$grid->setColProperty("communication", array("editable" => true, "width" => 70, "fixed" => true, "label" => "Communication", "edittype" => "select"));
$grid->setSelect("communication", $communication, false, true, true, array("" => "All"));
$grid->setColProperty("notes", array("editable" => true, "width" => 400, "fixed" => true, "edittype" => "textarea", "editoptions" => array("rows" => 6, "cols" => 60), "label" => "Notes"));
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 250, "caption" => "Proxy Management", "rownumbers" => true, "rowNum" => 100, "sortname" => "status asc, startdate", "sortorder" => "desc", "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" => "Proxy Management"));
$grid->setNavOptions('add', array("width" => 750, "dataheight" => 500, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Proxy", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 500, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Proxy", "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);
$conn = null;
コード例 #13
0
ファイル: insidesales.php プロジェクト: sangikumar/IP
// Change some property of the field(s)
$grid->setColProperty("id", array("editable" => false, "hidden" => true, "label" => "ID"));
$grid->setColProperty("startdate", array("formatter" => "date", "width" => 80, "fixed" => true, "formatoptions" => array("srcformat" => "Y-m-d", "newformat" => "Y-m-d"), "editable" => true, "label" => "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("name", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Name"));
$grid->setAutocomplete("name", null, "select name, name from (SELECT distinct name FROM leads union select distinct name from candidate union select distinct name from recruit) p where name like ? ORDER BY name", null, true, true);
$grid->setColProperty("email", array("editable" => true, "width" => 150, "fixed" => true, "formatter" => "email", "editrules" => array("email" => true, "required" => true), "label" => "Email"));
$grid->setAutocomplete("email", null, "select email, email from (SELECT distinct email FROM leads union select distinct email from candidate union select distinct email from recruit) p where email like ? ORDER BY email", null, true, true);
$grid->setColProperty("phone", array("editable" => true, "width" => 90, "fixed" => true, "label" => "Phone"));
$grid->setAutocomplete("phone", null, "select phone, phone from (SELECT distinct phone FROM leads union select distinct phone from candidate union select distinct phone from recruit) p where phone like ? ORDER BY phone", null, true, true);
$grid->setColProperty("type", array("editable" => true, "width" => 70, "fixed" => true, "label" => "Type", "edittype" => "select"));
$grid->setSelect("type", $insidesaletype, false, true, true, array("" => "All"));
$grid->setColProperty("status", array("editable" => true, "width" => 70, "fixed" => true, "label" => "Status", "edittype" => "select"));
$grid->setSelect("status", $insidesalestatus, false, true, true, array("" => "All"));
$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" => "Inside Sales Management", "rownumbers" => true, "rowNum" => 100, "shrinkToFit" => false, "sortname" => "startdate", "sortorder" => "desc", "toppager" => true, "rowList" => array(10, 20, 30, 50, 100, 500)));
$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" => "Inside Sales Management"));
$grid->setNavOptions('add', array("width" => 750, "dataheight" => 500, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Inside Sale", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 500, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Inside Sale", "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;
コード例 #14
0
ファイル: subsubgrid.php プロジェクト: nong053/prototype-nnit
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");
// Get the needed parameters passed from the main grid
$subtable = jqGridUtils::Strip($_REQUEST["subgrid"]);
$rowid = jqGridUtils::Strip($_REQUEST["rowid"]);
if (!$subtable && !$rowid) {
    die("Missed parameters");
}
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = "SELECT OrderID, ProductID, Quantity, UnitPrice FROM order_details WHERE OrderID=?";
// set the ouput format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->setColModel(null, array(&$rowid));
// Set the url from where we obtain the data
$grid->setUrl('subsubgrid.php');
// Set some grid options
$grid->setGridOptions(array("width" => 480, "rowNum" => 10, "sortname" => "OrderID", "height" => 'auto', "postData" => array("subgrid" => $subtable, "rowid" => $rowid)));
// Change some property of the field(s)
$grid->navigator = true;
$grid->setNavOptions('navigator', array("excel" => false, "add" => false, "edit" => false, "del" => false, "view" => false));
// Enjoy
$subtable = $subtable . "_t";
$pager = $subtable . "_p";
$grid->renderGrid($subtable, $pager, true, null, array(&$rowid), true, true);
$conn = null;
コード例 #15
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 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 serch dialog", "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 search
// Set autocomplete only on serch form.
$grid->setAutocomplete("ShipName", false, "SELECT DISTINCT ShipName FROM orders WHERE ShipName LIKE ? ORDER BY ShipName", null, false, true);
$grid->datearray = array('OrderDate');
// Enjoy
$grid->navigator = true;
$grid->setNavOptions('navigator', array("search" => true, "excel" => false, "edit" => false, "add" => false, "del" => false));
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #16
0
    $id_Solicitud = $_GET['id_Solicitud'];
}
$x = $_GET['id'];
$grid->SelectCommand = "SELECT svi_id, svi_tipo_viaje, svi_origen, svi_destino,  svi_medio, svi_kilometraje,  svi_horario, svi_fecha_salida, svi_noches_hospedaje, svi_monto_peaje, svi_nombre_hotel, svi_monto_hospedaje, svi_hotel  FROM sv_itinerario  where svi_solicitud={$id_Solicitud}";
//$grid->SelectCommand = "SELECT t_id, t_iniciador, t_owner, t_etapa_actual, t_etiqueta, sv_motivo, sv_id FROM sv_itinerario inner join solicitud_viaje on (sv_itinerario.svi_solicitud=solicitud_viaje.sv_id)  inner join tramites  on (tramites.t_id=solicitud_viaje.sv_tramite) where t_id={$x} ";
//$grid->SelectCommand = "SELECT t_id, t_iniciador, t_owner, t_etapa_actual FROM tramites where t_id={$x}";
// Set the table to where you add the data
$grid->table = 'sv_itinerario';
// 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_travel.php?id=' . $_GET['id'] . '&id_Solicitud=' . $id_Solicitud);
$grid->addCol(array("name" => "Acciones", "formatter" => "actions", "editable" => false, "sortable" => false, "resizable" => false, "fixed" => true, "width" => 50, "formatoptions" => array("keys" => true)), "second");
$grid->setGridOptions(array("rowList" => array(10, 20, 30), "sortname" => "svi_id", "height" => 100, "width" => 900));
$grid->setColProperty('svi_id', array("editable" => false, "width" => 50, "hidden" => true));
$grid->setColProperty('svi_tipo_viaje', array("editable" => true, "width" => 32, "label" => "Tipo", "hidden" => false, "edittype" => "select", "editoptions" => array("value" => "Nacional:Nacional;Extranjero:Extranjero")));
$grid->setColProperty('svi_origen', array("editable" => false, "width" => 45, "label" => "Origen"));
$grid->setColProperty('svi_destino', array("editable" => false, "width" => 45, "rowpos" => 4, "colpos" => 5, "label" => "Destino"));
$grid->setColProperty('svi_medio', array("editable" => true, "width" => 30, "label" => "Medio", "edittype" => "select", "editoptions" => array("value" => "Terrestre:Terrestre;Aéreo:Aereo")));
//$grid->setColProperty('svi_medio', array("edittype"=>"select","editoptions"=>array("value"=>"Terrestre:Terrestre;Aéreo:Aéreo")));
$grid->setColProperty('svi_kilometraje', array("editable" => true, "width" => 30, "thousandsSeparator" => ",", "formatter" => "numeric", "label" => "Km"));
$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")));
コード例 #17
0
ファイル: rmcandidate.php プロジェクト: sangikumar/IP
$grid->setColProperty("phone", array("editable" => false, "width" => 90, "fixed" => true, "label" => "Phone"));
$grid->setColProperty("status", array("editable" => false, "width" => 70, "fixed" => true, "label" => "Status"));
$grid->setSelect("status", $candidatestatus, false, true, true, array("" => "All"));
$grid->setColProperty("workstatus", array("editable" => false, "width" => 70, "fixed" => true, "label" => "US Status"));
$grid->setSelect("workstatus", $workauthtype, false, true, true, array("" => "All"));
$grid->setColProperty("education", array("editable" => false, "width" => 90, "fixed" => true, "label" => "Education"));
$grid->setColProperty("workexperience", array("editable" => false, "width" => 90, "fixed" => true, "label" => "Work Experience"));
$grid->setColProperty("ssn", array("editable" => false, "width" => 90, "fixed" => true, "label" => "SSN"));
$grid->setColProperty("secondaryemail", array("editable" => false, "width" => 150, "fixed" => true, "formatter" => "email", "editrules" => array("email" => true, "required" => false), "label" => "Secondary Email"));
$grid->setColProperty("secondaryphone", array("editable" => false, "width" => 90, "fixed" => true, "label" => "Secondary Phone"));
$grid->setColProperty("portalid", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Portal ID", "edittype" => "select"));
$grid->setSelect("portalid", "select '' as id, '' as name from dual union SELECT distinct id, concat(fullname, '-', uname) as name FROM authuser order by name");
$grid->setColProperty("workpermiturl", array("editable" => false, "frozen" => true, "width" => 200, "editoptions" => array("size" => 75, "maxlength" => 400), "formatter" => "link", "fixed" => true, "editrules" => array("url" => true, "required" => false), "label" => "Work Permit Url"));
$grid->setColProperty("batchname", array("editable" => false, "width" => 90, "fixed" => true, "label" => "Batch Name"));
$grid->setSelect("batchname", "select distinct batchname as id, batchname as name from batch", false, true, true);
// Set alternate background using altRows property
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 250, "caption" => "Candidates List", "rownumbers" => true, "rowNum" => 500, "sortname" => "name", "sortorder" => "asc", "toppager" => true, "rowList" => array(500, 1000, 5000), "grouping" => true, "groupingView" => array("groupField" => array('batchname'), "groupColumnShow" => array(true), "groupOrder" => array('desc'), "groupText" => array('<b>{0}</b>'), "groupDataSorted" => true)));
$grid->showError = true;
$grid->navigator = true;
$grid->setNavOptions('navigator', array("pdf" => false, "excel" => true, "add" => false, "edit" => true, "del" => false, "view" => true, "search" => true));
$grid->setNavOptions('view', array("width" => 750, "dataheight" => 300, "viewCaption" => "Candidate Management"));
$grid->setNavOptions('edit', array("width" => 500, "dataheight" => 300, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Candidate", "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, $summaryrows, null, true, true);
$DB = null;
コード例 #18
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
<?php

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 from SQL query
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('grid.php');
// Set alternate background using altRows property
$grid->setGridOptions(array("rowNum" => 10, "sortname" => "OrderID", "rowList" => array(10, 20, 50), "height" => 'auto', "grouping" => true, "groupingView" => array("groupField" => array('CustomerID'), "groupColumnShow" => array(true), "groupText" => array('<b>{0}</b>'), "groupDataSorted" => true)));
// 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")));
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #19
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 EmployeeID, TitleOfCourtesy, LastName, FirstName, BirthDate, City, Region FROM employees';
// Set the table to where you add the data
$grid->table = 'employees';
// Set output format to json
$grid->dataType = 'json';
//$grid->usertimeformat = "d/m/Y";
// Let the grid create the model
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('grid.php');
// add a action column and instruct the formatter to create the needed butons
// for inline editing
$grid->setColProperty('EmployeeID', array("editable" => false, "width" => 50, "label" => "ID"));
$grid->setColProperty('TitleOfCourtesy', array("hidden" => true));
$grid->setColProperty('LastName', array("cellattr" => "js:function( rowId, value, rowObject, colModel, arrData){ return ' colspan=2'}", "formatter" => "js:function(value, options, rData){ return rData['TitleOfCourtesy'] + ' ' + value +', '+ rData['FirstName'];}"));
$grid->setColProperty('FirstName', array("cellattr" => "js:function( rowId, value, rowObject, colModel, arrData){ return ' style=\"display:none\"'}"));
$grid->setColProperty('BirthDate', array("formatter" => "date", "formatoptions" => array("srcformat" => "Y-m-d H:i:s", "newformat" => "m/d/Y h:i A"), "editoptions" => array("dataInit" => "js:function(elm){setTimeout(function(){\n                    jQuery(elm).datepicker({dateFormat: 'm/d/yy',timeFormat: 'hh:mm TT',separator: ' ' ,ampm: true});\n                    jQuery('.ui-datepicker').css({'font-size':'75%'});\n                },200);}")));
// Set some grid options
$grid->setGridOptions(array("rowNum" => 10, "rowList" => array(10, 20, 30), "sortname" => "EmployeeID"));
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #20
0
ファイル: feedback.php プロジェクト: sangikumar/IP
$grid->setPrimaryKeyId('id');
$grid->serialKey = false;
$grid->dataType = 'json';
$grid->setColModel();
$grid->setUrl('../grids/feedback.php');
$grid->setColProperty("id", array("editable" => false, "width" => 25, "fixed" => true, "label" => "ID"));
$grid->setColProperty("name", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Name"));
$grid->setColProperty("email", array("editable" => true, "width" => 150, "fixed" => true, "formatter" => "email", "editrules" => array("email" => true, "required" => true), "label" => "Email"));
$grid->setColProperty("phone", array("editable" => true, "width" => 90, "fixed" => true, "label" => "Phone"));
$grid->setColProperty("trainingmessage", array("editable" => true, "hidden" => true, "edittype" => "textarea", "editrules" => array("edithidden" => true, "required" => false), "editoptions" => array("rows" => 6, "cols" => 80), "label" => "Training Message"));
$grid->setColProperty("companymessage", array("editable" => true, "hidden" => true, "edittype" => "textarea", "editrules" => array("edithidden" => true, "required" => false), "editoptions" => array("rows" => 6, "cols" => 80), "label" => "Company Message"));
$grid->setColProperty("improvemessage", array("editable" => true, "hidden" => true, "edittype" => "textarea", "editrules" => array("edithidden" => true, "required" => false), "editoptions" => array("rows" => 6, "cols" => 80), "label" => "Improve Message"));
$grid->setColProperty("refer", array("editable" => true, "label" => "Refer", "width" => 50, "fixed" => true, "edittype" => "select"));
$grid->setSelect("refer", $yesno, false, true, true, array("" => "All"));
$grid->setColProperty("usefeedback", array("editable" => true, "label" => "Use Feedback", "width" => 50, "fixed" => true, "edittype" => "select"));
$grid->setSelect("usefeedback", $yesno, false, true, true, array("" => "All"));
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 250, "caption" => "Feedback Management", "rownumbers" => true, "rowNum" => 100, "footerrow" => true, "userDataOnFooter" => true, "shrinkToFit" => false, "sortname" => "id", "sortorder" => "desc", "toppager" => true, "rowList" => array(10, 50, 100, 500, 1000)));
$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" => "Feedback Management"));
$grid->setNavOptions('add', array("width" => 750, "dataheight" => 500, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Feedback", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 500, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Feedback", "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;
コード例 #21
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;
コード例 #22
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
<?php

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
jqGridDB::query($conn, "SET NAMES utf8");
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = 'SELECT EmployeeID, LastName, FirstName, Title FROM 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');
// Set some grid options
$grid->setGridOptions(array("rowNum" => 10, "height" => 250, "rowList" => array(10, 20, 30), "sortname" => "EmployeeID"));
//the icons of the subgrid
$grid->setGridOptions(array("subGridOptions" => array("plusicon" => "ui-icon-triangle-1-e", "minusicon" => "ui-icon-triangle-1-s", "openicon" => "ui-icon-arrowreturn-1-e")));
// Set the url from where we get the data
$grid->setSubGridGrid('details.php');
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
コード例 #23
0
ファイル: assignment.php プロジェクト: sangikumar/IP
$grid->serialKey = false;
$grid->dataType = 'json';
$grid->setColModel();
$grid->setUserDate("Y-m-d");
$grid->setUrl('../grids/assignment.php');
$grid->setColProperty("id", array("editable" => false, "hidden" => true, "label" => "ID"));
$grid->setColProperty("weeknumber", array("editable" => true, "width" => 30, "fixed" => true, "label" => "Week"));
$grid->setColProperty("instructorid", array("editable" => true, "frozen" => true, "width" => 100, "fixed" => true, "label" => "Instructor", "edittype" => "select"));
$grid->setSelect("instructorid", "SELECT distinct id, name FROM employee order by id");
$grid->setColProperty("question", array("editable" => true, "width" => 450, "fixed" => true, "edittype" => "textarea", "editoptions" => array("rows" => 6, "cols" => 60), "label" => "Question"));
$grid->setColProperty("categoryid", array("editable" => true, "frozen" => true, "width" => 60, "fixed" => true, "label" => "Subject", "edittype" => "select"));
$grid->setSelect("categoryid", "SELECT distinct id, concat(id,category)  FROM ip_subjectcategory order by id");
$grid->setColProperty("subcategoryid", array("editable" => true, "frozen" => true, "width" => 60, "fixed" => true, "label" => "Category", "edittype" => "select"));
$grid->setSelect("subcategoryid", "SELECT distinct id, concat(categoryid,subcategory)  FROM ip_subjectsubcategory order by id");
$grid->setColProperty("priority", array("editable" => true, "width" => 30, "fixed" => true, "label" => "Priority"));
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 400, "caption" => "Assignment Management", "rownumbers" => true, "rowNum" => 1000, "shrinkToFit" => false, "sortname" => "weeknumber", "sortorder" => "asc", "toppager" => true, "rowList" => array(10, 100, 500, 1000, 10000, 20000)));
$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" => 750, "dataheight" => 300, "viewCaption" => "Assignment Management"));
$grid->setNavOptions('add', array("width" => 750, "dataheight" => 300, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Assignment", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 300, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Assignment", "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;
?>
コード例 #24
0
ファイル: detail.php プロジェクト: nong053/prototype-nnit
$conn->query("SET NAMES utf8");
// Get the needed parameters passed from the main grid
$rowid = jqGridUtils::GetParam('EmployeeID', 0);
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = "SELECT OrderID, RequiredDate, ShipName, ShipCity, Freight, EmployeeID FROM orders WHERE EmployeeID= ?";
// set the ouput format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->setPrimaryKeyId('OrderID');
$grid->setColModel(null, array((int) $rowid));
// Set the url from where we obtain the data
$grid->setUrl('detail.php');
// Set some grid options
$grid->setGridOptions(array("rowNum" => 10, "footerrow" => true, "userDataOnFooter" => true, "sortname" => "OrderID", "height" => 110));
// Change some property of the field(s)
$grid->setColProperty("RequiredDate", array("formatter" => "date", "formatoptions" => array("srcformat" => "Y-m-d H:i:s", "newformat" => "m/d/Y"), "search" => false));
// on beforeshow form when add we get the customer id and set it for posting
$beforeshow = <<<BEFORE
function(formid)
{
var srow = jQuery("#grid").jqGrid('getGridParam','selrow');
if(srow) {
\tvar gridrow = jQuery("#grid").jqGrid('getRowData',srow);
\t\$("#CustomerID",formid).val(gridrow.CustomerID);
}
}
BEFORE;
// disable the CRUD buttons when we initialy load the grid
$initgrid = <<<INIT
コード例 #25
0
ファイル: clr_application.php プロジェクト: sangikumar/IP
$grid->table = 'clr_applications';
$grid->setPrimaryKeyId('id');
$grid->serialKey = false;
$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;
コード例 #26
0
ファイル: grid.php プロジェクト: nong053/prototype-nnit
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = 'SELECT CustomerID, CompanyName, Phone, PostalCode, Country, City FROM customers';
// Set the table to where you update the data
$grid->table = 'customers';
$grid->setPrimaryKeyId("CustomerID");
$grid->serialKey = false;
// 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"));
$grid->setColProperty('CustomerID', array("editoptions" => array("readonly" => true)));
$grid->setColProperty('City', array("edittype" => "select", "editoptions" => array("value" => " :Select")));
$grid->setSelect("Country", "SELECT DISTINCT Country, Country FROM customers ORDER BY Country", true, true, false);
//$grid->setSelect("City","SELECT DISTINCT City, City FROM customers ORDER BY City", true, true, false);
// This event check if we are in add or edit mode and is lunched
// every time the form opens.
// The purpose of thris event is to get the value of the selected
// country and to get the values of the cityes for that country when the form is open.
// Another action here is to select the city from the grid
$beforeshow = <<<BEFORESHOW
function(formid)
{
    // get the value of the country
\tvar cntryval = \$("#Country",formid).val();
\tjQuery("#City",formid).html("<option>Select</option>");
コード例 #27
0
ファイル: email_group.php プロジェクト: sangikumar/IP
// Set the table to where we add the data
$grid->table = 'ip_email_group';
$grid->setPrimaryKeyId('id');
$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);
コード例 #28
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;
コード例 #29
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;
コード例 #30
0
ファイル: invoice.php プロジェクト: sangikumar/IP
$grid->setColProperty("hrphone", array("editable" => false, "frozen" => true, "width" => 100, "fixed" => true, "label" => "HR Phone"));
$grid->setColProperty("managername", array("editable" => false, "frozen" => true, "width" => 150, "fixed" => true, "label" => "Mgr Name"));
$grid->setColProperty("manageremail", array("editable" => false, "frozen" => true, "width" => 150, "fixed" => true, "label" => "Mgr Email"));
$grid->setColProperty("managerphone", array("editable" => false, "frozen" => true, "width" => 100, "fixed" => true, "label" => "Mgr Phone"));
$grid->setColProperty("secondaryname", array("editable" => false, "frozen" => true, "width" => 150, "fixed" => true, "label" => "Sec Name"));
$grid->setColProperty("secondaryemail", array("editable" => false, "frozen" => true, "width" => 150, "fixed" => true, "label" => "Sec Email"));
$grid->setColProperty("secondaryphone", array("editable" => false, "frozen" => true, "width" => 100, "fixed" => true, "label" => "Sec Phone"));
$grid->setColProperty("candidatename", array("editable" => false, "frozen" => true, "width" => 150, "fixed" => true, "label" => "Cand Name"));
$grid->setColProperty("candidatephone", array("editable" => false, "frozen" => true, "width" => 100, "fixed" => true, "label" => "Cand Phone"));
$grid->setColProperty("candidateemail", array("editable" => false, "frozen" => true, "width" => 150, "fixed" => true, "label" => "Cand Email"));
$grid->setColProperty("wrkemail", array("editable" => false, "frozen" => true, "width" => 150, "fixed" => true, "label" => "Wrk Email"));
$grid->setColProperty("wrkphone", array("editable" => false, "frozen" => true, "width" => 100, "fixed" => true, "label" => "Wrk Phone"));
$grid->setColProperty("recruitername", array("editable" => false, "frozen" => true, "width" => 150, "fixed" => true, "label" => "Recruiter Name"));
$grid->setColProperty("recruiterphone", array("editable" => false, "frozen" => true, "width" => 100, "fixed" => true, "label" => "Recruiter Ph"));
$grid->setColProperty("recruiteremail", array("editable" => false, "frozen" => true, "width" => 150, "fixed" => true, "label" => "Recruiter Email"));
$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 Management", "rownumbers" => true, "rowNum" => 1000, "footerrow" => true, "userDataOnFooter" => true, "shrinkToFit" => false, "sortname" => "invoicedate", "sortorder" => "desc", "toppager" => true, "rowList" => array(1000, 2000, 5000, 10000), "grouping" => true, "groupingView" => array("groupCollapse" => true, "groupField" => array('poid'), "groupColumnShow" => array(true), "groupOrder" => array('desc'), "groupSummary" => array(true), "groupText" => array('<b>{0}</b>'), "groupDataSorted" => false)));
$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" => 700, "dataheight" => 500, "viewCaption" => "Invoice Management"));
$grid->setNavOptions('add', array("width" => 700, "dataheight" => 500, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Invoice", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 700, "dataheight" => 500, "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;