コード例 #1
0
ファイル: uc_youhuiModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $did = intval($_REQUEST['did']);
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     $page_size = app_conf("PAGE_SIZE");
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $user_id = $GLOBALS['user_info']['id'];
     $sql = "select * from " . DB_PREFIX . "youhui_log  where  " . " user_id = " . $user_id . " order by  create_time desc limit " . $limit;
     $sql_count = "select count(*) from " . DB_PREFIX . "youhui_log  where  " . " user_id = " . $user_id;
     $list = $GLOBALS['db']->getAll($sql);
     foreach ($list as $k => $v) {
         $list[$k]['youhui'] = load_auto_cache("youhui", array("id" => $v['youhui_id']));
     }
     $count = $GLOBALS['db']->getOne($sql_count);
     $page = new Page($count, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("list", $list);
     $GLOBALS['tmpl']->assign("NOW_TIME", NOW_TIME);
     $GLOBALS['tmpl']->assign("page_title", "我的优惠券");
     assign_uc_nav_list();
     $GLOBALS['tmpl']->display("uc/uc_youhui_index.html");
 }
コード例 #2
0
ファイル: eventrModule.class.php プロジェクト: macall/jsd
 /**
  * 活动点评
  * @see BizBaseModule::index()
  */
 public function index()
 {
     init_app_page();
     $s_account_info = $GLOBALS['account_info'];
     $supplier_id = intval($s_account_info['supplier_id']);
     $filter_point = intval($_REQUEST['filter_point']);
     $filter_is_img = intval($_REQUEST['filter_is_img']);
     $GLOBALS['tmpl']->assign("filter_point", $filter_point);
     $GLOBALS['tmpl']->assign("filter_is_img", $filter_is_img);
     $dp_type = "event";
     require_once APP_ROOT_PATH . 'system/model/review.php';
     //组装查询条件
     $conditions = biz_get_dp_conditions($supplier_id, $dp_type, $filter_point, $filter_is_img);
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     //分页
     $page_size = 10;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "supplier_location_dp " . $conditions);
     $page = new Page($total, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     //获取点评数据
     $dp_list = biz_get_dp_list($conditions, $dp_type, $limit);
     $GLOBALS['tmpl']->assign("dp_list", $dp_list);
     $GLOBALS['tmpl']->assign("ajax_url", url("biz", "eventr"));
     $GLOBALS['tmpl']->assign("form_url", url("biz", "eventr#index"));
     $GLOBALS['tmpl']->assign("head_title", "活动点评管理");
     $GLOBALS['tmpl']->display("pages/review/index.html");
 }
コード例 #3
0
ファイル: topicModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $id = intval($_REQUEST['id']);
     require_once APP_ROOT_PATH . 'system/model/topic.php';
     $topic = get_topic_item($id);
     if ($id > 0 && !empty($topic)) {
         //
     } else {
         app_redirect(url("index"));
     }
     if ($topic['group_id'] > 0) {
         $GLOBALS['tmpl']->assign('topic_group', get_topic_group($topic['group_id']));
     }
     $title = $topic['forum_title'];
     $content = decode_topic($topic['content']);
     $is_fav = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic where  (fav_id = " . $id . " or (origin_id = " . $id . " and fav_id <> 0))  and user_id = " . intval($GLOBALS['user_info']['id']));
     $GLOBALS['tmpl']->assign("topic", $topic);
     $GLOBALS['tmpl']->assign("title", $title);
     $GLOBALS['tmpl']->assign("content", $content);
     $GLOBALS['tmpl']->assign("is_fav", $is_fav);
     $GLOBALS['tmpl']->assign("page_title", $title);
     $GLOBALS['tmpl']->assign("page_keyword", $title . ",");
     $GLOBALS['tmpl']->assign("page_description", $title . ",");
     $GLOBALS['tmpl']->assign('user_auth', get_user_auth());
     $GLOBALS['tmpl']->display("topic_index.html");
 }
コード例 #4
0
ファイル: uc_logModule.class.php プロジェクト: macall/jsd
 public function __construct()
 {
     if (file_exists(APP_ROOT_PATH . "public/uc_config.php")) {
         require_once APP_ROOT_PATH . "public/uc_config.php";
     }
     if (app_conf("INTEGRATE_CODE") == 'Ucenter' && UC_CONNECT == 'mysql') {
         if (file_exists(APP_ROOT_PATH . "public/uc_data/creditsettings.php")) {
             require_once APP_ROOT_PATH . "public/uc_data/creditsettings.php";
             $this->creditsettings = $_CACHE['creditsettings'];
             if (count($this->creditsettings) > 0) {
                 foreach ($this->creditsettings as $k => $v) {
                     $this->creditsettings[$k]['srctitle'] = $this->credits_CFG[$v['creditsrc']]['title'];
                 }
                 $this->allow_exchange = true;
             }
         }
     }
     $GLOBALS['tmpl']->assign("allow_exchange", $this->allow_exchange);
     parent::__construct();
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     init_app_page();
 }
コード例 #5
0
ファイル: mallModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     $GLOBALS['tmpl']->caching = true;
     $GLOBALS['tmpl']->cache_lifetime = 600;
     //首页缓存10分钟
     $cache_id = md5(MODULE_NAME . ACTION_NAME . $GLOBALS['city']['id']);
     if (!$GLOBALS['tmpl']->is_cached('mall.html', $cache_id)) {
         init_app_page();
         //获取商城公告
         $notice_list = get_notice(0, array(0, 2));
         $GLOBALS['tmpl']->assign("notice_list", $notice_list);
         //输出首页推荐的分类
         $index_cates = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "shop_cate where is_delete = 0 and is_effect = 1 and recommend = 1 and pid = 0 order by sort");
         foreach ($index_cates as $k => $v) {
             $index_cates[$k]['deal_cate_type_list'] = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "shop_cate  where pid = " . $v['id'] . " order by sort limit 8");
             require_once APP_ROOT_PATH . "system/model/deal.php";
             $deal_result = get_goods_list(8, array(DEAL_ONLINE, DEAL_NOTICE), array("city_id" => $GLOBALS['city']['id'], "cid" => $v['id']), "", " d.buy_type <> 1 and d.is_shop = 1 and d.is_recommend = 1 ");
             $index_cates[$k]['deal_list'] = $deal_result['list'];
         }
         $GLOBALS['tmpl']->assign("index_cates", $index_cates);
         $GLOBALS['tmpl']->assign("drop_nav", "no_drop");
         //首页下拉菜单不输出
         $GLOBALS['tmpl']->assign("wrap_type", "1");
         //首页宽屏展示
     }
     $GLOBALS['tmpl']->display("mall.html", $cache_id);
 }
コード例 #6
0
ファイル: uc_voucherModule.class.php プロジェクト: macall/jsd
 public function exchange()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $result = get_exchange_voucher_list($limit);
     $GLOBALS['tmpl']->assign("list", $result['list']);
     $page = new Page($result['count'], app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_VOUCHER']);
     assign_uc_nav_list();
     //左侧导航菜单
     $GLOBALS['tmpl']->display("uc/uc_voucher_exchange.html");
 }
コード例 #7
0
ファイル: linkModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME);
     if (!$GLOBALS['tmpl']->is_cached('link_index.html', $cache_id)) {
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index", "index"));
         $site_nav[] = array('name' => $GLOBALS['lang']['FRIEND_LINK'], 'url' => url("index", "acate"));
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         $p_link_group = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "link_group where is_effect = 1 order by sort desc");
         foreach ($p_link_group as $k => $v) {
             $g_links = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "link where is_effect = 1 and group_id = " . $v['id'] . " order by sort desc");
             if ($g_links) {
                 foreach ($g_links as $kk => $vv) {
                     if (substr($vv['url'], 0, 7) == 'http://') {
                         $g_links[$kk]['url'] = str_replace("http://", "", $vv['url']);
                     }
                 }
                 $p_link_group[$k]['links'] = $g_links;
             } else {
                 unset($p_link_group[$k]);
             }
         }
         $GLOBALS['tmpl']->assign("click_url", url('index', 'link#go'));
         $GLOBALS['tmpl']->assign("p_link_data", $p_link_group);
         $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['FRIEND_LINK']);
     }
     $GLOBALS['tmpl']->display("link_index.html", $cache_id);
 }
コード例 #8
0
ファイル: withdrawalModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     init_app_page();
     $s_account_info = $GLOBALS["account_info"];
     $supplier_id = intval($s_account_info['supplier_id']);
     $supplier_info = $GLOBALS['db']->getRow("select * from  " . DB_PREFIX . "supplier where id=" . $supplier_id);
     //分页
     $page_size = 10;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "supplier_money_submit  where supplier_id=" . $supplier_id . " order by status asc,create_time desc limit " . $limit);
     foreach ($list as $k => $v) {
         if ($v['status'] == 1) {
             $list[$k]['status'] = "已确认提现";
         } else {
             $list[$k]['status'] = "待审核";
         }
     }
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "supplier_money_submit  where supplier_id=" . $supplier_id);
     $page = new Page($total, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("sms_lesstime", load_sms_lesstime());
     $GLOBALS['tmpl']->assign("sms_ipcount", load_sms_ipcount());
     $GLOBALS['tmpl']->assign("list", $list);
     $GLOBALS['tmpl']->assign("supplier_info", $supplier_info);
     $GLOBALS['tmpl']->assign("head_title", "商户提现");
     $GLOBALS['tmpl']->display("pages/withdrawal/index.html");
 }
コード例 #9
0
ファイル: uc_collectModule.class.php プロジェクト: macall/jsd
 public function event_collect()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $event_result = get_event_collect($GLOBALS['user_info']['id']);
     foreach ($event_result['list'] as $k => $v) {
         $event_result['list'][$k]['url'] = url('index', 'event#' . $v['id']);
         $event_result['list'][$k]['del_url'] = url('index', 'uc_collect#del', array('id' => $v['cid'], 'type' => 'event'));
     }
     $GLOBALS['tmpl']->assign("list", $event_result['list']);
     $page = new Page($event_result['count'], app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("type", "event");
     $GLOBALS['tmpl']->assign("page_title", "我的收藏");
     assign_uc_nav_list();
     //左侧导航菜单
     $GLOBALS['tmpl']->display("uc/uc_collect.html");
 }
コード例 #10
0
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . "system_article" . trim($_REQUEST['act']));
     if (!$GLOBALS['tmpl']->is_cached('system_article.html', $cache_id)) {
         $id = intval($_REQUEST['act']);
         if ($id == 0) {
             app_redirect(APP_ROOT . "/");
         }
         $article = $GLOBALS['db']->getRow("select a.*,ac.type_id from " . DB_PREFIX . "article as a left join " . DB_PREFIX . "article_cate as ac on a.cate_id = ac.id where a.id = " . $id . " and a.is_effect = 1 and a.is_delete = 0");
         if (!$article || $article['type_id'] != 3) {
             app_redirect(APP_ROOT . "/");
         }
         $GLOBALS['tmpl']->assign("article", $article);
         $seo_title = $article['seo_title'] != '' ? $article['seo_title'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_title", $seo_title);
         $seo_keyword = $article['seo_keyword'] != '' ? $article['seo_keyword'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ",");
         $seo_description = $article['seo_description'] != '' ? $article['seo_description'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_description", $seo_description . ",");
     }
     $GLOBALS['tmpl']->display("system_article.html", $cache_id);
 }
コード例 #11
0
ファイル: youhuioModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     init_app_page();
     $s_account_info = $GLOBALS["account_info"];
     $supplier_id = intval($s_account_info['supplier_id']);
     $name = strim($_REQUEST['name']);
     $begin_time = strim($_REQUEST['begin_time']);
     $end_time = strim($_REQUEST['end_time']);
     $begin_time_s = to_timespan($begin_time, "Y-m-d H:i");
     $end_time_s = to_timespan($end_time, "Y-m-d H:i");
     $condition = "";
     if ($name != "") {
         $youhui_ids = $GLOBALS['db']->getRow("select group_concat(id SEPARATOR ',') as ids  from " . DB_PREFIX . "youhui where name  like '%" . $name . "%'");
         $condition .= " and log.youhui_id in (" . $youhui_ids['ids'] . ") ";
     }
     if ($begin_time_s) {
         $condition .= " and log.create_time > " . $begin_time_s . " ";
     }
     if ($end_time_s) {
         $condition .= " and log.create_time < " . $end_time_s . " ";
     }
     $GLOBALS['tmpl']->assign("name", $name);
     $GLOBALS['tmpl']->assign("begin_time", $begin_time);
     $GLOBALS['tmpl']->assign("end_time", $end_time);
     //分页
     $page_size = 15;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $list = $GLOBALS['db']->getAll("select distinct(log.id),log.* from " . DB_PREFIX . "youhui_log as log  left join " . DB_PREFIX . "youhui_location_link as l on l.youhui_id = log.youhui_id where l.location_id in (" . implode(",", $s_account_info['location_ids']) . ") " . $condition . " order by log.create_time desc limit " . $limit);
     foreach ($list as $k => $v) {
         $list[$k]['user_name'] = load_user($v['user_id']);
         $list[$k]['user_name'] = $list[$k]['user_name']['user_name'];
         $youhui_info = load_auto_cache("youhui", array('id' => $v['youhui_id']));
         $list[$k]['youhui_name'] = $youhui_info['name'];
         $location_info = load_auto_cache("store", array('id' => $v['location_id']));
         $list[$k]['location_name'] = $location_info['name'];
         if ($list[$k]['expire_time'] != 0 && $list[$k]['expire_time'] < NOW_TIME) {
             $list[$k]['expire_time'] = "已过期";
         } elseif ($list[$k]['expire_time'] == 0) {
             $list[$k]['expire_time'] = "永久有效";
         } else {
             $list[$k]['expire_time'] = to_date($list[$k]['expire_time']);
         }
         $list[$k]['url'] = url('index', 'youhui#' . $v['youhui_id']);
     }
     $total = $GLOBALS['db']->getOne("select count(distinct(log.id)) from " . DB_PREFIX . "youhui_log as log  left join " . DB_PREFIX . "youhui_location_link as l on l.youhui_id = log.youhui_id where l.location_id in (" . implode(",", $s_account_info['location_ids']) . ") " . $condition);
     $page = new Page($total, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("list", $list);
     $GLOBALS['tmpl']->assign("head_title", "优惠券下载记录");
     $GLOBALS['tmpl']->display("pages/youhuio/index.html");
 }
コード例 #12
0
ファイル: positionModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $GLOBALS['tmpl']->assign("city_name", $GLOBALS['city']['name']);
     $GLOBALS['tmpl']->display("position.html");
 }
コード例 #13
0
ファイル: youhuivModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     init_app_page();
     $s_account_info = $GLOBALS['account_info'];
     $account_id = intval($s_account_info['id']);
     //获取支持的门店
     //$location_list = $GLOBALS['db']->getAll("select sl.id,sl.name from ".DB_PREFIX."supplier_account_location_link sall left join ".DB_PREFIX."supplier_location sl on sl.id = sall.location_id where sall.account_id=".$account_id);
     $location_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "supplier_location where id in (" . implode(",", $s_account_info['location_ids']) . ") ");
     $GLOBALS['tmpl']->assign("location_list", $location_list);
     $GLOBALS['tmpl']->assign("page_title", "优惠券验证");
     $GLOBALS['tmpl']->display("pages/youhuiv/index.html");
 }
コード例 #14
0
ファイル: bankinfoModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     init_app_page();
     $s_account_info = $GLOBALS["account_info"];
     $supplier_id = intval($s_account_info['supplier_id']);
     $supplier_info = $GLOBALS['db']->getRow("select * from  " . DB_PREFIX . "supplier where id=" . $supplier_id);
     $GLOBALS['tmpl']->assign("sms_lesstime", load_sms_lesstime());
     $GLOBALS['tmpl']->assign("sms_ipcount", load_sms_ipcount());
     $GLOBALS['tmpl']->assign("supplier_info", $supplier_info);
     $GLOBALS['tmpl']->assign("head_title", "银行卡绑定");
     $GLOBALS['tmpl']->display("pages/bankinfo/index.html");
 }
コード例 #15
0
ファイル: dealvModule.class.php プロジェクト: macall/jsd
 public function super()
 {
     init_app_page();
     $s_account_info = $GLOBALS['account_info'];
     $account_id = intval($s_account_info['id']);
     assign_biz_nav_list();
     //获取支持的门店
     $location_list = $GLOBALS['db']->getAll("select id,name from " . DB_PREFIX . "supplier_location where id in(" . implode(",", $GLOBALS['account_info']['location_ids']) . ")");
     $GLOBALS['tmpl']->assign("location_list", $location_list);
     $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['VERIFY_COUPON']);
     $GLOBALS['tmpl']->display("pages/verify/super.html");
 }
コード例 #16
0
ファイル: uc_reviewModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $GLOBALS['tmpl']->assign("page_title", "我的点评");
     assign_uc_nav_list();
     //begin review
     require_once APP_ROOT_PATH . "system/model/review.php";
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     //分页
     $page_size = 10;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $dp_res = get_dp_list($limit, "", " user_id = " . $GLOBALS['user_info']['id']);
     $dp_list = $dp_res['list'];
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "supplier_location_dp  where " . $dp_res['condition']);
     $page = new Page($total, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     foreach ($dp_list as $k => $v) {
         if ($v['deal_id'] > 0) {
             $data_info = load_auto_cache("deal", array("id" => $v['deal_id']));
         } elseif ($v['youhui_id'] > 0) {
             $data_info = load_auto_cache("youhui", array("id" => $v['youhui_id']));
         } elseif ($v['event_id'] > 0) {
             $data_info = load_auto_cache("event", array("id" => $v['event_id']));
         }
         if (empty($data_info)) {
             $data_info = load_auto_cache("store", array("id" => $v['supplier_location_id']));
         }
         $dp_list[$k]['data_info'] = $data_info;
     }
     $GLOBALS['tmpl']->assign('dp_list', $dp_list);
     require_once APP_ROOT_PATH . "system/model/topic.php";
     global $no_lazy;
     $no_lazy = true;
     $review_html = decode_topic_without_img($GLOBALS['tmpl']->fetch("inc/uc_review_list.html"));
     $GLOBALS['tmpl']->assign("review_html", $review_html);
     //end review
     $no_lazy = false;
     $GLOBALS['tmpl']->display("uc/uc_review_index.html");
 }
コード例 #17
0
ファイル: newsModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['act']));
     if (!$GLOBALS['tmpl']->is_cached('notice_list.html', $cache_id)) {
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index", "index"));
         $site_nav[] = array('name' => $GLOBALS['lang']['SITE_NOTICE_LIST'], 'url' => url("index", "news"));
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         $id = intval($_REQUEST['act']);
         $cate_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where id = " . $id . " and is_effect = 1 and is_delete = 0");
         if ($id > 0 && !$cate_item) {
             app_redirect(APP_ROOT . "/");
         } elseif ($cate_item && $cate_item['type_id'] != 2) {
             if ($cate_item['type_id'] == 1) {
                 app_redirect(url("index", "help"));
             }
             if ($cate_item['type_id'] == 0) {
                 app_redirect(url("index", "acate"));
             }
             if ($cate_item['type_id'] == 3) {
                 app_redirect(APP_ROOT . "/");
             }
         }
         $cate_id = intval($cate_item['id']);
         $cate_tree = get_acate_tree('', 2, "news");
         $GLOBALS['tmpl']->assign("acate_tree", $cate_tree);
         //分页
         $page = intval($_REQUEST['p']);
         if ($page <= 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
         $result = get_article_list($limit, $cate_id, 'ac.type_id = 2', '', false);
         $GLOBALS['tmpl']->assign("list", $result['list']);
         $page = new Page($result['count'], app_conf("PAGE_SIZE"));
         //初始化分页对象
         $p = $page->show();
         $GLOBALS['tmpl']->assign('pages', $p);
         $GLOBALS['tmpl']->assign("cur_id", $cate_id);
         $GLOBALS['tmpl']->assign("cur_title", $GLOBALS['lang']['SITE_NOTICE_LIST']);
         $GLOBALS['tmpl']->assign("page_title", $cate_item['title']);
         $GLOBALS['tmpl']->assign("page_keyword", $cate_item['title'] . ",");
         $GLOBALS['tmpl']->assign("page_description", $cate_item['title'] . ",");
     }
     $GLOBALS['tmpl']->display("notice_list.html", $cache_id);
 }
コード例 #18
0
ファイル: uc_couponModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $did = intval($_REQUEST['did']);
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     $page_size = 10;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $user_id = $GLOBALS['user_info']['id'];
     require_once APP_ROOT_PATH . "system/model/deal_order.php";
     $order_item_table = get_user_order_item_table_name($user_id);
     $order_table = get_user_order_table_name($user_id);
     if ($did > 0) {
         $order_deal_item = $GLOBALS['db']->getRow("select doi.* from " . $order_item_table . " as doi left join " . $order_table . " as do on doi.order_id = do.id where doi.id = " . $did . " and doi.is_coupon = 1 and do.user_id = " . $user_id);
         $deal = load_auto_cache("deal", array("id" => $order_deal_item['deal_id']));
         $order_deal_item['url'] = $deal['url'];
     }
     if ($order_deal_item) {
         $sql = "select doi.sub_name,doi.name,doi.number,c.* from " . DB_PREFIX . "deal_coupon as c left join " . $order_item_table . " as doi on doi.id = c.order_deal_id where c.is_valid > 0 and " . " c.user_id = " . $user_id . " and doi.id = " . $order_deal_item['id'] . " order by c.id desc limit " . $limit;
         $sql_count = "select count(*) from " . DB_PREFIX . "deal_coupon as c where c.is_valid > 0 and " . " c.user_id = " . $user_id . " and c.order_deal_id = " . $order_deal_item['id'];
         $GLOBALS['tmpl']->assign("deal", $order_deal_item);
     } else {
         $sql = "select doi.sub_name,doi.name,doi.number,c.* from " . DB_PREFIX . "deal_coupon as c left join " . DB_PREFIX . "deal_order_item as doi on doi.id = c.order_deal_id where c.is_valid > 0 and " . " c.user_id = " . $user_id . " order by c.id desc limit " . $limit;
         $sql_count = "select count(*) from " . DB_PREFIX . "deal_coupon as c where c.is_valid > 0 and " . " c.user_id = " . $user_id;
     }
     $list = $GLOBALS['db']->getAll($sql);
     foreach ($list as $k => $v) {
         $list[$k]['deal'] = load_auto_cache("deal", array("id" => $v['deal_id']));
     }
     $count = $GLOBALS['db']->getOne($sql_count);
     $page = new Page($count, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("list", $list);
     $GLOBALS['tmpl']->assign("NOW_TIME", NOW_TIME);
     $GLOBALS['tmpl']->assign("page_title", "我的团购券");
     assign_uc_nav_list();
     $GLOBALS['tmpl']->display("uc/uc_coupon_index.html");
 }
コード例 #19
0
 public function add()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     if (intval($_REQUEST['id']) > 0) {
         $GLOBALS['tmpl']->assign("consignee_id", intval($_REQUEST['id']));
     }
     $GLOBALS['tmpl']->assign("page_title", "配送地址");
     assign_uc_nav_list();
     //左侧导航菜单
     $GLOBALS['tmpl']->display("uc/uc_consignee_add.html");
 }
コード例 #20
0
ファイル: noticeModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['act']));
     if (!$GLOBALS['tmpl']->is_cached('notice_index.html', $cache_id)) {
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index", "index"));
         $site_nav[] = array('name' => $GLOBALS['lang']['SITE_NOTICE_LIST'], 'url' => url("index", "news"));
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         $id = intval($_REQUEST['act']);
         if ($id == 0) {
             app_redirect(url("index", "news"));
         }
         $article = $GLOBALS['db']->getRow("select a.*,ac.type_id from " . DB_PREFIX . "article as a left join " . DB_PREFIX . "article_cate as ac on a.cate_id = ac.id where a.id = " . $id . " and a.is_effect = 1 and a.is_delete = 0");
         $cate_tree = get_acate_tree('', 2, "news");
         $GLOBALS['tmpl']->assign("acate_tree", $cate_tree);
         if (!$article || $article['type_id'] != 2) {
             app_redirect(APP_ROOT . "/");
         } else {
             if ($article['rel_url'] != '') {
                 if (!preg_match("/http:\\/\\//i", $article['rel_url'])) {
                     if (substr($article['rel_url'], 0, 2) == 'u:') {
                         app_redirect(parse_url_tag($article['rel_url']));
                     } else {
                         app_redirect(APP_ROOT . "/" . $article['rel_url']);
                     }
                 } else {
                     app_redirect($article['rel_url']);
                 }
             }
         }
         $GLOBALS['tmpl']->assign("article", $article);
         $GLOBALS['tmpl']->assign("cur_id", $article['cate_id']);
         $GLOBALS['tmpl']->assign("cur_title", $GLOBALS['lang']['SITE_NOTICE_LIST']);
         $seo_title = $article['seo_title'] != '' ? $article['seo_title'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_title", $seo_title);
         $seo_keyword = $article['seo_keyword'] != '' ? $article['seo_keyword'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ",");
         $seo_description = $article['seo_description'] != '' ? $article['seo_description'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_description", $seo_description . ",");
     }
     $GLOBALS['tmpl']->display("notice_index.html", $cache_id);
 }
コード例 #21
0
ファイル: uc_msgModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $GLOBALS['tmpl']->assign("page_title", "我的消息");
     $user_info = $GLOBALS['user_info'];
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     $page_size = app_conf("PAGE_SIZE");
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $sql = "select * from " . DB_PREFIX . "msg_box where user_id = " . $GLOBALS['user_info']['id'] . " and is_delete = 0 order by create_time desc limit " . $limit;
     $sql_count = "select count(*) from " . DB_PREFIX . "msg_box where user_id = " . $GLOBALS['user_info']['id'] . " and is_delete = 0 ";
     $list = $GLOBALS['db']->getAll($sql);
     $ids[] = 0;
     foreach ($list as $k => $v) {
         $list[$k] = load_msg($v['type'], $v);
         $list[$k]['create_time'] = to_date($v['create_time']);
         $ids[] = $v['id'];
     }
     $count = $GLOBALS['db']->getOne($sql_count);
     $page = new Page($count, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("list", $list);
     $ids_str = implode(",", $ids);
     $GLOBALS['db']->query("update " . DB_PREFIX . "msg_box set is_read = 1 where user_id = " . $GLOBALS['user_info']['id'] . " and id in (" . $ids_str . ")");
     require_once APP_ROOT_PATH . "system/model/user.php";
     load_user($GLOBALS['user_info']['id'], true);
     assign_uc_nav_list();
     $GLOBALS['tmpl']->assign("user_info", $user_info);
     $GLOBALS['tmpl']->display("uc/uc_msg.html");
 }
コード例 #22
0
ファイル: dhapiModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index", "index"));
     $site_nav[] = array('name' => $GLOBALS['lang']['API_LIST'], 'url' => url("index", "dhapi"));
     $GLOBALS['tmpl']->assign("site_nav", $site_nav);
     $directory = APP_ROOT_PATH . "dh/";
     $read_api = true;
     $dir = @opendir($directory);
     $apis = array();
     while (false !== ($file = @readdir($dir))) {
         if (preg_match("/^.*?\\.php\$/", $file)) {
             $tmp = (require_once $directory . $file);
             if ($tmp) {
                 $apis[] = $tmp;
             }
         }
     }
     @closedir($dir);
     unset($read_api);
     $contents_html = '<table>';
     foreach ($apis as $k => $v) {
         foreach ($v['info'] as $kk => $vv) {
             $contents_html .= "<tr><td style='padding:10px 25px 10px 5px;'>";
             $contents_html .= $vv['name'] . ":</td><td style='padding:10px 5px 10px 5px;'><input type='text' style='width:350px;' class='f-input' value='" . get_domain() . APP_ROOT . "/dh/" . $vv['url'] . "' /></td>";
             $contents_html .= "</tr>";
         }
     }
     $contents_html .= '</table>';
     $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['API_LIST']);
     $GLOBALS['tmpl']->assign("page_keyword", $GLOBALS['lang']['API_LIST']);
     $GLOBALS['tmpl']->assign("page_description", $GLOBALS['lang']['API_LIST']);
     $article['title'] = $GLOBALS['lang']['API_LIST'];
     $article['content'] = $contents_html;
     $GLOBALS['tmpl']->assign("article", $article);
     $GLOBALS['tmpl']->display("dhapi.html");
 }
コード例 #23
0
ファイル: cityModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     //用于重写模式下的城市定位跳转
     $act = strim($_REQUEST['act']);
     if ($act) {
         require_once APP_ROOT_PATH . "system/model/city.php";
         $_GET['city'] = $act;
         City::locate_city();
         app_redirect(url("index"));
     }
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME);
     if (!$GLOBALS['tmpl']->is_cached('city_index.html', $cache_id)) {
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index", "index"));
         $site_nav[] = array('name' => $GLOBALS['lang']['SWITCH_CITY'], 'url' => url("index", "city"));
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         $city_lists = load_auto_cache("city_list_result");
         //print_r($city_lists);
         $GLOBALS['tmpl']->assign("city_lists", $city_lists['zm']);
         $province_list = $GLOBALS['db']->getAll("select id,name,uname from " . DB_PREFIX . "deal_city where pid=0 and is_effect=1 order by uname asc");
         foreach ($province_list as $k => $v) {
             $province_new[$v['id']] = $v;
             $province_new[$v['id']]['city_list'] = $GLOBALS['db']->getAll("select id,name,uname from " . DB_PREFIX . "deal_city where is_effect=1 and pid = " . $v['id'] . " order by uname asc");
             foreach ($province_new[$v['id']]['city_list'] as $kk => $vv) {
                 $province_new[$v['id']]['city_list'][$kk]['url'] = url("index", "index", array("city" => $vv['uname']));
             }
         }
         //print_r($province_new);
         $GLOBALS['tmpl']->assign("province_list", $province_new);
         $GLOBALS['tmpl']->assign("city_json", json_encode($province_new));
         $GLOBALS['tmpl']->assign("city_lists_data", $city_lists['ls']);
     }
     $GLOBALS['tmpl']->display("city_index.html", $cache_id);
 }
コード例 #24
0
ファイル: uc_medalModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     require APP_ROOT_PATH . "system/model/uc_center_service.php";
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $user_id = intval($GLOBALS['user_info']['id']);
     $list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "medal where is_effect = 1 ");
     foreach ($list as $k => $v) {
         $list[$k]['url'] = url("index", "uc_medal#load_medal", array("id" => $v['id']));
     }
     $GLOBALS['tmpl']->assign('list', $list);
     $my_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user_medal where user_id = " . $user_id . " and is_delete = 0 order by create_time desc");
     $GLOBALS['tmpl']->assign('my_list', $my_list);
     $GLOBALS['tmpl']->assign("page_title", "会员勋章");
     assign_uc_nav_list();
     //左侧导航菜单
     $GLOBALS['tmpl']->display("uc/uc_medal_index.html");
 }
コード例 #25
0
ファイル: uc_inviteModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     require APP_ROOT_PATH . "system/model/uc_center_service.php";
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $page = intval($_REQUEST['p']);
     if ($page <= 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $user_id = intval($GLOBALS['user_info']['id']);
     $result = get_invite_list($limit, $user_id);
     $GLOBALS['tmpl']->assign("list", $result['list']);
     $page = new Page($result['count'], app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $total_referral_money = $GLOBALS['db']->getOne("select sum(money) from " . DB_PREFIX . "referrals where user_id = " . $GLOBALS['user_info']['id'] . " and pay_time > 0");
     $total_referral_score = $GLOBALS['db']->getOne("select sum(score) from " . DB_PREFIX . "referrals where user_id = " . $GLOBALS['user_info']['id'] . " and pay_time > 0");
     $GLOBALS['tmpl']->assign("total_referral_money", $total_referral_money);
     $GLOBALS['tmpl']->assign("total_referral_score", $total_referral_score);
     $share_url = get_domain() . APP_ROOT . "/";
     if ($GLOBALS['user_info']) {
         $share_url .= "?r=" . base64_encode(intval($GLOBALS['user_info']['id']));
     }
     $GLOBALS['tmpl']->assign("share_url", $share_url);
     $GLOBALS['tmpl']->assign("page_title", "我的邀请");
     assign_uc_nav_list();
     //左侧导航菜单
     $GLOBALS['tmpl']->display("uc/uc_invite.html");
 }
コード例 #26
0
ファイル: youhuiModule.class.php プロジェクト: macall/jsd
 public function doprint()
 {
     global_run();
     init_app_page();
     if (empty($GLOBALS['user_info'])) {
         app_redirect(url("index", "user#login"));
     }
     $id = intval($_REQUEST['id']);
     $log = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "youhui_log where user_id = " . $GLOBALS['user_info']['id'] . " and id = " . $id);
     if ($log) {
         $GLOBALS['db']->query("update " . DB_PREFIX . "youhui set print_count = print_count + 1 where id = " . $log['youhui_id']);
         require_once APP_ROOT_PATH . "system/model/youhui.php";
         $youhui_info = get_youhui($log['youhui_id']);
         if ($youhui_info) {
             $GLOBALS['tmpl']->assign("youhui_info", $youhui_info);
             $GLOBALS['tmpl']->assign("log", $log);
             $GLOBALS['tmpl']->display("youhui_print.html");
         } else {
             showErr("优惠券已下架");
         }
     } else {
         app_redirect_preview();
     }
 }
コード例 #27
0
ファイル: scoresModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("wrap_type", "1");
     //宽屏展示
     //参数处理
     $shop_cate_id = intval($_REQUEST['cid']);
     if ($shop_cate_id) {
         $url_param['cid'] = $shop_cate_id;
     }
     $brand_id = intval($_REQUEST['bid']);
     if ($brand_id) {
         $url_param['bid'] = intval($_REQUEST['bid']);
     }
     $sort_name = strim($_REQUEST["sort"]);
     if ($sort_name != "return_score" && $sort_name != "buy_count") {
         $sort_name = "";
     }
     if ($sort_name) {
         $url_param['sort'] = $sort_name;
     }
     $sort_type = strim($_REQUEST['type']) == "asc" ? "asc" : "desc";
     if ($_REQUEST['type']) {
         $url_param['type'] = $sort_type;
     }
     //seo元素
     $page_title = "积分商城";
     $page_keyword = "积分商城";
     $page_description = "积分商城";
     //输出自定义的filter_row
     /* array(
     				"nav_list"=>array(
     						array( //导航类型的切换
     							"current"=>array("name"=>'xxx',"url"=>"当前的地址","cancel"=>"取消的地址"),
     							"list"=>array(
     									array("name"=>"xxx","url"=>"xxx")
     								)
     						)
     				),
     				"filter_list"=>array( //列表类型的切换
     					array(
     						"name"=>"分类",
     						"list"	=> array(
     								array("name"=>"xxx","url"=>"xxx")
     						)
     					)		
     				)
     			
     		); */
     $cate_cache = load_auto_cache("cache_shop_cate");
     //商城分类缓存
     //获取品牌
     if ($shop_cate_id > 0) {
         $cate_key = load_auto_cache("shop_cate_key", array("cid" => $shop_cate_id));
         $brand_list = $GLOBALS['db']->getAll("select id,name from " . DB_PREFIX . "brand where match(tag_match) against('" . $cate_key . "' IN BOOLEAN MODE)  order by sort limit 100");
         if ($brand_id > 0 && $brand_list) {
             $brand_info = $GLOBALS['db']->getRow("select id,name from " . DB_PREFIX . "brand where id = " . $brand_id);
         }
     }
     if ($shop_cate_id > 0 && $cate_cache[$shop_cate_id] || $brand_id > 0 && $brand_list) {
         $filter_row_data['nav_list'][] = array("current" => array("name" => "全部", "url" => url("index", "scores")));
     }
     //全部
     if ($shop_cate_id > 0 && $cate_cache[$shop_cate_id]) {
         if ($cate_cache[$shop_cate_id]['pid'] == 0) {
             //选中大分类
             $bcate_info = $cate_cache[$shop_cate_id];
             $bcate_list = load_auto_cache("cache_shop_cate", array("pid" => 0));
             foreach ($bcate_list as $k => $v) {
                 $bcate_list[$k]['url'] = $v['score_url'];
             }
             $filter_row = array();
             unset($tmp_url_param['cid']);
             $filter_row['current'] = array("name" => $cate_cache[$shop_cate_id]['name'], "cancel" => url("index", "scores"));
             $filter_row['list'] = $bcate_list;
             $filter_row_data['nav_list'][] = $filter_row;
             $scate_list = load_auto_cache("cache_shop_cate", array("pid" => $shop_cate_id));
             foreach ($scate_list as $k => $v) {
                 $scate_list[$k]['url'] = $v['score_url'];
             }
         } else {
             //选中小分类
             $scate_info = $cate_cache[$shop_cate_id];
             $bcate_info = $cate_cache[$scate_info['pid']];
             $bcate_list = load_auto_cache("cache_shop_cate", array("pid" => 0));
             foreach ($bcate_list as $k => $v) {
                 $bcate_list[$k]['url'] = $v['score_url'];
             }
             $filter_row = array();
             $filter_row['current'] = array("name" => $bcate_info['name'], "cancel" => url("index", "scores"));
             $filter_row['list'] = $bcate_list;
             $filter_row_data['nav_list'][] = $filter_row;
             $scate_list = load_auto_cache("cache_shop_cate", array("pid" => $bcate_info['id']));
             foreach ($scate_list as $k => $v) {
                 $scate_list[$k]['url'] = $v['score_url'];
             }
         }
         //输出小分类
         if ($scate_list) {
             $tmp_url_param = $url_param;
             $tmp_url_param['cid'] = $bcate_info['id'];
             if ($scate_info) {
                 $scate_list_out[] = array("name" => "全部", "url" => url("index", "scores", $tmp_url_param));
             } else {
                 $scate_list_out[] = array("name" => "全部", "url" => url("index", "scores", $tmp_url_param), "current" => true);
             }
             foreach ($scate_list as $k => $v) {
                 if ($v['id'] == $shop_cate_id) {
                     $v['current'] = true;
                 }
                 $scate_list_out[] = $v;
             }
             $filter_row_data['filter_list'][] = array("name" => "分类", "list" => $scate_list_out);
         }
         if ($bcate_info) {
             $page_title = $bcate_info['name'] . " - " . $page_title;
             $page_keyword = $page_keyword . "," . $bcate_info['name'];
             $page_description = $page_description . "," . $bcate_info['name'];
         }
         if ($scate_info) {
             $page_title = $scate_info['name'] . " - " . $page_title;
             $page_keyword = $page_keyword . "," . $scate_info['name'];
             $page_description = $page_description . "," . $scate_info['name'];
         }
     } else {
         //输出大分类
         $bcate_list = load_auto_cache("cache_shop_cate", array("pid" => 0));
         foreach ($bcate_list as $k => $v) {
             $bcate_list[$k]['url'] = $v['score_url'];
         }
         $filter_row_data['filter_list'][] = array("name" => "分类", "list" => $bcate_list);
     }
     //有分类结束
     //关于品牌筛选
     if ($brand_list) {
         $brand_list_bak = $brand_list;
         $brand_list = array();
         $tmp_url_param = $url_param;
         unset($tmp_url_param['bid']);
         $brand_list[] = array("name" => "全部", "url" => url("index", "scores", $tmp_url_param), "current" => true);
         foreach ($brand_list_bak as $k => $v) {
             $tmp_url_param = $url_param;
             $tmp_url_param['bid'] = $v['id'];
             $v['url'] = url("index", "scores", $tmp_url_param);
             $brand_list[] = $v;
         }
     }
     if ($brand_info) {
         //选中大分类
         $filter_row = array();
         $tmp_url_param = $url_param;
         unset($tmp_url_param['bid']);
         $filter_row['current'] = array("name" => $brand_info['name'], "cancel" => url("index", "scores", $tmp_url_param));
         $filter_row['list'] = $brand_list;
         $filter_row_data['nav_list'][] = $filter_row;
         $page_title = $brand_info['name'] . " - " . $page_title;
         $page_keyword = $page_keyword . "," . $brand_info['name'];
         $page_description = $page_description . "," . $brand_info['name'];
     } else {
         if ($brand_list) {
             //输出品牌
             $filter_row_data['filter_list'][] = array("name" => "品牌", "list" => $brand_list);
         }
     }
     //end 品牌
     $GLOBALS['tmpl']->assign("filter_row_data", $filter_row_data);
     //输出排序
     $sort_row_data = array();
     /* $sort_row_data = array(
     			"sort"	=> array(
     				array("name"=>"xxx","key"=>"xxx","type"=>"desc|asc","url"=>"xxx","current"=>"true|false")		
     			),
     			"range"	=> array(
     				array
     				(
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     				)
     			),
     			"tag"	=> array(
     				array("name"=>"xxx","url"=>"xxx","checked"=>"true|false")
     			)		
     		); */
     //默认排序
     $tmp_url_param = $url_param;
     unset($tmp_url_param['type']);
     unset($tmp_url_param['sort']);
     if (empty($url_param['sort'])) {
         $current = true;
     } else {
         $current = false;
     }
     $sort_list[] = array("name" => "默认排序", "current" => $current, "url" => url("index", "scores", $tmp_url_param));
     //价格排序
     $tmp_url_param = $url_param;
     if ($tmp_url_param['sort'] == "return_score") {
         if ($tmp_url_param['type'] == "desc") {
             $tmp_url_param['type'] = "asc";
             $c_sort_type = "desc";
         } else {
             $tmp_url_param['type'] = "desc";
             $c_sort_type = "asc";
         }
         $current = true;
     } else {
         $tmp_url_param['sort'] = "return_score";
         $tmp_url_param['type'] = "desc";
         $c_sort_type = "desc";
         $current = false;
     }
     $sort_list[] = array("name" => "积分", "key" => "return_score", "type" => $c_sort_type, "current" => $current, "url" => url("index", "scores", $tmp_url_param));
     //销量排序
     $tmp_url_param = $url_param;
     if ($tmp_url_param['sort'] == "buy_count") {
         if ($tmp_url_param['type'] == "desc") {
             $tmp_url_param['type'] = "asc";
             $c_sort_type = "desc";
         } else {
             $tmp_url_param['type'] = "desc";
             $c_sort_type = "asc";
         }
         $current = true;
     } else {
         $tmp_url_param['sort'] = "buy_count";
         $tmp_url_param['type'] = "desc";
         $c_sort_type = "desc";
         $current = false;
     }
     $sort_list[] = array("name" => "销量", "key" => "buy_count", "type" => $c_sort_type, "current" => $current, "url" => url("index", "scores", $tmp_url_param));
     $sort_row_data['sort'] = $sort_list;
     $ext_condition = "  d.buy_type = 1 and d.is_shop = 1 ";
     $GLOBALS['tmpl']->assign("sort_row_data", $sort_row_data);
     //开始获取商品
     //获取排序条件
     //积分商城积分排序相反
     if ($url_param['sort'] == "return_score") {
         $sort_type = $url_param['type'] == "desc" ? "asc" : "desc";
     } else {
         $sort_type = $url_param['type'];
     }
     if ($url_param['sort']) {
         $sort_field = "d." . $url_param['sort'] . " " . $sort_type;
     }
     require_once APP_ROOT_PATH . "system/model/deal.php";
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("DEAL_PAGE_SIZE") . "," . app_conf("DEAL_PAGE_SIZE");
     $condition_param = $url_param;
     $condition_param['city_id'] = $GLOBALS['city']['id'];
     $deal_result = get_goods_list($limit, array(DEAL_ONLINE, DEAL_NOTICE), $condition_param, "", $ext_condition, $sort_field);
     $deal_list = $deal_result['list'];
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal as d where " . $deal_result['condition']);
     $page = new Page($total, app_conf("DEAL_PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign('deal_list', $deal_list);
     $side_deal_result = get_goods_list(app_conf("SIDE_DEAL_COUNT"), array(DEAL_ONLINE, DEAL_NOTICE), array("city_id" => $GLOBALS['city']['id']), "", " d.buy_type = 1 and d.is_shop = 1 ", " d.buy_count desc ");
     $side_deal_list = $side_deal_result['list'];
     $GLOBALS['tmpl']->assign('side_deal_list', $side_deal_list);
     $GLOBALS['tmpl']->assign("page_title", $page_title);
     $GLOBALS['tmpl']->assign("page_keyword", $page_keyword);
     $GLOBALS['tmpl']->assign("page_description", $page_description);
     $GLOBALS['tmpl']->display("scores.html");
 }
コード例 #28
0
ファイル: youhuisModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     require_once APP_ROOT_PATH . "system/model/youhui.php";
     //浏览历史
     $history_ids = get_view_history("youhui");
     //浏览历史
     if ($history_ids) {
         $ids_conditioin = " y.id in (" . implode(",", $history_ids) . ") ";
         $history_deal_list = get_youhui_list(app_conf("SIDE_DEAL_COUNT"), array(YOUHUI_ONLINE), array("city_id" => $GLOBALS['city']['id']), "", $ids_conditioin);
         //重新组装排序
         $history_list = array();
         foreach ($history_ids as $k => $v) {
             foreach ($history_deal_list['list'] as $history_item) {
                 if ($history_item['id'] == $v) {
                     $history_list[] = $history_item;
                 }
             }
         }
         $GLOBALS['tmpl']->assign("history_deal_list", $history_list);
     }
     //参数处理
     $deal_cate_id = intval($_REQUEST['cid']);
     if ($deal_cate_id) {
         $url_param['cid'] = $deal_cate_id;
     }
     $deal_type_id = intval($_REQUEST['tid']);
     if ($deal_type_id) {
         $url_param['tid'] = $deal_type_id;
     }
     $deal_area_id = intval($_REQUEST['aid']);
     if ($deal_area_id) {
         $url_param['aid'] = $deal_area_id;
     }
     $deal_quan_id = intval($_REQUEST['qid']);
     if ($deal_quan_id) {
         $url_param['qid'] = $deal_quan_id;
     }
     $sort_name = strim($_REQUEST["sort"]);
     if ($sort_name != "user_count") {
         $sort_name = "";
     }
     if ($sort_name) {
         $url_param['sort'] = $sort_name;
     }
     $sort_type = strim($_REQUEST['type']) == "asc" ? "asc" : "desc";
     if ($_REQUEST['type']) {
         $url_param['type'] = $sort_type;
     }
     if (isset($_REQUEST['ytype'])) {
         //2减免:满立减 1:代金券
         $ytype = intval($_REQUEST['ytype']);
         $url_param['ytype'] = $ytype;
     }
     if ($GLOBALS['kw']) {
         $url_param['kw'] = $GLOBALS['kw'];
     }
     //条件初始化
     $condition = " 1=1 ";
     //输出自定义的filter_row
     /* array(
     				"nav_list"=>array(
     						array( //导航类型的切换
     							"current"=>array("name"=>'xxx',"url"=>"当前的地址","cancel"=>"取消的地址"),
     							"list"=>array(
     									array("name"=>"xxx","url"=>"xxx")
     								)
     						)
     				),
     				"filter_list"=>array( //列表类型的切换
     					array(
     						"name"=>"分类",
     						"list"	=> array(
     								array("name"=>"xxx","url"=>"xxx")
     						)
     					)		
     				)
     			
     		); */
     //seo元素
     $page_title = "优惠券";
     $page_keyword = "优惠券";
     $page_description = "优惠券";
     $area_result = load_auto_cache("cache_area", array("city_id" => $GLOBALS['city']['id']));
     //商圈缓存
     $cate_list = load_auto_cache("cache_deal_cate");
     //分类缓存
     $cache_param = array("cid" => $deal_cate_id, "tid" => $deal_type_id, "aid" => $deal_area_id, "qid" => $deal_quan_id, "city_id" => intval($GLOBALS['city']['id']));
     $filter_nav_data = load_auto_cache("youhui_filter_nav_cache", $cache_param);
     if ($deal_cate_id > 0 && $cate_list[$deal_cate_id] || $deal_area_id > 0 && $area_result[$deal_area_id] && $area_result[$deal_area_id]['pid'] == 0) {
         $filter_row_data['nav_list'][] = array("current" => array("name" => "全部", "url" => url("index", "youhuis")));
     }
     //全部
     if ($deal_cate_id > 0 && $cate_list[$deal_cate_id]) {
         $filter_row = array();
         $tmp_url_param = $url_param;
         unset($tmp_url_param['cid']);
         unset($tmp_url_param['tid']);
         $filter_row['current'] = array("name" => $cate_list[$deal_cate_id]['name'], "cancel" => url("index", "youhuis", $tmp_url_param));
         $filter_row['list'] = $filter_nav_data['bcate_list'];
         $filter_row_data['nav_list'][] = $filter_row;
         //输出小分类
         if ($filter_nav_data['scate_list']) {
             $filter_row_data['filter_list'][] = array("name" => "分类", "list" => $filter_nav_data['scate_list']);
         }
         $page_title = $cate_list[$deal_cate_id]['name'] . " - " . $page_title;
         $page_keyword = $page_keyword . "," . $cate_list[$deal_cate_id]['name'];
         $page_description = $page_description . "," . $cate_list[$deal_cate_id]['name'];
         $type_list = load_auto_cache("cache_deal_cate_type", array("cate_id" => $deal_cate_id));
         if ($deal_type_id > 0 && $type_list[$deal_type_id]) {
             $page_title = $type_list[$deal_type_id]['name'] . " - " . $page_title;
             $page_keyword = $page_keyword . "," . $type_list[$deal_type_id]['name'];
             $page_description = $page_description . "," . $type_list[$deal_type_id]['name'];
         }
     } else {
         //输出大分类
         $filter_row_data['filter_list'][] = array("name" => "分类", "list" => $filter_nav_data['bcate_list']);
     }
     if ($deal_area_id > 0 && $area_result[$deal_area_id] && $area_result[$deal_area_id]['pid'] == 0) {
         $filter_row = array();
         $tmp_url_param = $url_param;
         unset($tmp_url_param['qid']);
         unset($tmp_url_param['aid']);
         $filter_row['current'] = array("name" => $area_result[$deal_area_id]['name'], "cancel" => url("index", "youhuis", $tmp_url_param));
         $filter_row['list'] = $filter_nav_data['bquan_list'];
         $filter_row_data['nav_list'][] = $filter_row;
         //输出小商圈
         if ($filter_nav_data['squan_list']) {
             $filter_row_data['filter_list'][] = array("name" => "商圈", "list" => $filter_nav_data['squan_list']);
         }
         $page_title = $area_result[$deal_area_id]['name'] . " - " . $page_title;
         $page_keyword = $page_keyword . "," . $area_result[$deal_area_id]['name'];
         $page_description = $page_description . "," . $area_result[$deal_area_id]['name'];
         if ($deal_quan_id > 0 && $area_result[$deal_quan_id] && $area_result[$deal_quan_id]['pid'] != 0) {
             $page_title = $area_result[$deal_quan_id]['name'] . " - " . $page_title;
             $page_keyword = $page_keyword . "," . $area_result[$deal_quan_id]['name'];
             $page_description = $page_description . "," . $area_result[$deal_quan_id]['name'];
         }
     } else {
         //输出大商圈
         $filter_row_data['filter_list'][] = array("name" => "地区", "list" => $filter_nav_data['bquan_list']);
     }
     $GLOBALS['tmpl']->assign("filter_row_data", $filter_row_data);
     //输出排序
     $sort_row_data = array();
     /* $sort_row_data = array(
     			"sort"	=> array(
     				array("name"=>"xxx","key"=>"xxx","type"=>"desc|asc","url"=>"xxx","current"=>"true|false")		
     			),
     			"range"	=> array(
     				array
     				(
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     				)
     			),
     			"tag"	=> array(
     				array("name"=>"xxx","url"=>"xxx","checked"=>"true|false")
     			)		
     		); */
     //默认排序
     $tmp_url_param = $url_param;
     unset($tmp_url_param['type']);
     unset($tmp_url_param['sort']);
     if (empty($url_param['sort'])) {
         $current = true;
     } else {
         $current = false;
     }
     $sort_list[] = array("name" => "默认排序", "current" => $current, "url" => url("index", "youhuis", $tmp_url_param));
     //价格排序
     $tmp_url_param = $url_param;
     if ($tmp_url_param['sort'] == "user_count") {
         if ($tmp_url_param['type'] == "desc") {
             $tmp_url_param['type'] = "asc";
             $c_sort_type = "desc";
         } else {
             $tmp_url_param['type'] = "desc";
             $c_sort_type = "asc";
         }
         $current = true;
     } else {
         $tmp_url_param['sort'] = "user_count";
         $tmp_url_param['type'] = "desc";
         $c_sort_type = "desc";
         $current = false;
     }
     $sort_list[] = array("name" => "下载量", "key" => "user_count", "type" => $c_sort_type, "current" => $current, "url" => url("index", "youhuis", $tmp_url_param));
     $sort_row_data['sort'] = $sort_list;
     //标签筛选
     //0减免:满立减 1:代金券
     $tag_condition = "";
     for ($i = 0; $i <= 1; $i++) {
         $t = $i == 1 ? $i : 2;
         $checked = false;
         if (isset($url_param['ytype']) && $url_param['ytype'] == $t) {
             $checked = true;
         }
         $tmp_url_param = $url_param;
         if (isset($tmp_url_param['ytype']) && $tmp_url_param['ytype'] == $t) {
             unset($tmp_url_param['ytype']);
         } else {
             $tmp_url_param['ytype'] = $t;
         }
         $dtags[] = array("name" => lang("YOUHUI_TYPE" . $i), "checked" => $checked, "url" => url("index", "youhuis", $tmp_url_param));
     }
     if (isset($url_param['ytype'])) {
         if ($url_param['ytype'] == 1) {
             $ext_condition = " y.youhui_type = '" . $url_param['ytype'] . "' ";
         } else {
             $ext_condition = " y.youhui_type = 0 ";
         }
     }
     $sort_row_data['tag'] = $dtags;
     $GLOBALS['tmpl']->assign("sort_row_data", $sort_row_data);
     //开始获取优惠券
     //获取排序条件
     if ($url_param['sort']) {
         $sort_field = "y." . $url_param['sort'] . " " . $url_param['type'];
     }
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("DEAL_PAGE_SIZE") . "," . app_conf("DEAL_PAGE_SIZE");
     $condition_param = $url_param;
     $condition_param['city_id'] = $GLOBALS['city']['id'];
     if ($GLOBALS['kw']) {
         if ($ext_condition != "") {
             $ext_condition .= " and ";
         }
         $ext_condition .= " y.name like '%" . $GLOBALS['kw'] . "%' ";
     }
     $youhui_result = get_youhui_list($limit, array(YOUHUI_NOTICE, YOUHUI_ONLINE), $condition_param, "", $ext_condition, $sort_field);
     $youhui_list = $youhui_result['list'];
     foreach ($youhui_list as $k => $v) {
         $youhui_list[$k]['qrcode'] = gen_qrcode(SITE_DOMAIN . $v['url'], 3);
     }
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "youhui as y where " . $youhui_result['condition'], false);
     $page = new Page($total, app_conf("DEAL_PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign('youhui_list', $youhui_list);
     $side_youhui_result = get_youhui_list(app_conf("SIDE_DEAL_COUNT"), array(YOUHUI_ONLINE, YOUHUI_NOTICE), array("city_id" => $GLOBALS['city']['id']), "", "", " y.user_count desc ");
     $side_youhui_list = $side_youhui_result['list'];
     $GLOBALS['tmpl']->assign('side_youhui_list', $side_youhui_list);
     $GLOBALS['tmpl']->assign("page_title", $page_title);
     $GLOBALS['tmpl']->assign("page_keyword", $page_keyword);
     $GLOBALS['tmpl']->assign("page_description", $page_description);
     $GLOBALS['tmpl']->display("youhuis.html");
 }
コード例 #29
0
ファイル: discoverModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     require_once APP_ROOT_PATH . "system/model/topic.php";
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("wrap_type", "1");
     //宽屏展示
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     convert_req($_REQUEST);
     $title = $GLOBALS['lang']['DISCOVER'];
     $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index"));
     $site_nav[] = array('name' => $title, 'url' => url("index", "discover"));
     $GLOBALS['tmpl']->assign("site_nav", $site_nav);
     $cid = intval($_REQUEST['cid']);
     $cate_name = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "topic_tag_cate where id = " . $cid);
     $GLOBALS['tmpl']->assign("cid", $cid);
     $tag = strim($_REQUEST['tag']);
     if ($tag) {
         $GLOBALS['tmpl']->assign("tag", $tag);
     }
     if ($GLOBALS['kw']) {
         $GLOBALS['tmpl']->assign("tag", $GLOBALS['kw']);
     }
     if ($cate_name) {
         $title = $title . $cate_name;
     }
     if ($tag) {
         $title = $title . $tag;
     }
     $GLOBALS['tmpl']->assign("page_title", $title);
     $GLOBALS['tmpl']->assign("page_keyword", $title . ",");
     $GLOBALS['tmpl']->assign("page_description", $title . ",");
     if ($cid == 0) {
         $tag_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "topic_tag where is_recommend = 1 order by sort desc limit 10");
     } else {
         $tag_list = $GLOBALS['db']->getAll("select t.* from " . DB_PREFIX . "topic_tag as t left join " . DB_PREFIX . "topic_tag_cate_link as l on l.tag_id = t.id where l.cate_id = " . $cid . " order by t.sort desc limit 10");
     }
     $GLOBALS['tmpl']->assign("tag_list", $tag_list);
     $cate_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "topic_tag_cate where showin_web = 1 order by sort desc limit 7");
     $GLOBALS['tmpl']->assign("cate_list", $cate_list);
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $GLOBALS['tmpl']->assign("page", $page);
     $condition = ' is_effect = 1 and is_delete = 0 ';
     $param['cid'] = $cid;
     $param['tag'] = $tag;
     $param_condition = build_topic_filter_condition($param);
     $condition .= " " . $param_condition;
     $condition .= " and fav_id = 0 and relay_id = 0 and has_image = 1 and type in ('share','sharedeal','shareyouhui','shareevent') ";
     $sql = "select count(*) from " . DB_PREFIX . "topic where " . $condition;
     $count = $GLOBALS['db']->getOne($sql);
     $page_size = PIN_PAGE_SIZE;
     $page = new Page($count, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $remain_count = $count - ($page - 1) * $page_size;
     //从当前页算起剩余的数量
     $remain_page = ceil($remain_count / $page_size);
     //剩余的页数
     if ($remain_page == 1) {
         //末页
         $step_size = ceil($remain_count / PIN_SECTOR);
     } else {
         $step_size = ceil(PIN_PAGE_SIZE / PIN_SECTOR);
     }
     $GLOBALS['tmpl']->assign('step_size', $step_size);
     $GLOBALS['tmpl']->display("discover.html");
 }
コード例 #30
0
ファイル: eventsModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     require_once APP_ROOT_PATH . "system/model/event.php";
     //浏览历史
     $history_ids = get_view_history("event");
     //浏览历史
     if ($history_ids) {
         $ids_conditioin = " e.id in (" . implode(",", $history_ids) . ") ";
         $history_deal_list = get_event_list(app_conf("SIDE_DEAL_COUNT"), array(EVENT_ONLINE), array("city_id" => $GLOBALS['city']['id']), "", $ids_conditioin);
         //重新组装排序
         $history_list = array();
         foreach ($history_ids as $k => $v) {
             foreach ($history_deal_list['list'] as $history_item) {
                 if ($history_item['id'] == $v) {
                     $history_list[] = $history_item;
                 }
             }
         }
         $GLOBALS['tmpl']->assign("history_deal_list", $history_list);
     }
     //参数处理
     $deal_cate_id = intval($_REQUEST['cid']);
     if ($deal_cate_id) {
         $url_param['cid'] = $deal_cate_id;
     }
     $deal_area_id = intval($_REQUEST['aid']);
     if ($deal_area_id) {
         $url_param['aid'] = $deal_area_id;
     }
     $deal_quan_id = intval($_REQUEST['qid']);
     if ($deal_quan_id) {
         $url_param['qid'] = $deal_quan_id;
     }
     $sort_name = strim($_REQUEST["sort"]);
     if ($sort_name != "submit_count") {
         $sort_name = "";
     }
     if ($sort_name) {
         $url_param['sort'] = $sort_name;
     }
     $sort_type = strim($_REQUEST['type']) == "asc" ? "asc" : "desc";
     if ($_REQUEST['type']) {
         $url_param['type'] = $sort_type;
     }
     if ($GLOBALS['kw']) {
         $url_param['kw'] = $GLOBALS['kw'];
     }
     //条件初始化
     $condition = " 1=1 ";
     //输出自定义的filter_row
     /* array(
     				"nav_list"=>array(
     						array( //导航类型的切换
     							"current"=>array("name"=>'xxx',"url"=>"当前的地址","cancel"=>"取消的地址"),
     							"list"=>array(
     									array("name"=>"xxx","url"=>"xxx")
     								)
     						)
     				),
     				"filter_list"=>array( //列表类型的切换
     					array(
     						"name"=>"分类",
     						"list"	=> array(
     								array("name"=>"xxx","url"=>"xxx")
     						)
     					)		
     				)
     			
     		); */
     //seo元素
     $page_title = "活动";
     $page_keyword = "活动";
     $page_description = "活动";
     $area_result = load_auto_cache("cache_area", array("city_id" => $GLOBALS['city']['id']));
     //商圈缓存
     $cate_list = load_auto_cache("cache_event_cate");
     //分类缓存
     $cache_param = array("cid" => $deal_cate_id, "aid" => $deal_area_id, "qid" => $deal_quan_id, "city_id" => intval($GLOBALS['city']['id']));
     $filter_nav_data = load_auto_cache("event_filter_nav_cache", $cache_param);
     if ($deal_cate_id > 0 && $cate_list[$deal_cate_id] || $deal_area_id > 0 && $area_result[$deal_area_id] && $area_result[$deal_area_id]['pid'] == 0) {
         $filter_row_data['nav_list'][] = array("current" => array("name" => "全部", "url" => url("index", "events")));
     }
     //全部
     if ($deal_cate_id > 0 && $cate_list[$deal_cate_id]) {
         $filter_row = array();
         $tmp_url_param = $url_param;
         unset($tmp_url_param['cid']);
         unset($tmp_url_param['tid']);
         $filter_row['current'] = array("name" => $cate_list[$deal_cate_id]['name'], "cancel" => url("index", "events", $tmp_url_param));
         $filter_row['list'] = $filter_nav_data['bcate_list'];
         $filter_row_data['nav_list'][] = $filter_row;
         $page_title = $cate_list[$deal_cate_id]['name'] . " - " . $page_title;
         $page_keyword = $page_keyword . "," . $cate_list[$deal_cate_id]['name'];
         $page_description = $page_description . "," . $cate_list[$deal_cate_id]['name'];
     } else {
         //输出大分类
         $filter_row_data['filter_list'][] = array("name" => "分类", "list" => $filter_nav_data['bcate_list']);
     }
     if ($deal_area_id > 0 && $area_result[$deal_area_id] && $area_result[$deal_area_id]['pid'] == 0) {
         $filter_row = array();
         $tmp_url_param = $url_param;
         unset($tmp_url_param['qid']);
         unset($tmp_url_param['aid']);
         $filter_row['current'] = array("name" => $area_result[$deal_area_id]['name'], "cancel" => url("index", "events", $tmp_url_param));
         $filter_row['list'] = $filter_nav_data['bquan_list'];
         $filter_row_data['nav_list'][] = $filter_row;
         //输出小商圈
         if ($filter_nav_data['squan_list']) {
             $filter_row_data['filter_list'][] = array("name" => "商圈", "list" => $filter_nav_data['squan_list']);
         }
         $page_title = $area_result[$deal_area_id]['name'] . " - " . $page_title;
         $page_keyword = $page_keyword . "," . $area_result[$deal_area_id]['name'];
         $page_description = $page_description . "," . $area_result[$deal_area_id]['name'];
         if ($deal_quan_id > 0 && $area_result[$deal_quan_id] && $area_result[$deal_quan_id]['pid'] != 0) {
             $page_title = $area_result[$deal_quan_id]['name'] . " - " . $page_title;
             $page_keyword = $page_keyword . "," . $area_result[$deal_quan_id]['name'];
             $page_description = $page_description . "," . $area_result[$deal_quan_id]['name'];
         }
     } else {
         //输出大商圈
         $filter_row_data['filter_list'][] = array("name" => "地区", "list" => $filter_nav_data['bquan_list']);
     }
     $GLOBALS['tmpl']->assign("filter_row_data", $filter_row_data);
     //输出排序
     $sort_row_data = array();
     /* $sort_row_data = array(
     			"sort"	=> array(
     				array("name"=>"xxx","key"=>"xxx","type"=>"desc|asc","url"=>"xxx","current"=>"true|false")		
     			),
     			"range"	=> array(
     				array
     				(
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     				)
     			),
     			"tag"	=> array(
     				array("name"=>"xxx","url"=>"xxx","checked"=>"true|false")
     			)		
     		); */
     //默认排序
     $tmp_url_param = $url_param;
     unset($tmp_url_param['type']);
     unset($tmp_url_param['sort']);
     if (empty($url_param['sort'])) {
         $current = true;
     } else {
         $current = false;
     }
     $sort_list[] = array("name" => "默认排序", "current" => $current, "url" => url("index", "events", $tmp_url_param));
     //价格排序
     $tmp_url_param = $url_param;
     if ($tmp_url_param['sort'] == "submit_count") {
         if ($tmp_url_param['type'] == "desc") {
             $tmp_url_param['type'] = "asc";
             $c_sort_type = "desc";
         } else {
             $tmp_url_param['type'] = "desc";
             $c_sort_type = "asc";
         }
         $current = true;
     } else {
         $tmp_url_param['sort'] = "submit_count";
         $tmp_url_param['type'] = "desc";
         $c_sort_type = "desc";
         $current = false;
     }
     $sort_list[] = array("name" => "报名量", "key" => "submit_count", "type" => $c_sort_type, "current" => $current, "url" => url("index", "events", $tmp_url_param));
     $sort_row_data['sort'] = $sort_list;
     $GLOBALS['tmpl']->assign("sort_row_data", $sort_row_data);
     //开始获取优惠券
     //获取排序条件
     if ($url_param['sort']) {
         $sort_field = "e." . $url_param['sort'] . " " . $url_param['type'];
     }
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("DEAL_PAGE_SIZE") . "," . app_conf("DEAL_PAGE_SIZE");
     $condition_param = $url_param;
     $condition_param['city_id'] = $GLOBALS['city']['id'];
     if ($GLOBALS['kw']) {
         if ($ext_condition != "") {
             $ext_condition .= " and ";
         }
         $ext_condition .= " e.name like '%" . $GLOBALS['kw'] . "%' ";
     }
     $event_result = get_event_list($limit, array(EVENT_NOTICE, EVENT_ONLINE), $condition_param, "", $ext_condition, $sort_field);
     $event_list = $event_result['list'];
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "event as e where " . $event_result['condition'], false);
     $page = new Page($total, app_conf("DEAL_PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign('event_list', $event_list);
     $side_event_result = get_event_list(app_conf("SIDE_DEAL_COUNT"), array(EVENT_NOTICE, EVENT_ONLINE), array("city_id" => $GLOBALS['city']['id']), "", " is_recommend = 1 ", " e.submit_count desc ");
     $side_event_list = $side_event_result['list'];
     $GLOBALS['tmpl']->assign('side_event_list', $side_event_list);
     $GLOBALS['tmpl']->assign("page_title", $page_title);
     $GLOBALS['tmpl']->assign("page_keyword", $page_keyword);
     $GLOBALS['tmpl']->assign("page_description", $page_description);
     $GLOBALS['tmpl']->display("events.html");
 }