Пример #1
0
//$dg -> display();
?>



<?php 
$dg = new C_DataGrid("select * from employees", array("employeeNumber", "lastName"), "employees");
$dg->enable_edit("FORM", "CRU");
//$dg -> set_col_hidden('employeeNumber',true);
$dg->enable_kb_nav(true);
/*
 * $dg -> set_col_edittype("isActive", "checkbox","1:0");
//$dg -> set_col_edittype("officeCode", "select", "1:San Francisco;2:Boston;3:NYC;4:Paris;5:Tokyo;6:Sydney;7:London");
$dg -> set_col_edittype("officeCode", "select", "Select officeCode,city from offices",false);
$dg -> set_col_edittype("reportsTo", "select", "Select employeeNumber, lastName from employees",false);
$dg -> set_row_color('lightyellow', 'yellow', '#F1F7F9');
$dg->enable_search(true);
$dg->enable_advanced_search(true);
//$dg->set_selectnetsted('officeCode', 'reportsTo');

$dg->enable_columnchooser();
*/
$dg->enable_debug(true);
$dg->display();
?>



    </body>
</html>
Пример #2
0
// hide a column
$dg->set_col_hidden("requiredDate");
// change default caption
$dg->set_caption("Orders List");
// EXCEL export
$dg->enable_export('PDF');
$dg->display();
echo '<h2>EXCEL Export</h2>';
$dg2 = new C_DataGrid("select * from customers", "customerNumber", "Customers");
// PDF export
$dg2->enable_export('EXCEL');
$dg2->display();
echo '<h2>Export Dropdown (PDF, EXCEL, HTML, CSV)</h2>';
$dg3 = new C_DataGrid("SELECT * FROM products", "productCode", "products");
$exportDropdown = <<<EXPORTDROPDOWN
\$('#products_pager1_left').append ('<div style=padding-right: 16px;>Export:\\
    <select onchange=document.location.href=this.options[this.selectedIndex].value;>\\
        <option>---</option>\\
        <option value=/phpGridx/export.php?gn=products&export_type=excel>Excel</option>\\
        <option value=/phpGridx/export.php?gn=products&export_type=pdf>PDF</option>\\
        <option value=/phpGridx/export.php?gn=products&export_type=html>HTML</option>\\
        <option value=/phpGridx/export.php?gn=products&export_type=csv>CSV</option>\\
    </select></div>');
EXPORTDROPDOWN;
$dg3->before_script_end = $exportDropdown;
$dg3->display();
?>
<script>
</script>
</body>
</html>
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>A Basic PHP Datagrid</title>
</head>
<body>
<table>
<tr><td>
<?php 
$dg = new C_DataGrid("SELECT * FROM orders", "orderNumber", "orders");
$dg->enable_edit();
$dg->display();
?>
</td>
<td>
<?php 
$dg2 = new C_DataGrid("SELECT * FROM orders", "orderNumber", "orders");
$dg2->set_jq_gridName('order2');
$dg2->set_caption("order 2");
$dg2->enable_edit();
$dg2->display();
?>
</td></tr>
</table>



</body>
</html>
Пример #4
0
require_once "../conf.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Multiple Datagrids</title>
</head>
<body> 

<?php 
$dg = new C_DataGrid("SELECT * FROM orders", "orderNumber", 'orders');
$dg->enable_edit("FORM", "CRUD");
$dg->display();
$dg2 = new C_DataGrid("select * from employees", "employeeNumber", "employees");
$dg2->enable_edit("FORM", "CRUD");
$dg2->display();
$dg3 = new C_DataGrid("select * from offices", "officeCode", "offices");
$dg3->enable_edit("FORM", "CRUD");
$dg3->display();
$dg4 = new C_DataGrid("select * from productlines", "productLine", "productlines");
$dg4->enable_edit("FORM", "CRUD");
$dg4->display();
$dg5 = new C_DataGrid("select * from customers", "customerNumber", "customers");
$dg5->enable_edit("FORM", "CRUD");
$dg5->display();
?>

</body>
</html>
Пример #5
0
|
*/
Route::get('/', function () {
    return view('welcome');
});
/**
 * Special route for using PHP Data Grid to display "dashboard" list of users.
 * See http://www.codeproject.com/Articles/1006057/phpGrid-Laravel-and-Bootstrap for details.
 */
Route::get('dashboard', function () {
    require_once public_path() . '/assets/plugins/phpGrid_Lite/conf.php';
    $dg = new C_DataGrid("SELECT * FROM users", "id", "users");
    $dg->enable_edit("INLINE", "CRUD");
    $dg->enable_autowidth(true)->enable_autoheight(true);
    $dg->set_theme('cobalt-flat');
    $dg->display(false);
    $grid = $dg->get_display(true);
    return view('dashboard', array('grid' => $grid));
});
// Provide controller methods with model object instance instead of ID
// by using route-model binding
Route::model('projects', 'Project');
Route::model('tasks', 'Task');
Route::model('users', 'User');
Route::bind('projects', function ($value, $route) {
    return App\Project::whereSlug($value)->first();
});
Route::bind('tasks', function ($value, $route) {
    return App\Task::whereSlug($value)->first();
});
Route::bind('users', function ($value, $route) {
<?php

require_once "../conf.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Data grid Foreign Lanugage Display</title>
</head>
<body> 

<?php 
//set database name parameter
$dg1 = new C_DataGrid("SELECT * FROM names", "id", "names");
$dg1->enable_edit("INLINE", "CRUD");
$dg1->display();
?>

</body>
</html>