setSQLColumn( 'l.item_code AS \''.__('Item Code').'\'', 'b.title AS \''.__('Title').'\'', 'l.loan_date AS \''.__('Loan Date').'\'', 'IF(return_date IS NULL, \''.__('Not Returned Yet').'\', 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 = SWB.'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'); // 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 {result->num_rows} from your keywords')); //mfc echo '
'.$msg.' : "'.$_GET['keywords'].'"
'; } echo $datagrid_result; } // get the buffered content $content = ob_get_clean(); // include the page template require SB.'/admin/'.$sysconf['admin_template']['dir'].'/notemplate_page_tpl.php';