本文整理汇总了PHP中jqGridRender::setUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP jqGridRender::setUrl方法的具体用法?PHP jqGridRender::setUrl怎么用?PHP jqGridRender::setUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jqGridRender
的用法示例。
在下文中一共展示了jqGridRender::setUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_main_grid
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: jqGridRender
<?php
require_once $_SERVER["DOCUMENT_ROOT"] . "/ip-includes/gridincludes.php";
$grid = new jqGridRender($DB);
$grid->SelectCommand = 'SELECT id, startdate, name, email, phone, wrkemail, wrkphone, status, communication, notes FROM reference';
$grid->table = 'reference';
$grid->setPrimaryKeyId('id');
$grid->serialKey = false;
$grid->dataType = 'json';
$grid->datearray = array('startdate');
$grid->setUserDate("Y-m-d");
$grid->setColModel();
$grid->setUrl('../grids/reference.php');
$grid->setColProperty("id", array("editable" => false, "width" => 25, "fixed" => true, "label" => "ID"));
$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" => "Reference Management", "rownumbers" => true, "rowNum" => 100, "sortname" => "status asc, startdate", "sortorder" => "desc", "toppager" => true, "rowList" => array(10, 20, 30, 50, 100)));
示例3: PDO
// include pdf
require_once ABSPATH . '/php/tcpdf/config/lang/eng.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 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: jqGridRender
<?php
require_once $_SERVER["DOCUMENT_ROOT"] . "/ip-includes/gridincludes.php";
$grid = new jqGridRender($DB);
$grid->SelectCommand = 'SELECT id, (select url from clr_position cp where cp.id = positionid) url, email, applicationdate, autoapply, candidate from clr_applications';
$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
示例5: jqGridRender
<?php
require_once $_SERVER["DOCUMENT_ROOT"] . "/ip-includes/gridincludes.php";
// Create the jqGrid instance
$grid = new jqGridRender($DB);
// Write the SQL Query
$grid->SelectCommand = 'SELECT id, weeknumber, instructorid, question, categoryid, subcategoryid, priority FROM ip_assignment';
// Set the table to where we add the data
$grid->table = 'ip_assignment';
$grid->setPrimaryKeyId('id');
$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));
示例6: PDO
// 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 * FROM detallescliente';
// Set the table to where you add the data
$grid->table = 'detallescliente';
// 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);}")
示例7: jqGridRender
<?php
require_once $_SERVER["DOCUMENT_ROOT"] . "/ip-includes/gridincludes.php";
$grid = new jqGridRender($DB);
$grid->SelectCommand = 'SELECT id,companyname,email,phone,status,url,fax,address,city,state,country,twitter,linkedin,facebook,zip,manager1name,manager1email,manager1phone,hmname,hmemail,hmphone,hrname,hremail,hrphone,notes FROM client';
$grid->table = 'client';
$grid->setPrimaryKeyId('id');
$grid->serialKey = false;
$grid->dataType = 'json';
$grid->datearray = array('startdate');
$grid->setUserDate("Y-m-d");
$grid->setColModel();
$grid->setUrl('../grids/client.php');
$grid->setColProperty("id", array("editable" => false, "width" => 40, "fixed" => true, "label" => "ID"));
$grid->setColProperty("companyname", array("editable" => true, "frozen" => true, "width" => 250, "editoptions" => array("size" => 75, "maxlength" => 250, "style" => "text-transform: uppercase"), "fixed" => true, "label" => "Company Name"));
$grid->setColProperty("email", array("editable" => true, "width" => 200, "editoptions" => array("size" => 75, "maxlength" => 250, "style" => "text-transform: lowercase"), "fixed" => true, "formatter" => "email", "editrules" => array("email" => true, "required" => true), "label" => "Email"));
$grid->setColProperty("phone", array("editable" => true, "width" => 150, "editoptions" => array("size" => 75, "maxlength" => 250), "fixed" => true, "label" => "Phone"));
$grid->setColProperty("status", array("editable" => true, "width" => 90, "fixed" => true, "label" => "Status", "edittype" => "select"));
$grid->setSelect("status", $vendorstatus, false, true, true, array("" => "All"));
$grid->setColProperty("url", array("editable" => true, "frozen" => true, "width" => 200, "editoptions" => array("size" => 75, "maxlength" => 200, "style" => "text-transform: lowercase"), "formatter" => "link", "formatoptions" => array("target" => "_blank"), "fixed" => true, "editrules" => array("url" => true, "required" => false), "label" => "Url"));
$grid->setColProperty("fax", array("editable" => true, "width" => 150, "editoptions" => array("size" => 75, "maxlength" => 250), "fixed" => true, "label" => "Fax"));
$grid->setColProperty("address", array("editable" => true, "width" => 150, "editoptions" => array("size" => 75, "maxlength" => 250), "fixed" => true, "label" => "Address"));
$grid->setColProperty("city", array("editable" => true, "width" => 120, "editoptions" => array("size" => 75, "maxlength" => 250), "fixed" => true, "label" => "City"));
$grid->setAutocomplete("city", null, "select name, name from (select distinct city as name from city) p where name like ? ORDER BY name", null, true, true);
$grid->setColProperty("state", array("editable" => true, "width" => 120, "editoptions" => array("size" => 75, "maxlength" => 250), "fixed" => true, "label" => "State"));
$grid->setAutocomplete("state", null, "select name, name from (SELECT distinct name FROM state)p where name like ? ORDER BY name", null, true, true);
$grid->setColProperty("country", array("editable" => true, "width" => 120, "editoptions" => array("size" => 75, "maxlength" => 250), "fixed" => true, "label" => "Country"));
$grid->setAutocomplete("country", null, "select name, name from (SELECT distinct short_name as name FROM country) p where name like ? ORDER BY name", null, true, true);
$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"));
示例8: array
// Write the SQL Query
if (isset($_GET['id_Solicitud'])) {
$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"));
示例9: PDO
<?php
include_once "../ip-config.php";
require_once '../jq-config.php';
require_once ABSPATH . "php/jqGrid.php";
require_once ABSPATH . "php/jqGridPdo.php";
$conn = new PDO(DB_DSN, DB_USER, DB_PASSWORD);
$conn->query("SET NAMES utf8");
$grid = new jqGridRender($conn);
$grid->SelectCommand = 'select id, pageid, headerid, label, sortorder from uc_header_pages t';
$grid->table = 'uc_header_pages';
$grid->setPrimaryKeyId('id');
$grid->serialKey = false;
$grid->dataType = 'json';
$grid->setColModel();
$grid->setUrl('admin_headerpages.php');
$grid->setColProperty("id", array("editable" => false, "width" => 25, "fixed" => true, "label" => "ID"));
$grid->setColProperty("label", array("editable" => true, "frozen" => true, "width" => 100, "editoptions" => array("size" => 75, "maxlength" => 200), "fixed" => true, "label" => "Label"));
$grid->setColProperty("headerid", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Header", "edittype" => "select"));
$grid->setSelect("headerid", "select id, TRIM(LEADING '->' FROM label) from (SELECT distinct id, concat(ifnull((select concat(ifnull((select concat(ifnull((select label from uc_header uh3 where id = uh2.parentid), ''), '->', label) as label from uc_header uh2 where id = uh1.parentid), ''), '->', label)as label from uc_header uh1 where id = uh.parentid), ''), '->', label) as label FROM uc_header uh order by label) t");
$grid->setColProperty("pageid", array("editable" => true, "frozen" => true, "width" => 250, "fixed" => true, "label" => "Page", "edittype" => "select"));
$grid->setSelect("pageid", "select id, concat(page, ' - ', IFNULL(label, '')) as label1 from uc_pages up order by label1");
$grid->setColProperty("sortorder", array("editable" => true, "width" => 90, "fixed" => true, "label" => "SortOrder"));
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 250, "caption" => "Header Pages Management", "rownumbers" => true, "rowNum" => 100, "sortname" => "headerid asc, sortorder", "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" => true, "view" => true, "search" => true));
$grid->setNavOptions('view', array("width" => 750, "dataheight" => 250, "viewCaption" => "Header Pages Management"));
$grid->setNavOptions('add', array("width" => 750, "dataheight" => 250, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Header Page", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 250, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Header Page", "reloadAfterSubmit" => false));
$grid->callGridMethod('#grid', 'setFrozenColumns');
示例10: jqGridRender
// Create the jqGrid instance
$grid = new jqGridRender($DB);
// Write the SQL Query
$grid->SelectCommand = 'SELECT id, startdate, name, email, phone, type, status, notes FROM insidesales';
// Set the table to where we add the data
$grid->table = 'insidesales';
$grid->setPrimaryKeyId('id');
$grid->serialKey = false;
// set the ouput format to json
$grid->dataType = 'json';
$grid->datearray = array('startdate');
$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/insidesales.php');
// 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
示例11: jqGridRender
<?php
require_once $_SERVER["DOCUMENT_ROOT"] . "/ip-includes/gridincludes.php";
$employeeid = $_GET['employeeid'];
$grid = new jqGridRender($DB);
$grid->SelectCommand = 'SELECT id, candidateid, candidateid as cid, mmid, positiondate, type, status, vendorcall, rate, vendor1email, vendor1, clientemail, client, vendor2email, vendor2,vendor3email, vendor3, reference, notes FROM position where mmid = "' . $employeeid . '" or mmid in (select id from employee where mgrid = "' . $employeeid . '")';
$grid->table = 'position';
$grid->setPrimaryKeyId('id');
$grid->serialKey = false;
$grid->dataType = 'json';
$grid->datearray = array('positiondate');
$grid->setUserDate("Y-m-d");
$grid->setColModel();
$grid->setUrl('../grids/rposition.php?employeeid=' . $employeeid);
$grid->setColProperty("id", array("editable" => false, "hidden" => true, "label" => "ID"));
$grid->setColProperty("cid", array("editable" => false, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Candidate Name", "edittype" => "select"));
$grid->setSelect("cid", "SELECT distinct candidateid as id, name as name FROM candidate order by name");
$grid->setColProperty("candidateid", array("editable" => true, "hidden" => true, "editrules" => array("edithidden" => true, "required" => false), "frozen" => true, "width" => 200, "fixed" => true, "label" => "Candidate Name", "edittype" => "select"));
$grid->setSelect("candidateid", "SELECT distinct candidateid as id, name as name FROM candidate where status in ('Marketing', 'Placed', 'OnProject-Mkt') order by name");
$grid->setColProperty("mmid", array("editable" => true, "frozen" => true, "width" => 100, "fixed" => true, "label" => "Manager", "edittype" => "select"));
$grid->setSelect("mmid", "SELECT distinct id, name FROM employee where id = {$employeeid} or mgrid = {$employeeid} order by name");
$grid->setColProperty("positiondate", array("formatter" => "date", "width" => 80, "fixed" => true, "formatoptions" => array("srcformat" => "Y-m-d", "newformat" => "Y-m-d"), "editable" => true, "label" => "Position 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("type", array("editable" => true, "width" => 70, "fixed" => true, "label" => "Type", "edittype" => "select"));
$grid->setSelect("type", $technology, false, true, true, array("" => "All"));
$grid->setColProperty("status", array("editable" => true, "width" => 70, "fixed" => true, "label" => "Status", "edittype" => "select"));
$grid->setSelect("status", array("Scheduled" => "Scheduled", "Candidate Cancelled" => "Candidate Cancelled", "Cancelled" => "Cancelled"), false, true, true, array("" => "All"));
$grid->setColProperty("vendorcall", array("editable" => true, "width" => 70, "fixed" => true, "label" => "Call", "edittype" => "select"));
$grid->setSelect("vendorcall", $yesno, false, true, true, array("" => "All"));
$grid->setColProperty("vendor1email", array("editable" => true, "width" => 200, "fixed" => true, "editoptions" => array("size" => 75, "maxlength" => 200), "formatter" => "email", "editrules" => array("email" => true, "required" => false), "label" => "Vendor1 Email"));
$grid->setAutocomplete("vendor1email", "#vendor1", "select email, email, vendor1 from (select r.email, (select companyname from vendor where id = r.vendorid) vendor1 from recruiter r union select distinct vendor1email as email, vendor1 from position) p where email like ? ORDER BY email", null, true, true);
$grid->setColProperty("vendor1", array("editable" => true, "width" => 90, "fixed" => true, "editoptions" => array("size" => 75, "maxlength" => 200), "label" => "Vendor1"));
示例12: jqGridRender
<?php
require_once $_SERVER["DOCUMENT_ROOT"] . "/ip-includes/gridincludes.php";
// Create the jqGrid instance
$grid = new jqGridRender($DB);
// Write the SQL Query
$grid->SelectCommand = 'SELECT id, vendorid, candidateid , name, url, type FROM agreement';
$grid->table = 'agreement';
$grid->setPrimaryKeyId('id');
$grid->serialKey = false;
$grid->dataType = 'json';
$grid->setColModel();
$grid->setUrl('../grids/agreement.php');
$grid->setColProperty("id", array("editable" => false, "width" => 25, "fixed" => true, "label" => "ID"));
$grid->setColProperty("vendorid", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Vendor", "edittype" => "select"));
$grid->setSelect("vendorid", "select '' as id, '' as name from dual union SELECT distinct id as id, companyname as name FROM vendor order by name");
$grid->setColProperty("candidateid", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Candidate Name", "edittype" => "select"));
$grid->setSelect("candidateid", "select '' as id , ' None' as name from dual union SELECT distinct candidateid as id, name as name FROM candidate where status = 'Placed' order by name ");
$grid->setColProperty("name", array("editable" => true, "width" => 100, "fixed" => true, "label" => "Name"));
$grid->setColProperty("url", array("editable" => true, "width" => 120, "fixed" => true, "formatter" => "link", "label" => "Url"));
$grid->setColProperty("type", array("editable" => true, "width" => 70, "fixed" => true, "label" => "Type", "edittype" => "select"));
$grid->setSelect("type", $agreementtype, false, true, true, array("" => "All"));
$grid->setGridOptions(array("sortable" => true, "width" => 1024, "height" => 250, "caption" => "Agreement Management", "rownumbers" => true, "rowNum" => 1000, "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" => "Agreement Management"));
$grid->setNavOptions('add', array("width" => 750, "dataheight" => 500, "closeOnEscape" => true, "closeAfterAdd" => true, "addCaption" => "Add Agreement", "reloadAfterSubmit" => false));
$grid->setNavOptions('edit', array("width" => 750, "dataheight" => 500, "closeOnEscape" => true, "closeAfterEdit" => true, "editCaption" => "Update Agreement", "reloadAfterSubmit" => false));
$grid->callGridMethod('#grid', 'setFrozenColumns');
$grid->callGridMethod('#grid', 'gridResize');
示例13: PDO
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;
示例14: PDO
require_once(ABSPATH.'/php/tcpdf/config/lang/eng.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 eid AS EventId, seen AS Seen, lastseen AS LastSeen FROM snare_eid where eid>0 and 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/snare_eid.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'));
示例15: jqGridRender
// Create the jqGrid instance
$grid = new jqGridRender($DB);
// Write the SQL Query
$grid->SelectCommand = 'select sessionid, instructorid, candidateid, title, status, sessiondate, type, candidate2id, candidate3id, candidate4id, candidate5id, subject, performance, feedback, recorded, uploaded, link, videoid, notes from session';
// Set the table to where we add the data
$grid->table = 'session';
$grid->setPrimaryKeyId('sessionid');
$grid->serialKey = false;
// set the ouput format to json
$grid->dataType = 'json';
$grid->datearray = array('sessiondate');
$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/session.php');
// Change some property of the field(s)
$grid->setColProperty("sessionid", array("editable" => false, "hidden" => true, "label" => "ID"));
$grid->setColProperty("candidateid", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Candidate Name", "edittype" => "select"));
$grid->setSelect("candidateid", "select '' as id, ' Group Mock' as name from dual union SELECT distinct candidateid as id, name as name FROM candidate where status not in ('Discontinued' , 'Completed' , 'Defaulted') order by name");
$grid->setColProperty("candidate2id", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Candidate2 Name", "edittype" => "select"));
$grid->setSelect("candidate2id", "select null as id, '' as name from dual union SELECT distinct candidateid as id, name as name FROM candidate where status not in ('Discontinued' , 'Completed' , 'Defaulted') order by name");
$grid->setColProperty("candidate3id", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Candidate3 Name", "edittype" => "select"));
$grid->setSelect("candidate3id", "select null as id, '' as name from dual union SELECT distinct candidateid as id, name as name FROM candidate where status not in ('Discontinued' , 'Completed' , 'Defaulted') order by name");
$grid->setColProperty("candidate4id", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Candidate4 Name", "edittype" => "select"));
$grid->setSelect("candidate4id", "select null as id, '' as name from dual union SELECT distinct candidateid as id, name as name FROM candidate where status not in ('Discontinued' , 'Completed' , 'Defaulted') order by name");
$grid->setColProperty("candidate5id", array("editable" => true, "frozen" => true, "width" => 200, "fixed" => true, "label" => "Candidate5 Name", "edittype" => "select"));
$grid->setSelect("candidate5id", "select null as id, '' as name from dual union SELECT distinct candidateid as id, name as name FROM candidate where status not in ('Discontinued' , 'Completed' , 'Defaulted') order by name");
$grid->setColProperty("instructorid", array("editable" => true, "frozen" => true, "width" => 100, "fixed" => true, "label" => "Instructor Name", "edittype" => "select"));
$grid->setSelect("instructorid", "select id, name from employee where designationid in (1,2,9,12) order by name");
$grid->setColProperty("title", array("editable" => true, "frozen" => true, "width" => 400, "editoptions" => array("size" => 75, "maxlength" => 300), "fixed" => true, "editrules" => array("required" => false), "label" => "Title"));