Example #1
0
function action_query()
{
    $user = $GLOBALS['user'];
    $_CFG = $GLOBALS['_CFG'];
    $_LANG = $GLOBALS['_LANG'];
    $smarty = $GLOBALS['smarty'];
    $db = $GLOBALS['db'];
    $ecs = $GLOBALS['ecs'];
    $user_id = $_SESSION['user_id'];
    $list = pre_sale_list();
    $smarty->assign('pre_sale_list', $list['item']);
    $smarty->assign('filter', $list['filter']);
    $smarty->assign('record_count', $list['record_count']);
    $smarty->assign('page_count', $list['page_count']);
    $sort_flag = sort_flag($list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('pre_sale_list.htm'), '', array('filter' => $list['filter'], 'page_count' => $list['page_count']));
}
Example #2
0
/**
 * 客服列表
 */
function action_list()
{
    $user = $GLOBALS['user'];
    $_CFG = $GLOBALS['_CFG'];
    $_LANG = $GLOBALS['_LANG'];
    $smarty = $GLOBALS['smarty'];
    $db = $GLOBALS['db'];
    $ecs = $GLOBALS['ecs'];
    $user_id = $_SESSION['user_id'];
    /* 模板赋值 */
    $smarty->assign('full_page', 1);
    $smarty->assign('ur_here', $_LANG['customer_list']);
    $smarty->assign('action_link', array('href' => 'customer.php?act=add', 'text' => $_LANG['add_customer']));
    $result = customer_list();
    $smarty->assign('customer_list', $result['item']);
    $smarty->assign('filter', $result['filter']);
    $smarty->assign('record_count', $result['record_count']);
    $smarty->assign('page_count', $result['page_count']);
    $sort_flag = sort_flag($result['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    /* 显示客服列表页面 */
    assign_query_info();
    $smarty->display('customer_list.htm');
}
Example #3
0
    $smarty->assign('page_count', $list['page_count']);
    $sort_flag = sort_flag($list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    assign_query_info();
    $smarty->display('booking_list.htm');
}
/*------------------------------------------------------ */
//-- 翻页、排序
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'query') {
    $list = get_bookinglist();
    $smarty->assign('booking_list', $list['item']);
    $smarty->assign('filter', $list['filter']);
    $smarty->assign('record_count', $list['record_count']);
    $smarty->assign('page_count', $list['page_count']);
    $sort_flag = sort_flag($list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('booking_list.htm'), '', array('filter' => $list['filter'], 'page_count' => $list['page_count']));
}
/*------------------------------------------------------ */
//-- 删除缺货登记
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'remove') {
    check_authz_json('booking');
    $id = intval($_GET['id']);
    $db->query("DELETE FROM " . $ecs->table('booking_goods') . " WHERE rec_id='{$id}'");
    $url = 'goods_booking.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
}
/*------------------------------------------------------ */
Example #4
0
    $smarty->assign('ur_here', $_LANG['order_by_surplus']);
    $smarty->assign('filter', $order_list['filter']);
    $smarty->assign('record_count', $order_list['record_count']);
    $smarty->assign('page_count', $order_list['page_count']);
    $smarty->assign('full_page', 1);
    $smarty->assign('action_link', array('text' => $_LANG['user_account_manage'], 'href' => 'user_account_manage.php?act=list&start_date=' . local_date('Y-m-d', $start_date) . '&end_date=' . local_date('Y-m-d', $end_date)));
    /* 显示页面 */
    assign_query_info();
    $smarty->display('order_surplus_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $order_list = order_list();
    $smarty->assign('order_list', $order_list['order_list']);
    $smarty->assign('filter', $order_list['filter']);
    $smarty->assign('record_count', $order_list['record_count']);
    $smarty->assign('page_count', $order_list['page_count']);
    $sort_flag = sort_flag($order_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('order_surplus_list.htm'), '', array('filter' => $order_list['filter'], 'page_count' => $order_list['page_count']));
}
/**
* 获得账户变动金额
* @param   string  $type   0,充值 1,提现
* @return  array
*/
function get_total_amount($start_date, $end_date, $type = 0)
{
    $sql = " SELECT IFNULL(SUM(amount), 0) AS total_amount FROM " . $GLOBALS['ecs']->table('user_account') . " AS a, " . $GLOBALS['ecs']->table('users') . " AS u " . " WHERE process_type = {$type} AND is_paid = 1 AND a.user_id = u.user_id AND paid_time >= '{$start_date}' AND paid_time < '" . ($end_date + 86400) . "'";
    $amount = $GLOBALS['db']->getone($sql);
    $amount = $type ? price_format(abs($amount)) : price_format($amount);
    return $amount;
}
Example #5
0
    $smarty->assign('article_list', $article_list['arr']);
    $smarty->assign('filter', $article_list['filter']);
    $smarty->assign('record_count', $article_list['record_count']);
    $smarty->assign('page_count', $article_list['page_count']);
    $sort_flag = sort_flag($article_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    assign_query_info();
    $smarty->display('article_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    check_authz_json('article_manage');
    $article_list = get_articleslist();
    $smarty->assign('article_list', $article_list['arr']);
    $smarty->assign('filter', $article_list['filter']);
    $smarty->assign('record_count', $article_list['record_count']);
    $smarty->assign('page_count', $article_list['page_count']);
    $sort_flag = sort_flag($article_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('article_list.htm'), '', array('filter' => $article_list['filter'], 'page_count' => $article_list['page_count']));
}
/*------------------------------------------------------ */
//-- 添加文章
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'add') {
    /* 权限判断 */
    admin_priv('article_manage');
    /* 创建 html editor */
    create_html_editor('FCKeditor1');
    /*初始化*/
    $article = array();
    $article['is_open'] = 1;
    /* 取得分类、品牌 */
    $smarty->assign('msg_list', $msg_list['msg_list']);
    $smarty->assign('filter', $msg_list['filter']);
    $smarty->assign('record_count', $msg_list['record_count']);
    $smarty->assign('page_count', $msg_list['page_count']);
    $smarty->assign('full_page', 1);
    $smarty->assign('sort_msg_id', '<img src="images/sort_desc.gif">');
    $smarty->assign('ur_here', $_LANG['08_unreply_msg']);
    $smarty->assign('full_page', 1);
    $smarty->display('msg_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $msg_list = msg_list();
    $smarty->assign('msg_list', $msg_list['msg_list']);
    $smarty->assign('filter', $msg_list['filter']);
    $smarty->assign('record_count', $msg_list['record_count']);
    $smarty->assign('page_count', $msg_list['page_count']);
    $sort_flag = sort_flag($msg_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('msg_list.htm'), '', array('filter' => $msg_list['filter'], 'page_count' => $msg_list['page_count']));
} elseif ($_REQUEST['act'] == 'remove') {
    $msg_id = intval($_REQUEST['id']);
    /* 检查权限 */
    check_authz_json('feedback_priv');
    $msg_title = $exc->get_name($msg_id);
    $img = $exc->get_name($msg_id, 'message_img');
    if ($exc->drop($msg_id)) {
        /* 删除图片 */
        if (!empty($img)) {
            @unlink(ROOT_PATH . DATA_DIR . '/feedbackimg/' . $img);
        }
        $sql = "DELETE FROM " . $ecs->table('feedback') . " WHERE parent_id = '{$msg_id}' LIMIT 1";
        $db->query($sql, 'SILENT');
Example #7
0
    $smarty->assign('inout_list', $inout_list['arr']);
    $smarty->assign('filter', $inout_list['filter']);
    $smarty->assign('record_count', $inout_list['record_count']);
    $smarty->assign('page_count', $inout_list['page_count']);
    $sort_flag = sort_flag($inout_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    assign_query_info();
    $smarty->display('store_inout_in_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    check_authz_json('inout_in_manage');
    $inout_list = get_inoutlist();
    $smarty->assign('inout_list', $inout_list['arr']);
    $smarty->assign('filter', $inout_list['filter']);
    $smarty->assign('record_count', $inout_list['record_count']);
    $smarty->assign('page_count', $inout_list['page_count']);
    $sort_flag = sort_flag($inout_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('store_inout_in_list.htm'), '', array('filter' => $inout_list['filter'], 'page_count' => $inout_list['page_count']));
}
/*------------------------------------------------------ */
//-- 添加入库单
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'add') {
    /* 权限判断 */
    admin_priv('inout_in_manage');
    /*初始化*/
    $inout = array();
    $inout['store_id'] = $_REQUEST['store_id'] ? intval($_REQUEST['store_id']) : 0;
    if ($inout['store_id']) {
        $inout['sub_id_list'] = $db->getAll("select store_id, store_name from " . $ecs->table('store_main') . " where parent_id='{$inout['store_id']}' and store_type_id=0 ");
    }
Example #8
0
    $smarty->assign('class_list', $class_list);
    $smarty->assign('grade_list', $grade_list);
    $smarty->assign('filter', $classAdmin_list['filter']);
    $smarty->assign('record_count', $classAdmin_list['record_count']);
    $smarty->assign('page_count', $classAdmin_list['page_count']);
    $smarty->assign('full_page', 1);
    $smarty->assign('sort_classAdmin_id', '<img src="images/sort_desc.gif">');
    assign_query_info();
    $smarty->display('classAdmin_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $classAdmin_list = classAdmin_list($table);
    $smarty->assign('classAdmin_list', $classAdmin_list['classAdmin_list']);
    $smarty->assign('filter', $classAdmin_list['filter']);
    $smarty->assign('record_count', $classAdmin_list['record_count']);
    $smarty->assign('page_count', $classAdmin_list['page_count']);
    $sort_flag = sort_flag($classAdmin_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('classAdmin_list.htm'), '', array('filter' => $classAdmin_list['filter'], 'page_count' => $classAdmin_list['page_count']));
} elseif ($_REQUEST['act'] == 'add') {
    /* 检查权限 */
    admin_priv('classAdmin_manage');
    $smarty->assign('ur_here', "添加班级管理员");
    $smarty->assign('action_link', array('text' => "班级管理员列表", 'href' => 'classAdmin.php?act=list'));
    $smarty->assign('form_action', 'insert');
    $class_list = class_list();
    $smarty->assign('class_list', $class_list);
    assign_query_info();
    $smarty->display('classAdmin_info.htm');
} elseif ($_REQUEST['act'] == 'insert') {
    /* 检查权限 */
    admin_priv('classAdmin_manage');
    $smarty->assign('filter', $agency_list['filter']);
    $smarty->assign('record_count', $agency_list['record_count']);
    $smarty->assign('page_count', $agency_list['page_count']);
    /* 排序标记 */
    $sort_flag = sort_flag($agency_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    assign_query_info();
    $smarty->display('agency_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $agency_list = get_agencylist();
    $smarty->assign('agency_list', $agency_list['agency']);
    $smarty->assign('filter', $agency_list['filter']);
    $smarty->assign('record_count', $agency_list['record_count']);
    $smarty->assign('page_count', $agency_list['page_count']);
    /* 排序标记 */
    $sort_flag = sort_flag($agency_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('agency_list.htm'), '', array('filter' => $agency_list['filter'], 'page_count' => $agency_list['page_count']));
} elseif ($_REQUEST['act'] == 'edit_agency_name') {
    check_authz_json('agency_manage');
    $id = intval($_POST['id']);
    $name = json_str_iconv(trim($_POST['val']));
    /* 检查名称是否重复 */
    if ($exc->num("agency_name", $name, $id) != 0) {
        make_json_error(sprintf($_LANG['agency_name_exist'], $name));
    } else {
        if ($exc->edit("agency_name = '{$name}'", $id)) {
            admin_log($name, 'edit', 'agency');
            clear_cache_files();
            make_json_result(stripslashes($name));
        } else {
Example #10
0
    }
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('ad_manage');
    $id = intval($_GET['id']);
    $exc->drop($id);
    admin_log('', 'remove', 'ads_position');
    $url = 'new_position.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
} elseif ($_REQUEST['act'] == 'query') {
    $position_list = get_position();
    $smarty->assign('position_list', $position_list['ads']);
    $smarty->assign('filter', $position_list['filter']);
    $smarty->assign('record_count', $position_list['record_count']);
    $smarty->assign('page_count', $position_list['page_count']);
    $sort_flag = sort_flag($position_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('new_position.htm'), '', array('filter' => $position_list['filter'], 'page_count' => $position_list['page_count']));
}
/* 获取广告数据列表 */
function get_position()
{
    /* 过滤查询 */
    $position_name = !empty($_REQUEST['position_name']) ? trim($_REQUEST['position_name']) : '';
    $filter = array();
    $filter['position_name'] = $position_name;
    $filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'position_name' : trim($_REQUEST['sort_by']);
    $filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);
    $where = 'WHERE 1 ';
    if ($position_name) {
        $where .= ' AND position_name like \'%' . $position_name . '%\'';
Example #11
0
    $smarty->assign('stock_control_log', $stock_control_log['arr']);
    $smarty->assign('filter', $stock_control_log['filter']);
    $smarty->assign('record_count', $stock_control_log['record_count']);
    $smarty->assign('page_count', $stock_control_log['page_count']);
    $sort_flag = sort_flag($stock_control_log['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    assign_query_info();
    $smarty->display('goods_stock_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    check_authz_json('goods_stock_list');
    $stock_control_log = get_stock_control_log();
    $smarty->assign('stock_control_log', $stock_control_log['arr']);
    $smarty->assign('filter', $stock_control_log['filter']);
    $smarty->assign('record_count', $stock_control_log['record_count']);
    $smarty->assign('page_count', $stock_control_log['page_count']);
    $sort_flag = sort_flag($stock_control_log['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('goods_stock_list.htm'), '', array('filter' => $stock_control_log['filter'], 'page_count' => $stock_control_log['page_count']));
} elseif ($_REQUEST['act'] == 'remove') {
    $id = intval($_REQUEST['id']);
    /* 检查权限 */
    //check_authz_json('goods_stock_list');
    /* 删除商品 */
    if ($exc->drop($id)) {
        clear_cache_files();
        $url = 'goods_stock_list.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
        ecs_header("Location: {$url}\n");
        exit;
    }
} elseif ($_REQUEST['act'] == 'edit_costing_price') {
    check_authz_json('goods_stock_list');
Example #12
0
    $smarty->assign('crons_enable', $crons_enable);
    $smarty->assign('full_page', 1);
    $smarty->assign('ur_here', $_LANG['article_auto']);
    $smarty->assign('goodsdb', $goodsdb['goodsdb']);
    $smarty->assign('filter', $goodsdb['filter']);
    $smarty->assign('record_count', $goodsdb['record_count']);
    $smarty->assign('page_count', $goodsdb['page_count']);
    assign_query_info();
    $smarty->display('goods_auto.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $goodsdb = get_auto_goods();
    $smarty->assign('goodsdb', $goodsdb['goodsdb']);
    $smarty->assign('filter', $goodsdb['filter']);
    $smarty->assign('record_count', $goodsdb['record_count']);
    $smarty->assign('page_count', $goodsdb['page_count']);
    $sort_flag = sort_flag($goodsdb['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('goods_auto.htm'), '', array('filter' => $goodsdb['filter'], 'page_count' => $goodsdb['page_count']));
} elseif ($_REQUEST['act'] == 'del') {
    $goods_id = (int) $_REQUEST['goods_id'];
    $sql = "DELETE FROM " . $ecs->table('auto_manage') . " WHERE item_id = '{$goods_id}' AND type = 'article'";
    $db->query($sql);
    $links[] = array('text' => $_LANG['article_auto'], 'href' => 'article_auto.php?act=list');
    sys_msg($_LANG['edit_ok'], 0, $links);
} elseif ($_REQUEST['act'] == 'edit_starttime') {
    check_authz_json('goods_auto');
    if (!preg_match('/^\\d{4}-\\d{2}-\\d{2}$/', trim($_POST['val']))) {
        make_json_error('');
    }
    $id = intval($_POST['id']);
    $time = local_strtotime(trim($_POST['val']));
Example #13
0
     }
     if (!empty($_REQUEST['status'])) {
         $cond .= " AND status = " . intval($_REQUEST['status']);
     }
     $sort['sort_by'] = empty($_REQUEST['sort_by']) ? 'dateline' : trim($_REQUEST['sort_by']);
     $sort['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);
     $SQL = "SELECT * FROM " . $ecs->table('verifycode') . " WHERE 1 = 1 {$cond}";
     $page['record_count'] = $db->getOne($SQL);
     $page = page_and_size($page);
     $SQL = "SELECT * FROM " . $ecs->table('verifycode') . " WHERE 1 = 1 {$cond} ORDER BY {$sort['sort_by']} {$sort['sort_order']} LIMIT {$page['start']}, {$page['page_size']}";
     $rs = $db->getAll($SQL);
     $smarty->assign('list', $rs);
     $smarty->assign('filter', $_REQUEST);
     $smarty->assign('record_count', $page['record_count']);
     $smarty->assign('page_count', $page['page_count']);
     $sort_flag = sort_flag($sort);
     $smarty->assign($sort_flag['tag'], $sort_flag['img']);
     if ($_REQUEST['is_ajax'] == 1) {
         make_json_result($smarty->fetch('verifycode.htm'), '', array('filter' => $_REQUEST, 'page_count' => $page['page_count']));
     } else {
         $smarty->assign('full_page', 1);
         $smarty->display('verifycode.htm');
     }
     break;
     /* 发送短信 */
 /* 发送短信 */
 case 'send_sms':
     $send_num = isset($_POST['send_num']) ? $_POST['send_num'] : '';
     if (isset($send_num)) {
         $phone = $send_num . ',';
     }
Example #14
0
    $smarty->assign('action_link', array('text' => '添加新版本号', 'href' => 'app_version.php?act=add'));
    $smarty->assign('full_page', 1);
    $request_log_list = request_log();
    $smarty->assign('request_log_list', $request_log_list['request_log_list']);
    $smarty->assign('filter', $request_log_list['filter']);
    $smarty->assign('record_count', $request_log_list['record_count']);
    $smarty->assign('page_count', $request_log_list['page_count']);
    assign_query_info();
    $smarty->display('request_log.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $request_log_list = request_log();
    $smarty->assign('request_log_list', $request_log_list['request_log_list']);
    $smarty->assign('filter', $request_log_list['filter']);
    $smarty->assign('record_count', $request_log_list['record_count']);
    $smarty->assign('page_count', $request_log_list['page_count']);
    $sort_flag = sort_flag($request_log_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('request_log.htm'), '', array('filter' => $request_log_list['filter'], 'page_count' => $request_log_list['page_count']));
}
/* 获取版本数据列表 */
function request_log()
{
    $filter = array();
    /* 获得总记录数据 */
    $sql = 'SELECT COUNT(*) FROM ' . $GLOBALS['ecs']->table('connector_app');
    $filter['record_count'] = $GLOBALS['db']->getOne($sql);
    $filter = page_and_size($filter);
    /* 获得广告数据 */
    $arr = array();
    $sql = 'SELECT v.id,v.imei,v.phone,v.sim_sn,v.imsi,v.os,v.system_version,v.app_version,v.user_info,v.time,' . 'v.insert_time,u.user_name FROM ' . $GLOBALS['ecs']->table('connector_app') . ' as v left join ' . $GLOBALS['ecs']->table('users') . ' as u on v.user_id = u.user_id ORDER BY v.id DESC';
    $res = $GLOBALS['db']->selectLimit($sql, $filter['page_size'], $filter['start']);
Example #15
0
    $attribute_count = count($_attribute);
    $smarty->assign('attribute_count', $attribute_count);
    $smarty->assign('attribute', $_attribute);
    $smarty->assign('attribute_count_3', $attribute_count + 3);
    $smarty->assign('product_sn', $goods['goods_sn'] . '_');
    $smarty->assign('product_number', $_CFG['default_storage']);
    /* 取商品的货品 */
    $product = product_list($goods_id, '');
    $smarty->assign('ur_here', $_LANG['18_product_list']);
    $smarty->assign('action_link', array('href' => 'goods.php?act=list', 'text' => $_LANG['01_goods_list']));
    $smarty->assign('product_list', $product['product']);
    $smarty->assign('use_storage', empty($_CFG['use_storage']) ? 0 : 1);
    $smarty->assign('goods_id', $goods_id);
    $smarty->assign('filter', $product['filter']);
    /* 排序标记 */
    $sort_flag = sort_flag($product['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('product_info.htm'), '', array('filter' => $product['filter'], 'page_count' => $product['page_count']));
} elseif ($_REQUEST['act'] == 'product_remove') {
    /* 检查权限 */
    check_authz_json('remove_back');
    /* 是否存在商品id */
    if (empty($_REQUEST['id'])) {
        make_json_error($_LANG['product_id_null']);
    } else {
        $product_id = intval($_REQUEST['id']);
    }
    /* 货品库存 */
    $product = get_product_info($product_id, 'product_number, goods_id');
    /* 删除货品 */
    $sql = "DELETE FROM " . $ecs->table('products') . " WHERE product_id = '{$product_id}'";
Example #16
0
    $smarty->assign('action_link', array('text' => $_LANG['pack_add'], 'href' => 'pack.php?act=add'));
    $smarty->assign('full_page', 1);
    $packs_list = packs_list();
    $smarty->assign('packs_list', $packs_list['packs_list']);
    $smarty->assign('filter', $packs_list['filter']);
    $smarty->assign('record_count', $packs_list['record_count']);
    $smarty->assign('page_count', $packs_list['page_count']);
    assign_query_info();
    $smarty->display('pack_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $packs_list = packs_list();
    $smarty->assign('packs_list', $packs_list['packs_list']);
    $smarty->assign('filter', $packs_list['filter']);
    $smarty->assign('record_count', $packs_list['record_count']);
    $smarty->assign('page_count', $packs_list['page_count']);
    $sort_flag = sort_flag($packs_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('pack_list.htm'), '', array('filter' => $packs_list['filter'], 'page_count' => $packs_list['page_count']));
}
/*------------------------------------------------------ */
//-- 添加新包装
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'add') {
    /* 权限判断 */
    admin_priv('pack');
    $pack['pack_fee'] = 0;
    $pack['free_money'] = 0;
    $smarty->assign('pack', $pack);
    $smarty->assign('ur_here', $_LANG['pack_add']);
    $smarty->assign('form_action', 'insert');
    $smarty->assign('action_link', array('text' => $_LANG['06_pack_list'], 'href' => 'pack.php?act=list'));
Example #17
0
    $special_ranks = get_rank_list();
    $send_rank[SEND_LIST . '_0'] = $_LANG['email_user'];
    $send_rank[SEND_USER . '_0'] = $_LANG['user_list'];
    foreach ($special_ranks as $rank_key => $rank_value) {
        $send_rank[SEND_RANK . '_' . $rank_key] = $rank_value;
    }
    $smarty->assign('send_rank', $send_rank);
    assign_query_info();
    $smarty->display('magazine_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $magazinedb = get_magazine();
    $smarty->assign('magazinedb', $magazinedb['magazinedb']);
    $smarty->assign('filter', $magazinedb['filter']);
    $smarty->assign('record_count', $magazinedb['record_count']);
    $smarty->assign('page_count', $magazinedb['page_count']);
    $sort_flag = sort_flag($magazinedb['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('magazine_list.htm'), '', array('filter' => $magazinedb['filter'], 'page_count' => $magazinedb['page_count']));
} elseif ($_REQUEST['act'] == 'add') {
    if (empty($_POST['step'])) {
        include_once ROOT_PATH . 'includes/fckeditor/fckeditor.php';
        // 包含 html editor 类文件
        $smarty->assign('action_link', array('text' => $_LANG['go_list'], 'href' => 'magazine_list.php?act=list'));
        $smarty->assign(array('ur_here' => $_LANG['magazine_list'], 'act' => 'add'));
        create_html_editor('magazine_content');
        assign_query_info();
        $smarty->display('magazine_list_add.htm');
    } elseif ($_POST['step'] == 2) {
        $magazine_name = trim($_POST['magazine_name']);
        $magazine_content = trim($_POST['magazine_content']);
        $magazine_content = str_replace('src=\\"', 'src=\\"http://' . $_SERVER['HTTP_HOST'], $magazine_content);
Example #18
0
    $smarty->assign('ur_here', $_LANG['07_card_list']);
    $smarty->assign('action_link', array('text' => $_LANG['card_add'], 'href' => 'card.php?act=add'));
    $smarty->assign('full_page', 1);
    $cards_list = cards_list();
    $smarty->assign('card_list', $cards_list['card_list']);
    $smarty->assign('filter', $cards_list['filter']);
    $smarty->assign('record_count', $cards_list['record_count']);
    $smarty->assign('page_count', $cards_list['page_count']);
    $smarty->display('card_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $cards_list = cards_list();
    $smarty->assign('card_list', $cards_list['card_list']);
    $smarty->assign('filter', $cards_list['filter']);
    $smarty->assign('record_count', $cards_list['record_count']);
    $smarty->assign('page_count', $cards_list['page_count']);
    $sort_flag = sort_flag($cards_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('card_list.htm'), '', array('filter' => $cards_list['filter'], 'page_count' => $cards_list['page_count']));
} elseif ($_REQUEST['act'] == 'remove') {
    /* 检查权限 */
    check_authz_json('card_manage');
    $card_id = empty($_REQUEST['id']) ? 0 : intval($_REQUEST['id']);
    $name = $exc->get_name($card_id);
    $img = $exc->get_name($card_id, 'card_img');
    if ($exc->drop($card_id)) {
        /* 删除图片 */
        if (!empty($img)) {
            @unlink('../' . DATA_DIR . '/cardimg/' . $img);
        }
        admin_log(addslashes($name), 'remove', 'card');
        $url = 'card.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
Example #19
0
File: ads.php Project: Ryan007/mybb
    $ads_list = get_adslist();
    $smarty->assign('ads_list', $ads_list['ads']);
    $smarty->assign('filter', $ads_list['filter']);
    $smarty->assign('record_count', $ads_list['record_count']);
    $smarty->assign('page_count', $ads_list['page_count']);
    $sort_flag = sort_flag($ads_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    assign_query_info();
    $smarty->display('ads_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $ads_list = get_adslist();
    $smarty->assign('ads_list', $ads_list['ads']);
    $smarty->assign('filter', $ads_list['filter']);
    $smarty->assign('record_count', $ads_list['record_count']);
    $smarty->assign('page_count', $ads_list['page_count']);
    $sort_flag = sort_flag($ads_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('ads_list.htm'), '', array('filter' => $ads_list['filter'], 'page_count' => $ads_list['page_count']));
} elseif ($_REQUEST['act'] == 'add') {
    admin_priv('ad_manage');
    $ad_link = empty($_GET['ad_link']) ? '' : trim($_GET['ad_link']);
    $ad_name = empty($_GET['ad_name']) ? '' : trim($_GET['ad_name']);
    $start_time = local_date('Y-m-d');
    $end_time = local_date('Y-m-d', gmtime() + 3600 * 24 * 30);
    // 默认结束时间为1个月以后
    $smarty->assign('ads', array('ad_link' => $ad_link, 'ad_name' => $ad_name, 'start_time' => $start_time, 'end_time' => $end_time, 'enabled' => 1));
    $smarty->assign('ur_here', $_LANG['ads_add']);
    $smarty->assign('action_link', array('href' => 'ads.php?act=list', 'text' => $_LANG['ad_list']));
    $smarty->assign('position_list', get_position_list());
    $smarty->assign('form_act', 'insert');
    $smarty->assign('action', 'add');
Example #20
0
    $sort_flag = sort_flag($bid_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    /* 赋值 */
    $smarty->assign('info', get_snatch_info($id));
    $smarty->assign('full_page', 1);
    $smarty->assign('result', get_snatch_result($id));
    $smarty->assign('ur_here', $_LANG['view_detail']);
    $smarty->assign('action_link', array('text' => $_LANG['02_snatch_list'], 'href' => 'snatch.php?act=list'));
    $smarty->display('snatch_view.htm');
} elseif ($_REQUEST['act'] == 'query_bid') {
    $bid_list = get_snatch_detail();
    $smarty->assign('bid_list', $bid_list['bid']);
    $smarty->assign('filter', $bid_list['filter']);
    $smarty->assign('record_count', $bid_list['record_count']);
    $smarty->assign('page_count', $bid_list['page_count']);
    $sort_flag = sort_flag($bid_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('snatch_view.htm'), '', array('filter' => $bid_list['filter'], 'page_count' => $bid_list['page_count']));
} elseif ($_REQUEST['act'] == 'search_goods') {
    include_once ROOT_PATH . 'includes/cls_json.php';
    $json = new JSON();
    $filters = $json->decode($_GET['JSON']);
    $arr['goods'] = get_goods_list($filters);
    if (!empty($arr['goods'][0]['goods_id'])) {
        $arr['products'] = get_good_products($arr['goods'][0]['goods_id']);
    }
    make_json_result($arr);
} elseif ($_REQUEST['act'] == 'search_products') {
    include_once ROOT_PATH . 'includes/cls_json.php';
    $json = new JSON();
    $filters = $json->decode($_GET['JSON']);
Example #21
0
    $smarty->assign('filter', $logdb['filter']);
    $smarty->assign('record_count', $logdb['record_count']);
    $smarty->assign('page_count', $logdb['page_count']);
    if (!empty($_GET['auid'])) {
        $smarty->assign('action_link', array('text' => $_LANG['back_note'], 'href' => "users.php?act=edit&id={$_GET['auid']}"));
    }
    assign_query_info();
    $smarty->display('affiliate_ck_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $logdb = get_affiliate_ck();
    $smarty->assign('logdb', $logdb['logdb']);
    $smarty->assign('on', $separate_on);
    $smarty->assign('filter', $logdb['filter']);
    $smarty->assign('record_count', $logdb['record_count']);
    $smarty->assign('page_count', $logdb['page_count']);
    $sort_flag = sort_flag($logdb['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('affiliate_ck_list.htm'), '', array('filter' => $logdb['filter'], 'page_count' => $logdb['page_count']));
} elseif ($_REQUEST['act'] == 'del') {
    $oid = (int) $_REQUEST['oid'];
    $stat = $db->getOne("SELECT is_separate FROM " . $GLOBALS['ecs']->table('order_info') . " WHERE order_id = '{$oid}'");
    if (empty($stat)) {
        $sql = "UPDATE " . $GLOBALS['ecs']->table('order_info') . " SET is_separate = 2" . " WHERE order_id = '{$oid}'";
        $db->query($sql);
    }
    $links[] = array('text' => $_LANG['affiliate_ck'], 'href' => 'affiliate_ck.php?act=list');
    sys_msg($_LANG['edit_ok'], 0, $links);
} elseif ($_REQUEST['act'] == 'rollback') {
    $logid = (int) $_REQUEST['logid'];
    $stat = $db->getRow("SELECT * FROM " . $GLOBALS['ecs']->table('affiliate_log') . " WHERE log_id = '{$logid}'");
    if (!empty($stat)) {
Example #22
0
    $smarty->assign('package_list', $packages['packages']);
    $smarty->assign('filter', $packages['filter']);
    $smarty->assign('record_count', $packages['record_count']);
    $smarty->assign('page_count', $packages['page_count']);
    $sort_flag = sort_flag($packages['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    $smarty->assign('full_page', 1);
    assign_query_info();
    $smarty->display('package_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $packages = get_packagelist();
    $smarty->assign('package_list', $packages['packages']);
    $smarty->assign('filter', $packages['filter']);
    $smarty->assign('record_count', $packages['record_count']);
    $smarty->assign('page_count', $packages['page_count']);
    $sort_flag = sort_flag($packages['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('package_list.htm'), '', array('filter' => $packages['filter'], 'page_count' => $packages['page_count']));
} elseif ($_REQUEST['act'] == 'edit_package_name') {
    check_authz_json('package_manage');
    $id = intval($_POST['id']);
    $val = json_str_iconv(trim($_POST['val']));
    /* 检查活动重名 */
    $sql = "SELECT COUNT(*) " . " FROM " . $hhs->table('goods_activity') . " WHERE act_type='" . GAT_PACKAGE . "' AND act_name='{$val}' AND act_id <> '{$id}'";
    if ($db->getOne($sql)) {
        make_json_error(sprintf($_LANG['package_exist'], $val));
    }
    $exc->edit("act_name='{$val}'", $id);
    make_json_result(stripslashes($val));
} elseif ($_REQUEST['act'] == 'search_goods') {
    include_once ROOT_PATH . 'includes/cls_json.php';
Example #23
0
     $smarty->assign('back_list', $result['back']);
     $smarty->assign('filter', $result['filter']);
     $smarty->assign('record_count', $result['record_count']);
     $smarty->assign('page_count', $result['page_count']);
     $sort_flag = sort_flag($result['filter']);
     $smarty->assign($sort_flag['tag'], $sort_flag['img']);
     make_json_result($smarty->fetch('back_list.htm'), '', array('filter' => $result['filter'], 'page_count' => $result['page_count']));
 } elseif ($_REQUEST['act'] == 'complain_query') {
     /* 检查权限 */
     admin_priv('back_view');
     $result = complain_list();
     $smarty->assign('complain_list', $result['complain']);
     $smarty->assign('filter', $result['filter']);
     $smarty->assign('record_count', $result['record_count']);
     $smarty->assign('page_count', $result['page_count']);
     $sort_flag = sort_flag($result['filter']);
     $smarty->assign($sort_flag['tag'], $sort_flag['img']);
     make_json_result($smarty->fetch('user_complain.htm'), '', array('filter' => $result['filter'], 'page_count' => $result['page_count']));
 } elseif ($_REQUEST['act'] == 'complain_edit') {
     $type = !empty($_REQUEST['type']) ? $_REQUEST['type'] : 'update';
     $complain_id = !empty($_REQUEST['complain_id']) ? $_REQUEST['complain_id'] : '';
     $complain_reply_content = !empty($_REQUEST['complain_reply_content']) ? $_REQUEST['complain_reply_content'] : '';
     update_reply_content($complain_id, $complain_reply_content, $type);
     header("Location:order.php?act=user_complain");
     exit;
 } elseif ($_REQUEST['act'] == 'complain_info') {
     $complain_id = isset($_REQUEST['complain_id']) ? $_REQUEST['complain_id'] : '';
     if ($complain_id == '') {
         echo "出现错误,投诉号为空";
         exit;
     }
    $smarty->assign('action_link', array('text' => $_LANG['add_new'], 'href' => 'navigator.php?act=add'));
    $smarty->assign('full_page', 1);
    $navdb = get_nav();
    $smarty->assign('navdb', $navdb['navdb']);
    $smarty->assign('filter', $navdb['filter']);
    $smarty->assign('record_count', $navdb['record_count']);
    $smarty->assign('page_count', $navdb['page_count']);
    assign_query_info();
    $smarty->display('navigator.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $navdb = get_nav();
    $smarty->assign('navdb', $navdb['navdb']);
    $smarty->assign('filter', $navdb['filter']);
    $smarty->assign('record_count', $navdb['record_count']);
    $smarty->assign('page_count', $navdb['page_count']);
    $sort_flag = sort_flag($navdb['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('navigator.htm'), '', array('filter' => $navdb['filter'], 'page_count' => $navdb['page_count']));
} elseif ($_REQUEST['act'] == 'add') {
    if (empty($_REQUEST['step'])) {
        $rt = array('act' => 'add');
        $sysmain = get_sysnav();
        $smarty->assign('action_link', array('text' => $_LANG['go_list'], 'href' => 'navigator.php?act=list'));
        $smarty->assign('ur_here', $_LANG['navigator']);
        assign_query_info();
        $smarty->assign('sysmain', $sysmain);
        $smarty->assign('rt', $rt);
        $smarty->display('navigator_add.htm');
    } elseif ($_REQUEST['step'] == 2) {
        $item_name = $_REQUEST['item_name'];
        $item_url = $_REQUEST['item_url'];
Example #25
0
            $order_by = $k + 1;
            $data .= "{$order_by}\t{$row['goods_name']}\t{$row['goods_sn']}\t{$row['goods_num']}\t{$row['turnover']}\t{$row['wvera_price']}\n";
        }
        if (EC_CHARSET == 'utf-8') {
            echo ecs_iconv(EC_CHARSET, 'GB2312', $data);
        } else {
            echo $data;
        }
        exit;
    }
    $goods_order_data = get_sales_order();
    $smarty->assign('goods_order_data', $goods_order_data['sales_order_data']);
    $smarty->assign('filter', $goods_order_data['filter']);
    $smarty->assign('record_count', $goods_order_data['record_count']);
    $smarty->assign('page_count', $goods_order_data['page_count']);
    $sort_flag = sort_flag($goods_order_data['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('sale_order.htm'), '', array('filter' => $goods_order_data['filter'], 'page_count' => $goods_order_data['page_count']));
} else {
    /* 权限检查 */
    admin_priv('sale_order_stats');
    /* 时间参数 */
    if (!isset($_REQUEST['start_date'])) {
        $_REQUEST['start_date'] = local_strtotime('-1 months');
    }
    if (!isset($_REQUEST['end_date'])) {
        $_REQUEST['end_date'] = local_strtotime('+1 day');
    }
    $goods_order_data = get_sales_order();
    /* 赋值到模板 */
    $smarty->assign('ur_here', $_LANG['sell_stats']);
Example #26
0
    $user_list = user_list();
    $smarty->assign('user_list', $user_list['user_list']);
    $smarty->assign('filter', $user_list['filter']);
    $smarty->assign('record_count', $user_list['record_count']);
    $smarty->assign('page_count', $user_list['page_count']);
    $smarty->assign('full_page', 1);
    $smarty->assign('sort_user_id', '<img src="images/sort_desc.gif">');
    assign_query_info();
    $smarty->display('distributor_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $user_list = user_list();
    $smarty->assign('user_list', $user_list['user_list']);
    $smarty->assign('filter', $user_list['filter']);
    $smarty->assign('record_count', $user_list['record_count']);
    $smarty->assign('page_count', $user_list['page_count']);
    $sort_flag = sort_flag($user_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('distributor_list.htm'), '', array('filter' => $user_list['filter'], 'page_count' => $user_list['page_count']));
} elseif ($_REQUEST['act'] == 'edit') {
    $sql = "SELECT u.user_name, u.sex, u.birthday, u.pay_points, u.rank_points, u.user_rank , u.user_money, u.frozen_money, u.credit_line, u.parent_id, u2.user_name as parent_username, u.qq, u.msn, u.office_phone, u.home_phone, u.mobile_phone" . " FROM " . $ecs->table('users') . " u LEFT JOIN " . $ecs->table('users') . " u2 ON u.parent_id = u2.user_id WHERE u.user_id='{$_GET['id']}'";
    $row = $db->GetRow($sql);
    $row['user_name'] = addslashes($row['user_name']);
    $users =& init_users();
    $user = $users->get_user_info($row['user_name']);
    $sql = "SELECT u.user_id, u.sex, u.birthday, u.pay_points, u.rank_points, u.user_rank , u.user_money, u.frozen_money, u.credit_line, u.parent_id, u2.user_name as parent_username, u.qq, u.msn,\n    u.office_phone, u.home_phone, u.mobile_phone,u.real_name,u.card,u.face_card,u.back_card,u.country,u.province,u.city,u.district,u.address,u.status " . " FROM " . $ecs->table('users') . " u LEFT JOIN " . $ecs->table('users') . " u2 ON u.parent_id = u2.user_id WHERE u.user_id='{$_GET['id']}'";
    $row = $db->GetRow($sql);
    if ($row) {
        $user['user_id'] = $row['user_id'];
        $user['sex'] = $row['sex'];
        $user['birthday'] = date($row['birthday']);
        $user['pay_points'] = $row['pay_points'];
Example #27
0
    } else {
        edit_tag($tag_words, $id, $goods_id);
        /* 娓呴櫎缂撳瓨 */
        clear_cache_files();
        $link[0]['text'] = $_LANG['back_list'];
        $link[0]['href'] = 'tag_manage.php?act=list';
        sys_msg($_LANG['tag_edit_success'], 0, $link);
    }
} elseif ($_REQUEST['act'] == 'query') {
    check_authz_json('tag_manage');
    $tag_list = get_tag_list();
    $smarty->assign('tag_list', $tag_list['tags']);
    $smarty->assign('filter', $tag_list['filter']);
    $smarty->assign('record_count', $tag_list['record_count']);
    $smarty->assign('page_count', $tag_list['page_count']);
    $sort_flag = sort_flag($tag_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('tag_manage.htm'), '', array('filter' => $tag_list['filter'], 'page_count' => $tag_list['page_count']));
} elseif ($_REQUEST['act'] == 'search_goods') {
    check_authz_json('tag_manage');
    include_once ROOT_PATH . 'includes/cls_json.php';
    $json = new JSON();
    $filter = $json->decode($_GET['JSON']);
    $arr = get_goods_list($filter);
    if (empty($arr)) {
        $arr[0] = array('goods_id' => 0, 'goods_name' => '');
    }
    make_json_result($arr);
} elseif ($_REQUEST['act'] == 'batch_drop') {
    admin_priv('tag_manage');
    if (isset($_POST['checkboxes'])) {
Example #28
0
    $smarty->assign('goods_list', $goods_list['arr']);
    $smarty->assign('filter', $goods_list['filter']);
    $smarty->assign('record_count', $goods_list['record_count']);
    $smarty->assign('page_count', $goods_list['page_count']);
    $sort_flag = sort_flag($goods_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    assign_query_info();
    $smarty->display('exchange_goods_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    check_authz_json('exchange_goods');
    $goods_list = get_exchange_goodslist();
    $smarty->assign('goods_list', $goods_list['arr']);
    $smarty->assign('filter', $goods_list['filter']);
    $smarty->assign('record_count', $goods_list['record_count']);
    $smarty->assign('page_count', $goods_list['page_count']);
    $sort_flag = sort_flag($goods_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('exchange_goods_list.htm'), '', array('filter' => $goods_list['filter'], 'page_count' => $goods_list['page_count']));
}
/*------------------------------------------------------ */
//-- 添加商品
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'add') {
    /* 权限判断 */
    admin_priv('exchange_goods');
    /*初始化*/
    $goods = array();
    $goods['is_exchange'] = 1;
    $goods['is_hot'] = 0;
    $goods['option'] = '<option value="0">' . $_LANG['make_option'] . '</option>';
    $smarty->assign('goods', $goods);
Example #29
0
    if (!empty($_REQUEST['is_ajax'])) {
        $url = 'topic.php?act=query&' . str_replace('act=delete', '', $_SERVER['QUERY_STRING']);
        ecs_header("Location: {$url}\n");
        exit;
    }
    $links[] = array('href' => 'topic.php', 'text' => $_LANG['back_list']);
    sys_msg($_LANG['succed'], 0, $links);
} elseif ($_REQUEST['act'] == 'query') {
    $topic_list = get_topic_list();
    $smarty->assign('topic_list', $topic_list['item']);
    $smarty->assign('filter', $topic_list['filter']);
    $smarty->assign('record_count', $topic_list['record_count']);
    $smarty->assign('page_count', $topic_list['page_count']);
    $smarty->assign('use_storage', empty($_CFG['use_storage']) ? 0 : 1);
    /* 排序标记 */
    $sort_flag = sort_flag($topic_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    $tpl = 'topic_list.htm';
    make_json_result($smarty->fetch($tpl), '', array('filter' => $topic_list['filter'], 'page_count' => $topic_list['page_count']));
}
/**
 * 获取专题列表.
 */
function get_topic_list()
{
    $result = get_filter();
    if ($result === false) {
        /* 查询条件 */
        $filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'topic_id' : trim($_REQUEST['sort_by']);
        $filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);
        $sql = 'SELECT COUNT(*) FROM ' . $GLOBALS['ecs']->table('topic');
Example #30
0
        header("Content-Disposition: attachment; filename={$filename}.xls");
        $data = "{$_LANG['visit_buy']}\t\n";
        $data .= "{$_LANG['order_by']}\t{$_LANG['member_name']}\t{$_LANG['order_amount']}\t{$_LANG['buy_sum']}\t\n";
        foreach ($user_orderinfo['user_orderinfo'] as $k => $row) {
            $order_by = $k + 1;
            $data .= "{$order_by}\t{$row['user_name']}\t{$row['order_num']}\t{$row['turnover']}\n";
        }
        echo ecs_iconv(EC_CHARSET, 'GB2312', $data);
        exit;
    }
    $user_orderinfo = get_user_orderinfo();
    $smarty->assign('filter', $user_orderinfo['filter']);
    $smarty->assign('record_count', $user_orderinfo['record_count']);
    $smarty->assign('page_count', $user_orderinfo['page_count']);
    $smarty->assign('user_orderinfo', $user_orderinfo['user_orderinfo']);
    $sort_flag = sort_flag($user_orderinfo['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('users_order.htm'), '', array('filter' => $user_orderinfo['filter'], 'page_count' => $user_orderinfo['page_count']));
} else {
    /* 权限判断 */
    admin_priv('client_flow_stats');
    /* 时间参数 */
    if (!isset($_REQUEST['start_date'])) {
        $start_date = local_strtotime('-7 days');
    }
    if (!isset($_REQUEST['end_date'])) {
        $end_date = local_strtotime('today');
    }
    /* 取得会员排行数据 */
    $user_orderinfo = get_user_orderinfo();
    /* 赋值到模板 */