$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($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
Ejemplo n.º 2
0
} else {
    if ($sysconf['index']['type'] == 'mongodb' && class_exists('MongoClient')) {
        require LIB . 'biblio_list_mongodb.inc.php';
    } else {
        if ($sysconf['index']['type'] == 'sphinx' && file_exists(LIB . 'sphinx/sphinxapi.php')) {
            require LIB . 'sphinx/sphinxapi.php';
            require LIB . 'biblio_list_sphinx.inc.php';
            $sysconf['opac_result_num'] = (int) $sysconf['opac_result_num'];
        } else {
            require LIB . 'biblio_list.inc.php';
        }
    }
}
// create biblio list object
try {
    $biblio_list = new biblio_list($dbs, $sysconf['opac_result_num']);
} catch (Exception $err) {
    die($err->getMessage());
}
if (isset($sysconf['enable_xml_detail']) && !$sysconf['enable_xml_detail']) {
    $biblio_list->xml_detail = false;
}
// search result info
$search_result_info = '';
// if we are in searching mode
if (isset($_GET['search']) && !empty($_GET['search'])) {
    // default vars
    $is_adv = false;
    $keywords = '';
    $criteria = '';
    // simple search
Ejemplo n.º 3
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
/* Showing list of catalogues and also for searching handling */
// include required class class
require SIMBIO_BASE_DIR . 'simbio_UTILS/simbio_tokenizecql.inc.php';
require SIMBIO_BASE_DIR . 'simbio_GUI/paging/simbio_paging.inc.php';
require LIB_DIR . 'biblio_list.inc.php';
// create biblio list object
$biblio_list = new biblio_list($dbs);
if (!$sysconf['enable_xml_detail']) {
    $biblio_list->xml_detail = false;
}
// if we are in searching mode
if (isset($_GET['search']) and !empty($_GET['search'])) {
    // default vars
    $is_adv = false;
    $keywords = '';
    $criteria = '';
    // simple search
    if (isset($_GET['keywords'])) {
        $keywords = trim(strip_tags(urldecode($_GET['keywords'])));
    }
    if ($keywords && !preg_match('@[a-z0-9_.]+=[^=]+\\s+@i', $keywords . ' ')) {
        $criteria = 'title=' . $keywords . ' OR author=' . $keywords . ' OR subject=' . $keywords;
Ejemplo n.º 4
0
 $q = trim(strip_tags($_GET['q']));
 require SIMBIO . 'simbio_UTILS/simbio_tokenizecql.inc.php';
 require LIB . 'biblio_list_model.inc.php';
 // index choice
 if ($sysconf['index']['type'] == 'index') {
     require LIB . 'biblio_list_index.inc.php';
 } else {
     if ($sysconf['index']['type'] == 'sphinx' && file_exists(LIB . 'sphinx/sphinxapi.php')) {
         require LIB . 'sphinx/sphinxapi.php';
         require LIB . 'biblio_list_sphinx.inc.php';
         $sysconf['opac_result_num'] = (int) $sysconf['opac_result_num'];
     }
 }
 // create biblio list object
 try {
     $biblio_list = new biblio_list($dbs, $sysconf['opac_result_num']);
 } catch (Exception $err) {
     die($err->getMessage());
 }
 $sql_criteria = $biblio_list->setSQLcriteria($q);
 // cluster by GMD
 $gmd_cluster_q = $dbs->query('SELECT TRIM(gmd) AS `Cluster Name`, COUNT(biblio_id) AS `Cluster Count` FROM search_biblio AS `index` ' . ($sql_criteria['sql_criteria'] ? ' WHERE ' . $sql_criteria['sql_criteria'] : '') . ' GROUP BY `Cluster Name` LIMIT ' . $cluster_limit);
 if ($gmd_cluster_q->num_rows > 0) {
     echo '<h3 class="cluster-title">' . __('GMD') . '</h3>' . "\n";
     echo '<ul class="cluster-list">' . "\n";
     $i = 0;
     while ($cluster_data = $gmd_cluster_q->fetch_assoc()) {
         if (trim($cluster_data['Cluster Name']) == '') {
             continue;
         }
         $hidden = '';