当前位置: 首页>>代码示例>>PHP>>正文


PHP simbio_datagrid::setSQLColumn方法代码示例

本文整理汇总了PHP中simbio_datagrid::setSQLColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP simbio_datagrid::setSQLColumn方法的具体用法?PHP simbio_datagrid::setSQLColumn怎么用?PHP simbio_datagrid::setSQLColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在simbio_datagrid的用法示例。


在下文中一共展示了simbio_datagrid::setSQLColumn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showLoanHist

 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;
 }
开发者ID:banumelody,项目名称:slims7_cendana,代码行数:41,代码来源:download_loan_history.inc.php

示例2: setIframeContent

    global $can_read, $can_write, $count;
    $_output = '<div style="float: left;"><strong style="font-size: 120%;"><a href="#" title="Edit Bibliographic Data" onclick="openWin(\'' . MODULES_WEB_ROOT_DIR . 'bibliography/pop_biblio.php?action=detail&inPopUp=true&itemID=' . $array_data[0] . '&itemCollID=0\', \'popSerialBiblio\', 600, 400, true)">' . $array_data[1] . '</a></strong> (' . $array_data[2] . ')</div>';
    if ($can_read and $can_write) {
        $_output .= ' <a href="#" class="addSubscription" onclick="javascript: $(\'subscriptionListCont' . $count . '\').show(); setIframeContent(\'subscriptionList' . $count . '\', \'' . MODULES_WEB_ROOT_DIR . 'serial_control/subscription.php?biblioID=' . $array_data[0] . '&action=detail\');" title="' . __('Add New Subscription') . '">&nbsp;</a> ';
    }
    $_output .= ' <a href="#" class="viewSubscription" onclick="$(\'subscriptionListCont' . $count . '\').show(); setIframeContent(\'subscriptionList' . $count . '\', \'' . MODULES_WEB_ROOT_DIR . 'serial_control/subscription.php?biblioID=' . $array_data[0] . '\');" title="' . __('View Subscriptions') . '">&nbsp;</a> ';
    $_output .= '<div id="subscriptionListCont' . $count . '" style="clear: both; display: none;">';
    $_output .= '<div><a href="#" style="font-weight: bold; color: red;" title="Close Box" onclick="$(\'subscriptionListCont' . $count . '\').hide()">' . __('CLOSE') . '</a></div>';
    $_output .= '<iframe id="subscriptionList' . $count . '" src="' . MODULES_WEB_ROOT_DIR . 'serial_control/subscription.php?biblioID=' . $array_data[0] . '" style="width: 100%; height: 270px;"></iframe>';
    $_output .= '</div>';
    $count++;
    return $_output;
}
// create datagrid
$datagrid = new simbio_datagrid();
$datagrid->setSQLColumn('b.biblio_id', 'b.title AS \'' . __('Serial Title') . '\'', 'fr.frequency AS \'Frequency\'');
$datagrid->invisible_fields = array(0, 2);
$datagrid->modifyColumnContent(1, 'callback{subscriptionDetail}');
$datagrid->setSQLorder('b.last_update DESC');
// table alias and field relation
$tables['bsub'] = array('title', 'isbn_issn');
$tables['mt'] = array('topic');
if (isset($_GET['field']) and !empty($_GET['field'])) {
    foreach ($tables as $table_alias => $fields) {
        if (!in_array($_GET['field'], $fields)) {
            // remove unneeded array
            unset($tables[$table_alias]);
        }
    }
    // check if fields array is empty to prevent SQL error
    if (!$tables) {
开发者ID:sulfan,项目名称:SENAYAN-3-Stable-jQuery,代码行数:31,代码来源:index.php

示例3: array

echo ' ' . __('in queue waiting to be printed.');
//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);
开发者ID:purwoko,项目名称:slims3-stable15-jquery,代码行数:31,代码来源:item_barcode_generator.php

示例4: explode

} else {
    /* TOPIC LIST */
    // table spec
    $sql_criteria = 't.topic_id > 1';
    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);
开发者ID:ridorido,项目名称:s3st15_matoa,代码行数:31,代码来源:topic.php

示例5: MATCH

        skin : "o2k7", skin_variant : "silver",
        // Theme options
        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,fontsizeselect,|,bullist,numlist,|,link,unlink,anchor,image,cleanup,code,forecolor",
        theme_advanced_buttons2 : "undo,redo,|,tablecontrols,|,hr,removeformat,visualaid,|,charmap,media,|,ltr,rtl,|,search,replace",
        theme_advanced_buttons3 : null, theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "center", theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : false, content_css : "' . (SENAYAN_WEB_ROOT_DIR . 'admin/' . $sysconf['admin_template']['css']) . '",
        });</script>';
    echo $form->printOut();
} else {
    /* USER LIST */
    // table spec
    $table_spec = 'content AS c';
    // create datagrid
    $datagrid = new simbio_datagrid();
    if ($can_read and $can_write) {
        $datagrid->setSQLColumn('c.content_id', 'c.content_title AS \'' . __('Content Title') . '\'', 'c.content_path AS \'' . __('Path (Must be unique)') . '\'', 'c.last_update AS \'' . __('Last Updated') . '\'');
    } else {
        $datagrid->setSQLColumn('c.content_title AS \'' . __('Content Title') . '\'', 'c.content_path AS \'' . __('Path (Must be unique)') . '\'', 'c.last_update AS \'' . __('Last Updated') . '\'');
    }
    $datagrid->setSQLorder('c.last_update DESC');
    // is there any search
    $criteria = 'c.content_id IS NOT NULL ';
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);
        $criteria .= " AND MATCH(content_title, content_desc) AGAINST('{$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
开发者ID:slims,项目名称:s3st14,代码行数:31,代码来源:content.php

示例6: urldecode

    $form->addCheckbox('rules', __('Rules'), $rules_option, $rules);
    // edit mode messagge
    if ($form->edit_mode) {
        echo '<div class="infoBox">' . __('You are going to edit Item Status data') . ' : <b>' . $rec_d['item_status_name'] . '</b>  <br />' . __('Last Update') . $rec_d['last_update'] . '</div>';
        //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"';
开发者ID:edikriting,项目名称:SENAYAN-3-Stable,代码行数:31,代码来源:item_status.php

示例7:

    // language ID
    $form->addTextField('text', 'langID', __('Language Code') . '*', $rec_d['language_id'], 'style="width: 20%;" maxlength="5"');
    // language_name
    $form->addTextField('text', 'langName', __('Language') . '*', $rec_d['language_name'], 'style="width: 60%;"');
    // 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
开发者ID:edikriting,项目名称:SENAYAN-3-Stable,代码行数:31,代码来源:doc_language.php

示例8: trim

require SIMBIO_BASE_DIR . 'simbio_DB/datagrid/simbio_dbgrid.inc.php';
// 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%');
开发者ID:edikriting,项目名称:SENAYAN-3-Stable,代码行数:31,代码来源:member_loan_hist.php

示例9: die

            <br />' . __('Leave Password field blank if you don\'t want to change the password') . '</div>';
    }
    // print out the form object
    echo $form->printOut();
} 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
开发者ID:slims,项目名称:s3st14,代码行数:31,代码来源:app_user.php

示例10: foreach

 if (!empty($unpaid_fines)) {
     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
开发者ID:slims,项目名称:slims8_akasia,代码行数:31,代码来源:fines_list.php

示例11: explode

system/sys_log.php" id="saveLogsForm" target="blindSubmit" method="post" style="display: inline;"><input type="hidden" name="saveLogs" value="true" /></form>
    <?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 {
开发者ID:banumelody,项目名称:slims7_cendana,代码行数:31,代码来源:sys_log.php

示例12: showNodeName

         $_authors .= $_biblio_d[1] . ' - ';
     }
     $_authors = substr_replace($_authors, '', -3);
     $_output = '<div style="float: left;"><b>' . $_title . '</b><br /><i>' . $_authors . '</i></div>';
     return $_output;
 }
 // callback function to show node name
 function showNodeName($obj_db, $array_data)
 {
     global $sysconf;
     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)) {
开发者ID:slims,项目名称:s3st14,代码行数:31,代码来源:index.php

示例13: explode

}
echo ' ' . __('in queue waiting to be printed.');
//mfc
?>
    </div>
</div>
</fieldset>
<?php 
/* search form end */
/* ITEM 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();
$datagrid->setSQLColumn('m.member_id', 'm.member_id AS \'' . __('Member ID') . '\'', 'm.member_name AS \'' . __('Member Name') . '\'', 'mt.member_type_name AS \'' . __('Membership Type') . '\'');
$datagrid->setSQLorder('m.last_update 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 .= " (m.member_id LIKE '%{$word}%' OR m.member_name LIKE '%{$word}%'";
        }
        // remove the last AND
        $concat_sql = substr_replace($concat_sql, '', -3);
        $concat_sql .= ') ';
        $datagrid->setSQLCriteria($concat_sql);
    } else {
开发者ID:banumelody,项目名称:slims7_cendana,代码行数:31,代码来源:member_card_generator.php

示例14:

    $form->addTextField('text', 'supplierAccount', __('Account Number'), $rec_d['account'], 'style="width: 60%;"');
    // edit mode messagge
    if ($form->edit_mode) {
        echo '<div class="infoBox">' . __('You are going to edit Supplier data') . ' : <b>' . $rec_d['supplier_name'] . '</b> <br />' . __('Last Update') . $rec_d['last_update'] . '</div>';
        //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
开发者ID:sulfan,项目名称:SENAYAN-3-Stable-jQuery,代码行数:31,代码来源:supplier.php

示例15:

    $form->addSelectList('timeUnit', lang_mod_masterfile_frequency_form_field_frequency_unit, $unit_options, $rec_d['time_unit']);
    // edit mode messagge
    if ($form->edit_mode) {
        echo '<div class="infoBox">' . lang_mod_masterfile_frequency_common_edit_info . ' : <b>' . $rec_d['frequency'] . '</b>  <br />' . lang_mod_masterfile_frequency_common_last_update . $rec_d['last_update'] . '</div>';
    }
    // 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 \'' . lang_mod_masterfile_frequency_form_field_frequency_name . '\'', 'l.language_name AS \'' . lang_mod_masterfile_lang_form_field_name . '\'', 'f.time_increment AS \'' . lang_mod_masterfile_frequency_form_field_frequency_time_increment . '\'', 'f.time_unit AS \'' . lang_mod_masterfile_frequency_form_field_frequency_unit . '\'', 'f.last_update AS \'' . lang_mod_masterfile_frequency_common_last_update . '\'');
    } else {
        $datagrid->setSQLColumn('f.frequency AS \'' . lang_mod_masterfile_frequency_form_field_frequency_name . '\'', 'l.language_name AS \'' . lang_mod_masterfile_lang_form_field_name . '\'', 'f.time_increment AS \'' . lang_mod_masterfile_frequency_form_field_frequency_time_increment . '\'', 'f.time_unit AS \'' . lang_mod_masterfile_frequency_form_field_frequency_unit . '\'', 'f.last_update AS \'' . lang_mod_masterfile_frequency_common_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
开发者ID:purwoko,项目名称:SENAYAN-3-Stable,代码行数:31,代码来源:frequency.php


注:本文中的simbio_datagrid::setSQLColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。