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


PHP json_str_iconv函数代码示例

本文整理汇总了PHP中json_str_iconv函数的典型用法代码示例。如果您正苦于以下问题:PHP json_str_iconv函数的具体用法?PHP json_str_iconv怎么用?PHP json_str_iconv使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: 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;
}
开发者ID:dalinhuang,项目名称:hteacher,代码行数:33,代码来源:course.php

示例2: exchange_shop_license

/**
 * 功能:与 ECShop 交换数据
 *
 * @param   array $certi 登录参数
 * @param   array $license 网店license信息
 * @param   bool $use_lib 使用哪一个json库,0为ec,1为shopex
 * @return  array
 */
function exchange_shop_license($certi, $license, $use_lib = 0)
{
    $touch =& get_instance();
    if (!is_array($certi)) {
        return array();
    }
    $touch->load->library('transport');
    //    include_once(ROOT_PATH . 'includes/cls_transport.php');
    //    include_once(ROOT_PATH . 'includes/cls_json.php');
    $params = '';
    foreach ($certi as $key => $value) {
        $params .= '&' . $key . '=' . $value;
    }
    $params = trim($params, '&');
    $transport = new transport();
    //$transport->connect_timeout = 1;
    $request = $transport->request($license['certi'], $params, 'POST');
    $request_str = json_str_iconv($request['body']);
    //    if (empty($use_lib))
    //    {
    //$json = new JSON();
    $request_arr = json_decode($request_str, 1);
    //    }
    //    else
    //    {
    //        //include_once(ROOT_PATH . 'includes/shopex_json.php');
    //        $request_arr = json_decode($request_str, 1);
    //    }
    return $request_arr;
}
开发者ID:connwap135,项目名称:ectouch,代码行数:38,代码来源:license_helper.php

示例3: 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;
}
开发者ID:dalinhuang,项目名称:hteacher,代码行数:37,代码来源:sms.php

示例4: 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;
}
开发者ID:dalinhuang,项目名称:hteacher,代码行数:41,代码来源:exam_prj.php

示例5: exchange_shop_license

/**
 * 功能:与 ECShop 交换数据
 *
 * @param   array     $certi    登录参数
 * @param   array     $license  网店license信息
 * @param   bool      $use_lib  使用哪一个json库,0为ec,1为shopex
 * @return  array
 */
function exchange_shop_license($certi, $license, $use_lib = 0)
{
    if (!is_array($certi)) {
        return array();
    }
    include_once ROOT_PATH . 'includes/cls_transport.php';
    include_once ROOT_PATH . 'includes/cls_json.php';
    $params = '';
    foreach ($certi as $key => $value) {
        $params .= '&' . $key . '=' . $value;
    }
    $params = trim($params, '&');
    $transport = new transport();
    //$transport->connect_timeout = 1;
    $request = $transport->request($license['certi'], $params, 'POST');
    $request_str = json_str_iconv($request['body']);
    if (empty($use_lib)) {
        $json = new JSON();
        $request_arr = $json->decode($request_str, 1);
    } else {
        include_once ROOT_PATH . 'includes/shopex_json.php';
        $request_arr = json_decode($request_str, 1);
    }
    return $request_arr;
}
开发者ID:dlpc,项目名称:ecshop,代码行数:33,代码来源:lib_license.php

示例6: 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']);
}
开发者ID:dlpc,项目名称:ecshop,代码行数:60,代码来源:stock_control_log.php

示例7: 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;
}
开发者ID:dalinhuang,项目名称:hteacher,代码行数:59,代码来源:resource.php

示例8: 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;
}
开发者ID:dalinhuang,项目名称:hteacher,代码行数:51,代码来源:person.php

示例9: 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;
 }
开发者ID:ChanHarold,项目名称:ecshop,代码行数:42,代码来源:AuctionController.class.php

示例10: area_list

function area_list()
{
    if (!empty($_GET['is_ajax']) && $_GET['is_ajax'] == 1) {
        $_REQUEST['area'] = json_str_iconv($_REQUEST['area']);
        $_REQUEST['city'] = json_str_iconv($_REQUEST['city']);
        $_REQUEST['stan'] = json_str_iconv($_REQUEST['stan']);
    }
    $filter['code'] = empty($_REQUEST['code']) ? '' : trim($_REQUEST['code']);
    $filter['area'] = empty($_REQUEST['area']) ? '' : trim($_REQUEST['area']);
    $filter['city'] = empty($_REQUEST['city']) ? '' : trim($_REQUEST['city']);
    $filter['stan'] = empty($_REQUEST['stan']) ? '' : trim($_REQUEST['stan']);
    $filter['fee'] = intval($_REQUEST['fee']);
    $filter['page'] = empty($_REQUEST['page']) || intval($_REQUEST['page']) <= 0 ? 1 : intval($_REQUEST['page']);
    $where = " where 1 ";
    if ($filter['code']) {
        $where .= " and route_name = '" . $filter['code'] . "' ";
    }
    if ($filter['area']) {
        $where .= " and area_name like '%" . $filter['area'] . "%'";
    }
    if ($filter['fee']) {
        $where .= " and fee = " . $filter['fee'];
    }
    if ($filter['stan']) {
        $where .= " and station_id = '" . $filter['stan'] . "'";
    }
    if ($filter['city']) {
        $where .= " and city = '" . $filter['city'] . "'";
    }
    $size = 30;
    $sql = "select count(1) from view_ship_area " . $where;
    $record_count = $GLOBALS['db_read']->getOne($sql);
    $page_count = $record_count > 0 ? ceil($record_count / $size) : 1;
    $sql = "select * from view_ship_area " . $where . " LIMIT " . ($filter['page'] - 1) * $size . ",{$size}";
    //echo $sql;
    $rs = $GLOBALS['db_read']->getAll($sql);
    $arr = array('list' => $rs, 'filter' => $filter, 'page_count' => $page_count, 'record_count' => $record_count);
    return $arr;
}
开发者ID:songtaiwu,项目名称:mordercms,代码行数:39,代码来源:area_b.php

示例11: 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;
}
开发者ID:dalinhuang,项目名称:hteacher,代码行数:46,代码来源:forum.php

示例12: msg_list

/**
 *
 *
 * @access  public
 * @param
 *
 * @return void
 */
function msg_list($from, $table)
{
    /* 过滤条件 */
    $filter['keywords'] = empty($_REQUEST['search_keywords']) ? '' : trim($_REQUEST['search_keywords']);
    $filter['msg_type'] = isset($_REQUEST['msg_type']) ? intval($_REQUEST['msg_type']) : -1;
    if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
        $filter['keywords'] = json_str_iconv($filter['keywords']);
    }
    $filter['sort'] = empty($_REQUEST['sort']) || trim($_REQUEST['sort']) == 'msg_reply' ? 'msg_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 parent_id = '0' AND msg_from='" . $from . "' and user_id='" . $_SESSION["admin_id"] . "' ";
    $filter['from'] = $from;
    if ($filter['keywords']) {
        $where .= " AND (msg_title LIKE '%" . mysql_like_quote($filter['keywords']) . "%' ";
        $where .= " OR msg_content LIKE '%" . mysql_like_quote($filter['keywords']) . "%') ";
    }
    if ($filter['msg_type'] != -1) {
        $where .= " AND msg_type = '{$filter['msg_type']}' ";
    }
    $sql = "SELECT count(*) FROM " . $table . " AS f " . $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'];
    $msg_list = $GLOBALS['db']->getAll($sql);
    foreach ($msg_list as $key => $value) {
        $reply = $GLOBALS['db']->getOne("select msg_content  from " . $table . " where parent_id=" . $value["msg_id"] . " limit 1");
        $msg_list[$key]['msg_status'] = $reply ? 1 : 0;
        $msg_list[$key]['msg_reply'] = $reply;
        $msg_list[$key]['msg_time'] = local_date($GLOBALS['_CFG']['time_format'], $value['msg_time']);
        $msg_list[$key]['msg_type'] = $GLOBALS['_LANG']['type'][$value['msg_type']];
    }
    $filter['keywords'] = stripslashes($filter['keywords']);
    $arr = array('rows' => $msg_list, 'filter' => $filter, 'page' => $filter['page_count'], 'total' => $filter['record_count']);
    return $arr;
}
开发者ID:dalinhuang,项目名称:hteacher,代码行数:46,代码来源:user_msg.php

示例13: get_order_comment_list

/**
 * 获取评论列表
 * @access  public
 * @return  array
 */
function get_order_comment_list()
{
    $supplier_id = $_SESSION['supplier_id'];
    /* 查询条件 */
    $filter['keywords'] = empty($_REQUEST['keywords']) ? 0 : trim($_REQUEST['keywords']);
    if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
        $filter['keywords'] = json_str_iconv($filter['keywords']);
    }
    $filter['sort_by'] = empty($_REQUEST['sort_by']) ? 's.add_time' : trim($_REQUEST['sort_by']);
    $filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);
    $where = !empty($filter['keywords']) ? " AND order_sn LIKE '%" . mysql_like_quote($filter['keywords']) . "%' " : '';
    // $sql = "SELECT count(*) FROM " .$GLOBALS['ecs']->table('shop_grade'). " WHERE user_id > 0 $where";
    $sql = "SELECT count(*) FROM " . $GLOBALS['ecs']->table('shop_grade') . " s" . " LEFT JOIN " . $GLOBALS['ecs']->table('order_info') . " o" . " ON o.order_id = s.order_id" . " WHERE s.send > 0 AND o.supplier_id ='{$supplier_id}'  {$where}";
    $filter['record_count'] = $GLOBALS['db']->getOne($sql);
    /* 分页大小 */
    $filter = page_and_size($filter);
    /* 获取评论数据 */
    $arr = array();
    // $sql  = "SELECT * FROM " .$GLOBALS['ecs']->table('shop_grade'). " WHERE user_id > 0  AND send >0$where " .
    // " ORDER BY $filter[sort_by] $filter[sort_order] ".
    // " LIMIT ". $filter['start'] .", $filter[page_size]";
    $sql = "SELECT * FROM " . $GLOBALS['ecs']->table('shop_grade') . " s " . " LEFT JOIN " . $GLOBALS['ecs']->table('order_info') . " o " . " ON o.order_id = s.order_id " . " WHERE  o.supplier_id ='{$supplier_id}' AND send >0 {$where}" . " ORDER BY {$filter['sort_by']} {$filter['sort_order']} " . " LIMIT " . $filter['start'] . ", {$filter['page_size']}";
    $res = $GLOBALS['db']->query($sql);
    while ($row = $GLOBALS['db']->fetchRow($res)) {
        $u_name = $row['user_name'];
        $o_id = $row['order_id'];
        $row['add_time'] = local_date($GLOBALS['_CFG']['time_format'], $row['add_time']);
        $sql = "SELECT AVG(comment_rank) FROM " . $GLOBALS['ecs']->table('comment') . " c" . " LEFT JOIN " . $GLOBALS['ecs']->table('order_goods') . " o" . " ON o.goods_id = c.id_value" . " WHERE  c.order_id = '{$o_id}' AND c.order_id = o.order_id";
        $comment_rank = $GLOBALS['db']->getOne($sql);
        $row['comment_rank'] = round($comment_rank, 1);
        $row['all_avg'] = round(($row['server'] + $row['send'] + $row['shipping'] + $row['comment_rank']) / 4, 1);
        $arr[] = $row;
    }
    $filter['keywords'] = stripslashes($filter['keywords']);
    $arr = array('item' => $arr, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
    return $arr;
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:42,代码来源:order_comment.php

示例14: intval

    //-- 删除收货人信息
    /*------------------------------------------------------ */
    include_once 'includes/lib_transaction.php';
    $consignee_id = intval($_GET['id']);
    if (drop_consignee($consignee_id)) {
        ecs_header("Location: buy.php?act=checkout\n");
        exit;
    }
    //	else
    //	{
    //		show_message($_LANG['not_fount_consignee']);
    //	}
} elseif ($act == 'add_to_cart') {
    include_once 'includes/cls_json.php';
    $_POST['goods'] = strip_tags(urldecode($_POST['goods']));
    $_POST['goods'] = json_str_iconv($_POST['goods']);
    if (!empty($_REQUEST['goods_id']) && empty($_POST['goods'])) {
        if (!is_numeric($_REQUEST['goods_id']) || intval($_REQUEST['goods_id']) <= 0) {
            ecs_header("Location:./\n");
        }
        $goods_id = intval($_REQUEST['goods_id']);
        exit;
    }
    $result = array('error' => 0, 'message' => '', 'content' => '', 'goods_id' => '');
    $json = new JSON();
    if (empty($_POST['goods'])) {
        $result['error'] = 1;
        die($json->encode($result));
    }
    $goods = $json->decode($_POST['goods']);
    /* 检查:如果商品有规格,而post的数据没有规格,把商品的规格属性通过JSON传到前台 */
开发者ID:nanhuacrab,项目名称:ecshop,代码行数:31,代码来源:buy_bak.php

示例15: order_list

/**
 *  返回用户订单列表数据
 *
 * @access  public
 * @param
 *
 * @return void
 */
function order_list()
{
    global $start_date, $end_date;
    $result = get_filter();
    if ($result === false) {
        /* 过滤条件 */
        $filter['keywords'] = empty($_REQUEST['keywords']) ? '' : trim($_REQUEST['keywords']);
        if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
            $filter['keywords'] = json_str_iconv($filter['keywords']);
        }
        $filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'order_id' : trim($_REQUEST['sort_by']);
        $filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);
        $filter['start_date'] = local_date('Y-m-d', $start_date);
        $filter['end_date'] = local_date('Y-m-d', $end_date);
        $ex_where = ' WHERE 1 ';
        if ($filter['keywords']) {
            $ex_where .= " AND user_name LIKE '%" . mysqli_real_escape_string($GLOBALS['db']->link_id, $filter['keywords']) . "%'";
        }
        $ex_where .= " AND o.user_id = u.user_id AND (o.surplus != 0 OR integral_money != 0) AND `add_time` >= " . $start_date . " AND `add_time` < " . ($end_date + 86400);
        $filter['record_count'] = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('order_info') . " AS o, " . $GLOBALS['ecs']->table('users') . " AS u " . $ex_where);
        /* 分页大小 */
        $filter = page_and_size($filter);
        $sql = "SELECT o.order_id, o.order_sn, u.user_name, o.surplus, o.integral_money, o.add_time FROM " . $GLOBALS['ecs']->table('order_info') . " AS o," . $GLOBALS['ecs']->table('users') . " AS u " . $ex_where . " ORDER by " . $filter['sort_by'] . ' ' . $filter['sort_order'] . " LIMIT " . $filter['start'] . ',' . $filter['page_size'];
        $filter['keywords'] = stripslashes($filter['keywords']);
        set_filter($filter, $sql);
    } else {
        $sql = $result['sql'];
        $filter = $result['filter'];
    }
    $order_list = $GLOBALS['db']->getAll($sql);
    $count = count($order_list);
    for ($i = 0; $i < $count; $i++) {
        $order_list[$i]['add_time'] = local_date($GLOBALS['_CFG']['date_format'], $order_list[$i]['add_time']);
    }
    $arr = array('order_list' => $order_list, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
    return $arr;
}
开发者ID:run100,项目名称:ecshop,代码行数:45,代码来源:user_account_manage.php


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