本文整理汇总了PHP中get_filter函数的典型用法代码示例。如果您正苦于以下问题:PHP get_filter函数的具体用法?PHP get_filter怎么用?PHP get_filter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_filter函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sms_list
/**
* 返回短信列表数据
*/
function sms_list($class_code, $phone)
{
$result = get_filter();
if ($result === false) {
/* 过滤条件 */
$filter['keywords'] = empty($_REQUEST['search_keyword']) ? '' : trim($_REQUEST['search_keyword']);
//关键字
$filter['phones'] = empty($_REQUEST['search_phones']) ? '' : trim($_REQUEST['search_phones']);
//学校code
if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
$filter['keywords'] = json_str_iconv($filter['keywords']);
}
$filter['sort'] = empty($_REQUEST['sort']) ? 'sms_id' : trim($_REQUEST['sort']);
$filter['order'] = empty($_REQUEST['order']) ? 'DESC' : trim($_REQUEST['order']);
$filter['page'] = empty($_REQUEST['page']) ? '1' : trim($_REQUEST['page']);
$filter['page_size'] = empty($_REQUEST['rows']) ? '20' : trim($_REQUEST['rows']);
$ex_where = " WHERE class_code='" . $class_code . "' and phones like '%{$phone}%'";
if ($filter['keywords']) {
$ex_where .= " AND content LIKE '%" . mysql_like_quote($filter['keywords']) . "%'";
}
$filter['record_count'] = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS["ecs"]->table("sms") . $ex_where);
/* 分页大小 */
$filter = page_and_size($filter);
$sql = "SELECT * " . " FROM " . $GLOBALS["ecs"]->table("sms") . $ex_where . " ORDER by " . $filter['sort'] . ' ' . $filter['order'] . " LIMIT " . $filter['start'] . ',' . $filter['page_size'];
$filter['keywords'] = stripslashes($filter['keywords']);
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$sms_list = $GLOBALS['db']->getAll($sql);
$arr = array('rows' => $sms_list, 'filter' => $filter, 'page' => $filter['page_count'], 'total' => $filter['record_count']);
return $arr;
}
示例2: get_stock_control_log
function get_stock_control_log()
{
$result = get_filter();
if ($result === false) {
$filter = array();
$filter['keyword'] = empty($_REQUEST['keyword']) ? '' : trim($_REQUEST['keyword']);
$filter['admin_agency_id'] = empty($_REQUEST['admin_agency_id']) ? '' : trim($_REQUEST['admin_agency_id']);
if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
$filter['keyword'] = json_str_iconv($filter['keyword']);
}
$filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'a.id' : trim($_REQUEST['sort_by']);
$filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);
$filter['start_date'] = empty($_REQUEST['start_date']) ? local_strtotime('-30 days') : $_REQUEST['start_date'];
$filter['end_date'] = empty($_REQUEST['end_date']) ? local_strtotime('today') : $_REQUEST['end_date'];
if (strpos($filter['start_date'], '-') !== false) {
$filter['start_date'] = local_strtotime($filter['start_date']);
$filter['end_date'] = local_strtotime($filter['end_date']);
}
$where = agency_where();
/*add by hg for date 2014-04-21 可选商品*/
if (if_agency()) {
if (!empty($filter['admin_agency_id'])) {
$where .= " AND (a.admin_agency_id = {$filter['admin_agency_id']} ) ";
} else {
$where .= " AND (a.admin_agency_id = 0 ) ";
}
}
if (!empty($filter['keyword'])) {
$where .= " AND (a.goods_name LIKE '%" . mysql_like_quote($filter['keyword']) . "%' or a.stock_number LIKE '%" . mysql_like_quote($filter['keyword']) . "%' )";
}
if ($filter['start_date']) {
$where = $where . " AND a.log_time >= '{$filter['start_date']}'";
}
if ($filter['end_date']) {
$where = $where . " AND a.log_time <= '" . ($filter['end_date'] + 86400) . "'";
}
$sql = 'SELECT COUNT(*) FROM ' . $GLOBALS['ecs']->table('stock_control_log') . ' AS a ' . 'WHERE 1 ' . $where;
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
$filter = page_and_size($filter);
/* 获取库存日志管理数据 */
$sql = 'SELECT a.* ' . 'FROM ' . $GLOBALS['ecs']->table('stock_control_log') . ' AS a ' . 'WHERE 1 ' . $where . ' ORDER by ' . $filter['sort_by'] . ' ' . $filter['sort_order'];
$filter['keyword'] = stripslashes($filter['keyword']);
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$arr = array();
$res = $GLOBALS['db']->selectLimit($sql, $filter['page_size'], $filter['start']);
while ($rows = $GLOBALS['db']->fetchRow($res)) {
$rows['date'] = local_date($GLOBALS['_CFG']['time_format'], $rows['log_time']);
$rows['out_type_remarks'] = $GLOBALS['db']->getOne("SELECT remarks FROM " . $GLOBALS['ecs']->table('stock_out_type') . " WHERE id = '" . $rows['out_type_id'] . "' ");
$arr[] = $rows;
}
$GLOBALS['smarty']->assign('start_date', local_date('Y-m-d', $filter['start_date']));
$GLOBALS['smarty']->assign('end_date', local_date('Y-m-d', $filter['end_date']));
$filter['start_date'] = local_date('Y-m-d', $filter['start_date']);
$filter['end_date'] = local_date('Y-m-d', $filter['end_date']);
return array('arr' => $arr, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
}
示例3: exam_prj_list
/**
* 返回班级管理员列表数据
*
* @access public
* @param
*
* @return void
*/
function exam_prj_list()
{
$result = get_filter();
if ($result === false) {
/* 过滤条件 */
$filter['name'] = empty($_REQUEST['search_name']) ? '' : trim($_REQUEST['search_name']);
//名称
if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
$filter['name'] = json_str_iconv($filter['name']);
}
$filter['sort'] = empty($_REQUEST['sort']) ? 'prj_id' : trim($_REQUEST['sort']);
$filter['order'] = empty($_REQUEST['order']) ? 'DESC' : trim($_REQUEST['order']);
$filter['page'] = empty($_REQUEST['page']) ? '1' : trim($_REQUEST['page']);
$filter['page_size'] = empty($_REQUEST['rows']) ? '25' : trim($_REQUEST['rows']);
$ex_where = " WHERE class_code='" . $_SESSION["class_code"] . "' ";
if ($filter['name']) {
$ex_where .= " AND name like '" . mysql_like_quote($filter['name']) . "%'";
}
$sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table("exam_prj") . $ex_where;
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
/* 分页大小 */
$filter = page_and_size($filter);
$sql = "SELECT * " . " FROM " . $GLOBALS['ecs']->table("exam_prj") . $ex_where . " ORDER by " . $filter['sort'] . ' ' . $filter['order'] . " LIMIT " . $filter['start'] . ',' . $filter['page_size'];
// echo $sql; echo '<br>';
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$list = $GLOBALS['db']->getAll($sql);
$arr = array('rows' => $list, 'filter' => $filter, 'page' => $filter['page_count'], 'total' => $filter['record_count']);
return $arr;
}
示例4: get_temp_list
function get_temp_list()
{
// Obtaion to the temp list
$result = get_filter();
if ($result === false) {
$filter = array();
$where = "WHERE 1";
$filter['bdate'] = empty($_REQUEST['bdate']) ? date('Y-m-d') : trim($_REQUEST['bdate']);
if (!empty($_REQUEST['city'])) {
$where .= " AND ";
} else {
$where .= " AND a.country" . db_create_in(array_keys($_SESSION['city_arr']));
}
$where .= " AND a.order_status=1 AND b.goods_price>100";
if ($filter['bdate']) {
$where .= " AND a.best_time BETWEEN '" . $filter['bdate'] . " 00:00:00' AND '" . $filter['bdate'] . " 23:59:59'";
}
$query = "SELECT DISTINCT COUNT(*) FROM ecs_order_info AS a \r\n\t\t\tLEFT JOIN ecs_order_goods AS b ON a.order_id=b.order_id \r\n\t\t\tLEFT JOIN order_dispatch AS c ON c.order_id=a.order_id \r\n\t\t\tLEFT JOIN ship_route AS d ON d.route_id=c.route_id {$where}";
$filter['record_count'] = $GLOBALS['db_read']->getOne($query);
$filter = page_and_size($filter);
$limit = "LIMIT " . $filter['start'] . "," . $filter['page_size'] . "";
$sql = "SELECT SUM(b.goods_number) AS gnum,c.turn,d.station_id \r\n\t\t\tFROM ecs_order_info AS a \r\n\t\t\tLEFT JOIN ecs_order_goods AS b ON a.order_id=b.order_id \r\n\t\t\tLEFT JOIN order_dispatch AS c ON c.order_id=a.order_id \r\n\t\t\tLEFT JOIN ship_route AS d ON d.route_id=c.route_id {$where} \r\n\t\t\tGROUP BY c.turn,d.station_id {$limit}";
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$list = $GLOBALS['db_read']->getAll($sql);
return array('list' => $list, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
}
示例5: course_list
/**
* 返回班级管理员列表数据
*
* @access public
* @param
*
* @return void
*/
function course_list()
{
$result = get_filter();
if ($result === false) {
/* 过滤条件 */
$filter['semster'] = empty($_REQUEST['search_semster']) ? '' : trim($_REQUEST['search_semster']);
//名称
if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
$filter['semster'] = json_str_iconv($filter['semster']);
}
$ex_where = " WHERE class_code='" . $_SESSION["class_code"] . "' ";
if ($filter['semster']) {
$ex_where .= " AND semster = '" . mysql_like_quote($filter['semster']) . "'";
}
$sql = "SELECT * FROM " . $GLOBALS['ecs']->table("course") . $ex_where;
// echo $sql; echo '<br>';
$filter['semster'] = stripslashes($filter['semster']);
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$list = $GLOBALS['db']->getRow($sql);
return $list;
}
示例6: get_stat_list
function get_stat_list()
{
// Obtaion to the statistics list
$result = get_filter();
if ($result === false) {
$filter = array();
$city_group = $_SESSION['city_group'];
$where = "WHERE 1 ";
$bdate = date('Y-m-d', strtotime(date('Y-m-d')) - 3600 * 24 * 2);
$sdate = date('Y-m-d', strtotime(date('Y-m-d')) - 3600 * 24 * 1);
$filter['turn'] = empty($_REQUEST['turn']) ? '' : intval($_REQUEST['turn']);
$filter['bdate'] = empty($_REQUEST['bdate']) ? $bdate : trim($_REQUEST['bdate']);
$filter['sdate'] = empty($_REQUEST['sdate']) ? $sdate : trim($_REQUEST['sdate']);
$filter['order_sn'] = empty($_REQUEST['order_sn']) ? '' : trim($_REQUEST['order_sn']);
$filter['print_sn'] = empty($_REQUEST['print_sn']) ? '' : trim($_REQUEST['print_sn']);
$filter['stan'] = empty($_REQUEST['city']) ? $_SESSION['city_arr'] : intval($_REQUEST['city']);
$join = "";
if (!empty($filter['turn'])) {
$join .= " LEFT JOIN order_dispatch AS d ON d.order_id=b.order_id";
}
if (!empty($filter['print_sn'])) {
$join .= " LEFT JOIN print_log_x AS p ON p.order_id=b.order_id";
}
$term = "WHERE 1 AND b.order_status='1' AND c.goods_price>40";
if ($filter['bdate'] && $filter['sdate']) {
$term .= " and b.best_time>='" . $filter['bdate'] . " 00:00:00' AND b.best_time<='" . $filter['sdate'] . " 23:59:59'";
}
if ($filter['turn']) {
$term .= " AND d.turn='" . $filter['turn'] . "'";
}
if ($filter['print_sn']) {
$term .= " and p.print_sn='" . $filter['print_sn'] . "'and p.city_group=" . $city_group;
}
if ($filter['order_sn']) {
$term .= " and b.order_sn like '%" . $filter['order_sn'] . "'";
}
$query = "select count(*) from \r\n\t\t\t(SELECT b.best_time,c.goods_id,c.goods_attr,SUM(c.goods_number) AS gnum,GROUP_CONCAT(c.order_id) AS order_group \r\n\t\t\tFROM order_genid AS a \r\n\t\t\tLEFT JOIN ecs_order_info AS b ON b.order_id=a.order_id \r\n\t\t\tLEFT JOIN ecs_order_goods AS c ON c.order_id=b.order_id " . $join . " {$term} \r\n\t\t\tGROUP BY c.goods_id,c.goods_attr )as a ";
$filter['record_count'] = $GLOBALS['db_read']->getOne($query);
$filter = page_and_size($filter);
$limit = "LIMIT " . $filter['start'] . "," . $filter['page_size'];
$sql = "SELECT b.best_time,c.goods_id,c.goods_attr,SUM(c.goods_number) AS gnum,GROUP_CONCAT(c.order_id) AS order_group \r\n\t\t\tFROM order_genid AS a \r\n\t\t\tLEFT JOIN ecs_order_info AS b ON b.order_id=a.order_id \r\n\t\t\tLEFT JOIN ecs_order_goods AS c ON c.order_id=b.order_id " . $join . " {$term} \r\n\t\t\tGROUP BY c.goods_id,c.goods_attr ASC " . $limit;
//print_r($sql);exit;
$goods = $GLOBALS['db_read']->getAll($sql);
foreach ($goods as $key => $val) {
$list['stat'][$key]['goods_id'] = $val['goods_id'];
$list['stat'][$key]['goods_name'] = get_goods_name($val['goods_id']);
$list['stat'][$key]['bdate'] = $filter['bdate'];
$list['stat'][$key]['goods_attr'] = empty($val['goods_attr']) ? '0.25' : floatval($val['goods_attr']);
$list['stat'][$key]['goods_sum'] = $val['gnum'];
$list['stat'][$key]['order_group'] = $val['order_group'];
$list['weight_total'] += $val['gnum'] * floatval($val['goods_attr']);
$list['num_total'] += $val['gnum'];
set_filter($filter, $sql);
}
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
return array('list' => $list, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count'], 'sql' => $sql);
}
示例7: goods_stock
function goods_stock()
{
global $ecs, $db;
$result = get_filter($param_str);
if ($result === false) {
$filter['goods_name'] = empty($_REQUEST['goods_name']) ? '' : trim($_REQUEST['goods_name']);
$filter['goods_sn'] = empty($_REQUEST['goods_sn']) ? '' : trim($_REQUEST['goods_sn']);
$where = ' WHERE supplier_id=' . $_SESSION['supplier_id'];
if (!empty($filter['goods_name'])) {
$where .= ' AND goods_name LIKE "%' . $filter['goods_name'] . '%" ';
}
if (!empty($filter['goods_sn'])) {
$where .= ' AND goods_sn LIKE "%' . $filter['goods_sn'] . '%" ';
}
$sql = 'SELECT COUNT(*) FROM ' . $ecs->table('goods') . $where;
$filter['record_count'] = $db->getOne($sql);
$filter['page'] = empty($_REQUEST['page']) || intval($_REQUEST['page']) <= 0 ? 1 : intval($_REQUEST['page']);
if (isset($_REQUEST['page_size']) && intval($_REQUEST['page_size']) > 0) {
$filter['page_size'] = intval($_REQUEST['page_size']);
} elseif (isset($_COOKIE['ECSCP']['page_size']) && intval($_COOKIE['ECSCP']['page_size']) > 0) {
$filter['page_size'] = intval($_COOKIE['ECSCP']['page_size']);
} else {
$filter['page_size'] = 15;
}
$filter = page_and_size($filter);
$limit = ' LIMIT ' . $filter['start'] . ',' . $filter['page_size'];
$sql = 'SELECT goods_id,goods_sn,goods_name,goods_number FROM ' . $ecs->table('goods') . $where . $limit;
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$goods = $db->getAll($sql);
foreach ($goods as $goods_key => $goods_val) {
$sql = 'SELECT goods_attr AS goods_attr_id,product_number FROM ' . $ecs->table('products') . ' WHERE goods_id=' . $goods_val['goods_id'];
$attr = $db->getAll($sql);
foreach ($attr as $attr_key => $attr_val) {
$goods_attr_arr = explode('|', $attr_val['goods_attr_id']);
$attr_sql = implode(' OR goods_attr_id= ', $goods_attr_arr);
$sql = 'SELECT attr_value FROM ' . $ecs->table('goods_attr') . ' WHERE goods_attr_id=' . $attr_sql;
$attr_name_arr = $db->getAll($sql);
$attr_name = '';
foreach ($attr_name_arr as $name_key => $name_val) {
$attr_name .= implode(' ', $name_val);
}
$attr_val['goods_attr_name'] = $attr_name;
$attr[$attr_key] = $attr_val;
}
$goods_val['goods_attr'] = $attr;
$goods[$goods_key] = $goods_val;
}
$arr = array('goods' => $goods, 'filter' => $filter);
return $arr;
}
示例8: resource_list
/**
* 返回班级管理员列表数据
*
* @access public
* @param
*
* @return void
*/
function resource_list()
{
$result = get_filter();
if ($result === false) {
/* 过滤条件 */
$filter['resource_type'] = empty($_REQUEST['search_resource_type']) ? '' : trim($_REQUEST['search_resource_type']);
//编号
$filter['name'] = empty($_REQUEST['search_name']) ? '' : trim($_REQUEST['search_name']);
//名称
$filter['sdate'] = empty($_REQUEST['search_sdate']) ? '' : trim($_REQUEST['search_sdate']);
//起始日期
$filter['edate'] = empty($_REQUEST['search_edate']) ? '' : trim($_REQUEST['search_edate']);
//截止日期
if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
$filter['name'] = json_str_iconv($filter['name']);
}
$filter['sort'] = empty($_REQUEST['sort']) ? 'resource_id' : trim($_REQUEST['sort']);
$filter['order'] = empty($_REQUEST['order']) ? 'DESC' : trim($_REQUEST['order']);
$filter['page'] = empty($_REQUEST['page']) ? '1' : trim($_REQUEST['page']);
$filter['page_size'] = empty($_REQUEST['rows']) ? '25' : trim($_REQUEST['rows']);
$ex_where = " WHERE d.class_code='" . $_SESSION["class_code"] . "' ";
if ($filter['resource_type']) {
$ex_where .= " AND d.type = '" . mysql_like_quote($filter['resource_type']) . "'";
}
if ($filter['name']) {
$ex_where .= " AND d.name like '" . mysql_like_quote($filter['name']) . "%'";
}
if ($filter['sdate']) {
$ex_where .= " AND d.created >='" . mysql_like_quote($filter['sdate']) . "'";
}
if ($filter['edate']) {
$ex_where .= " AND d.created <='" . mysql_like_quote($filter['edate']) . "'";
}
$sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table("resource") . " d " . $ex_where;
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
/* 分页大小 */
$filter = page_and_size($filter);
$sql = "SELECT d.*, s.name as resource_type " . " FROM " . $GLOBALS['ecs']->table("resource") . " d left join " . $GLOBALS['ecs']->table("resource_type") . " s on d.type=s.rtype_id " . $ex_where . " ORDER by " . $filter['sort'] . ' ' . $filter['order'] . " LIMIT " . $filter['start'] . ',' . $filter['page_size'];
// echo $sql; echo '<br>';
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$list = $GLOBALS['db']->getAll($sql);
foreach ($list as $k => $v) {
$list[$k]['creator_name'] = get_user_name($v["creator"], 'admin');
}
$arr = array('rows' => $list, 'filter' => $filter, 'page' => $filter['page_count'], 'total' => $filter['record_count']);
return $arr;
}
示例9: show_notes
function show_notes($_POST)
{
extract($_POST);
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($from_day, "num", 1, 2, "Invalid Invoice From Date day.");
$v->isOk($from_month, "num", 1, 2, "Invalid Invoice From Date month.");
$v->isOk($from_year, "num", 1, 5, "Invalid Invoice From Date year.");
$v->isOk($to_day, "num", 1, 2, "Invalid Invoice To Date day.");
$v->isOk($to_month, "num", 1, 2, "Invalid Invoice To Date month.");
$v->isOk($to_year, "num", 1, 5, "Invalid Invoice To Date year.");
$fromdate = mkdate($from_year, $from_month, $from_day);
$todate = mkdate($to_year, $to_month, $to_day);
$v->isOk($fromdate, "date", 1, 1, "Invalid From Date.");
$v->isOk($todate, "date", 1, 1, "Invalid To Date.");
# display errors, if any
if ($v->isError()) {
$err = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$err .= "<li class='err'>" . $e["msg"] . "</li>";
}
return get_filter($_POST, $err);
}
$listing = "\n\t\t<tr>\n\t\t\t<th>Customer</th>\n\t\t\t<th>Credit Note No.</th>\n\t\t\t<th>Ref.</th>\n\t\t\t<th>Date</th>\n\t\t\t<th>Amount</th>\n\t\t\t<th>Stock Returned</th>\n\t\t\t<th>Options</th>\n\t\t</tr>";
db_connect();
$get_sql = "SELECT * FROM credit_notes WHERE tdate >= '{$fromdate}' AND tdate <= '{$todate}'";
$run_get = db_exec($get_sql) or errDie("Unable to get credit note information.");
if (pg_numrows($run_get) < 1) {
$listing .= "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='7'>No Credit Notes Found.</td>\n\t\t\t</tr>";
} else {
while ($carr = pg_fetch_array($run_get)) {
$get_cust = "SELECT surname FROM customers WHERE cusnum = '{$carr['cusnum']}'";
$run_cust = db_exec($get_cust) or errDie("Unable to get customer information.");
if (pg_numrows($run_cust) < 1) {
$cusname = "";
} else {
$cusname = pg_fetch_result($run_cust, 0, 0);
}
if (isset($carr['used_stock']) and $carr['used_stock'] == "1") {
$showstockused = "Yes";
} else {
$showstockused = "No";
}
$listing .= "\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>{$cusname}</td>\n\t\t\t\t\t<td>g{$carr['creditnote_num']}</td>\n\t\t\t\t\t<td>{$carr['refnum']}</td>\n\t\t\t\t\t<td>{$carr['tdate']}</td>\n\t\t\t\t\t<td>" . CUR . " {$carr['totamt']}</td>\n\t\t\t\t\t<td>{$showstockused}</td>\n\t\t\t\t\t<td><a href='credit-note-print.php?id={$carr['id']}'>Print</a></td>\n\t\t\t\t</tr>";
}
}
$display = "\n\t\t<h2>Listing Of Credit Notes</h2>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t{$listing}\n\t\t</table>";
return $display;
}
示例10: person_list
/**
* 返回班级管理员列表数据
*
* @access public
* @param
*
* @return void
*/
function person_list()
{
$result = get_filter();
if ($result === false) {
/* 过滤条件 */
$filter['keywords'] = empty($_REQUEST['keywords']) ? '' : trim($_REQUEST['keywords']);
//名称
$filter['tel'] = empty($_REQUEST['tel']) ? '' : trim($_REQUEST['tel']);
//电话
if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
$filter['keywords'] = json_str_iconv($filter['keywords']);
}
$filter['sort'] = empty($_REQUEST['sort']) ? 'person_id' : trim($_REQUEST['sort']);
$filter['order'] = empty($_REQUEST['order']) ? 'DESC' : trim($_REQUEST['order']);
$filter['page'] = empty($_REQUEST['page']) ? '1' : trim($_REQUEST['page']);
$filter['page_size'] = empty($_REQUEST['rows']) ? '25' : trim($_REQUEST['rows']);
$ex_where = " WHERE class_code='" . $_SESSION["class_code"] . "' ";
if ($filter['keywords']) {
$ex_where .= " AND name LIKE '%" . mysql_like_quote($filter['keywords']) . "%'";
}
if ($filter['tel']) {
$ex_where .= " AND tel = '" . mysql_like_quote($filter['tel']) . "'";
}
$sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table("person") . $ex_where;
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
/* 分页大小 */
$filter = page_and_size($filter);
$sql = "SELECT * " . " FROM " . $GLOBALS['ecs']->table("person") . $ex_where . " ORDER by " . $filter['sort'] . ' ' . $filter['order'] . " LIMIT " . $filter['start'] . ',' . $filter['page_size'];
// echo $sql; echo '<br>';
$filter['keywords'] = stripslashes($filter['keywords']);
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$list = $GLOBALS['db']->getAll($sql);
// foreach ($list AS $key=>$val)
// {
// $list[$key]['created'] = local_date($GLOBALS['_CFG']['time_format'], $val['created']);
// }
$arr = array('rows' => $list, 'filter' => $filter, 'page' => $filter['page_count'], 'total' => $filter['record_count']);
return $arr;
}
示例11: auction_list
public function auction_list($offset = '0, 12')
{
$result = get_filter();
if ($result === false) {
/* 过滤条件 */
$filter['keyword'] = empty($_REQUEST['keyword']) ? '' : trim($_REQUEST['keyword']);
if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
$filter['keyword'] = json_str_iconv($filter['keyword']);
}
$filter['is_going'] = empty($_REQUEST['is_going']) ? 0 : 1;
$filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'act_id' : trim($_REQUEST['sort_by']);
$filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);
$where = "";
if (!empty($filter['keyword'])) {
$where .= " AND goods_name LIKE '%" . mysql_like_quote($filter['keyword']) . "%'";
}
if ($filter['is_going']) {
$now = gmtime();
$where .= " AND is_finished = 0 AND start_time <= '{$now}' AND end_time >= '{$now}' ";
}
/* 分页大小 */
// $filter = page_and_size($filter);
/* 查询 */
$sql = "SELECT * " . "FROM " . $this->model->pre . "goods_activity WHERE act_type = '" . GAT_AUCTION . "' {$where} " . " ORDER BY {$filter['sort_by']} {$filter['sort_order']} " . " LIMIT {$offset}";
$filter['keyword'] = stripslashes($filter['keyword']);
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$res = $this->model->query($sql);
$list = array();
foreach ($res as $row) {
$ext_info = unserialize($row['ext_info']);
$arr = array_merge($row, $ext_info);
$arr['start_time'] = local_date('Y-m-d H:i', $arr['start_time']);
$arr['end_time'] = local_date('Y-m-d H:i', $arr['end_time']);
$list[] = $arr;
}
$arr = array('item' => $list, 'filter' => $filter);
return $arr;
}
示例12: get_email_list
function get_email_list()
{
$result = get_filter();
if ($result === false) {
$filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'stat' : trim($_REQUEST['sort_by']);
$filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'ASC' : trim($_REQUEST['sort_order']);
$sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('email_list');
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
/* 分页大小 */
$filter = page_and_size($filter);
/* 查询 */
$sql = "SELECT * FROM " . $GLOBALS['ecs']->table('email_list') . " ORDER BY " . $filter['sort_by'] . ' ' . $filter['sort_order'] . " LIMIT " . $filter['start'] . ",{$filter['page_size']}";
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$emaildb = $GLOBALS['db']->getAll($sql);
$arr = array('emaildb' => $emaildb, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
return $arr;
}
示例13: forum_list
/**
* 返回班级管理员列表数据
*
* @access public
* @param
*
* @return void
*/
function forum_list()
{
$result = get_filter();
if ($result === false) {
/* 过滤条件 */
$filter['keyword'] = empty($_REQUEST['search_keyword']) ? '' : trim($_REQUEST['search_keyword']);
//主体
if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
$filter['keyword'] = json_str_iconv($filter['keyword']);
}
$filter['sort'] = empty($_REQUEST['sort']) ? 'forum_id' : trim($_REQUEST['sort']);
$filter['order'] = empty($_REQUEST['order']) ? 'DESC' : trim($_REQUEST['order']);
$filter['page'] = empty($_REQUEST['page']) ? '1' : trim($_REQUEST['page']);
$filter['page_size'] = empty($_REQUEST['rows']) ? '25' : trim($_REQUEST['rows']);
$ex_where = " WHERE parent_id=0 and class_code='" . $_SESSION["class_code"] . "' ";
if ($filter['keyword']) {
$ex_where .= " AND (title like '%" . mysql_like_quote($filter['keyword']) . "%'";
$ex_where .= " OR content like '%" . mysql_like_quote($filter['keyword']) . "%')";
}
$sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table("forum") . $ex_where;
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
/* 分页大小 */
$filter = page_and_size($filter);
$sql = "SELECT * " . " FROM " . $GLOBALS['ecs']->table("forum") . $ex_where . " ORDER by " . $filter['sort'] . ' ' . $filter['order'] . " LIMIT " . $filter['start'] . ',' . $filter['page_size'];
// echo $sql; echo '<br>';
$filter['keyword'] = stripslashes($filter['keyword']);
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$list = $GLOBALS['db']->getAll($sql);
foreach ($list as $key => $val) {
$list[$key]['setime'] = $val['stime'] . "-" . $val['etime'];
}
$arr = array('rows' => $list, 'filter' => $filter, 'page' => $filter['page_count'], 'total' => $filter['record_count']);
return $arr;
}
示例14: mp_core_the_featured_image
/**
* This function returns the featured image url of a post
*
* @since 1.0.0
* @link http://mintplugins.com/doc/mp_core_the_featured_image/
* @see has_filter()
* @see get_filter()
* @see get_post_thumbnail_id()
* @see wp_get_attachment_image_src()
* @see mp_aq_resize()
* @param string $post_id The ID of the post who's featured image we want
* @param int $width The width of the image we want in pixels. Defaults to 600
* @param int $height The height of the image we want in pixels. Defaults to 600
* @param string $before Optional. A string to output directly before the image URL
* @param string $after Optional. A string to output directly after the image URL
* @return string The featured image's URL with $before and $after before and after respectively.
*/
function mp_core_the_featured_image($post_id = NULL, $width = NULL, $height = NULL, $before = NULL, $after = NULL)
{
if (empty($post_id)) {
return false;
}
//Default width if blank
$width = isset($width) ? $width : 600;
//Set crop if there is a height. If not, don't crop
$crop = isset($height) ? true : false;
//Set default for featured image
$image_url = has_filter('mp_featured_image_default') ? get_filter('mp_featured_image_default', '') : NULL;
//get the post thumbnail for this post
$image_id = get_post_thumbnail_id($post_id);
if ($image_id != "") {
$image_url = wp_get_attachment_image_src($image_id, 'full');
$image_url = $image_url[0];
if (is_ssl()) {
//action to take for page using SSL
$image_url = str_replace('http://', 'https://', $image_url);
}
return $before . mp_aq_resize($image_url, $width, $height, $crop) . $after;
}
}
示例15: exam_subject_list
/**
* 返回班级管理员列表数据
*
* @access public
* @param
*
* @return void
*/
function exam_subject_list($table)
{
$result = get_filter();
if ($result === false) {
$filter['sort'] = empty($_REQUEST['sort']) ? 'subject_id' : trim($_REQUEST['sort']);
$filter['order'] = empty($_REQUEST['order']) ? 'DESC' : trim($_REQUEST['order']);
$filter['page'] = empty($_REQUEST['page']) ? '1' : trim($_REQUEST['page']);
$filter['page_size'] = empty($_REQUEST['rows']) ? '25' : trim($_REQUEST['rows']);
$where = " WHERE class_code='" . $_SESSION['class_code'] . "' ";
$sql = "SELECT COUNT(*) FROM " . $table . $where;
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
/* 分页大小 */
$filter = page_and_size($filter);
$sql = "SELECT * " . " FROM " . $table . $where . " ORDER by " . $filter['sort'] . ' ' . $filter['order'] . " LIMIT " . $filter['start'] . ',' . $filter['page_size'];
// echo $sql; echo '<br>';
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$list = $GLOBALS['db']->getAll($sql);
$arr = array('rows' => $list, 'filter' => $filter, 'page' => $filter['page_count'], 'total' => $filter['record_count']);
return $arr;
}