'.__('You don\'t have enough privileges to access this area!').''); } /* search form */ ?> 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 { $datagrid->setSQLCriteria($criteria." AND sl.log_date LIKE '%$keyword%' OR sl.log_msg LIKE '%$keyword%'"); } } $datagrid->setSQLCriteria($criteria); // 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->delete_URL = $_SERVER['PHP_SELF']; $datagrid->column_width = array('18%', '82%'); $datagrid->disableSort('Message'); // put the result into variables $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 50, 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; /* main content end */