本文整理匯總了PHP中simbio_datagrid::setSQLcriteria方法的典型用法代碼示例。如果您正苦於以下問題:PHP simbio_datagrid::setSQLcriteria方法的具體用法?PHP simbio_datagrid::setSQLcriteria怎麽用?PHP simbio_datagrid::setSQLcriteria使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類simbio_datagrid
的用法示例。
在下文中一共展示了simbio_datagrid::setSQLcriteria方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$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($criteria)) {
$datagrid->setSQLcriteria('(' . $criteria['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;"';
// edit and checkbox property
$datagrid->edit_property = false;
$datagrid->chbox_property = array('itemID', __('Add'));
$datagrid->chbox_action_button = __('Add To Print Queue');
$datagrid->chbox_confirm_msg = __('Add to print queue?');
$datagrid->column_width = array('10%', '85%');
// set checkbox action URL
$datagrid->chbox_form_URL = $_SERVER['PHP_SELF'];
// put the result into variables
$datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, $can_read);
if (isset($_GET['keywords']) and $_GET['keywords']) {