function _wap_display_page($page_name = 'index.htm')
{
    global $smarty;
    $full_page = empty($_REQUEST['is_ajax']) ? 1 : ($_REQUEST['is_ajax'] == 1 ? 0 : 1);
    $smarty->assign('full_page', $full_page);
    if ($full_page == 1) {
        $smarty->display($page_name);
    } else {
        $content = $smarty->fetch($page_name);
        make_json_result($content);
    }
    exit;
}
 /**
  * 模板安装
  */
 public function install()
 {
     $tpl_name = I('get.tpl_name');
     $tpl_fg = I('get.tpl_fg', 0);
     $data['value'] = $tpl_name;
     $condition['code'] = 'template';
     $this->model->table('touch_shop_config')->data($data)->where($condition)->update();
     $data['value'] = $tpl_fg;
     $condition['code'] = 'stylename';
     $this->model->table('touch_shop_config')->data($data)->where($condition)->update();
     clear_all_files();
     //清除模板编译文件
     make_json_result($this->read_style_and_tpl($tpl_name, $tpl_fg), L('install_template_success'));
 }
 public function delmember()
 {
     $user_id = $this->_get['id'];
     if (ADMINUSERID != 1) {
         make_json_error('对不起,您无权删除其他管理员');
     }
     if ($user_id == ADMINUSERID) {
         make_json_error('您不能删除自己');
     }
     if ($user_id) {
         mod_member::member_delete($user_id);
         $list = mod_member::member_list($start, $level, 20);
         pm_tpl::assign('admin_list', $list['data']);
         make_json_result(pm_tpl::fetch('member_list'));
     } else {
         make_json_error('删除失败');
     }
 }
Example #4
0
        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');
        $filter['record_count'] = $GLOBALS['db']->getOne($sql);
        /* 分页大小 */
        $filter = page_and_size($filter);
Example #5
0
}
if ($_REQUEST['act'] == 'list') {
    $smarty->assign('full_page', 1);
    $distrib_sort_list = get_distrib_sort();
    $smarty->assign('distrib_sort_list', $distrib_sort_list['arr']);
    $smarty->assign('filter', $distrib_sort_list['filter']);
    $smarty->assign('record_count', $distrib_sort_list['record_count']);
    $smarty->assign('page_count', $distrib_sort_list['page_count']);
    $smarty->display('distrib_sort_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $distrib_sort_list = get_distrib_sort();
    $smarty->assign('distrib_sort_list', $distrib_sort_list['arr']);
    $smarty->assign('filter', $distrib_sort_list['filter']);
    $smarty->assign('record_count', $distrib_sort_list['record_count']);
    $smarty->assign('page_count', $distrib_sort_list['page_count']);
    make_json_result($smarty->fetch('distrib_sort_list.htm'), '', array('filter' => $city_list['filter'], 'page_count' => $city_list['page_count']));
}
function get_distrib_sort()
{
    $filter = array();
    $sql = "SELECT COUNT(distinct user_id) FROM " . $GLOBALS['ecs']->table('distrib_sort');
    $filter['record_count'] = $GLOBALS['db']->getOne($sql);
    $filter = page_and_size($filter);
    $arr = array();
    $sql = "SELECT d.*,sum(money) as total_money,u.user_name FROM " . $GLOBALS['ecs']->table('distrib_sort') . " as d inner join " . $GLOBALS['ecs']->table('users') . " as u on d.user_id = u.user_id group by d.user_id order by total_money desc";
    $res = $GLOBALS['db']->selectLimit($sql, $filter['page_size'], $filter['start']);
    while ($rows = $GLOBALS['db']->fetchRow($res)) {
        $arr[] = $rows;
    }
    return array('arr' => $arr, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
}
Example #6
0
            $sql = "DELETE FROM " . $ecs->table('email_sendlist') . " WHERE id = '{$row['id']}'";
            $db->query($sql);
            //剩余列表数
            $count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('email_sendlist'));
            if ($count > 0) {
                $msg = sprintf($_LANG['mailsend_ok'], $row['email'], $count);
            } else {
                $msg = sprintf($_LANG['mailsend_finished'], $row['email']);
            }
            make_json_result('', $msg, array('count' => $count));
        } else {
            //发送出错
            if ($row['error'] < 3) {
                $time = time();
                $sql = "UPDATE " . $ecs->table('email_sendlist') . " SET error = error + 1, pri = 0, last_send = '{$time}' WHERE id = '{$row['id']}'";
            } else {
                //将出错超次的纪录删除
                $sql = "DELETE FROM " . $ecs->table('email_sendlist') . " WHERE id = '{$row['id']}'";
            }
            $db->query($sql);
            $count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('email_sendlist'));
            make_json_result('', sprintf($_LANG['mailsend_fail'], $row['email']), array('count' => $count));
        }
    } else {
        //无效的邮件队列
        $sql = "DELETE FROM " . $ecs->table('email_sendlist') . " WHERE id = '{$row['id']}'";
        $db->query($sql);
        $count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('email_sendlist'));
        make_json_result('', sprintf($_LANG['mailsend_fail'], $row['email']), array('count' => $count));
    }
}
Example #7
0
    $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 #8
0
    }
    make_json_result($opt);
}
/*------------------------------------------------------ */
//-- 搜索商品
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'get_goods_list') {
    include_once ROOT_PATH . 'includes/cls_json.php';
    $json = new JSON();
    $filters = $json->decode($_GET['JSON']);
    $arr = get_goods_list($filters);
    $opt = array();
    foreach ($arr as $key => $val) {
        $opt[] = array('value' => $val['goods_id'], 'text' => $val['goods_name'], 'data' => $val['shop_price']);
    }
    make_json_result($opt);
} elseif ($_REQUEST['act'] == 'batch') {
    /* 批量删除 */
    if (isset($_POST['type'])) {
        if ($_POST['type'] == 'button_remove') {
            admin_priv('article_manage');
            if (!isset($_POST['checkboxes']) || !is_array($_POST['checkboxes'])) {
                sys_msg($_LANG['no_select_article'], 1);
            }
            /* 删除原来的文件 */
            $sql = "SELECT file_url FROM " . $ecs->table('article') . " WHERE article_id " . db_create_in(join(',', $_POST['checkboxes'])) . " AND file_url <> ''";
            $res = $db->query($sql);
            while ($row = $db->fetchRow($res)) {
                $old_url = $row['file_url'];
                if (strpos($old_url, 'http://') === false && strpos($old_url, 'https://') === false) {
                    @unlink(ROOT_PATH . $old_url);
Example #9
0
    clear_cache_files();
    admin_log('', 'remove', 'friendlink');
    $url = 'friend_link.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
} elseif ($_REQUEST['act'] == 'edit_show_order') {
    check_authz_json('friendlink');
    $id = intval($_POST['id']);
    $order = json_str_iconv(trim($_POST['val']));
    /* 检查输入的值是否合法 */
    if (!preg_match("/^[0-9]+\$/", $order)) {
        make_json_error(sprintf($_LANG['enter_int'], $order));
    } else {
        if ($exc->edit("show_order = '{$order}'", $id)) {
            clear_cache_files();
            make_json_result(stripslashes($order));
        }
    }
}
/* 获取友情链接数据列表 */
function get_links_list()
{
    $result = get_filter();
    if ($result === false) {
        $filter = array();
        $filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'link_id' : trim($_REQUEST['sort_by']);
        $filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);
        /* 获得总记录数据 */
        $sql = 'SELECT COUNT(*) FROM ' . $GLOBALS['ecs']->table('friend_link');
        $filter['record_count'] = $GLOBALS['db']->getOne($sql);
        $filter = page_and_size($filter);
Example #10
0
    // 清除相关的缓存文件
    $link[0]['text'] = "操作成功";
    $link[0]['href'] = 'stock_out_type.php?act=list';
    sys_msg("出库类型添加操作成功", 0, $link);
} elseif ($_REQUEST['act'] == 'query') {
    check_authz_json('stock_out_type');
    $type_list = get_typelist();
    /*判断代理商或管理员*/
    if (if_agency()) {
        $smarty->assign('if_agency', if_agency());
    }
    $smarty->assign('type_list', $type_list['arr']);
    $smarty->assign('filter', $type_list['filter']);
    $smarty->assign('record_count', $type_list['record_count']);
    $smarty->assign('page_count', $type_list['page_count']);
    make_json_result($smarty->fetch('stock_out_type_list.htm'), '', array('filter' => $type_list['filter'], 'page_count' => $type_list['page_count']));
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('stock_out_type');
    $id = intval($_REQUEST['id']);
    /*add by hg for date 2014-03-26 判断代理商是否非法操作商品*/
    //static_goods($_REQUEST['goods_id']);
    /*end*/
    if ($exc->edit("if_delete = 1", $id)) {
        clear_cache_files();
        //$goods_name = $exc->get_name($goods_id);
        //admin_log(addslashes($goods_name), 'trash', 'goods'); // 记录日志
        $url = 'stock_out_type.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
        ecs_header("Location: {$url}\n");
        exit;
    }
} elseif ($_REQUEST['act'] == 'restore_type') {
Example #11
0
    $smarty->assign('page_count', $result['page_count']);
    $smarty->assign('sort_suppliers_id', '<img src="images/sort_desc.gif">');
    /* 显示模板 */
    assign_query_info();
    $smarty->display('supplier_rebate_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    check_authz_json('supplier_manage');
    $result = rebate_list();
    $smarty->assign('supplier_list', $result['result']);
    $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('supplier_rebate_list.htm'), '', array('filter' => $result['filter'], 'page_count' => $result['page_count']));
} elseif ($_REQUEST['act'] == 'view') {
    /* 检查权限 */
    admin_priv('supplier_manage');
    /* 取得供货商返佣信息 */
    $id = $_REQUEST['id'];
    $is_pay_ok = $_REQUEST['is_pay_ok'] ? intval($_REQUEST['is_pay_ok']) : 0;
    $sql = "SELECT r.*, s.supplier_name, s.bank, s.supplier_rebate FROM " . $ecs->table('supplier_rebate') . " AS r left join " . $ecs->table('supplier') . "  AS s on r.supplier_id=s.supplier_id WHERE r.rebate_id = '{$id}'";
    $rebate = $db->getRow($sql);
    if (empty($rebate)) {
        sys_msg('该返佣记录不存在!');
    } else {
        $nowtime = time();
        $rebate['rebate_paytime_start'] = local_date('Y.m.d', $rebate['rebate_paytime_start']);
        $paytime_end = $rebate['rebate_paytime_end'];
        $rebate['rebate_paytime_end'] = local_date('Y.m.d', $paytime_end);
Example #12
0
        $rank_name = $exc->get_name($rank_id);
        admin_log(addslashes($rank_name), 'edit', 'user_rank');
        clear_cache_files();
        make_json_result($val);
    } else {
        make_json_error($val);
    }
} elseif ($_REQUEST['act'] == 'toggle_special') {
    check_authz_json('user_rank');
    $rank_id = intval($_POST['id']);
    $is_special = intval($_POST['val']);
    if ($exc->edit("special_rank = '{$is_special}'", $rank_id)) {
        $rank_name = $exc->get_name($rank_id);
        admin_log(addslashes($rank_name), 'edit', 'user_rank');
        make_json_result($is_special);
    } else {
        make_json_error($db->error());
    }
} elseif ($_REQUEST['act'] == 'toggle_showprice') {
    check_authz_json('user_rank');
    $rank_id = intval($_POST['id']);
    $is_show = intval($_POST['val']);
    if ($exc->edit("show_price = '{$is_show}'", $rank_id)) {
        $rank_name = $exc->get_name($rank_id);
        admin_log(addslashes($rank_name), 'edit', 'user_rank');
        clear_cache_files();
        make_json_result($is_show);
    } else {
        make_json_error($db->error());
    }
}
Example #13
0
    $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);
        $time = gmtime();
        $sql = "INSERT INTO " . $ecs->table('mail_templates') . " (template_code, is_html,template_subject, template_content, last_modify, type) VALUES('" . md5($magazine_name . $time) . "',1, '{$magazine_name}', '{$magazine_content}', '{$time}', 'magazine')";
Example #14
0
    $smarty->assign('code', $code);
    $smarty->assign('filter', $agency_goods_list['filter']);
    $smarty->assign('record_count', $agency_goods_list['record_count']);
    $smarty->assign('page_count', $agency_goods_list['page_count']);
    $smarty->assign('full_page', 1);
    assign_query_info();
    $smarty->assign('action_link', list_link($is_add, $code));
    $smarty->assign('goods_res', $agency_goods_list['goods_res']);
    $smarty->display('goods_agency_info.htm');
} elseif ($_REQUEST['act'] == 'agency_add_query') {
    $agency_goods_list = agency_goods_list();
    $smarty->assign('goods_res', $agency_goods_list['goods_res']);
    $smarty->assign('filter', $agency_goods_list['filter']);
    $smarty->assign('record_count', $agency_goods_list['record_count']);
    $smarty->assign('page_count', $agency_goods_list['page_count']);
    make_json_result($smarty->fetch('goods_agency_info.htm'), '', array('filter' => $agency_goods_list['filter'], 'page_count' => $agency_goods_list['page_count']));
} elseif ($_REQUEST['act'] == 'agency_add_goods') {
    set_time_limit(0);
    $goods_id_arr = $_POST['checkboxes'];
    $shop_price_arr = $_POST['agency_shop_price'];
    if (@(!array_filter($goods_id_arr)) || !array_filter($shop_price_arr)) {
        sys_msg('没有填写价格或者没有勾选产品', 1, $link);
    }
    foreach ($goods_id_arr as $key => $value) {
        if (floatval($shop_price_arr[$value])) {
            $obj = new class_copy_goods($value, admin_agency_id(), $shop_price_arr[$value]);
            $obj->copy_go();
            $yes = true;
        }
    }
    if ($yes) {
Example #15
0
    check_authz_json('ad_manage');
    $id = intval($_POST['id']);
    $ad_height = json_str_iconv(trim($_POST['val']));
    /* 高度值必须是数字 */
    if (!preg_match("/^[\\.0-9]+\$/", $ad_height)) {
        make_json_error($_LANG['height_number']);
    }
    /* 广告位宽度应在1-1024之间 */
    if ($ad_height > 1024 || $ad_height < 1) {
        make_json_error($_LANG['height_value']);
    }
    if ($exc->edit("ad_height = '{$ad_height}'", $id)) {
        clear_cache_files();
        // 清除模版缓存
        admin_log($ad_height, 'edit', 'ads_position');
        make_json_result(stripslashes($ad_height));
    } else {
        make_json_error($db->error());
    }
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('ad_manage');
    $id = intval($_GET['id']);
    /* 查询广告位下是否有广告存在 */
    $sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('ad') . " WHERE position_id = '{$id}'";
    if ($db->getOne($sql) > 0) {
        make_json_error($_LANG['not_del_adposit']);
    } else {
        $exc->drop($id);
        admin_log('', 'remove', 'ads_position');
    }
    $url = 'ad_position.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
Example #16
0
    /* 取得参数 */
    $email          = trim($_POST['email']);

    /* 更新配置 */
    $_CFG['mail_service'] = intval($_POST['mail_service']);
    $_CFG['smtp_host']    = trim($_POST['smtp_host']);
    $_CFG['smtp_port']    = trim($_POST['smtp_port']);
    $_CFG['smtp_user']    = json_str_iconv(trim($_POST['smtp_user']));
    $_CFG['smtp_pass']    = trim($_POST['smtp_pass']);
    $_CFG['smtp_mail']    = trim($_POST['reply_email']);
    $_CFG['mail_charset'] = trim($_POST['mail_charset']);

    if (send_mail('', $email, $_LANG['test_mail_title'], $_LANG['cfg_name']['email_content'], 0))
    {
        make_json_result('', $_LANG['sendemail_success'] . $email);
    }
    else
    {
        make_json_error(join("\n", $err->_message));
    }
}

/*------------------------------------------------------ */
//-- 删除上传文件
/*------------------------------------------------------ */
elseif ($_REQUEST['act'] == 'del')
{
    /* 检查权限 */
    check_authz_json('shop_config');
    $smarty->assign('record_count', $logdb['record_count']);
    $smarty->assign('page_count', $logdb['page_count']);
    $smarty->assign('start_date', local_date('Y-m-d'));
    $smarty->assign('end_date', local_date('Y-m-d'));
    assign_query_info();
    $smarty->display('search_log_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $logdb = get_search_log();
    $smarty->assign('full_page', 0);
    $smarty->assign('logdb', $logdb['logdb']);
    $smarty->assign('filter', $logdb['filter']);
    $smarty->assign('record_count', $logdb['record_count']);
    $smarty->assign('page_count', $logdb['page_count']);
    $smarty->assign('start_date', local_date('Y-m-d'));
    $smarty->assign('end_date', local_date('Y-m-d'));
    make_json_result($smarty->fetch('search_log_list.htm'), '', array('filter' => $logdb['filter'], 'page_count' => $logdb['page_count']));
}
function get_search_log()
{
    $where = '';
    if (isset($_REQUEST['start_dateYear']) && isset($_REQUEST['end_dateYear'])) {
        $start_date = $_POST['start_dateYear'] . '-' . $_POST['start_dateMonth'] . '-' . $_POST['start_dateDay'];
        $end_date = $_POST['end_dateYear'] . '-' . $_POST['end_dateMonth'] . '-' . $_POST['end_dateDay'];
        $where .= " AND date <= '{$end_date}' AND date >= '{$start_date}'";
        $filter['start_dateYear'] = $_REQUEST['start_dateYear'];
        $filter['start_dateMonth'] = $_REQUEST['start_dateMonth'];
        $filter['start_dateDay'] = $_REQUEST['start_dateDay'];
        $filter['end_dateYear'] = $_REQUEST['end_dateYear'];
        $filter['end_dateMonth'] = $_REQUEST['end_dateMonth'];
        $filter['end_dateDay'] = $_REQUEST['end_dateDay'];
    }
    $rebate['caozuo'] = getRebateDo($rebate['status'], $rebate['rebate_id'], 'view');
    if ($order_type == 0) {
        $order_list = getOkOrder();
        $display = 'rebate_store_order.htm';
    } else {
        $order_list = getBackHuanOrder();
        $display = 'rebate_store_order2.htm';
    }
    $smarty->assign('rebate', $rebate);
    $smarty->assign('order_list', $order_list['orders']);
    $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($display), '', array('filter' => $order_list['filter'], 'page_count' => $order_list['page_count']));
} elseif ($_REQUEST['act'] == 'operate1') {
    if (empty($_REQUEST['order_id'])) {
        sys_msg('请先选择订单', 1);
    }
    $rebid = isset($_REQUEST['rid']) && intval($_REQUEST['rid']) > 0 ? intval($_REQUEST['rid']) : 0;
    if (empty($rebid)) {
        sys_msg('非法操作', 1);
    }
    if (($rebate = rebateHave($rebid)) === false) {
        sys_msg('该返佣记录不存在!');
    }
    //获取所有可以结算的订单
    $sql = "update " . $GLOBALS['ecs']->table('order_info') . " set store_rebate_ispay=2 where store_rebate_id=" . $rebid . " and order_sn in(" . $_REQUEST['order_id'] . ")";
    $links[] = array('href' => 'supplier_store_rebate.php?act=list', 'text' => '查看本期佣金列表');
    if ($GLOBALS['db']->query($sql)) {
Example #19
0
        $sql = "insert into " . $ecs->table("teacher") . " (name,sexuality,birthday,\r\n\t\tnational,id_card,phone,email,address,\r\n\t\ttitle,is_header,level,class_code,\r\n\t\tcreated )\r\n\t\tvalues \r\n\t\t\t('" . $_REQUEST["name"] . "','" . $_REQUEST["sexuality"] . "',\r\n\t\t\t'" . $_REQUEST["birthday"] . "','" . $_REQUEST["national"] . "',\r\n\t\t\t'" . $_REQUEST["id_card"] . "','" . $_REQUEST["phone"] . "','" . $_REQUEST["email"] . "',\r\n\t\t\t'" . $_REQUEST["address"] . "','" . $_REQUEST["title"] . "','" . $_REQUEST["is_header"] . "',\r\n\t\t\t'" . $_REQUEST["level"] . "','" . $_SESSION["class_code"] . "',\r\n\t\t\tnow())";
        $db->query($sql);
        admin_log(addslashes($_REQUEST["name"]), 'add', 'teacher');
        make_json_result("添加“" . $_REQUEST["name"] . "”成功!");
    } else {
        $sql = "update " . $ecs->table("teacher") . " set name='" . $_REQUEST["name"] . "',\r\n\t\t\tsexuality='" . $_REQUEST["sexuality"] . "',\r\n\t\t\tbirthday='" . $_REQUEST["birthday"] . "',\r\n\t\t\tnational='" . $_REQUEST["national"] . "',\r\n\t\t\tid_card='" . $_REQUEST["id_card"] . "',\r\n\t\t\tphone='" . $_REQUEST["phone"] . "',\r\n\t\t\temail='" . $_REQUEST["email"] . "',\r\n\t\t\taddress='" . $_REQUEST["address"] . "',\r\n\t\t\ttitle='" . $_REQUEST["title"] . "',\r\n\t\t\tis_header='" . $_REQUEST["is_header"] . "',\r\n\t\t\tlevel='" . $_REQUEST["level"] . "'\r\n\t\t\twhere teacher_id=" . $id;
        $db->query($sql);
        admin_log(addslashes($_REQUEST["name"]), 'update', 'teacher');
        make_json_result("修改“" . $_REQUEST["name"] . "”成功!");
    }
} elseif ($_REQUEST['act'] == 'ajax_delete') {
    $id = !empty($_REQUEST['teacher_id']) ? intval($_REQUEST['teacher_id']) : 0;
    $sql = "delete from " . $ecs->table("teacher") . " where teacher_id=" . $id;
    $db->query($sql);
    admin_log($_REQUEST["teacher_id"], 'delete', 'teacher');
    make_json_result("删除成功!");
}
/**
 *  返回班级管理员列表数据
 *
 * @access  public
 * @param
 *
 * @return void
 */
function teacher_list()
{
    $result = get_filter();
    if ($result === false) {
        /* 过滤条件 */
        $filter['keywords'] = empty($_REQUEST['search_name']) ? '' : trim($_REQUEST['search_name']);
Example #20
0
/**
 * 检查客服
 */
function action_check_of_username()
{
    $user = $GLOBALS['user'];
    $_CFG = $GLOBALS['_CFG'];
    $_LANG = $GLOBALS['_LANG'];
    $smarty = $GLOBALS['smarty'];
    $db = $GLOBALS['db'];
    $ecs = $GLOBALS['ecs'];
    $user_id = $_SESSION['user_id'];
    $of_username = $_REQUEST['of_username'];
    $user_id = $_REQUEST['of_username'];
    // 检查of_username是否存在
    $is_exist = check_of_username_binding($of_username);
    make_json_result($is_exist);
}
Example #21
0
        }
        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']);
    $smarty->assign('goods_order_data', $goods_order_data['sales_order_data']);
    $smarty->assign('filter', $goods_order_data['filter']);
Example #22
0
    $val = isset($_REQUEST['val']) ? json_str_iconv(trim($_REQUEST['val'])) : '';
    check_authz_json('reg_fields');
    if (is_numeric($val)) {
        if ($exc->edit("dis_order = '{$val}'", $id)) {
            /* 管理员日志 */
            admin_log($val, 'edit', 'reg_fields');
            clear_cache_files();
            make_json_result(stripcslashes($val));
        } else {
            make_json_error($db->error());
        }
    } else {
        make_json_error($_LANG['order_not_num']);
    }
} elseif ($_REQUEST['act'] == 'toggle_dis') {
    check_authz_json('reg_fields');
    $id = intval($_POST['id']);
    $is_dis = intval($_POST['val']);
    if ($exc->edit("display = '{$is_dis}'", $id)) {
        clear_cache_files();
        make_json_result($is_dis);
    }
} elseif ($_REQUEST['act'] == 'toggle_need') {
    check_authz_json('reg_fields');
    $id = intval($_POST['id']);
    $is_need = intval($_POST['val']);
    if ($exc->edit("is_need = '{$is_need}'", $id)) {
        clear_cache_files();
        make_json_result($is_need);
    }
}
Example #23
0
        admin_log(addslashes($tag_name), 'remove', 'tag_manage');
        $url = 'tag_manage.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
        ecs_header("Location: {$url}\n");
        exit;
    } else {
        make_json_error($db->error());
    }
} elseif ($_REQUEST['act'] == "edit_tag_name") {
    check_authz_json('tag_manage');
    $name = json_str_iconv(trim($_POST['val']));
    $id = intval($_POST['id']);
    if (!tag_is_only($name, $id)) {
        make_json_error(sprintf($_LANG['tagword_exist'], $name));
    } else {
        edit_tag($name, $id);
        make_json_result(stripslashes($name));
    }
}
/**
 * 鍒ゆ柇鍚屼竴鍟嗗搧鐨勬爣绛炬槸鍚﹀敮涓€
 *
 * @param $name  鏍囩?鍚
 * @param $id  鏍囩?id
 * @return bool
 */
function tag_is_only($name, $tag_id, $goods_id = '')
{
    if (empty($goods_id)) {
        $db = $GLOBALS['db'];
        $sql = 'SELECT goods_id FROM ' . $GLOBALS['ecs']->table('tag') . " WHERE tag_id = '{$tag_id}'";
        $row = $GLOBALS['db']->getRow($sql);
Example #24
0
 /**
  * 异步调用商品列表
  */
 public function get_goods_list()
 {
     $_POST['filters'] = strip_tags(urldecode($_POST['filters']));
     $_POST['filters'] = json_str_iconv($_POST['filters']);
     $json = new EcsJson();
     $filters = $json->decode($_POST['filters']);
     $arr = get_goods_list($filters);
     $opt = array();
     foreach ($arr as $key => $val) {
         $opt[] = array('value' => $val['goods_id'], 'text' => $val['goods_name']);
     }
     make_json_result($opt);
 }
Example #25
0
            if (count($new_region_id)) {
                $delete_region = array_merge($delete_region, $new_region_id);
            } else {
                continue;
            }
        }
    }
    $sql = "DELETE FROM " . $ecs->table("region") . "WHERE region_id" . db_create_in($delete_region);
    $db->query($sql);
    if ($exc->drop($id)) {
        admin_log(addslashes($region['region_name']), 'remove', 'area');
        /* 获取地区列表 */
        $region_arr = area_list($region['parent_id']);
        $smarty->assign('region_arr', $region_arr);
        $smarty->assign('region_type', $region['region_type']);
        make_json_result($smarty->fetch('area_list.htm'));
    } else {
        make_json_error($db->error());
    }
}
function new_region_id($region_id)
{
    $regions_id = array();
    if (empty($region_id)) {
        return $regions_id;
    }
    $sql = "SELECT region_id FROM " . $GLOBALS['ecs']->table("region") . "WHERE parent_id " . db_create_in($region_id);
    $result = $GLOBALS['db']->getAll($sql);
    foreach ($result as $val) {
        $regions_id[] = $val['region_id'];
    }
Example #26
0
    $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)) {
        if ($stat['separate_type'] == 1) {
            //推荐订单分成
Example #27
0
    $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 #28
0
            $goods_list[] = $row;
        }
        $attr = array();
        $arr = array();
        foreach ($goods_attr as $index => $array_val) {
            foreach ($array_val as $value) {
                $arr = explode(':', $value);
                //以 : 号将属性拆开
                $attr[$index][] = @array('name' => $arr[0], 'value' => $arr[1]);
            }
        }
        $smarty->assign('goods_attr', $attr);
        $smarty->assign('goods_list', $goods_list);
        $str = $smarty->fetch('order_goods_info.htm');
        $goods[] = array('order_id' => $order_id, 'str' => $str);
        make_json_result($goods);
    }
}
/**
 * 取得状态列表
 * @param   string  $type   类型:all | order | shipping | payment
 */
function get_status_list($type = 'all')
{
    global $_LANG;
    $list = array();
    if ($type == 'all' || $type == 'order') {
        $pre = $type == 'all' ? 'os_' : '';
        foreach ($_LANG['os'] as $key => $value) {
            $list[$pre . $key] = $value;
        }
Example #29
0
        clear_cache_files();
        make_json_result($val);
    } else {
        make_json_error($db->error());
    }
}
/*------------------------------------------------------ */
//-- 切换是否显示
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'toggle_is_show') {
    check_authz_json('cat_manage');
    $id = intval($_POST['id']);
    $val = intval($_POST['val']);
    if (cat_update($id, array('is_show' => $val)) != false) {
        clear_cache_files();
        make_json_result($val);
    } else {
        make_json_error($db->error());
    }
}
/*------------------------------------------------------ */
//-- 删除商品分类
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'remove') {
    check_authz_json('cat_manage');
    /* 初始化分类ID并取得分类名称 */
    $cat_id = intval($_GET['id']);
    $cat_name = $db->getOne('SELECT cat_name FROM ' . $ecs->table('category') . " WHERE cat_id='{$cat_id}'");
    /* 当前分类下是否有子分类 */
    $cat_count = $db->getOne('SELECT COUNT(*) FROM ' . $ecs->table('category') . " WHERE parent_id='{$cat_id}'");
    /* 当前分类下是否存在商品 */
Example #30
0
    include_once ROOT_PATH . 'includes/cls_json.php';
    $json = new JSON();
    $filter = $json->decode($_GET['JSON']);
    $arr['goods'] = get_goods_list($filter);
    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']);
    if (!empty($filters->goods_id)) {
        $arr['products'] = get_good_products($filters->goods_id);
    }
    make_json_result($arr);
}
/*
 * 取得拍卖活动列表
 * @return   array
 */
function auction_list()
{
    $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;