示例#1
0
 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");
 }
示例#2
0
 function save()
 {
     $url = $_GET['referer'];
     es_session::set("gopreview", $url);
     if (!$GLOBALS['user_info']) {
         app_redirect(url_wap("user#login"));
     }
     $info_data = array();
     $info_data['user_id'] = $GLOBALS['user_info']['id'];
     $info_data['name'] = $GLOBALS['user_info']['user_name'];
     $info_data['mobile'] = $GLOBALS['user_info']['mobile'];
     $info_data['ip'] = get_client_ip();
     $info_data['type'] = $_GET['f'];
     $info_data['creat_time'] = time();
     $tmp_zhuanti_user_info = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "zhuanti_user where (mobile='" . $info_data['mobile'] . "' or user_id=" . $info_data['user_id'] . ") and type=2");
     if ($tmp_zhuanti_user_info) {
         app_redirect("http://www.51zhishang.com/course/54.html");
     }
     $GLOBALS['db']->autoExecute(DB_PREFIX . "zhuanti_user", $info_data, "INSERT");
     $msgInfo = array();
     $msgInfo['title'] = '专题报名';
     $msgInfo['content'] = '专题报名';
     send_zhuanti_sms($info_data['mobile'], $msgInfo, 3812);
     $data['status'] = 1;
     $data['info'] = "报名成功!";
     app_redirect("http://www.51zhishang.com/course/54.html");
 }
示例#3
0
 private function view()
 {
     $id = intval($_REQUEST['id']);
     if ($id == 0) {
         app_redirect(url("index", "usagetip"));
     }
     $GLOBALS['tmpl']->caching = true;
     $GLOBALS['tmpl']->cache_lifetime = 6000;
     //首页缓存10分钟
     $cache_id = md5(MODULE_NAME . ACTION_NAME . "view" . $id);
     if (!$GLOBALS['tmpl']->is_cached("page/usagetip_view.html", $cache_id)) {
         $article = get_article($id);
         $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 . ",");
         //使用技巧
         $use_tech_list = get_article_list(6, 6);
         $GLOBALS['tmpl']->assign("use_tech_list", $use_tech_list);
     }
     $GLOBALS['tmpl']->display("page/usagetip_view.html", $cache_id);
 }
 public function send()
 {
     if (!$GLOBALS['user_info']) {
         app_redirect(url("user#login"));
     }
     $page_size = DEAL_COMMENT_PAGE_SIZE;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $sql = "select * from " . DB_PREFIX . "deal_comment where user_id = " . intval($GLOBALS['user_info']['id']) . " order by create_time desc limit " . $limit;
     $sql_count = "select count(*) from " . DB_PREFIX . "deal_comment where user_id = " . intval($GLOBALS['user_info']['id']);
     $comment_list = $GLOBALS['db']->getAll($sql);
     $deal_list = array();
     foreach ($comment_list as $k => $v) {
         if ($deal_list[$v['deal_id']]) {
             $comment_list[$k]['deal_info'] = $deal_list[$v['deal_id']];
         } else {
             $comment_list[$k]['deal_info'] = $GLOBALS['db']->getRow("select id,name from " . DB_PREFIX . "deal where id = " . $v['deal_id']);
             $deal_list[$v['deal_id']] = $comment_list[$k]['deal_info'];
         }
     }
     $comment_count = $GLOBALS['db']->getOne($sql_count);
     $GLOBALS['tmpl']->assign("comment_list", $comment_list);
     $page = new Page($comment_count, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->display("comment_send.html");
 }
示例#5
0
 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");
 }
 public function history()
 {
     if (!$GLOBALS['user_info']) {
         app_redirect(url("user#login"));
     }
     $dest_user_id = intval($_REQUEST['id']);
     $dest_user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $dest_user_id . " and is_effect = 1");
     if (!$dest_user_info) {
         app_redirect(url("message"));
     }
     $GLOBALS['db']->query("update " . DB_PREFIX . "user_message set is_read = 1 where user_id = " . intval($GLOBALS['user_info']['id']) . " and dest_user_id = " . $dest_user_id);
     $page_size = 20;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $sql = "select * from " . DB_PREFIX . "user_message  where user_id = " . intval($GLOBALS['user_info']['id']) . " and dest_user_id = " . $dest_user_id . " order by create_time desc limit " . $limit;
     $sql_count = "select count(*) from " . DB_PREFIX . "user_message where user_id = " . intval($GLOBALS['user_info']['id']) . " and dest_user_id = " . $dest_user_id;
     $message_list = $GLOBALS['db']->getAll($sql);
     $message_count = $GLOBALS['db']->getOne($sql_count);
     $GLOBALS['tmpl']->assign("dest_user_info", $dest_user_info);
     $GLOBALS['tmpl']->assign("message_list", $message_list);
     require APP_ROOT_PATH . 'app/Lib/page.php';
     $page = new Page($message_count, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->display("message_history.html");
 }
 public function save()
 {
     $data = $_POST;
     foreach ($data as $k => $v) {
         if ($k == "description") {
             $data[$k] = replace_public(btrim($v));
         } else {
             $data[$k] = strim($v);
         }
     }
     $data['user_id'] = intval($GLOBALS['user_info']['id']);
     $mode = "INSERT";
     $where = "";
     if ($GLOBALS['db']->getOne("SELECT count(*) FROM " . DB_PREFIX . "user_company WHERE user_id=" . intval($GLOBALS['user_info']['id'])) > 0) {
         $mode = "UPDATE";
         $where = "user_id=" . intval($GLOBALS['user_info']['id']);
     }
     $GLOBALS['db']->autoExecute(DB_PREFIX . "user_company", $data, $mode, $where);
     if ($GLOBALS['db']->affected_rows() > 0) {
         $user_info_re = array();
         $user_info_re['enterpriseName'] = $data['enterpriseName'];
         $user_info_re['bankLicense'] = $data['bankLicense'];
         $user_info_re['orgNo'] = $data['orgNo'];
         $user_info_re['businessLicense'] = $data['businessLicense'];
         $user_info_re['taxNo'] = $data['enterpriseName'];
         $GLOBALS['db']->autoExecute(DB_PREFIX . "user", $user_info_re, "UPDATE", "id=" . intval($GLOBALS['user_info']['id']));
     }
     app_redirect(url("index", "uc_company#index"));
 }
 public function detail()
 {
     $id = intval($_REQUEST['id']);
     $aid = intval($_REQUEST['aid']);
     if ($id == 0) {
         app_redirect(url("index", "guarantee"));
     }
     $article_cate = get_acate_tree(12);
     $info = null;
     foreach ($article_cate as $k => $v) {
         if ($id == $v['id']) {
             $info = $v;
         }
         $article_cate[$k]['article'] = get_article_list(100, $v['id'], "", "", true);
     }
     $GLOBALS['tmpl']->assign("article_cate", $article_cate);
     $GLOBALS['tmpl']->assign("id", $id);
     $GLOBALS['tmpl']->assign("aid", $aid);
     $seo_title = $info['seo_title'] != '' ? $info['seo_title'] : $info['title'];
     $GLOBALS['tmpl']->assign("page_title", $seo_title . " - 安全保障");
     $seo_keyword = $info['seo_keyword'] != '' ? $info['seo_keyword'] : $info['title'];
     $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ",安全保障,");
     $seo_description = $info['seo_description'] != '' ? $info['seo_description'] : $info['title'];
     $GLOBALS['tmpl']->assign("page_description", $seo_description . ",安全保障,");
     $GLOBALS['tmpl']->display("page/guarantee_detail.html");
 }
 public function loginout()
 {
     es_cookie::delete("sp_account_name");
     es_cookie::delete("sp_account_password");
     es_session::delete("account_info");
     app_redirect(url("biz", "index"));
 }
示例#10
0
 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");
 }
示例#11
0
 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");
 }
 public function index()
 {
     $user_id = intval($GLOBALS['user_info']['id']);
     if (!$user_id) {
         app_redirect(url("index"));
     }
     //返利列表
     $page = intval($_REQUEST['p']) > 0 ? intval($_REQUEST['p']) : 1;
     $referrals_count = $GLOBALS['db']->getRow("select count(*) as count,sum(score) as total_score from " . DB_PREFIX . "referrals where user_id= " . $user_id . " ");
     if ($referrals_count) {
         $page_size = ACCOUNT_PAGE_SIZE;
         $limit = ($page - 1) * $page_size . "," . $page_size;
         $sql = "select r.*,u.create_time as register_time from " . DB_PREFIX . "referrals as r " . " left join " . DB_PREFIX . "user as u on u.id=r.user_id " . " where user_id=" . $user_id . " order by id desc limit " . $limit;
         $referrals_list = $GLOBALS['db']->getAll($sql);
         $page = new Page($referrals_count['count'], $page_size);
         //初始化分页类
         $p = $page->show();
         $GLOBALS['tmpl']->assign("pages", $p);
     }
     //邀请连接
     $referrals_url = get_domain() . APP_ROOT . "/";
     if ($GLOBALS['user_info']) {
         $referrals_url .= "?ref=" . base64_encode(intval($user_id));
     }
     $GLOBALS['tmpl']->assign("referrals_url", $referrals_url);
     $GLOBALS['tmpl']->assign('referrals_list', $referrals_list);
     $GLOBALS['tmpl']->assign('referrals_count', $referrals_count);
     $GLOBALS['tmpl']->assign("page_title", "我的邀请");
     $GLOBALS['tmpl']->display("referrals_index.html");
 }
示例#13
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);
 }
示例#14
0
 public function init()
 {
     if (!$GLOBALS['user_info']) {
         if ($_REQUEST['ajax'] == 1) {
             ajax_return(array("status" => 0, "info" => "请先登录"));
         } else {
             es_session::set('before_login', $_SERVER['REQUEST_URI']);
             app_redirect(url("index", "user#login"));
         }
     }
     $id = intval($_REQUEST['id']);
     $this->space_user = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $id . " and is_effect=  1 and is_delete = 0");
     $user_id = intval($GLOBALS['user_info']['id']);
     if (!$this->space_user) {
         showErr($GLOBALS['lang']['USER_NOT_EXISTS']);
     }
     $focus_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_focus where focus_user_id = " . $user_id . " and focused_user_id = " . $this->space_user['id']);
     if ($focus_data) {
         $this->space_user['focused'] = 1;
     }
     $province_str = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "region_conf where id = " . $this->space_user['province_id']);
     $city_str = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "region_conf where id = " . $this->space_user['city_id']);
     if ($province_str . $city_str == '') {
         $user_location = $GLOBALS['lang']['LOCATION_NULL'];
     } else {
         $user_location = $province_str . " " . $city_str;
     }
     $this->space_user['fav_count'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic where user_id = " . $this->space_user['id'] . " and fav_id <> 0");
     $this->space_user['user_location'] = $user_location;
     $this->space_user['group_name'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "user_group where id = " . $this->space_user['group_id'] . " ");
     $GLOBALS['tmpl']->assign("space_user", $this->space_user);
     $GLOBALS['tmpl']->assign('user_statics', sys_user_status($id, true));
 }
 public function index()
 {
     global $tmpl;
     $rel_table = addslashes(trim($_REQUEST['act']));
     $message_type = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "message_type where type_name='" . $rel_table . "' and type_name <> 'supplier'");
     if (!$message_type || $message_type['is_fix'] == 0) {
         app_redirect(APP_ROOT . "/");
     }
     $rel_table = $message_type['type_name'];
     $condition = '';
     $id = intval($_REQUEST['id']);
     if ($rel_table == 'deal') {
         $deal = get_deal($id);
         if ($deal['buy_type'] != 1) {
             $GLOBALS['tmpl']->assign("deal", $deal);
         }
         $id = $deal['id'];
     }
     require APP_ROOT_PATH . 'app/Lib/side.php';
     if ($id > 0) {
         $condition = "rel_table = '" . $rel_table . "' and rel_id = " . $id;
     } else {
         $condition = "rel_table = '" . $rel_table . "'";
     }
     if (app_conf("USER_MESSAGE_AUTO_EFFECT") == 0) {
         $condition .= " and user_id = " . intval($GLOBALS['user_info']['id']);
     } else {
         if ($message_type['is_effect'] == 0) {
             $condition .= " and user_id = " . intval($GLOBALS['user_info']['id']);
         }
     }
     $condition .= " and is_buy = " . intval($_REQUEST['is_buy']);
     //message_form 变量输出
     $GLOBALS['tmpl']->assign("post_title", $message_type['show_name']);
     $GLOBALS['tmpl']->assign("page_title", $message_type['show_name']);
     $GLOBALS['tmpl']->assign('rel_id', $id);
     $GLOBALS['tmpl']->assign('rel_table', $rel_table);
     $GLOBALS['tmpl']->assign('is_buy', intval($_REQUEST['is_buy']));
     if (intval($_REQUEST['is_buy']) == 1) {
         $GLOBALS['tmpl']->assign("post_title", $GLOBALS['lang']['AFTER_BUY']);
         $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['AFTER_BUY']);
     }
     if (!$GLOBALS['user_info']) {
         $GLOBALS['tmpl']->assign("message_login_tip", sprintf($GLOBALS['lang']['MESSAGE_LOGIN_TIP'], url("shop", "user#login"), url("shop", "user#register")));
     }
     //分页
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $message = get_message_list($limit, $condition);
     $page = new Page($message['count'], app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("message_list", $message['list']);
     $GLOBALS['tmpl']->assign("user_auth", get_user_auth());
     $GLOBALS['tmpl']->display("message.html");
 }
示例#16
0
 public function fav()
 {
     if (!$GLOBALS['user_info']) {
         app_redirect(url("user#login"));
     }
     $GLOBALS['tmpl']->assign("page_title", "我关注的项目动态");
     $cate_result = load_dynamic_cache("INDEX_CATE_LIST");
     if ($cate_result === false) {
         $cate_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_cate order by sort asc");
         $cate_result = array();
         foreach ($cate_list as $k => $v) {
             $cate_result[$v['id']] = $v;
         }
         set_dynamic_cache("INDEX_CATE_LIST", $cate_result);
     }
     $GLOBALS['tmpl']->assign("cate_list", $cate_result);
     $rand_deals = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal where is_delete = 0 and is_effect = 1 and begin_time < " . NOW_TIME . " and (end_time >" . NOW_TIME . " or end_time = 0) order by rand() limit 3");
     $GLOBALS['tmpl']->assign("rand_deals", $rand_deals);
     $page_size = DEALUPDATE_PAGE_SIZE;
     $step_size = DEALUPDATE_STEP_SIZE;
     $step = intval($_REQUEST['step']);
     if ($step == 0) {
         $step = 1;
     }
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size + ($step - 1) * $step_size . "," . $step_size;
     $GLOBALS['tmpl']->assign("current_page", $page);
     $sql = "select dl.* from " . DB_PREFIX . "deal_log as dl left join " . DB_PREFIX . "deal_focus_log as dfl on dl.deal_id = dfl.deal_id where dfl.user_id = " . intval($GLOBALS['user_info']['id']) . " order by dl.create_time desc limit " . $limit;
     $sql_count = "select count(*) from " . DB_PREFIX . "deal_log as dl left join " . DB_PREFIX . "deal_focus_log as dfl on dl.deal_id = dfl.deal_id where dfl.user_id = " . intval($GLOBALS['user_info']['id']);
     $log_list = $GLOBALS['db']->getAll($sql);
     $log_count = $GLOBALS['db']->getOne($sql_count);
     foreach ($log_list as $k => $v) {
         $log_list[$k]['pass_time'] = pass_date($v['create_time']);
         $online_time = online_date($v['create_time'], $deal_info['begin_time']);
         $log_list[$k]['online_time'] = $online_time['info'];
         $log_list[$k]['comment_count'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_comment where log_id = " . $v['id']);
         $log_list[$k]['comment_list'] = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_comment where log_id = " . $v['id'] . " order by create_time desc limit 3");
         if ($log_list[$k]['comment_count'] <= count($log_list[$k]['comment_list'])) {
             $log_list[$k]['more_comment'] = false;
         } else {
             $log_list[$k]['more_comment'] = true;
         }
         $log_list[$k]['deal_info'] = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where id = " . $v['deal_id']);
         if ($log_list[$k]['deal_info']) {
             $log_list[$k]['deal_info']['remain_days'] = floor(($log_list[$k]['deal_info']['end_time'] - NOW_TIME) / (24 * 3600));
             $log_list[$k]['deal_info']['percent'] = round($log_list[$k]['deal_info']['support_amount'] / $log_list[$k]['deal_info']['limit_price'] * 100);
         }
     }
     $GLOBALS['tmpl']->assign('log_list', $log_list);
     $pager = new Page($log_count, $page_size);
     //初始化分页对象
     $p = $pager->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("ajaxurl", url("ajax#newsfav", array("p" => $page)));
     $GLOBALS['tmpl']->display("news.html");
 }
 public function index()
 {
     $preview = intval($_REQUEST['preview']);
     $event_id = intval($_REQUEST['id']);
     if ($preview > 0) {
         $event = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "event where id = " . $event_id);
         $adm_session = es_session::get(md5(app_conf("AUTH_KEY")));
         $adm_name = $adm_session['adm_name'];
         $adm_id = intval($adm_session['adm_id']);
         if ($adm_id == 0) {
             //验证是否当前的商家(不是后台管理员)
             $s_account_info = es_session::get("account_info");
             if ($s_account_info) {
                 foreach ($s_account_info['location_ids'] as $id) {
                     $location = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "supplier_location where id = " . $id);
                     if ($location) {
                         $locations[] = $location;
                     }
                 }
                 $deal_test = $GLOBALS['db']->getRow("select e.* from " . DB_PREFIX . "event as e left join " . DB_PREFIX . "event_location_link as l on l.event_id = e.id where e.id = " . intval($event['id']) . " and e.publish_wait = 1 and l.location_id in (" . implode(",", $s_account_info['location_ids']) . ")");
                 if (!$deal_test) {
                     showErr("活动不存在或者没有预览该活动的权限", 0, APP_ROOT . "/admin.php?m=Public&a=login");
                 }
             } else {
                 showErr("您不是系统管理员或者商家会员,无法预览", 0, APP_ROOT . "/");
             }
         }
     } else {
         $event = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "event where id = " . $event_id . " and is_effect = 1");
     }
     if (!$event) {
         app_redirect(url("youhui", "fcate"));
     }
     $GLOBALS['tmpl']->assign("event", $event);
     //开始输出当前的site_nav
     $cate = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "event_cate where id = " . $event['cate_id']);
     $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index", "index"));
     if ($cate) {
         $curl = url("youhui", "event#index", array("cid" => $cate['id']));
         $site_nav[] = array('name' => $cate['name'], 'url' => $curl);
     }
     $gurl = url("youhui", "edetail#index", array("id" => $event['id']));
     $site_nav[] = array('name' => $event['name'], 'url' => $gurl);
     $GLOBALS['tmpl']->assign("site_nav", $site_nav);
     //输出当前的site_nav
     $seo_title = $event['name'];
     $GLOBALS['tmpl']->assign("page_title", $seo_title);
     $seo_keyword = $event['name'];
     $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ",");
     $seo_description = $event['name'];
     $GLOBALS['tmpl']->assign("page_description", $seo_description . ",");
     $submit_result = $GLOBALS['db']->getAll("select user_id from " . DB_PREFIX . "event_submit where event_id = " . $event_id . " limit 18");
     $GLOBALS['tmpl']->assign("submit_result", $submit_result);
     if ($_REQUEST['plat'] == APP_PLAT) {
         $GLOBALS['tmpl']->display("youhui_app_edetail.html");
     } else {
         $GLOBALS['tmpl']->display("youhui_edetail.html");
     }
 }
 public function index()
 {
     if ($this->isios()) {
         app_redirect(app_conf("APPLE_DOWLOAD_URL"));
     } else {
         app_redirect(app_conf("ANDROID_DOWLOAD_URL"));
     }
 }
示例#19
0
 public function ignoreall()
 {
     if (!$GLOBALS['user_info']) {
         app_redirect(url("user#login"));
     }
     $GLOBALS['db']->query("update " . DB_PREFIX . "user_notify set is_read = 1 where user_id = " . intval($GLOBALS['user_info']['id']));
     app_redirect_preview();
 }
 public function index()
 {
     $id = intval($_REQUEST['id']);
     if ($id == 0) {
         //分页
         $page = intval($_REQUEST['p']);
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("DEAL_PAGE_SIZE") . "," . app_conf("DEAL_PAGE_SIZE");
         $condition = " brand_promote = 1 and (end_time = 0 or end_time > " . get_gmtime() . ") ";
         $brand_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "brand where " . $condition . " order by time_status asc,sort desc limit " . $limit);
         $brand_total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "brand where " . $condition);
         foreach ($brand_list as $k => $v) {
             $brand_list[$k]['url'] = url("shop", "discount#index", array("id" => $v['id']));
             $brand_list[$k]['time_status'] = syn_brand_status($v['id']);
         }
         $page = new Page($brand_total, app_conf("DEAL_PAGE_SIZE"));
         //初始化分页对象
         $p = $page->show();
         $GLOBALS['tmpl']->assign('pages', $p);
         //开始输出当前的site_nav
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/");
         $site_nav[] = array('name' => $GLOBALS['lang']['BRAND_DISCOUNT'], 'url' => url("shop", "discount#index"));
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         //输出当前的site_nav
         $GLOBALS['tmpl']->assign("brand_list", $brand_list);
         $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['BRAND_DISCOUNT']);
         $GLOBALS['tmpl']->assign("page_keyword", $GLOBALS['lang']['BRAND_DISCOUNT']);
         $GLOBALS['tmpl']->assign("page_description", $GLOBALS['lang']['BRAND_DISCOUNT']);
         //输出右侧的推荐
         $condition_rec = "buy_type <> 1 and is_effect =1 and is_delete = 0 and is_shop =1 and brand_promote = 1 and (begin_time = 0 or begin_time <= " . get_gmtime() . ") and (end_time = 0 or end_time > " . get_gmtime() . ") ";
         $rec_list = get_goods_list(intval(app_conf("REC_CATE_GOODS_LIMIT")), 0, $condition_rec);
         $GLOBALS['tmpl']->assign("rec_list", $rec_list['list']);
         $GLOBALS['tmpl']->display("discount_index.html", $cache_id);
     } else {
         $GLOBALS['tmpl']->caching = true;
         $cache_id = md5(MODULE_NAME . "show" . trim($_REQUEST['id']) . $GLOBALS['deal_city']['id']);
         if (!$GLOBALS['tmpl']->is_cached('brand_info.html', $cache_id)) {
             $condition = " brand_promote = 1 and (end_time = 0 or end_time > " . get_gmtime() . ") ";
             $brand_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "brand where id = " . $id . " and " . $condition);
             if ($brand_info) {
                 //开始输出当前的site_nav
                 $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/");
                 $site_nav[] = array('name' => $GLOBALS['lang']['BRAND_DISCOUNT'], 'url' => url("shop", "discount#index"));
                 $site_nav[] = array('name' => $brand_info['name'], 'url' => url("shop", "discount#index", array("id" => $brand_info['id'])));
                 $GLOBALS['tmpl']->assign("site_nav", $site_nav);
                 //输出当前的site_nav
                 $GLOBALS['tmpl']->assign("page_title", $brand_info['name']);
                 $GLOBALS['tmpl']->assign("page_keyword", $brand_info['name']);
                 $GLOBALS['tmpl']->assign("page_description", $brand_info['name']);
             } else {
                 app_redirect(APP_ROOT . "/");
             }
         }
         $GLOBALS['tmpl']->display("brand_info.html", $cache_id);
     }
 }
 public function index()
 {
     $id = intval($_REQUEST['id']);
     $transfer_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "transfer where id = " . $id);
     if (!$transfer_info) {
         app_redirect(url("index"));
     }
     $GLOBALS['tmpl']->assign("transfer_info", $transfer_info);
     $GLOBALS['tmpl']->display("tdetail.html");
 }
示例#22
0
 public function index()
 {
     $agent = strtolower($_SERVER['HTTP_USER_AGENT']);
     if (strpos($agent, 'iphone') || strpos($agent, 'ipad')) {
         app_redirect(app_conf("APPLE_DOWLOAD_URL"));
     }
     if (strpos($agent, 'android')) {
         app_redirect(app_conf("ANDROID_DOWLOAD_URL"));
     }
 }
 public function __construct()
 {
     $manageagency_info = es_session::get("manageagency_info");
     $GLOBALS['tmpl']->assign("manageagency_info", $manageagency_info);
     if (!$manageagency_info) {
         app_redirect(url("index", "manageagency#login"));
         die;
     }
     parent::__construct();
 }
示例#24
0
 public function index()
 {
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     $s_account_info = es_session::get("account_info");
     $account_id = intval($s_account_info['id']);
     $order_sn = htmlspecialchars(addslashes(trim($_REQUEST['order_sn'])));
     $coupon_sn = htmlspecialchars(addslashes(trim($_REQUEST['coupon_sn'])));
     if ($_REQUEST['is_redirect'] == 1) {
         $url_param = array("order_sn" => $order_sn, "coupon_sn" => $coupon_sn);
         app_redirect(url("biz", "order", $url_param));
     }
     $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['SUPPLIER_ORDER_LIST']);
     $supplier_id = intval($GLOBALS['db']->getOne("select supplier_id from " . DB_PREFIX . "supplier_account where id = " . intval($s_account_info['id'])));
     $GLOBALS['tmpl']->assign("supplier_id", $supplier_id);
     $deal_id = intval($_REQUEST['id']);
     if ($deal_id > 0) {
         $sql = "select d.* from " . DB_PREFIX . "deal as d left join " . DB_PREFIX . "deal_location_link as l on l.deal_id = d.id where l.deal_id = " . $deal_id . " and l.location_id in (" . implode(",", $s_account_info['location_ids']) . ")";
         $deal_info = $GLOBALS['db']->getRow($sql);
         if (!$deal_info) {
             showErr($GLOBALS['lang']['NO_AUTH']);
         }
     }
     $ext_where = ' and do.is_delete = 0 and do.after_sale = 0';
     if ($order_sn != '') {
         $ext_where .= " and do.order_sn = '" . $order_sn . "' ";
         $GLOBALS['tmpl']->assign("order_sn", $order_sn);
     }
     if ($coupon_sn != '') {
         $ext_where .= " and do.id in (select order_id from " . DB_PREFIX . "deal_coupon where sn = '" . $coupon_sn . "')";
         $GLOBALS['tmpl']->assign("coupon_sn", $coupon_sn);
     }
     if ($deal_id > 0) {
         $ext_where .= " and doi.deal_id = " . $deal_id;
         $GLOBALS['tmpl']->assign("deal_id", $deal_id);
     }
     //分页
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $order_list_sql = "select distinct(do.id) as oid,do.user_id,do.order_sn,do.create_time as ocreate_time,d.name,d.sub_name,d.* from " . DB_PREFIX . "deal_order_item as doi left join " . DB_PREFIX . "deal_order as do on do.id = doi.order_id left join " . DB_PREFIX . "deal as d on doi.deal_id = d.id left join " . DB_PREFIX . "deal_location_link as l on l.deal_id = d.id where l.location_id in (" . implode(",", $s_account_info['location_ids']) . ")  and d.supplier_id = " . $supplier_id . $ext_where . " group by do.id order by do.create_time desc limit " . $limit;
     $order_list_count_sql = "select count(distinct(do.id)) from " . DB_PREFIX . "deal_order_item as doi left join " . DB_PREFIX . "deal_order as do on do.id = doi.order_id left join " . DB_PREFIX . "deal as d on doi.deal_id = d.id left join " . DB_PREFIX . "deal_location_link as l on l.deal_id = d.id where l.location_id in (" . implode(",", $s_account_info['location_ids']) . ")]  and d.supplier_id = " . $supplier_id . $ext_where;
     $order_list = $GLOBALS['db']->getAll($order_list_sql);
     foreach ($order_list as $k => $v) {
         $order_list[$k]['number'] = $GLOBALS['db']->getOne("select sum(number) from " . DB_PREFIX . "deal_order_item as doi left join " . DB_PREFIX . "deal_order as do on doi.order_id = do.id where do.id = " . $v['oid']);
     }
     $GLOBALS['tmpl']->assign('order_list', $order_list);
     $order_count = $GLOBALS['db']->getOne($order_list_count_sql);
     $page = new Page($order_count, app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->display("biz/biz_order.html");
 }
示例#25
0
 public function index()
 {
     $id = intval($_REQUEST['id']);
     if ($id == 0) {
         $GLOBALS['tmpl']->caching = true;
         $cache_id = md5(MODULE_NAME . "list" . intval($_REQUEST['p']) . $GLOBALS['deal_city']['id']);
         if (!$GLOBALS['tmpl']->is_cached('brand_index.html', $cache_id)) {
             //分页
             $page = intval($_REQUEST['p']);
             if ($page == 0) {
                 $page = 1;
             }
             $limit = ($page - 1) * app_conf("DEAL_PAGE_SIZE") . "," . app_conf("DEAL_PAGE_SIZE");
             $brand_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "brand order by sort desc limit " . $limit);
             $brand_total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "brand");
             foreach ($brand_list as $k => $v) {
                 $brand_list[$k]['url'] = url("shop", "brand#index", array("id" => $v['id']));
             }
             $page = new Page($brand_total, app_conf("DEAL_PAGE_SIZE"));
             //初始化分页对象
             $p = $page->show();
             $GLOBALS['tmpl']->assign('pages', $p);
             //开始输出当前的site_nav
             $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/");
             $site_nav[] = array('name' => $GLOBALS['lang']['BRAND_INFO'], 'url' => url("shop", "brand#index"));
             $GLOBALS['tmpl']->assign("site_nav", $site_nav);
             //输出当前的site_nav
             $GLOBALS['tmpl']->assign("brand_list", $brand_list);
             $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['BRAND_INFO']);
             $GLOBALS['tmpl']->assign("page_keyword", $GLOBALS['lang']['BRAND_INFO']);
             $GLOBALS['tmpl']->assign("page_description", $GLOBALS['lang']['BRAND_INFO']);
         }
         $GLOBALS['tmpl']->display("brand_index.html", $cache_id);
     } else {
         $GLOBALS['tmpl']->caching = true;
         $cache_id = md5(MODULE_NAME . "show" . trim($_REQUEST['id']) . $GLOBALS['deal_city']['id']);
         if (!$GLOBALS['tmpl']->is_cached('brand_info.html', $cache_id)) {
             $brand_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "brand where id = " . $id);
             if ($brand_info) {
                 //开始输出当前的site_nav
                 $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/");
                 $site_nav[] = array('name' => $GLOBALS['lang']['BRAND_INFO'], 'url' => url("shop", "brand#index"));
                 $site_nav[] = array('name' => $brand_info['name'], 'url' => url("shop", "brand#index", array("id" => $brand_info['id'])));
                 $GLOBALS['tmpl']->assign("site_nav", $site_nav);
                 //输出当前的site_nav
                 $GLOBALS['tmpl']->assign("page_title", $brand_info['name']);
                 $GLOBALS['tmpl']->assign("page_keyword", $brand_info['name']);
                 $GLOBALS['tmpl']->assign("page_description", $brand_info['name']);
             } else {
                 app_redirect(APP_ROOT . "/");
             }
         }
         $GLOBALS['tmpl']->display("brand_info.html", $cache_id);
     }
 }
 public function index()
 {
     $id = intval($_REQUEST['id']);
     $deal = get_referral_deal($id);
     if (!$deal || $deal['buy_type'] == 1 || $deal['is_referral'] == 0) {
         app_redirect(url("tuan", "index"));
     }
     $GLOBALS['tmpl']->assign("deal", $deal);
     $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['REFERRAL_PAGE']);
     $GLOBALS['tmpl']->display("referral.html");
 }
示例#27
0
 public function index()
 {
     //获取权限
     $biz_account_auth = get_biz_account_auth();
     if (empty($biz_account_auth)) {
         app_redirect(url("biz", "user#login"));
     } else {
         $jump_url = url("biz", $biz_account_auth[0]);
         app_redirect($jump_url);
     }
 }
 public function delmessage()
 {
     $ajax = intval($_REQUEST['ajax']);
     if (!$GLOBALS['user_info']) {
         app_redirect(url_wap("user#login"));
     }
     $id = intval($_REQUEST['id']);
     $user_id = intval($GLOBALS['user_info']['id']);
     $GLOBALS['db']->query("delete from " . DB_PREFIX . "user_message where user_id = " . $user_id . " and id = " . $id);
     showSuccess("", $ajax, get_gopreview());
 }
示例#29
0
 public function pay()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $id = intval($_REQUEST['id']);
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $id);
     if ($payment_notice) {
         if ($payment_notice['is_paid'] == 0) {
             $payment_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment where id = " . $payment_notice['payment_id']);
             if (empty($payment_info)) {
                 app_redirect(url("index"));
             }
             $order = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id'] . " and is_delete = 0");
             if (empty($order)) {
                 app_redirect(url("index"));
             }
             if ($order['pay_status'] == 2) {
                 if ($order['after_sale'] == 0) {
                     app_redirect(url("index", "payment#done", array("id" => $order['id'])));
                     exit;
                 } else {
                     showErr($GLOBALS['lang']['DEAL_ERROR_COMMON'], 0, url("index"), 1);
                 }
             }
             require_once APP_ROOT_PATH . "system/payment/" . $payment_info['class_name'] . "_payment.php";
             $payment_class = $payment_info['class_name'] . "_payment";
             $payment_object = new $payment_class();
             $payment_code = $payment_object->get_payment_code($payment_notice['id']);
             $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['PAY_NOW']);
             $GLOBALS['tmpl']->assign("payment_code", $payment_code);
             $GLOBALS['tmpl']->assign("order", $order);
             $GLOBALS['tmpl']->assign("payment_notice", $payment_notice);
             if (intval($_REQUEST['check']) == 1) {
                 showErr($GLOBALS['lang']['PAYMENT_NOT_PAID_RENOTICE'], 0, url("index", "payment#pay", array("id" => $id)));
             }
             $GLOBALS['tmpl']->display("payment_pay.html");
         } else {
             $order = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']);
             if ($order['pay_status'] == 2) {
                 if ($order['after_sale'] == 0) {
                     app_redirect(url("index", "payment#done", array("id" => $order['id'])));
                 } else {
                     showErr($GLOBALS['lang']['DEAL_ERROR_COMMON'], 0, url("index"), 1);
                 }
             } else {
                 showSuccess($GLOBALS['lang']['NOTICE_PAY_SUCCESS'], 0, url("index"), 1);
             }
         }
     } else {
         showErr($GLOBALS['lang']['NOTICE_SN_NOT_EXIST'], 0, url("index"), 1);
     }
 }
示例#30
-1
 public function callback()
 {
     es_session::start();
     //获取token
     $token = $this->getAccessToken();
     //获取openid
     $opendid = $this->getQqOpenid($token);
     //获取返回的user
     $arr = $this->getQqUserInfo($this->api['config']['app_key'], $token, $opendid);
     $msg['field'] = 'qq_id';
     $msg['id'] = $opendid;
     $msg['name'] = $arr["nickname"];
     es_session::set("api_user_info", $msg);
     if (!$msg['name']) {
         app_redirect(url("index"));
     }
     $user_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where qq_id = '" . $opendid . "' and qq_id <> ''");
     if ($user_data) {
         require_once APP_ROOT_PATH . "system/libs/user.php";
         auto_do_login_user($user_data['user_name'], $user_data['user_pwd'], $from_cookie = false);
         es_session::delete("api_user_info");
         app_recirect_preview();
     } else {
         $this->create_user();
         app_redirect(url("shop", "user#stepone"));
     }
 }