Auto refresh 1.7.25 Default theme
Auto refresh grid after a configured amount of time. For this case 15 seconds
HIDE CODE
<?php
// Get an instance of the Xcrud class
$xcrud = Xcrud::get_instance();
// Set the table to work with
$xcrud->table("orderdetails");
// Define which columns to display in the table
$xcrud->columns("orderNumber,productCode,orderLineNumber,quantityOrdered,priceEach,total");
// Define which fields are available for data entry or editing
$xcrud->fields("orderNumber,productCode,orderLineNumber,quantityOrdered,priceEach,total");
$xcrud->relation("officeCode","offices","officeCode","city");
// Hide the 'extension' field when the 'officeCode' IN '7,3,4'(London, NYC, Paris)
$xcrud->set_formular("total","{quantityOrdered}+{priceEach}","onmouseout"); //{lastName}+''+{firstName}@gmail.com
$xcrud->set_routine("autorefresh","15");//number of seconds
/*$xcrud->set_routine("save","5");//save after ever of seconds
$xcrud->set_routine("query","5","update x set y =1");*/
$xcrud->readonly("total");
$xcrud->label("total","Total");
// Render the xcrud instance to display the table and form
echo $xcrud->render();
?>
Orderdetails
Add Export into CSV Print Search
| # | Ordernumber | Productcode | Orderlinenumber | Quantityordered | Priceeach | Total | |
|---|---|---|---|---|---|---|---|
| 1 | 10100 | ' | 3 | 100 | 136 | 1360.00 | View Edit Remove |
| 2 | 10100 | S18_2248 | 2 | 500 | 55.09 | 2754.50 | View Edit Remove |
| 3 | 10100 | S24_3969 | 1 | 49 | 35.29 | 1729.20 | View Edit Remove |
| 4 | 10101 | S18_2325 | 4 | 20 | 108.06 | 0.00 | View Edit Remove |
| 5 | 10101 | S18_2795 | 12222 | 26 | 167.06 | 0.00 | View Edit Remove |
| 6 | 10101 | S24_1937 | 3 | 45 | 32.53 | 1463.90 | View Edit Remove |
| 7 | 10101 | S24_2022 | 2 | 46 | 44.35 | View Edit Remove | |
| 8 | 10102 | S18_1342 | 2 | 39 | 95.55 | View Edit Remove | |
| 9 | 10102 | S18_1367 | 1 | 41 | 43.13 | View Edit Remove | |
| 10 | 10103 | S18_1097 | 10 | 35 | 94.5 | View Edit Remove |
?>