function showLoanHist($num_recs_show = 1000000) { global $dbs; require SIMBIO . 'simbio_GUI/table/simbio_table.inc.php'; require SIMBIO . 'simbio_DB/datagrid/simbio_dbgrid.inc.php'; require SIMBIO . 'simbio_GUI/paging/simbio_paging.inc.php'; require SIMBIO . 'simbio_UTILS/simbio_date.inc.php'; // table spec $_table_spec = 'loan AS l LEFT JOIN member AS m ON l.member_id=m.member_id LEFT JOIN item AS i ON l.item_code=i.item_code LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id'; // create datagrid $_loan_hist = new simbio_datagrid(); $_loan_hist->disable_paging = true; $_loan_hist->table_ID = 'loanhist'; $_loan_hist->setSQLColumn('l.item_code AS \'' . __('Item Code') . '\'', 'b.title AS \'' . __('Title') . '\'', 'l.loan_date AS \'' . __('Loan Date') . '\'', 'l.return_date AS \'' . __('Return Date') . '\''); $_loan_hist->setSQLorder('l.loan_date DESC'); $_criteria = sprintf('m.member_id=\'%s\' AND l.is_lent=1 AND is_return=1 ', $_SESSION['mid']); $_loan_hist->setSQLCriteria($_criteria); /* callback function to show overdue */ function showOverdue($obj_db, $array_data) { $_curr_date = date('Y-m-d'); if (simbio_date::compareDates($array_data[3], $_curr_date) == $_curr_date) { #return '<strong style="color: #f00;">'.$array_data[3].' '.__('OVERDUED').'</strong>'; } else { return $array_data[3]; } } // modify column value #$_loan_hist->modifyColumnContent(3, 'callback{showOverdue}'); // set table and table header attributes $_loan_hist->table_attr = 'align="center" class="memberLoanList" cellpadding="5" cellspacing="0"'; $_loan_hist->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; $_loan_hist->using_AJAX = false; // return the result $_result = $_loan_hist->createDataGrid($dbs, $_table_spec, $num_recs_show); $_result = '<div class="memberLoanHistInfo">' . $_loan_hist->num_rows . ' ' . __('item(s) loan history') . '</div>' . "\n" . $_result; return $_result; }
<input type="submit" id="doSearch" value="<?php echo __('Search'); ?> " class="button" /> </form> </div> </fieldset> <?php /* search form end */ /* STOCK TAKE LOGS LIST */ // table spec $table_spec = 'system_log AS sl'; // create datagrid $datagrid = new simbio_datagrid(); $datagrid->setSQLColumn('sl.log_date AS \'Time\'', 'sl.log_msg AS \'Message\''); $datagrid->setSQLorder("sl.log_date DESC"); $criteria = 'sl.log_location=\'stock_take\' AND sl.log_msg LIKE \'Stock Take ERROR%\' '; // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keyword = $dbs->escape_string(trim($_GET['keywords'])); $words = explode(' ', $keyword); if (count($words) > 1) { $concat_sql = ' ('; foreach ($words as $word) { $concat_sql .= " (sl.log_date LIKE '%{$word}%' OR sl.log_msg LIKE '%{$word}%') AND"; } // remove the last AND $concat_sql = substr_replace($concat_sql, '', -3); $concat_sql .= ') '; $datagrid->setSQLCriteria($criteria . ' AND ' . $concat_sql); } else {
//mfc ?> </div> </div> </fieldset> <?php /* search form end */ /* ITEM LIST */ require SIMBIO_BASE_DIR . 'simbio_UTILS/simbio_tokenizecql.inc.php'; require LIB_DIR . 'biblio_list.inc.php'; // table spec $table_spec = 'item LEFT JOIN biblio ON item.biblio_id=biblio.biblio_id'; // create datagrid $datagrid = new simbio_datagrid(); $datagrid->setSQLColumn('item.item_code', 'item.item_code AS \'' . __('Item Code') . '\'', 'biblio.title AS \'' . __('Title') . '\''); $datagrid->setSQLorder('item.last_update DESC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string(trim($_GET['keywords'])); $searchable_fields = array('title', 'author', 'subject', 'itemcode'); $search_str = ''; // if no qualifier in fields if (!preg_match('@[a-z]+\\s*=\\s*@i', $keywords)) { foreach ($searchable_fields as $search_field) { $search_str .= $search_field . '=' . $keywords . ' OR '; } } else { $search_str = $keywords; } $biblio_list = new biblio_list($dbs); $criteria = $biblio_list->setSQLcriteria($search_str);
if (isset($_GET['type']) && $_GET['type'] == 'orphaned') { $table_spec = 'mst_topic AS t LEFT JOIN biblio_topic AS bt ON t.topic_id=bt.topic_id'; $sql_criteria = 'bt.biblio_id IS NULL OR bt.topic_id IS NULL'; } else { $table_spec = 'mst_topic AS t'; } $subj_type_fld = 1; // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $subj_type_fld = 2; $datagrid->setSQLColumn('t.topic_id', 't.topic AS \'' . __('Subject') . '\'', 't.topic_type AS \'' . __('Subject Type') . '\'', 't.auth_list AS \'' . __('Authority Files') . '\'', 't.last_update AS \'' . __('Last Update') . '\''); } else { $datagrid->setSQLColumn('t.topic AS \'' . __('Subject') . '\'', 't.topic_type AS \'' . __('Subject Type') . '\'', 't.auth_list AS \'' . __('Authority Files') . '\'', 't.last_update AS \'' . __('Last Update') . '\''); } $datagrid->setSQLorder('topic ASC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keyword = $dbs->escape_string(trim($_GET['keywords'])); $words = explode(' ', $keyword); if (count($words) > 1) { $concat_sql = ' AND ('; foreach ($words as $word) { $concat_sql .= " t.topic LIKE '%{$word}%' AND"; } // remove the last AND $concat_sql = substr_replace($concat_sql, '', -3); $concat_sql .= ') '; $sql_criteria .= $concat_sql; } else { $sql_criteria .= " AND t.topic LIKE '%{$keyword}%'";
<input type="hidden" name="tkn" value="<?php echo $_SESSION['token']; ?> " /> </form> </div> </div> </fieldset> <?php /* BACKUP LOG LIST */ // table spec $table_spec = 'backup_log AS bl LEFT JOIN user AS u ON bl.user_id=u.user_id'; // create datagrid $datagrid = new simbio_datagrid(); $datagrid->setSQLColumn('u.realname AS \'Backup Executor\'', 'bl.backup_time AS \'Backup Time\'', 'bl.backup_file AS \'Backup File Location\''); $datagrid->setSQLorder('backup_time DESC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $datagrid->setSQLCriteria("bl.backup_time LIKE '%{$keywords}%' OR bl.backup_file LIKE '%{$keywords}%'"); } // set table and table header attributes $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // set delete proccess URL $datagrid->delete_URL = $_SERVER['PHP_SELF']; // put the result into variables $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, false); if (isset($_GET['keywords']) and $_GET['keywords']) { $msg = str_replace('{result->num_rows}', $datagrid->num_rows, __('Found <strong>{result->num_rows}</strong> from your keywords')); //mfc
$_output .= '<div style="float: right; width: 20px; height: 20px;" class="homeFlagIcon" title="Promoted To Homepage"> </div>'; } return $_output; } // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('biblio.biblio_id', 'biblio.biblio_id AS bid', 'biblio.title AS \'' . __('Title') . '\'', 'biblio.isbn_issn AS \'' . __('ISBN/ISSN') . '\'', 'IF(COUNT(item.item_id)>0, COUNT(item.item_id), \'<strong style="color: #f00;">' . __('None') . '</strong>\') AS \'' . __('Copies') . '\'', 'biblio.last_update AS \'' . __('Last Update') . '\''); $datagrid->modifyColumnContent(2, 'callback{showTitleAuthors}'); } else { $datagrid->setSQLColumn('biblio.biblio_id AS bid', 'biblio.title AS \'' . __('Title') . '\'', 'biblio.isbn_issn AS \'' . __('ISBN/ISSN') . '\'', 'IF(COUNT(item.item_id)>0, COUNT(item.item_id), \'<strong style="color: #f00;">' . __('None') . '</strong>\') AS \'' . __('Copies') . '\'', 'biblio.last_update AS \'' . __('Last Update') . '\''); // modify column value $datagrid->modifyColumnContent(1, 'callback{showTitleAuthors}'); } $datagrid->invisible_fields = array(0); $datagrid->setSQLorder('biblio.last_update DESC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string(trim($_GET['keywords'])); $searchable_fields = array('title', 'author', 'subject', 'isbn', 'publisher'); if ($_GET['field'] != '0' and in_array($_GET['field'], $searchable_fields)) { $field = $_GET['field']; $search_str = $field . '=' . $keywords; } else { $search_str = ''; foreach ($searchable_fields as $search_field) { $search_str .= $search_field . '=' . $keywords . ' OR '; } $search_str = substr_replace($search_str, '', -4); } $biblio_list = new biblio_list($dbs);
// page title $page_title = 'Member Loan List'; // start the output buffering ob_start(); // check if there is member ID if (isset($_SESSION['memberID']) and !empty($_SESSION['memberID'])) { /* LOAN HISTORY LIST */ $memberID = trim($_SESSION['memberID']); // table spec $table_spec = 'loan AS l LEFT JOIN item AS i ON l.item_code=i.item_code LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id'; // create datagrid $datagrid = new simbio_datagrid(); $datagrid->setSQLColumn('l.item_code AS \'' . __('Item Code') . '\'', 'b.title AS \'' . __('Title') . '\'', 'l.loan_date AS \'' . __('Loan Date') . '\'', 'IF(return_date IS NULL, \'<i>' . __('Not Returned Yet') . '</i>\', return_date) AS \'' . __('Returned Date') . '\''); $datagrid->setSQLorder("l.loan_date DESC"); $criteria = 'l.member_id=\'' . $dbs->escape_string($memberID) . '\' '; // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keyword = $dbs->escape_string($_GET['keywords']); $criteria .= " AND (l.item_code LIKE '%{$keyword}%' OR b.title LIKE '%{$keyword}%')"; } $datagrid->setSQLCriteria($criteria); // set table and table header attributes $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; $datagrid->icon_edit = SENAYAN_WEB_ROOT_DIR . 'admin/' . $sysconf['admin_template']['dir'] . '/' . $sysconf['admin_template']['theme'] . '/edit.gif'; // special properties $datagrid->using_AJAX = false; $datagrid->column_width = array(1 => '70%'); $datagrid->disableSort('Return Date');
function showLoanHist($num_recs_show = 20) { global $dbs; // table spec $_table_spec = 'loan AS l LEFT JOIN member AS m ON l.member_id=m.member_id LEFT JOIN item AS i ON l.item_code=i.item_code LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id'; // create datagrid $_loan_hist = new simbio_datagrid(); $_loan_hist->disable_paging = true; $_loan_hist->table_ID = 'loanhist'; $_loan_hist->setSQLColumn('l.item_code AS \'' . __('Item Code') . '\'', 'b.title AS \'' . __('Title') . '\'', 'l.loan_date AS \'' . __('Loan Date') . '\'', 'l.return_date AS \'' . __('Return Date') . '\''); $_loan_hist->setSQLorder('l.loan_date DESC'); $_criteria = sprintf('m.member_id=\'%s\' AND l.is_lent=1 AND is_return=1 ', $_SESSION['mid']); $_loan_hist->setSQLCriteria($_criteria); // modify column value #$_loan_hist->modifyColumnContent(3, 'callback{showOverdue}'); // set table and table header attributes $_loan_hist->table_attr = 'align="center" class="memberLoanList" cellpadding="5" cellspacing="0"'; $_loan_hist->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; $_loan_hist->using_AJAX = false; // return the result $_result = $_loan_hist->createDataGrid($dbs, $_table_spec, $num_recs_show); $_result = '<div class="memberLoanHistInfo"> ' . $_loan_hist->num_rows . ' ' . __('item(s) loan history') . ' | <a href="?p=download_loan_history">Download All Loan History</a></div>' . "\n" . $_result; return $_result; }
return $sysconf['node'][$array_data[4]]['name']; } // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('biblio.biblio_id', 'biblio.biblio_id AS bid', 'biblio.title AS \'' . __('Title') . '\'', 'biblio.isbn_issn AS \'' . __('ISBN/ISSN') . '\'', 'biblio.node_id AS \'' . __('Node') . '\'', 'biblio.last_update AS \'' . __('Last Update') . '\''); $datagrid->modifyColumnContent(2, 'callback{showTitleAuthors}'); $datagrid->modifyColumnContent(4, 'callback{showNodeName}'); } else { $datagrid->setSQLColumn('biblio.biblio_id AS bid', 'biblio.title AS \'' . __('Title') . '\'', 'biblio.isbn_issn AS \'' . __('ISBN/ISSN') . '\'', 'biblio.node_id AS \'' . __('Node') . '\'', 'biblio.last_update AS \'' . __('Last Update') . '\''); // modify column value $datagrid->modifyColumnContent(1, 'callback{showTitleAuthors}'); $datagrid->modifyColumnContent(3, 'callback{showNodeName}'); } $datagrid->invisible_fields = array(0); $datagrid->setSQLorder('biblio.input_date DESC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string(trim($_GET['keywords'])); $searchable_fields = array('title', 'author', 'subject', 'isbn', 'publisher'); if ($_GET['field'] != '0' and in_array($_GET['field'], $searchable_fields)) { $field = $_GET['field']; $search_str = $field . '=' . $keywords; } else { $search_str = ''; foreach ($searchable_fields as $search_field) { $search_str .= $search_field . '=' . $keywords . ' OR '; } $search_str = substr_replace($search_str, '', -4); } $biblio_list = new biblio_list($dbs);
//mfc } // print out the form object echo $form->printOut(); } else { /* SUPPLIER LIST */ // table spec $table_spec = 'mst_supplier AS sp'; // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('sp.supplier_id', 'sp.supplier_name AS \'' . __('Supplier Name') . '\'', 'sp.contact AS \'' . __('Contact') . '\'', 'sp.phone AS \'' . __('Phone Number') . '\'', 'sp.fax AS \'' . __('Fax Number') . '\'', 'sp.last_update AS \'' . __('Last Update') . '\''); } else { $datagrid->setSQLColumn('sp.supplier_name AS \'' . __('Supplier Name') . '\'', 'sp.contact AS \'' . __('Contact') . '\'', 'sp.phone AS \'' . __('Phone Number') . '\'', 'sp.fax AS \'' . __('Fax Number') . '\'', 'sp.last_update AS \'' . __('Last Update') . '\''); } $datagrid->setSQLorder('supplier_name ASC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $datagrid->setSQLCriteria("sp.supplier_name LIKE '%{$keywords}%' OR sp.supplier_id LIKE '%{$keywords}%'\n OR sp.contact LIKE '%{$keywords}%' OR sp.address LIKE '%{$keywords}%'"); } // set table and table header attributes $datagrid->table_attr = 'align="center" class="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // set delete proccess URL $datagrid->chbox_form_URL = $_SERVER['PHP_SELF']; // put the result into variables $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, $can_read and $can_write); if (isset($_GET['keywords']) and $_GET['keywords']) { $msg = str_replace('{result->num_rows}', $datagrid->num_rows, __('Found <strong>{result->num_rows}</strong> from your keywords')); //mfc
$_output .= '<div style="font-weight: bold; font-size: 110%;">' . $array_data[1] . '</div>'; $_output .= '<div style="font-weight: bold; font-size: 90%;"><a href="' . MODULES_WEB_ROOT_DIR . 'serial_control/kardex.php?serialID=' . $array_data[0] . '" title="' . __('View/Edit Kardex Detail') . '">' . __('View/Edit Kardex Detail') . '</a></div>'; return $_output; } // table spec $table_spec = 'serial AS s'; // create datagrid $datagrid = new simbio_datagrid(); $datagrid->setSQLColumn('s.serial_id', 's.period AS \'' . __('Period Name') . '\'', 's.date_start AS \'' . __('Subscription Start') . '\'', 's.notes AS \'' . __('Subscription Notes') . '\''); if ($can_read and $can_write) { $datagrid->modifyColumnContent(1, 'callback{serialTitle}'); } else { $datagrid->invisible_fields = array(0); $datagrid->modifyColumnContent(1, 'callback{serialTitle}'); } $datagrid->setSQLorder('s.date_start DESC'); $criteria = 's.biblio_id=' . $biblioID; // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keyword = $dbs->escape_string($_GET['keywords']); $criteria .= " AND (s.period LIKE '%{$keyword}%' OR s.notes LIKE '%{$keyword}%')"; } $datagrid->setSQLCriteria($criteria); // set table and table header attributes $datagrid->table_attr = 'align="center" id="dataList" style="width: 100%;" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; $datagrid->using_AJAX = false; // set delete proccess URL $datagrid->chbox_form_URL = $_SERVER['PHP_SELF']; // special properties $datagrid->column_width = array(0 => '45%');
//mfc } // print out the form object echo $form->printOut(); } else { /* LOCATION LIST */ // table spec $table_spec = 'mst_location AS l'; // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('l.location_id', 'l.location_id AS \'' . __('Location Code') . '\'', 'l.location_name AS \'' . __('Location Name') . '\'', 'l.last_update AS \'' . __('Last Update') . '\''); } else { $datagrid->setSQLColumn('l.location_id AS \'' . __('Location Code') . '\'', 'l.location_name AS \'' . __('Location Name') . '\'', 'l.last_update AS \'' . __('Last Update') . '\''); } $datagrid->setSQLorder('location_name ASC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $datagrid->setSQLCriteria("l.location_name LIKE '%{$keywords}%'"); } // set table and table header attributes $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // set delete proccess URL $datagrid->chbox_form_URL = $_SERVER['PHP_SELF']; // put the result into variables $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, $can_read and $can_write); if (isset($_GET['keywords']) and $_GET['keywords']) { $msg = str_replace('{result->num_rows}', $datagrid->num_rows, __('Found <strong>{result->num_rows}</strong> from your keywords')); //mfc
//mfc } // print out the form object echo $form->printOut(); } else { /* GMD LIST */ // table spec $table_spec = 'mst_label AS lb'; // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('lb.label_id', 'lb.label_desc AS \'' . __('Label Description') . '\'', 'lb.label_name AS \'' . __('Label Name') . '\'', 'lb.last_update AS \'' . __('Last Update') . '\''); } else { $datagrid->setSQLColumn('lb.label_desc AS \'' . __('Label Description') . '\'', 'lb.label_name AS \'' . __('Label Name') . '\'', 'lb.last_update AS \'' . __('Last Update') . '\''); } $datagrid->setSQLorder('label_name ASC'); // is there any search $criteria = 'lb.label_id IS NOT NULL'; if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $criteria = " AND (lb.label_name LIKE '%{$keywords}%' OR lb.label_desc LIKE '%{$keywords}%')"; } $datagrid->setSQLCriteria($criteria); // set table and table header attributes $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // set delete proccess URL $datagrid->chbox_form_URL = $_SERVER['PHP_SELF']; // put the result into variables $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, $can_read and $can_write); if (isset($_GET['keywords']) and $_GET['keywords']) {
<input type="submit" id="doSearch" class="button" /> </form> </div> </div> </fieldset> <?php /* ITEM LIST */ // table spec $table_spec = 'loan AS l LEFT JOIN member AS m ON l.member_id=m.member_id LEFT JOIN item AS i ON l.item_code=i.item_code LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id'; // create datagrid $datagrid = new simbio_datagrid(); $datagrid->setSQLColumn("i.item_code AS '" . __('Item Code') . "'", "m.member_id AS '" . __('Member ID') . "'", "b.title AS '" . __('Title') . "'", "l.loan_date AS '" . __('Loan Date') . "'", "l.due_date AS '" . __('Due Date') . "'"); $datagrid->setSQLorder("l.loan_date DESC"); // change the record order if (isset($_GET['fld']) and isset($_GET['dir'])) { $datagrid->setSQLorder("'" . urldecode($_GET['fld']) . "' " . $dbs->escape_string($_GET['dir'])); } $checkout_criteria = ' (l.is_lent=1 AND l.is_return=0) '; // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keyword = $dbs->escape_string(trim($_GET['keywords'])); $words = explode(' ', $keyword); if (count($words) > 1) { $concat_sql = ' ('; foreach ($words as $word) { $concat_sql .= " (b.title LIKE '%{$word}%' OR i.item_code LIKE '%{$word}%') AND"; } // remove the last AND
// table spec $sql_criteria = 'pl.place_id > 1'; if (isset($_GET['type']) && $_GET['type'] == 'orphaned') { $table_spec = 'mst_place AS pl LEFT JOIN biblio AS b ON pl.place_id = b.publish_place_id'; $sql_criteria = 'b.publish_place_id IS NULL'; } else { $table_spec = 'mst_place AS pl'; } // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('pl.place_id', 'pl.place_name AS \'' . __('Place Name') . '\'', 'pl.last_update AS \'' . __('Last Update') . '\''); } else { $datagrid->setSQLColumn('pl.place_name AS \'' . __('Place Name') . '\'', 'pl.last_update AS \'' . __('Last Update') . '\''); } $datagrid->setSQLorder('place_name ASC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $sql_criteria .= " AND pl.place_name LIKE '%{$keywords}%'"; } $datagrid->setSQLCriteria($sql_criteria); // set table and table header attributes $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // set delete proccess URL $datagrid->chbox_form_URL = $_SERVER['PHP_SELF']; // put the result into variable $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, $can_read and $can_write); if (isset($_GET['keywords']) and $_GET['keywords']) { $msg = str_replace('{result->num_rows}', $datagrid->num_rows, __('Found <strong>{result->num_rows}</strong> from your keywords'));
<?php } ?> <!-- LOG CLEARANCE FORM END --> </div> </div> </fieldset> <?php /* search form end */ /* SYSTEM LOGS LIST */ // table spec $table_spec = 'system_log AS sl'; // create datagrid $datagrid = new simbio_datagrid(); $datagrid->setSQLColumn('sl.log_date AS \'' . __('Time') . '\'', 'sl.log_location AS \'' . __('Location') . '\'', 'sl.log_msg AS \'' . __('Message') . '\''); $datagrid->setSQLorder('sl.log_date DESC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keyword = $dbs->escape_string(trim($_GET['keywords'])); $words = explode(' ', $keyword); if (count($words) > 1) { $concat_sql = ' ('; foreach ($words as $word) { $concat_sql .= " (sl.log_date LIKE '%{$word}%' OR sl.log_msg LIKE '%{$word}%') AND"; } // remove the last AND $concat_sql = substr_replace($concat_sql, '', -3); $concat_sql .= ') '; $datagrid->setSQLCriteria($concat_sql); } else { $datagrid->setSQLCriteria("sl.log_date LIKE '%{$keyword}%' OR sl.log_msg LIKE '%{$keyword}%'");
$table->setCellAttr($row, 0, 'class="alterCell" valign="top" style="width: 170px;"'); $table->setCellAttr($row, 1, 'class="alterCell" valign="top" style="width: 1%;"'); $table->setCellAttr($row, 2, 'class="alterCell2" valign="top" style="width: auto;"'); // add row count $row++; } // print out table echo $table->printTable(); } else { /* STOCK TAKE HISTORY LIST */ // table spec $table_spec = 'stock_take AS st'; // create datagrid $datagrid = new simbio_datagrid(); $datagrid->setSQLColumn('st.stock_take_id', 'st.stock_take_name AS \'' . __('Stock Take Name') . '\'', 'st.start_date AS \'' . __('Start Date') . '\'', 'st.end_date AS \'' . __('End Date') . '\'', 'CONCAT(\'<a class="notAJAX" href="' . SENAYAN_WEB_ROOT_DIR . FILES_DIR . '/' . REPORT_DIR . '/\', st.report_file, \'" target="_blank">\', st.report_file, \'</a>\') AS \'' . __('Report') . '\''); $datagrid->setSQLorder('st.start_date DESC'); $datagrid->disableSort('Report'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keyword = $dbs->escape_string(trim($_GET['keywords'])); $words = explode(' ', $keyword); if (count($words) > 1) { $concat_sql = ' ('; foreach ($words as $word) { $concat_sql .= " (stock_take_name LIKE '%{$word}%' OR init_user LIKE '%{$word}%') AND"; } // remove the last AND $concat_sql = substr_replace($concat_sql, '', -3); $concat_sql .= ') '; $datagrid->setSQLCriteria($concat_sql); } else {
foreach ($unpaid_fines as $key => $value) { $total_unpaid_fines = $total_unpaid_fines + $value['3'] - $value['4']; } } if ($total_unpaid_fines > 0) { $fines_alert = TRUE; } echo '<div style="color:red; font-weight:bold;">Total of unpaid fines: ' . $total_unpaid_fines . '</div>'; /* FINES LIST */ $memberID = trim($_SESSION['memberID']); // table spec $table_spec = 'fines AS f'; // create datagrid $datagrid = new simbio_datagrid(); $datagrid->setSQLColumn('f.fines_id AS \'EDIT\'', 'f.description AS \'' . __('Description/Name') . '\'', 'f.fines_date AS \'' . __('Fines Date') . '\'', 'f.debet AS \'' . __('Debit') . '\'', 'f.credit AS \'' . __('Credit') . '\''); $datagrid->setSQLorder("f.fines_date DESC"); $criteria = 'f.member_id=\'' . $dbs->escape_string($memberID) . '\' '; // view balanced overdue if (isset($_GET['balance'])) { $criteria .= ' AND (f.debet=f.credit) '; } else { $criteria .= ' AND (f.debet!=f.credit) '; } // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keyword = $dbs->escape_string($_GET['keywords']); $criteria .= " AND (f.description LIKE '%{$keyword}%' OR f.fines_date LIKE '%{$keyword}%')"; } $datagrid->setSQLCriteria($criteria); // set table and table header attributes $datagrid->table_attr = 'align="center" id="dataList" style="width: 100%;" cellpadding="5" cellspacing="0"';
echo $form->printOut(); } else { /* LOAN RULES LIST */ // table spec $table_spec = 'mst_loan_rules AS lr LEFT JOIN mst_member_type AS mt ON lr.member_type_id=mt.member_type_id LEFT JOIN mst_coll_type AS ct ON lr.coll_type_id=ct.coll_type_id LEFT JOIN mst_gmd AS g ON lr.gmd_id=g.gmd_id'; // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('lr.loan_rules_id', 'mt.member_type_name AS \'' . __('Member Type') . '\'', 'ct.coll_type_name AS \'' . __('Collection Type') . '\'', 'g.gmd_name AS \'' . __('GMD') . '\'', 'lr.loan_limit AS \'' . __('Loan Limit') . '\'', 'lr.loan_periode AS \'' . __('Loan Period') . '\'', 'lr.last_update AS \'' . __('Last Update') . '\''); } else { $datagrid->setSQLColumn('mt.member_type_name AS \'' . __('Member Type') . '\'', 'ct.coll_type_name AS \'' . __('Collection Type') . '\'', 'g.gmd_name AS \'' . __('GMD') . '\'', 'lr.loan_limit AS \'' . __('Loan Limit') . '\'', 'lr.loan_periode AS \'' . __('Loan Period') . '\'', 'lr.last_update AS \'' . __('Last Update') . '\''); } $datagrid->setSQLorder('mt.member_type_name ASC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $datagrid->setSQLCriteria("mt.member_type_name LIKE '%{$keywords}%'"); } // set table and table header attributes $datagrid->icon_edit = $sysconf['admin_template']['dir'] . '/' . $sysconf['admin_template']['theme'] . '/edit.gif'; $datagrid->table_attr = 'align="center" class="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // set delete proccess URL $datagrid->chbox_form_URL = $_SERVER['PHP_SELF']; // put the result into variables $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, $can_read and $can_write); if (isset($_GET['keywords']) and $_GET['keywords']) { $msg = str_replace('{result->num_rows}', $datagrid->num_rows, __('Found <strong>{result->num_rows}</strong> from your keywords'));
} else { // only administrator have privileges to view user list if (!($can_read and $can_write) or $_SESSION['uid'] != 1) { die('<div class="errorBox">' . __('You don\'t have enough privileges to view this section') . '</div>'); } /* USER LIST */ // table spec $table_spec = 'user AS u'; // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('u.user_id', 'u.realname AS \'' . __('Real Name') . '\'', 'u.username AS \'' . __('Login Username') . '\'', 'u.last_login AS \'' . __('Last Login') . '\'', 'u.last_update AS \'' . __('Last Update') . '\''); } else { $datagrid->setSQLColumn('u.realname AS \'' . __('Real Name') . '\'', 'u.username AS \'' . __('Real Name') . '\'', 'u.last_login AS \'' . __('Last Login') . '\'', 'u.last_update AS \'' . __('Last Update') . '\''); } $datagrid->setSQLorder('username ASC'); // is there any search $criteria = 'u.user_id != 1 '; if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $criteria .= " AND (u.username LIKE '%{$keywords}%' OR u.realname LIKE '%{$keywords}%')"; } $datagrid->setSQLCriteria($criteria); // set table and table header attributes $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // set delete proccess URL $datagrid->chbox_form_URL = $_SERVER['PHP_SELF']; // put the result into variables $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, $can_read and $can_write); if (isset($_GET['keywords']) and $_GET['keywords']) {
// print out the form object echo '<div class="infoBox">' . __('You are going to edit language data') . ' : <b>' . $rec_d['language_name'] . '</b> <br />' . __('Last Update') . $rec_d['last_update'] . '</div>'; //mfc echo $form->printOut(); } else { /* DOCUMENT LANGUAGE LIST */ // table spec $table_spec = 'mst_language AS l'; // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('l.language_id', 'l.language_name AS \'' . __('Language') . '\'', 'l.last_update AS \'' . __('Last Update') . '\''); } else { $datagrid->setSQLColumn('l.language_name AS \'' . __('Language') . '\'', 'l.last_update AS \'' . __('Last Update') . '\''); } $datagrid->setSQLorder('language_name ASC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $datagrid->setSQLCriteria("l.language_name LIKE '%{$keywords}%'"); } // set table and table header attributes $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // set delete proccess URL $datagrid->chbox_form_URL = $_SERVER['PHP_SELF']; // put the result into variables $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, $can_read and $can_write); if (isset($_GET['keywords']) and $_GET['keywords']) { $msg = str_replace('{result->num_rows}', $datagrid->num_rows, __('Found <strong>{result->num_rows}</strong> from your keywords')); //mfc
$form->addTextField('text', 'moduleDesc', __('Module Description'), $rec_d['module_desc'], 'style="width: 100%;"'); // edit mode messagge if ($form->edit_mode) { echo '<div class="infoBox">' . __('You are going to edit data') . ' : <b>' . $rec_d['module_name'] . '</b></div>'; //mfc } // print out the form object echo $form->printOut(); } else { /* MODULE LIST */ // table spec $table_spec = 'mst_module AS mdl'; // create datagrid $datagrid = new simbio_datagrid(); $datagrid->setSQLColumn('mdl.module_id', 'mdl.module_name AS \'' . __('Module Name') . '\'', 'mdl.module_desc AS \'' . __('Module Description') . '\''); $datagrid->setSQLorder('module_name ASC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $datagrid->setSQLCriteria("mdl.module_name LIKE '%{$keywords}%'"); } // set table and table header attributes $datagrid->icon_edit = $sysconf['admin_template']['dir'] . '/' . $sysconf['admin_template']['theme'] . '/edit.gif'; $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // set delete proccess URL $datagrid->chbox_form_URL = $_SERVER['PHP_SELF']; // put the result into variables $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, true); if (isset($_GET['keywords']) and $_GET['keywords']) { $msg = str_replace('{result->num_rows}', $datagrid->num_rows, __('Found <strong>{result->num_rows}</strong> from your keywords'));
//mfc } // print out the form object echo $form->printOut(); } else { /* ITEM STATUS LIST */ // table spec $table_spec = 'mst_item_status AS ist'; // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('ist.item_status_id', 'ist.item_status_id AS \'' . __('Item Status Code') . '\'', 'ist.item_status_name AS \'' . __('Item Status Name') . '\'', 'ist.last_update AS \'' . __('Last Update') . '\''); } else { $datagrid->setSQLColumn('ist.item_status_id AS \'' . __('Item Status Code') . '\'', 'ist.item_status_name AS \'' . __('Item Status Name') . '\'', 'ist.last_update AS \'' . __('Last Update') . '\''); } $datagrid->setSQLorder('item_status_name ASC'); // change the record order if (isset($_GET['fld']) and isset($_GET['dir'])) { $datagrid->setSQLorder("'" . urldecode($_GET['fld']) . "' " . $dbs->escape_string($_GET['dir'])); } // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $datagrid->setSQLCriteria("ist.item_status_name LIKE '%{$keywords}%'"); } // set table and table header attributes $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // set delete proccess URL $datagrid->chbox_form_URL = $_SERVER['PHP_SELF']; // put the result into variables
Form.Element.focus('itemCode'); </script> <div id="stError" class="errorBox" style="display: none;"> </div> <?php /* CURRENT STOCK TAKE ITEM LIST */ // table spec $table_spec = 'stock_take_item AS sti'; // create datagrid $datagrid = new simbio_datagrid(); $datagrid->setSQLColumn('item_code AS \''.__('Item Code').'\'', 'title AS \''.__('Title').'\'', 'coll_type_name AS \''.__('Collection Type').'\'', 'classification AS \''.__('Classification').'\'', 'IF(sti.status=\'e\', \''.__('Exists').'\', IF(sti.status=\'l\', \''.__('On Loan').'\', \''.__('Missing').'\')) AS \'Status\''); $datagrid->setSQLorder("last_update DESC"); $criteria = 'item_id <> 0 '; // is there any search if (isset($_GET['keywords']) AND $_GET['keywords']) { $keyword = $dbs->escape_string(trim($_GET['keywords'])); $words = explode(' ', $keyword); if (count($words) > 1) { $concat_sql = ' ('; foreach ($words as $word) { $concat_sql .= " (title LIKE '%$word%' OR item_code LIKE '%$word%') AND"; } // remove the last AND $concat_sql = substr_replace($concat_sql, '', -3); $concat_sql .= ') '; $criteria .= ' AND '.$concat_sql." AND status='".$view."'";
$form->addAnything(__('Privileges'), $priv_table); // edit mode messagge if ($form->edit_mode) { // print out the object echo '<div class="infoBox">' . __('You are going to edit Group data') . ' : <b>' . $rec_d['group_name'] . '</b> <br />' . __('Last Update') . $rec_d['last_update'] . '</div>'; //mfc } echo $form->printOut(); } else { /* GROUP LIST */ // table spec $table_spec = 'user_group AS ug'; // create datagrid $datagrid = new simbio_datagrid(); $datagrid->setSQLColumn('ug.group_id', 'ug.group_name AS \'' . __('Group Name') . '\'', 'ug.last_update AS \'' . __('Last Update') . '\''); $datagrid->setSQLorder('group_name ASC'); // is there any search $criteria = 'ug.group_id != 1'; if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $criteria .= " AND ug.group_name LIKE '%{$keywords}%'"; } $datagrid->setSQLCriteria($criteria); // set table and table header attributes $datagrid->icon_edit = SENAYAN_WEB_ROOT_DIR . 'admin/' . $sysconf['admin_template']['dir'] . '/' . $sysconf['admin_template']['theme'] . '/edit.gif'; $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // set delete proccess URL $datagrid->chbox_form_URL = $_SERVER['PHP_SELF']; // put the result into variables $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, true);
//mfc } // print out the form object echo $form->printOut(); } else { /* HOLIDAY LIST */ // table spec $table_spec = 'holiday'; // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('holiday_id', "holiday_dayname AS '" . __('Day name') . "'", "holiday_date AS '" . __('Holiday Date Start') . "'", "description AS '" . __('Holiday Description') . "'"); } else { $datagrid->setSQLColumn("holiday_dayname AS '" . __('Day name') . "'", "holiday_date AS '" . __('Holiday Date Start') . "'", "description AS '" . __('Holiday Description') . "'"); } $datagrid->setSQLorder('holiday_date DESC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $datagrid->setSQLCriteria("holiday_description LIKE '%{$keywords}%' OR holiday_date LIKE '%{$keywords}%'"); } else { $datagrid->setSQLCriteria('holiday_date IS NOT NULL'); } // set table and table header attributes $datagrid->icon_edit = SWB . 'admin/' . $sysconf['admin_template']['dir'] . '/' . $sysconf['admin_template']['theme'] . '/edit.gif'; $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // set delete proccess URL $datagrid->chbox_form_URL = $_SERVER['PHP_SELF']; // put the result into variables $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, $can_read and $can_write);
} // print out the form object echo $form->printOut(); } else { /* MEMBERSHIP LIST */ // table spec $table_spec = 'member AS m LEFT JOIN mst_member_type AS mt ON m.member_type_id=mt.member_type_id'; // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('m.member_id', 'm.member_id AS \'' . __('Member ID') . '\'', 'm.member_name AS \'' . __('Member Name') . '\'', 'mt.member_type_name AS \'' . __('Membership Type') . '\'', 'm.member_email AS \'' . __('E-mail') . '\'', 'm.last_update AS \'' . __('Last Updated') . '\''); } else { $datagrid->setSQLColumn('m.member_id AS \'' . __('Member ID') . '\'', 'm.member_name AS \'' . __('Member Name') . '\'', 'mt.member_type_name AS \'' . __('Membership Type') . '\'', 'm.member_email AS \'' . __('E-mail') . '\'', 'm.last_update AS \'' . __('Last Updated') . '\''); } $datagrid->setSQLorder('member_name ASC'); // is there any search $criteria = 'm.member_id IS NOT NULL '; if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $criteria .= " AND (m.member_name LIKE '%{$keywords}%' OR m.member_id LIKE '%{$keywords}%') "; } if (isset($_GET['expire'])) { $criteria .= " AND TO_DAYS('" . date('Y-m-d') . "')>TO_DAYS(m.expire_date)"; } $datagrid->setSQLCriteria($criteria); // set table and table header attributes $datagrid->icon_edit = SENAYAN_WEB_ROOT_DIR . 'admin/' . $sysconf['admin_template']['dir'] . '/' . $sysconf['admin_template']['theme'] . '/edit.gif'; $datagrid->table_name = 'memberList'; $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
} // print out the form object echo $form->printOut(); } else { /* GMD LIST */ // table spec $table_spec = 'mst_frequency AS f LEFT JOIN mst_language AS l ON f.language_prefix=l.language_id'; // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('f.frequency_id', 'f.frequency AS \'' . __('Frequency') . '\'', 'l.language_name AS \'' . __('Language') . '\'', 'f.time_increment AS \'' . __('Time Increment') . '\'', 'f.time_unit AS \'' . __('Time Unit') . '\'', 'f.last_update AS \'' . __('Last Update') . '\''); } else { $datagrid->setSQLColumn('f.frequency AS \'' . __('Frequency') . '\'', 'l.language_name AS \'' . __('Language') . '\'', 'f.time_increment AS \'' . __('Time Increment') . '\'', 'f.time_unit AS \'' . __('Time Unit') . '\'', 'f.last_update AS \'' . __('Last Update') . '\''); } $datagrid->setSQLorder('frequency ASC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $datagrid->setSQLCriteria("g.frequency_name LIKE '%{$keywords}%'"); } // set table and table header attributes $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // set delete proccess URL $datagrid->chbox_form_URL = $_SERVER['PHP_SELF']; // put the result into variables $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, $can_read and $can_write); if (isset($_GET['keywords']) and $_GET['keywords']) { $msg = str_replace('{result->num_rows}', $datagrid->num_rows, __('Found <strong>{result->num_rows}</strong> from your keywords')); //mfc
//mfc } // print out the form object echo $form->printOut(); } else { /* GMD LIST */ // table spec $table_spec = 'mst_gmd AS g'; // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('g.gmd_id', 'g.gmd_code AS \'' . __('GMD Code') . '\'', 'g.gmd_name AS \'' . __('GMD Name') . '\'', 'g.last_update AS \'' . __('Last Update') . '\''); } else { $datagrid->setSQLColumn('g.gmd_code AS \'' . __('GMD Code') . '\'', 'g.gmd_name AS \'' . __('GMD Name') . '\'', 'g.last_update AS \'' . __('Last Update') . '\''); } $datagrid->setSQLorder('gmd_name ASC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $datagrid->setSQLCriteria("g.gmd_name LIKE '%{$keywords}%' OR g.gmd_code LIKE '%{$keywords}%'"); } // set table and table header attributes $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // set delete proccess URL $datagrid->chbox_form_URL = $_SERVER['PHP_SELF']; // put the result into variables $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, $can_read and $can_write); if (isset($_GET['keywords']) and $_GET['keywords']) { $msg = str_replace('{result->num_rows}', $datagrid->num_rows, __('Found <strong>{result->num_rows}</strong> from your keywords')); //mfc
//mfc } // print out the form object echo $form->printOut(); } else { /* GMD LIST */ // table spec $table_spec = 'mst_' . $type . '_type AS g'; // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('g.id', 'g.code AS \'' . __('Code') . '\'', 'g.' . $type . '_type AS \'' . __('Name') . '\'', 'g.last_update AS \'' . __('Last Update') . '\''); } else { $datagrid->setSQLColumn('g.code AS \'' . __('Code') . '\'', 'g.' . $type . '_type AS \'' . __('Name') . '\'', 'g.last_update AS \'' . __('Last Update') . '\''); } $datagrid->setSQLorder($type . '_type ASC'); // is there any search if (isset($_GET['keywords']) and $_GET['keywords']) { $keywords = $dbs->escape_string($_GET['keywords']); $datagrid->setSQLCriteria("g." . $type . "_type LIKE '%{$keywords}%' OR g.code LIKE '%{$keywords}%'"); } // set table and table header attributes $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // set delete proccess URL $datagrid->chbox_form_URL = $_SERVER['PHP_SELF'] . '?type=' . $type; // put the result into variables $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, $can_read and $can_write); if (isset($_GET['keywords']) and $_GET['keywords']) { $msg = str_replace('{result->num_rows}', $datagrid->num_rows, __('Found <strong>{result->num_rows}</strong> from your keywords')); //mfc