コード例 #1
0
 public function index()
 {
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $user_id = $GLOBALS['user_info']['id'];
     $status = isset($_REQUEST['stauts']) ? intval($_REQUEST['stauts']) : 3;
     $time = isset($_REQUEST['time']) ? to_timespan($_REQUEST['time'], "Ymd") : "";
     $deal_name = strim($_REQUEST['deal_name']);
     $condition = "";
     if ($deal_name != "") {
         $condition .= " and d.name = '" . $deal_name . "' ";
         $GLOBALS['tmpl']->assign('deal_name', $deal_name);
     }
     if ($time != "") {
         $condition .= " and dlr.repay_time = " . $time . " ";
         $GLOBALS['tmpl']->assign('time', to_date($time, "Y-m-d"));
     }
     $result = getUcRepayPlan($user_id, $status, $limit, $condition);
     if ($result['rs_count'] > 0) {
         $page = new Page($result['rs_count'], app_conf("PAGE_SIZE"));
         //初始化分页对象
         $p = $page->show();
         $GLOBALS['tmpl']->assign('pages', $p);
         $GLOBALS['tmpl']->assign('list', $result['list']);
     }
     $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_REPAY_PLAN']);
     $GLOBALS['tmpl']->assign("inc_file", "inc/uc/uc_repay_plan.html");
     $GLOBALS['tmpl']->assign("status", $status);
     $GLOBALS['tmpl']->display("page/uc.html");
 }
コード例 #2
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $page = intval($GLOBALS['request']['page']);
     $status = strim($GLOBALS['request']['status']);
     //0:全部;1:可转让;2:转让中;3:已转让;4:已撤销;
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/uc_func.php';
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         $result = getUcTransferBuys($page, $status);
         $root['item'] = $result['list'];
         $root['page'] = array("page" => $page, "page_total" => ceil($result['count'] / app_conf("DEAL_PAGE_SIZE")));
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
コード例 #3
0
 public function export_csv($page = 1)
 {
     set_time_limit(0);
     $limit = ($page - 1) * intval(app_conf("BATCH_PAGE_SIZE")) . "," . intval(app_conf("BATCH_PAGE_SIZE"));
     $map['ecv_type_id'] = intval($_REQUEST['ecv_type_id']);
     $list = M(MODULE_NAME)->where($map)->limit($limit)->findAll();
     if ($list) {
         register_shutdown_function(array(&$this, 'export_csv'), $page + 1);
         $ecv_value = array('sn' => '""', 'password' => '""', 'money' => '""', 'use_limit' => '""', 'begin_time' => '""', 'end_time' => '""');
         if ($page == 1) {
             $content = iconv("utf-8", "gbk", "序列号,密码,面额,使用数量,生效时间,过期时间");
             $content = $content . "\n";
         }
         foreach ($list as $k => $v) {
             $ecv_value['sn'] = '"' . iconv('utf-8', 'gbk', $v['sn']) . '"';
             $ecv_value['password'] = '******' . iconv('utf-8', 'gbk', $v['password']) . '"';
             $ecv_value['money'] = '"' . iconv('utf-8', 'gbk', format_price($v['money'])) . '"';
             $ecv_value['use_limit'] = '"' . iconv('utf-8', 'gbk', $v['use_limit']) . '"';
             $ecv_value['begin_time'] = '"' . iconv('utf-8', 'gbk', to_date($v['begin_time'])) . '"';
             $ecv_value['end_time'] = '"' . iconv('utf-8', 'gbk', to_date($v['end_time'])) . '"';
             $content .= implode(",", $ecv_value) . "\n";
         }
         header("Content-Disposition: attachment; filename=voucher_list.csv");
         echo $content;
     } else {
         if ($page == 1) {
             $this->error(L("NO_RESULT"));
         }
     }
 }
コード例 #4
0
ファイル: deal_msg.action.php プロジェクト: workplayteam/P2P
 public function index()
 {
     //分页
     $page = intval($GLOBALS['request']['p']);
     if ($page == 0) {
         $page = 1;
     }
     $deal_id = intval($_REQUEST['deal_id']);
     $rel_table = 'deal';
     $condition = "rel_table = '" . $rel_table . "' and rel_id = " . $deal_id;
     if (app_conf("USER_MESSAGE_AUTO_EFFECT") == 0) {
         $condition .= " and user_id = " . intval($GLOBALS['user_info']['id']);
     } else {
         //留言是否需要审核
         $message_type = $GLOBALS['db']->getOne("select is_effect from " . DB_PREFIX . "message_type where type_name='" . $rel_table . "'");
         if ($message_type == 0) {
             $condition .= " and user_id = " . intval($GLOBALS['user_info']['id']);
         }
     }
     $root = array();
     //分页
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $msg_condition = $condition . " AND is_effect = 1 ";
     $message = get_message_list($limit, $msg_condition);
     $root['page'] = array("page" => $page, "page_total" => ceil($message['count'] / app_conf("PAGE_SIZE")));
     foreach ($message['list'] as $k => $v) {
         $msg_sub = get_message_list("", "pid=" . $v['id'], false);
         $message['list'][$k]["sub"] = $msg_sub["list"];
     }
     $root['response_code'] = 1;
     //$root['show_err'] = ;  //当response_code != 0 时,返回:错误内容
     $root['message_list'] = $message['list'];
     output($root);
 }
コード例 #5
0
 public function index()
 {
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $result = get_invite_list($limit, $GLOBALS['user_info']['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);
     $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_INVITE']);
     $GLOBALS['tmpl']->assign("inc_file", "inc/uc/uc_invite_index.html");
     $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']->display("uc.html");
 }
コード例 #6
0
 public function load($param)
 {
     $param = array();
     $key = $this->build_key(__CLASS__, $param);
     $GLOBALS['cache']->set_dir(APP_ROOT_PATH . "public/runtime/data/" . __CLASS__ . "/");
     $user_level_array = $GLOBALS['cache']->get($key);
     if ($user_level_array === false) {
         $user_level = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user_level order by point asc");
         $user_level_array = array();
         $template = app_conf("TEMPLATE");
         $template_level_icon_put_dir = "./app/Tpl/" . $template . "/images/level_icon/";
         $template_level_icon_open_dir = APP_ROOT_PATH . "/app/Tpl/" . $template . "/images/level_icon/";
         $no_leverl_icon = $template_level_icon_put_dir . "level.png";
         foreach ($user_level as $k => $v) {
             $user_level_array[$v['id']] = $v;
             $user_level_array[$v['id']]['level_num'] = $k;
             if ($v['icon'] == '') {
                 $put_dir = $template_level_icon_put_dir . "level" . $k . ".png";
                 $open_dir_val = $template_level_icon_open_dir . "level" . $k . ".png";
                 if (fopen($open_dir_val, 'r')) {
                     $user_level_array[$v['id']]['icon'] = $put_dir;
                 } else {
                     $user_level_array[$v['id']]['icon'] = $no_leverl_icon;
                 }
             }
         }
         $user_level_array[0] = array('icon' => $no_leverl_icon);
         $GLOBALS['cache']->set_dir(APP_ROOT_PATH . "public/runtime/data/" . __CLASS__ . "/");
         $GLOBALS['cache']->set($key, $user_level_array);
     }
     return $user_level_array;
 }
コード例 #7
0
function get_domain()
{
    /* 协议 */
    $protocol = get_http();
    if (app_conf("SITE_DOMAIN") != "") {
        return $protocol . app_conf("SITE_DOMAIN");
    }
    /* 域名或IP地址 */
    if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
        $host = $_SERVER['HTTP_X_FORWARDED_HOST'];
    } elseif (isset($_SERVER['HTTP_HOST'])) {
        $host = $_SERVER['HTTP_HOST'];
    } else {
        /* 端口 */
        if (isset($_SERVER['SERVER_PORT'])) {
            $port = ':' . $_SERVER['SERVER_PORT'];
            if (':80' == $port && 'http://' == $protocol || ':443' == $port && 'https://' == $protocol) {
                $port = '';
            }
        } else {
            $port = '';
        }
        if (isset($_SERVER['SERVER_NAME'])) {
            $host = $_SERVER['SERVER_NAME'] . $port;
        } elseif (isset($_SERVER['SERVER_ADDR'])) {
            $host = $_SERVER['SERVER_ADDR'] . $port;
        }
    }
    return $protocol . $host;
}
コード例 #8
0
 public function __construct()
 {
     $GLOBALS['tmpl']->assign("MODULE_NAME", MODULE_NAME);
     $GLOBALS['tmpl']->assign("ACTION_NAME", ACTION_NAME);
     $GLOBALS['fcache']->set_dir(APP_ROOT_PATH . "public/runtime/data/page_static_cache/");
     $GLOBALS['dynamic_cache'] = $GLOBALS['fcache']->get("APP_DYNAMIC_CACHE_" . APP_INDEX . "_" . MODULE_NAME . "_" . ACTION_NAME);
     $GLOBALS['fcache']->set_dir(APP_ROOT_PATH . "public/runtime/data/avatar_cache/");
     $GLOBALS['dynamic_avatar_cache'] = $GLOBALS['fcache']->get("AVATAR_DYNAMIC_CACHE");
     //头像的动态缓存
     //输出导航菜单
     $nav_list = get_shop_nav_list();
     $nav_list = init_nav_list($nav_list);
     $GLOBALS['tmpl']->assign("nav_list", $nav_list);
     //输出在线客服与时间
     $qq = explode("|", app_conf("ONLINE_QQ"));
     $msn = explode("|", app_conf("ONLINE_MSN"));
     $GLOBALS['tmpl']->assign("online_qq", $qq);
     $GLOBALS['tmpl']->assign("online_msn", $msn);
     //输出页面的标题关键词与描述
     $GLOBALS['tmpl']->assign("shop_info", get_shop_info());
     //输出系统文章
     $system_article = get_article_list(8, 0, "ac.type_id = 3", "", true);
     $GLOBALS['tmpl']->assign("system_article", $system_article['list']);
     //输出帮助
     $deal_help = get_help();
     $GLOBALS['tmpl']->assign("deal_help", $deal_help);
     //输出热门关键词
     // 热门搜索词
     $hot_kw = get_hot_kw();
     $GLOBALS['tmpl']->assign("hot_kw", $hot_kw);
     if (MODULE_NAME == "index" && ACTION_NAME == "index" || MODULE_NAME == "acate" && ACTION_NAME == "index" || MODULE_NAME == "article" && ACTION_NAME == "index" || MODULE_NAME == "brand" && ACTION_NAME == "index" || MODULE_NAME == "cate" && ACTION_NAME == "index" || MODULE_NAME == "city" && ACTION_NAME == "index" || MODULE_NAME == "comment" && ACTION_NAME == "index" || MODULE_NAME == "daren" && ACTION_NAME == "index" || MODULE_NAME == "daren" && ACTION_NAME == "submit" || MODULE_NAME == "discount" && ACTION_NAME == "index" || MODULE_NAME == "discover" && ACTION_NAME == "index" || MODULE_NAME == "exchange" && ACTION_NAME == "index" || MODULE_NAME == "goods" && ACTION_NAME == "index" || MODULE_NAME == "group" && ACTION_NAME == "index" || MODULE_NAME == "group" && ACTION_NAME == "forum" || MODULE_NAME == "group" && ACTION_NAME == "create" || MODULE_NAME == "help" && ACTION_NAME == "index" || MODULE_NAME == "link" && ACTION_NAME == "index" || MODULE_NAME == "mall" && ACTION_NAME == "index" || MODULE_NAME == "mobile" && ACTION_NAME == "index" || MODULE_NAME == "msg" && ACTION_NAME == "index" || MODULE_NAME == "notice" && ACTION_NAME == "index" || MODULE_NAME == "notice" && ACTION_NAME == "list_notice" || MODULE_NAME == "rec" && ACTION_NAME == "rhot" || MODULE_NAME == "rec" && ACTION_NAME == "rnew" || MODULE_NAME == "rec" && ACTION_NAME == "rbest" || MODULE_NAME == "rec" && ACTION_NAME == "rsale" || MODULE_NAME == "score" && ACTION_NAME == "index" || MODULE_NAME == "space" && ACTION_NAME == "index" || MODULE_NAME == "space" && ACTION_NAME == "fav" || MODULE_NAME == "space" && ACTION_NAME == "fans" || MODULE_NAME == "space" && ACTION_NAME == "focus" || MODULE_NAME == "msg" && ACTION_NAME == "index" || MODULE_NAME == "ss" && ACTION_NAME == "index" || MODULE_NAME == "ss" && ACTION_NAME == "pick" || MODULE_NAME == "sys" && ACTION_NAME == "index" || MODULE_NAME == "sys" && ACTION_NAME == "list_notice" || MODULE_NAME == "topic" && ACTION_NAME == "index" || MODULE_NAME == "vote" && ACTION_NAME == "index") {
         set_gopreview();
     }
 }
コード例 #9
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']);
     $f = addslashes(htmlspecialchars(trim($_REQUEST['f'])));
     if ($f == '' || !in_array($f, array("is_buy", "tuan", "event", "youhui", "daijin", "shop"))) {
         $condition = " ";
     } elseif ($f == 'is_buy') {
         $condition = " and is_buy = 1 ";
     } else {
         $condition = " and from_data  = '{$f}' ";
     }
     $GLOBALS['tmpl']->assign("f", $f);
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $dp_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "supplier_location_dp where status = 1 {$condition} and supplier_location_id in (" . implode(",", $s_account_info['location_ids']) . ") order by create_time desc limit " . $limit);
     $dp_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "supplier_location_dp where status = 1  {$condition} and supplier_location_id in (" . implode(",", $s_account_info['location_ids']) . ")");
     $page = new Page($dp_count, app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("dp_list", $dp_list);
     $html = decode_topic_without_img($GLOBALS['tmpl']->fetch("biz/biz_dp_list_content.html"));
     $GLOBALS['tmpl']->assign("html", $html);
     $GLOBALS['tmpl']->assign("page_title", "点评列表");
     $GLOBALS['tmpl']->display("biz/biz_dp.html");
 }
コード例 #10
0
ファイル: uc_refund.action.php プロジェクト: workplayteam/P2P
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $page = intval($GLOBALS['request']['page']);
     $status = intval($GLOBALS['request']['status']);
     //0:还款列表;1:已还清借款
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/deal.php';
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
         $deal_status = 4;
         if ($status == 1) {
             $deal_status = 5;
         }
         $result = get_deal_list($limit, 0, "deal_status ={$deal_status} AND user_id=" . $user_id, "id DESC", $email, $user['user_pwd']);
         $root['item'] = $result['list'];
         $root['page'] = array("page" => $page, "page_total" => ceil($result['count'] / app_conf("PAGE_SIZE")));
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
コード例 #11
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();
 }
コード例 #12
0
 public function __construct()
 {
     $GLOBALS['tmpl']->assign("MODULE_NAME", MODULE_NAME);
     $GLOBALS['tmpl']->assign("ACTION_NAME", ACTION_NAME);
     $GLOBALS['fcache']->set_dir(APP_ROOT_PATH . "public/runtime/data/page_static_cache/");
     $GLOBALS['dynamic_cache'] = $GLOBALS['fcache']->get("APP_DYNAMIC_CACHE_" . APP_INDEX . "_" . MODULE_NAME . "_" . ACTION_NAME);
     $GLOBALS['fcache']->set_dir(APP_ROOT_PATH . "public/runtime/data/avatar_cache/");
     $GLOBALS['dynamic_avatar_cache'] = $GLOBALS['fcache']->get("AVATAR_DYNAMIC_CACHE");
     //头像的动态缓存
     //输出导航菜单
     $nav_list = get_nav_list();
     $nav_list = init_nav_list($nav_list);
     $GLOBALS['tmpl']->assign("nav_list", $nav_list);
     //输出在线客服与时间
     $qq = explode("|", app_conf("ONLINE_QQ"));
     $msn = explode("|", app_conf("ONLINE_MSN"));
     $GLOBALS['tmpl']->assign("online_qq", $qq);
     $GLOBALS['tmpl']->assign("online_msn", $msn);
     //输出页面的标题关键词与描述
     $GLOBALS['tmpl']->assign("shop_info", get_shop_info());
     //输出帮助
     $deal_help = get_help();
     $GLOBALS['tmpl']->assign("deal_help", $deal_help);
     //输出系统文章
     $system_article = get_article_list(8, 0, "ac.type_id = 3", "", true);
     $GLOBALS['tmpl']->assign("system_article", $system_article['list']);
     //输出热门关键词
     $hot_kw = get_hot_kw();
     $GLOBALS['tmpl']->assign("hot_kw", $hot_kw);
     if (MODULE_NAME == "deal" && ACTION_NAME == "index" || MODULE_NAME == "deals" && ACTION_NAME == "index" || MODULE_NAME == "dhapi" && ACTION_NAME == "index" || MODULE_NAME == "index" && ACTION_NAME == "index" || MODULE_NAME == "message" && ACTION_NAME == "index" || MODULE_NAME == "order" && ACTION_NAME == "index" || MODULE_NAME == "search" && ACTION_NAME == "index" || MODULE_NAME == "second" && ACTION_NAME == "index") {
         set_gopreview();
     }
 }
コード例 #13
0
 private function getlist($mode = "index")
 {
     $result = getInvestList($mode, intval($GLOBALS['user_info']['id']), intval($_REQUEST['p']));
     $list = $result['list'];
     foreach ($list as $k => $v) {
         //当为天的时候
         if ($v['repay_time_type'] == 0) {
             $true_repay_time = 1;
         } else {
             $true_repay_time = $v['repay_time'];
         }
         $deal['borrow_amount'] = $v['u_load_money'];
         $deal['rate'] = $v['rate'];
         $deal['loantype'] = $v['loantype'];
         $deal['repay_time'] = $v['repay_time'];
         $deal['repay_time_type'] = $v['repay_time_type'];
         $deal['repay_start_time'] = $v['repay_start_time'];
         $deal_repay_rs = deal_repay_money($deal);
         $v['interest_amount'] = $deal_repay_rs['month_repay_money'];
         $list[$k] = $v;
     }
     $count = $result['count'];
     $GLOBALS['tmpl']->assign("list", $list);
     $page = new Page($count, app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign('user_id', $GLOBALS['user_info']['id']);
     $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_INVEST']);
     $GLOBALS['tmpl']->assign("inc_file", "inc/uc/uc_invest.html");
     $GLOBALS['tmpl']->display("page/uc.html");
 }
コード例 #14
0
 public function index()
 {
     $mobile = strim($GLOBALS['request']['mobile']);
     if (app_conf("SMS_ON") == 0) {
         $root['status'] = 0;
         $root['info'] = '短信功能关闭';
         output($root);
     }
     if ($mobile == '') {
         $root['status'] = 0;
         $root['info'] = '手机号码不能为空';
         output($root);
     }
     if (!check_mobile($mobile)) {
         $root['status'] = 0;
         $root['info'] = "请输入正确的手机号码";
         output($root);
     }
     if (!check_ipop_limit(CLIENT_IP, "register_verify_phone", 60, 0)) {
         $root['status'] = 0;
         $root['info'] = '发送太快了';
         output($root);
     }
     $sql = "SELECT * FROM " . DB_PREFIX . "user WHERE mobile = " . $mobile;
     $user = $GLOBALS['db']->getRow($sql);
     if (empty($user)) {
         $root['status'] = 0;
         $root['info'] = "手机号未在本站注册过";
         output($root);
     }
     //删除超过5分钟的验证码
     $sql = "DELETE FROM " . DB_PREFIX . "sms_mobile_verify WHERE mobile_phone = '{$mobile}' and add_time <=" . (get_gmtime() - 300);
     $GLOBALS['db']->query($sql);
     $code = rand(100000, 999999);
     $message = "您正在找回密码,验证码:" . $code . ",如非本人操作,请忽略本短信【" . app_conf("SHOP_TITLE") . "】";
     require_once APP_ROOT_PATH . "system/utils/es_sms.php";
     $sms = new sms_sender();
     $send = $sms->sendSms($mobile, $message);
     if ($send['status']) {
         $add_time = get_gmtime();
         $GLOBALS['db']->query("insert into " . DB_PREFIX . "sms_mobile_verify(mobile_phone,code,add_time,send_count,ip) values('{$mobile}','{$code}','{$add_time}',1," . "'" . CLIENT_IP . "')");
         /* 插入一条发送成功记录到队列表中 */
         $msg_data['dest'] = $mobile;
         $msg_data['send_type'] = 0;
         $msg_data['content'] = addslashes($message);
         $msg_data['send_time'] = $add_time;
         $msg_data['is_send'] = 1;
         $msg_data['is_success'] = 1;
         $msg_data['create_time'] = $add_time;
         $msg_data['user_id'] = intval($user['id']);
         $msg_data['title'] = "密码找回验证";
         $GLOBALS['db']->autoExecute(DB_PREFIX . "deal_msg_list", $msg_data);
         $root['info'] = "验证码发出,请注意查收";
         $root['status'] = 1;
     } else {
         $root['info'] = "发送失败" . $send['msg'];
         $root['status'] = 0;
     }
     output($root);
 }
コード例 #15
0
ファイル: uc_bank.action.php プロジェクト: eliu03/fanweP2P
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     $root['user_id'] = $user_id;
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/uc_func.php';
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         $bank_list = $GLOBALS['db']->getAll("SELECT u.id, u.bankcard,u.real_name, b.name as bank_name, b.id as bank_id FROM " . DB_PREFIX . "user_bank u left join " . DB_PREFIX . "bank b on b.id = u.bank_id where u.user_id=" . $user_id . " ORDER BY u.id ASC");
         foreach ($bank_list as $k => $v) {
             $bank_list[$k]['bankcode'] = str_replace(" ", "", $v['bankcard']);
             $bank_list[$k]['img'] = str_replace("/mapi", "", SITE_DOMAIN . APP_ROOT . '/public/bank/' . $v['bank_id'] . '.jpg');
         }
         $root['item'] = $bank_list;
         //手续费
         $fee_config = load_auto_cache("user_carry_config");
         $json_fee = array();
         foreach ($fee_config as $k => $v) {
             $json_fee[] = $v;
             $fee_config[$k]['fee_format'] = format_price($v['fee']);
         }
         $root['fee_config'] = $fee_config;
         //$root['json_fee'] = json_encode($json_fee);
         $root['open_ips'] = intval(app_conf("OPEN_IPS"));
         $root['ips_acct_no'] = $user['ips_acct_no'];
         $root['idno'] = $user['idno'];
         //身份证号
         $root['real_name'] = $user['real_name'];
         //第三方托管标
         if (!empty($user['ips_acct_no']) && intval(app_conf("OPEN_IPS")) > 0) {
             $result = GetIpsUserMoney($user_id, 0);
             $root['ips_money'] = $result['pBalance'];
             //提现 http://p2p.fanwe.net/index.php?ctl=collocation&act=DoDwTrade&user_type=0&from=app&user_id=44&pTrdAmt=10
             $app_url = APP_ROOT . "/index.php?ctl=collocation&act=DoDwTrade&user_type=0&pTrdAmt=parm_amt&user_id=" . $user_id . "&from=" . $GLOBALS['request']['from'];
             $root['dw_url'] = str_replace("/mapi", "", SITE_DOMAIN . $app_url);
         } else {
             //申请
             $app_url = APP_ROOT . "/index.php?ctl=collocation&act=CreateNewAcct&user_type=0&user_id=" . $user_id . "&from=" . $GLOBALS['request']['from'];
             $root['acct_url'] = str_replace("/mapi", "", SITE_DOMAIN . $app_url);
             $root['ips_money'] = 0;
         }
         $root['ips_money_format'] = format_price($root['ips_money']);
         //预留 提现金额
         $root['ips_money_fee'] = 0;
         //预留 提现费用
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     $root['program_title'] = "提现";
     output($root);
 }
コード例 #16
0
/**
 * 付款单的支付
 * @param unknown_type $payment_notice_id
 * 当超额付款时在此进行退款处理
 */
function payment_paid($payment_notice_id, $outer_notice_sn = '')
{
    $payment_notice_id = intval($payment_notice_id);
    $now = TIME_UTC;
    $GLOBALS['db']->query("update " . DB_PREFIX . "payment_notice set pay_time = " . $now . ", pay_date = " . to_date($now, 'Y-m-d') . ",outer_notice_sn = '" . $outer_notice_sn . "',is_paid = 1 where id = " . $payment_notice_id . " and is_paid = 0");
    $rs = $GLOBALS['db']->affected_rows();
    if ($rs) {
        $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
        $payment_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment where id = " . $payment_notice['payment_id']);
        $GLOBALS['db']->query("update " . DB_PREFIX . "payment set total_amount = total_amount + " . $payment_notice['money'] . " where class_name = '" . $payment_info['class_name'] . "'");
        //if (intval($payment_notice['order_id']) == 0){
        //充值
        require_once APP_ROOT_PATH . "system/libs/user.php";
        $msg = sprintf($GLOBALS['lang']['PAYMENT_INCHARGE'], $payment_notice['notice_sn']);
        modify_account(array('money' => $payment_notice['money'], 'score' => 0), $payment_notice['user_id'], $msg, 1);
        // 充值奖励
        if ($payment_notice['money'] > intval(app_conf("USER_RECHARGE_LIMIT_MONEY"))) {
            $award = $payment_notice['money'] * floatval(app_conf("USER_RECHARGE_PERCENT")) * 0.01;
            modify_account(array('money' => $award, 'score' => 0), $payment_notice['user_id'], "充值奖励", 1);
        }
        //在此处开始生成付款的短信及邮件
        send_payment_sms($payment_notice_id);
        send_payment_mail($payment_notice_id);
        //}
    }
    return $rs;
}
コード例 #17
0
ファイル: invest2.action.php プロジェクト: eliu03/fanweP2P
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $page = intval($GLOBALS['request']['page']);
     $mode = strim($GLOBALS['request']['mode']);
     //index,invite,ing,over,bad
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $result = getInvestList($mode, $user_id, $page);
         $root['item'] = $result['list'];
         $root['page'] = array("page" => $page, "page_total" => ceil($result['count'] / app_conf("DEAL_PAGE_SIZE")));
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
コード例 #18
0
 public function dologin()
 {
     if (check_ipop_limit(get_client_ip(), "supplier_dologin", intval(app_conf("SUBMIT_DELAY")))) {
         $account_name = htmlspecialchars(addslashes(trim($_REQUEST['account_name'])));
         $account_password = htmlspecialchars(addslashes(trim($_REQUEST['account_password'])));
         $account = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "supplier_account where account_name = '" . $account_name . "' and account_password = '******' and is_effect = 1 and is_delete = 0");
         if ($account) {
             if (intval($_REQUEST['save_password']) == 1) {
                 es_cookie::set("sp_account_name", $account_name, 3600 * 24 * 30);
                 es_cookie::set("sp_account_password", md5($account_password), 3600 * 24 * 30);
             }
             //$account_locations = $GLOBALS['db']->getAll("select location_id from ".DB_PREFIX."supplier_account_location_link where account_id = ".$account['id']);
             $account_locations = $GLOBALS['db']->getAll("select id from " . DB_PREFIX . "supplier_location where supplier_id = " . $account['supplier_id']);
             $account_location_ids = array(0);
             foreach ($account_locations as $row) {
                 $account_location_ids[] = $row['id'];
             }
             $account['location_ids'] = $account_location_ids;
             es_session::set("account_info", $account);
             $result['status'] = 1;
             $GLOBALS['db']->query("update " . DB_PREFIX . "supplier_account set login_time = " . get_gmtime() . ",login_ip = '" . get_client_ip() . "' where id = " . $account['id']);
             ajax_return($result);
         } else {
             $result['status'] = 0;
             $result['msg'] = $GLOBALS['lang']['SUPPLIER_LOGIN_FAILED'];
             ajax_return($result);
         }
     } else {
         $result['status'] = 0;
         $result['msg'] = $GLOBALS['lang']['SUBMIT_TOO_FAST'];
         ajax_return($result);
     }
 }
コード例 #19
0
 public function index()
 {
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     if (app_conf("SMS_ON") == 0) {
         $root['response_code'] = 0;
         $root['show_err'] = $GLOBALS['lang']['SMS_OFF'];
         //短信未开启
         output($root);
     }
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     $root['user_id'] = $user_id;
     if ($user_id > 0) {
         $mobile = $user['mobile'];
         $code = intval($user['bind_verify']);
         if ($mobile == '') {
             $root['response_code'] = 0;
             $root['show_err'] = $GLOBALS['lang']['MOBILE_EMPTY_TIP'];
             output($root);
         }
         if (!check_mobile($mobile)) {
             $root['response_code'] = 0;
             $root['show_err'] = $GLOBALS['lang']['FILL_CORRECT_MOBILE_PHONE'];
             output($root);
         }
         if (!check_ipop_limit(get_client_ip(), "mobile_verify", 60, 0)) {
             $root['response_code'] = 0;
             $root['show_err'] = $GLOBALS['lang']['MOBILE_SMS_SEND_FAST'];
             //短信发送太快
             output($root);
         }
         //开始生成手机验证
         if ($code == 0) {
             //已经生成过了,则使用旧的验证码;反之生成一个新的
             $code = rand(1111, 9999);
             $GLOBALS['db']->query("update " . DB_PREFIX . "user set bind_verify = '" . $code . "',verify_create_time = '" . TIME_UTC . "' where id = " . $user_id);
         }
         //使用立即发送方式
         $result = send_verify_sms($mobile, $code, $user, true);
         //
         $root['response_code'] = $result['status'];
         if ($root['response_code'] == 1) {
             $root['show_err'] = $GLOBALS['lang']['MOBILE_VERIFY_SEND_OK'];
         } else {
             $root['show_err'] = $result['msg'];
             if ($root['show_err'] == null || $root['show_err'] == '') {
                 $root['show_err'] = "验证码发送失败";
             }
         }
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
コード例 #20
0
ファイル: smsModule.class.php プロジェクト: eliu03/fanweP2P
 public function do_unsubscribe()
 {
     //开始发送验证码
     if (check_ipop_limit(CLIENT_IP, "sms_send_code_un", intval(app_conf("SUBMIT_DELAY")))) {
         $mobile = addslashes(trim($_REQUEST['mobile']));
         $verify = md5(trim($_REQUEST['verify']));
         $session_verify = es_session::get('verify');
         if ($verify != $session_verify) {
             $result['type'] = 0;
             $result['message'] = $GLOBALS['lang']['VERIFY_CODE_ERROR'];
             ajax_return($result);
         }
         $mobile_subscribe = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "mobile_list where mobile='" . $mobile . "' and is_effect = 1");
         if (!$mobile_subscribe) {
             $result['type'] = 0;
             $result['message'] = $GLOBALS['lang']['MOBILE_NOT_SUBSCRIBE'];
             ajax_return($result);
         }
         $code = rand(1111, 9999);
         $GLOBALS['db']->query("update " . DB_PREFIX . "mobile_list set verify_code = '" . $code . "' where id = " . $mobile_subscribe['id']);
         send_verify_sms($mobile_subscribe['mobile'], $code);
         $result['type'] = 1;
         ajax_return($result);
     } else {
         $result['type'] = 0;
         $result['message'] = $GLOBALS['lang']['SUBMIT_TOO_FAST'];
         ajax_return($result);
     }
 }
コード例 #21
0
 public function index()
 {
     $user_id = $GLOBALS['user_info']['id'];
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $status = $_REQUEST['status'];
     if (!$status) {
         $condition = "";
     } elseif ($status == 3) {
         $condition = " and status = 0";
         //未审核
     } elseif ($status == 1) {
         $condition = " and status = 1";
         //已通过
     } elseif ($status == 2) {
         $condition = " and status = 2";
         //未通过
     }
     $GLOBALS['tmpl']->assign('status', $status);
     $result = get_deal_quota_list($limit, $user_id, $condition);
     $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['tmpl']->assign("inc_file", "inc/uc/uc_deal_quota.html");
     $GLOBALS['tmpl']->display("page/uc.html");
 }
コード例 #22
0
 public function index()
 {
     $mobile = addslashes(htmlspecialchars(trim($GLOBALS['request']['mobile'])));
     $root = array();
     if (app_conf("SMS_ON") == 0) {
         $root['response_code'] = 0;
         $root['show_err'] = $GLOBALS['lang']['SMS_OFF'];
         //短信未开启
         output($root);
     }
     if ($mobile == '') {
         $root['response_code'] = 0;
         $root['show_err'] = $GLOBALS['lang']['MOBILE_EMPTY_TIP'];
         //请输入你的手机号
         output($root);
     }
     if (!check_mobile($mobile)) {
         $root['response_code'] = 0;
         $root['show_err'] = $GLOBALS['lang']['FILL_CORRECT_MOBILE_PHONE'];
         //请填写正确的手机号码
         output($root);
     }
     if ($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user where mobile = '" . $mobile . "'") > 0) {
         $field_show_name = $GLOBALS['lang']['USER_TITLE_mobile'];
         //手机号码
         $root['response_code'] = 0;
         $root['show_err'] = sprintf($GLOBALS['lang']['EXIST_ERROR_TIP'], $field_show_name);
         //已存在,请重新输入
         output($root);
     }
     if (!check_ipop_limit(CLIENT_IP, "mobile_verify", 60, 0)) {
         $root['response_code'] = 0;
         $root['show_err'] = $GLOBALS['lang']['MOBILE_SMS_SEND_FAST'];
         //短信发送太快
         output($root);
     }
     //删除超过5分钟的验证码
     $GLOBALS['db']->query("DELETE FROM " . DB_PREFIX . "mobile_verify_code WHERE create_time <=" . TIME_UTC - 300);
     $verify_code = $GLOBALS['db']->getOne("select verify_code from " . DB_PREFIX . "mobile_verify_code where mobile = '" . $mobile . "' and create_time>=" . (TIME_UTC - 180) . " ORDER BY id DESC");
     if (intval($verify_code) == 0) {
         //如果数据库中存在验证码,则取数据库中的(上次的 );确保连接发送时,前后2条的验证码是一至的.==为了防止延时
         //开始生成手机验证
         $verify_code = rand(1111, 9999);
         $GLOBALS['db']->autoExecute(DB_PREFIX . "mobile_verify_code", array("verify_code" => $verify_code, "mobile" => $mobile, "create_time" => TIME_UTC, "client_ip" => CLIENT_IP), "INSERT");
     }
     //使用立即发送方式
     $result = send_verify_sms($mobile, $verify_code, null, true);
     //
     $root['response_code'] = $result['status'];
     if ($root['response_code'] == 1) {
         $root['show_err'] = $GLOBALS['lang']['MOBILE_VERIFY_SEND_OK'];
     } else {
         $root['show_err'] = $result['msg'];
         if ($root['show_err'] == null || $root['show_err'] == '') {
             $root['show_err'] = "验证码发送失败";
         }
     }
     //../system/sms/FW_sms.php  提示账户或密码错误地址
     output($root);
 }
コード例 #23
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $page = intval($GLOBALS['request']['page']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/uc_func.php';
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
         $result = get_user_incharge($limit, $GLOBALS['user_info']['id']);
         $root['item'] = $result['list'];
         $root['page'] = array("page" => $page, "page_total" => ceil($result['count'] / app_conf("PAGE_SIZE")));
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
コード例 #24
0
ファイル: insert_libs.php プロジェクト: macall/jsd
/**
 * 商户中心用户面板
 */
function insert_load_biz_user_tip()
{
    $GLOBALS['tmpl']->assign("supplier_name", $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "supplier where id = '" . $GLOBALS['account_info']['supplier_id'] . "'"));
    $GLOBALS['tmpl']->assign("account_info", $GLOBALS['account_info']);
    $GLOBALS['tmpl']->assign("biz_gen_qrcode", gen_qrcode(SITE_DOMAIN . url("biz", "downapp"), app_conf("QRCODE_SIZE")));
    return $GLOBALS['tmpl']->fetch("inc/insert/load_biz_user_tip.html");
}
コード例 #25
0
 public function index()
 {
     //分页
     $page = intval($GLOBALS['request']['page']);
     if ($page == 0) {
         $page = 1;
     }
     $root = array();
     //$root['biz_article_cate_id'] = $GLOBALS['m_config']['biz_article_cate_id'];//我的消息,(文章分类ID)
     $cate_id = intval($GLOBALS['request']['cate_id']);
     if ($cate_id == 0) {
         $cate_id = intval($GLOBALS['m_config']['biz_article_cate_id']);
     }
     $cate_id = 19;
     //分页
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $sql = "select id,title from " . DB_PREFIX . "article where is_effect = 1 and cate_id = " . $cate_id . " order by sort";
     $sql .= " limit " . $limit;
     $sql_count = "select count(*) from " . DB_PREFIX . "article where is_effect = 1 and cate_id = " . $cate_id;
     $count = $GLOBALS['db']->getOne($sql_count);
     $list = $GLOBALS['db']->getAll($sql);
     $root['page'] = array("page" => $page, "page_total" => ceil($count / PAGE_SIZE), "page_size" => PAGE_SIZE);
     //$root['sql'] = $sql;
     $root['return'] = 1;
     $root['list'] = $list;
     output($root);
 }
コード例 #26
0
 public function index()
 {
     $order_sn = strim($_REQUEST['order_sn']);
     $time = isset($_REQUEST['time']) ? to_date(to_timespan($_REQUEST['time'], "Y-m-d"), "Y-m-d") : "";
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $condition = " 1=1 ";
     if ($order_sn != "") {
         $condition .= " and go.order_sn = '" . $order_sn . "' ";
     }
     if ($time != "") {
         $condition .= " and go.ex_date = '" . $time . "' ";
         $GLOBALS['tmpl']->assign('time', $time);
     }
     $user_id = $GLOBALS['user_info']['id'];
     $result = get_order($limit, $user_id, $condition);
     $page = new Page($result['count'], app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("order_sn", $order_sn);
     $GLOBALS['tmpl']->assign("order_info", $result['list']);
     $GLOBALS['tmpl']->assign("inc_file", "inc/uc/uc_goods_order.html");
     $GLOBALS['tmpl']->display("page/uc.html");
 }
コード例 #27
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $page = intval($GLOBALS['request']['page']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/uc_func.php';
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
         $result = get_user_log($limit, $GLOBALS['user_info']['id'], 'money');
         $list = $result['list'];
         foreach ($list as $k => $v) {
             $list[$k]['log_time_format'] = to_date($v['log_time'], "Y-m-d H:i:s");
             $list[$k]['money_format'] = format_price($v['money']);
             $list[$k]['lock_money_format'] = format_price($v['lock_money']);
         }
         $root['item'] = $list;
         $root['page'] = array("page" => $page, "page_total" => ceil($result['count'] / app_conf("PAGE_SIZE")));
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
コード例 #28
0
 static function set($name, $value, $expire = '', $path = '', $domain = '')
 {
     $path = app_conf("COOKIE_PATH");
     $domain = app_conf("DOMAIN_ROOT");
     $expire = !empty($expire) ? TIME_UTC + $expire : 0;
     setcookie($name, $value, $expire, $path, $domain);
 }
コード例 #29
0
 private function cate()
 {
     require APP_ROOT_PATH . 'app/Lib/page.php';
     $cate_id = 6;
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME . "cate" . $cate_id . intval($_REQUEST['p']));
     if (!$GLOBALS['tmpl']->is_cached('page/usagetip_index.html', $cache_id)) {
         $cate_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where id = {$cate_id} and is_effect = 1 and is_delete = 0");
         if ($cate_id > 0 && !$cate_item) {
             app_redirect(APP_ROOT . "/");
         }
         $cate_tree = get_acate_tree();
         $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, '', '');
         $GLOBALS['tmpl']->assign("list", $result['list']);
         $page = new Page($result['count'], app_conf("PAGE_SIZE"));
         //初始化分页对象
         $p = $page->show();
         $GLOBALS['tmpl']->assign('pages', $p);
         //使用技巧
         $use_tech_list = get_article_list(6, 6);
         $GLOBALS['tmpl']->assign("use_tech_list", $use_tech_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("page/usagetip_index.html", $cache_id);
 }
コード例 #30
0
 public function load($param)
 {
     $param = array();
     $key = $this->build_key(__CLASS__, $param);
     $GLOBALS['cache']->set_dir(APP_ROOT_PATH . "public/runtime/data/" . __CLASS__ . "/");
     $nav_list = $GLOBALS['cache']->get($key);
     if ($nav_list === false) {
         $nav_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "nav where is_effect = 1 order by sort asc");
         $nav_list_item = array();
         foreach ($nav_list as $k => $v) {
             if (app_conf("INVEST_STATUS") == 0) {
                 //开启“产品”和“股权”众筹
                 $nav_list_item[$k] = $v;
             } elseif (app_conf("INVEST_STATUS") == 1) {
                 //只开启“产品”众筹
                 if ($v['u_param'] != "type=1") {
                     $nav_list_item[$k] = $v;
                 }
             } elseif (app_conf("INVEST_STATUS") == 2) {
                 //只开启“股权”众筹
                 if ($v['u_module'] != "deals" || $v['u_param'] == "type=1") {
                     $nav_list_item[$k] = $v;
                 }
             }
         }
         $nav_list = format_nav_list($nav_list_item);
         unset($nav_list_item);
         $GLOBALS['cache']->set_dir(APP_ROOT_PATH . "public/runtime/data/" . __CLASS__ . "/");
         $GLOBALS['cache']->set($key, $nav_list);
     }
     return $nav_list;
 }