Beispiel #1
0
 public function send()
 {
     //links
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     $GLOBALS['tmpl']->assign("page_title", "最新动态");
     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) {
         $comment_list[$k] = cache_deal_comment($comment_list[$k]);
     }
     $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");
 }
Beispiel #2
0
 public function index()
 {
     //links
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     if (!$GLOBALS['user_info']) {
         app_redirect(url("user#login"));
     }
     $GLOBALS['db']->query("update " . DB_PREFIX . "user_message set is_read=1 where user_id=" . intval($GLOBALS['user_info']['id']));
     $page_size = 20;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $sql = "select max(id) as id,count(id) as total,dest_user_id from " . DB_PREFIX . "user_message  where user_id = " . intval($GLOBALS['user_info']['id']) . " group by dest_user_id order by create_time desc limit " . $limit;
     $sql_count = "select count(distinct(dest_user_id)) from " . DB_PREFIX . "user_message where user_id = " . intval($GLOBALS['user_info']['id']);
     $contact_list = $GLOBALS['db']->getAll($sql);
     $contact_count = $GLOBALS['db']->getOne($sql_count);
     foreach ($contact_list as $k => $v) {
         $contact_list[$k] = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_message where id = " . $v['id']);
         $contact_list[$k]['has_new'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_message where is_read = 0 and dest_user_id = " . $v['dest_user_id'] . " and user_id = " . intval($GLOBALS['user_info']['id']));
         $contact_list[$k]['total'] = $v['total'];
     }
     $GLOBALS['tmpl']->assign("contact_count", $contact_count);
     $GLOBALS['tmpl']->assign("contact_list", $contact_list);
     require APP_ROOT_PATH . 'app/Lib/page.php';
     $page = new Page($contact_count, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->display("message_index.html");
 }
Beispiel #3
0
 public function index()
 {
     $this->middle();
     //links
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     $GLOBALS['tmpl']->assign("page_title", "最新动态");
 }
function init_deal_page($deal_info)
{
    //links
    $g_links = get_link_by_id(14);
    $GLOBALS['tmpl']->assign("g_links", $g_links);
    $GLOBALS['tmpl']->assign("page_title", $deal_info['name']);
    if ($deal_info['seo_title'] != "") {
        $GLOBALS['tmpl']->assign("seo_title", $deal_info['seo_title']);
    }
    if ($deal_info['seo_keyword'] != "") {
        $GLOBALS['tmpl']->assign("seo_keyword", $deal_info['seo_keyword']);
    }
    if ($deal_info['seo_description'] != "") {
        $GLOBALS['tmpl']->assign("seo_description", $deal_info['seo_description']);
    }
    $deal_info['tags_arr'] = preg_split("/[ ,]/", $deal_info['tags']);
    $deal_info['support_amount_format'] = number_price_format($deal_info['support_amount']);
    $deal_info['limit_price_format'] = number_price_format($deal_info['limit_price']);
    $deal_info['remain_days'] = floor(($deal_info['end_time'] - NOW_TIME) / (24 * 3600));
    //初始化与虚拟金额有所关联的几个比较特殊的数据 start
    foreach ($deal_info['deal_item_list'] as $k => $v) {
        // 统计所有真实+虚拟(钱)
        $deal_info['total_virtual_price'] += $v['price'] * $v['virtual_person'] + $v['support_amount'];
        //统计每个子项目真实+虚拟(人)
        $deal_info['deal_item_list'][$k]['virtual_person_list'] = $v['virtual_person'] + $v['support_count'];
    }
    //项目等级放到项目详细页面模块(对详细页面进行控制)
    $deal_info['deal_level'] = $GLOBALS['db']->getOne("select level from " . DB_PREFIX . "deal_level where id=" . intval($deal_info['user_level']));
    $deal_info['virtual_person'] = $GLOBALS['db']->getOne("select sum(virtual_person) from " . DB_PREFIX . "deal_item where deal_id=" . $deal_info['id']);
    $deal_info['person'] = $deal_info['virtual_person'] + $deal_info['support_count'];
    $deal_info['percent'] = round($deal_info['total_virtual_price'] / $deal_info['limit_price'] * 100);
    //初始化与虚拟金额有所关联的几个比较特殊的数据 end
    $GLOBALS['tmpl']->assign("deal_info", $deal_info);
    $deal_item_list = $deal_info['deal_item_list'];
    //开启限购后剩余几位
    foreach ($deal_item_list as $k => $v) {
        if ($v['limit_user'] > 0) {
            $deal_item_list[$k]['remain_person'] = $v['limit_user'] - $v['virtual_person'] - $v['support_count'];
        }
    }
    $GLOBALS['tmpl']->assign("deal_item_list", $deal_item_list);
    if ($deal_info['user_id'] > 0) {
        //		$deal_user_info = $GLOBALS['db']->getRow("select id,user_name,province,city,intro,login_time from ".DB_PREFIX."user where id = ".$deal_info['user_id']." and is_effect = 1");
        //		if($deal_user_info)
        //		{
        //			$deal_user_info['weibo_list'] = $GLOBALS['db']->getAll("select * from ".DB_PREFIX."user_weibo where user_id = ".$deal_user_info['id']);
        //			$GLOBALS['tmpl']->assign("deal_user_info",$deal_user_info);
        //		}
    }
    if ($GLOBALS['user_info']) {
        $is_focus = $GLOBALS['db']->getOne("select  count(*) from " . DB_PREFIX . "deal_focus_log where deal_id = " . $deal_info['id'] . " and user_id = " . intval($GLOBALS['user_info']['id']));
        $GLOBALS['tmpl']->assign("is_focus", $is_focus);
    }
}
Beispiel #5
0
 public function index()
 {
     //友情链接
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     $GLOBALS['tmpl']->caching = true;
     //输出文章
     $id = intval($_REQUEST['id']);
     if ($id) {
         $article = $GLOBALS['db']->getRow("select a.*,ac.type_id from " . DB_PREFIX . "article as a left join " . DB_PREFIX . "article_cate as ac on ac.id=a.cate_id where ac.id={$id}");
     }
     $cid = intval($_REQUEST['cid']);
     if ($cid) {
         $article = $GLOBALS['db']->getRow("select a.*,ac.type_id from " . DB_PREFIX . "article as a left join " . DB_PREFIX . "article_cate as ac on ac.id=a.cate_id where a.id={$cid}");
     }
     $cate_id = $article['cate_id'];
     $artilce_cate = load_auto_cache("article_cates");
     $artilce_cate_new = array();
     foreach ($artilce_cate as $k => $v) {
         if ($v['type_id'] == $article['type_id'] && $v['num'] > 0) {
             $artilce_cate_new[$k]['cate_id'] = $v['id'];
             $artilce_cate_new[$k]['titles'] = $v['title'];
             $artilce_cate_new[$k]['url'] = url('article_cate', array('cid' => $v['id']));
         }
     }
     $GLOBALS['tmpl']->assign("other_cate", $artilce_cate_new);
     //文章详细页面最新更新(控制最新的10条)
     $temp_article_list = $GLOBALS['db']->getAllCached("SELECT a.*,c.type_id from " . DB_PREFIX . "article a LEFT JOIN " . DB_PREFIX . "article_cate c on a.cate_id=c.id where 1=1 and a.is_delete=0 and a.is_effect=1 and c.type_id=" . $article['type_id'] . " and a.cate_id={$cate_id}  order by update_time desc limit 0,5");
     $article_list = array();
     foreach ($temp_article_list as $k => $v) {
         //最新更新
         $article_list[$k]['id'] = $v['id'];
         $article_list[$k]['cate_title'] = $v['title'];
         if ($v['rel_url'] == "") {
             $article_list[$k]['url'] = url('article', array('cid' => $v['id']));
         } else {
             $article_list[$k]['url'] = $v['rel_url'];
         }
     }
     unset($temp_article_list);
     $GLOBALS['tmpl']->assign('deal_type', 'article_type');
     //文章头部导航
     $nav_top = set_nav_top($GLOBALS['module'], $GLOBALS['action'], $id);
     $GLOBALS['tmpl']->assign('nav_top', $nav_top);
     $GLOBALS['tmpl']->assign("cid", $cid);
     $GLOBALS['tmpl']->assign("page_title", $article['seo_title']);
     $GLOBALS['tmpl']->assign("page_seo_keyword", $article['seo_keyword']);
     $GLOBALS['tmpl']->assign("page_seo_description", $article['seo_description']);
     $GLOBALS['tmpl']->assign("article", $article);
     $GLOBALS['tmpl']->assign("article_list", $article_list);
     $GLOBALS['tmpl']->display("article_index.html");
 }
Beispiel #6
0
 public function index()
 {
     //links
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     $act = strim($_REQUEST['act']);
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME . $act);
     if (!$GLOBALS['tmpl']->is_cached('help_index.html', $cache_id)) {
         $help_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "help where type = '" . $act . "' or id = " . intval($act));
         if ($help_item) {
             $GLOBALS['tmpl']->assign("help_item", $help_item);
             $GLOBALS['tmpl']->assign("page_title", $help_item['title']);
         } else {
             app_redirect(url("index"));
         }
     }
     $GLOBALS['tmpl']->display("help_index.html", $cache_id);
 }
Beispiel #7
0
 public function response()
 {
     //links
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     //支付跳转返回页
     if ($GLOBALS['pay_req']['class_name']) {
         $_REQUEST['class_name'] = $GLOBALS['pay_req']['class_name'];
     }
     $class_name = quotes(trim($_REQUEST['class_name']));
     $payment_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment where class_name = '" . $class_name . "'");
     if ($payment_info) {
         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();
         $_REQUEST = quotes($_REQUEST);
         $payment_code = $payment_object->response($_REQUEST);
     } else {
         showErr("支付接口不存在");
     }
 }
Beispiel #8
0
 public function index()
 {
     //links
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     if (!$GLOBALS['user_info']) {
         app_redirect(url("user#login"));
     }
     $all = intval($_REQUEST['all']);
     $page_size = 20;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     if ($all == 0) {
         $cond = " and is_read = 0 ";
     } else {
         $cond = " and 1=1 ";
     }
     $GLOBALS['tmpl']->assign("all", $all);
     $sql = "select * from " . DB_PREFIX . "user_notify  where user_id = " . intval($GLOBALS['user_info']['id']) . " {$cond}  order by log_time desc limit " . $limit;
     $sql_count = "select count(*) from " . DB_PREFIX . "user_notify  where user_id = " . intval($GLOBALS['user_info']['id']) . " {$cond}  ";
     $notify_list = $GLOBALS['db']->getAll($sql);
     $notify_count = $GLOBALS['db']->getOne($sql_count);
     foreach ($notify_list as $k => $v) {
         $notify_list[$k]['url'] = parse_url_tag("u:" . $v['url_route'] . "|" . $v['url_param']);
     }
     $GLOBALS['tmpl']->assign("notify_list", $notify_list);
     require APP_ROOT_PATH . 'app/Lib/page.php';
     $page = new Page($notify_count, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->display("notify.html");
 }
Beispiel #9
0
 public function index()
 {
     //links
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME);
     if (!$GLOBALS['tmpl']->is_cached('faq_index.html', $cache_id)) {
         $faq_list = array();
         $faq_group_list = $GLOBALS['db']->getAll("select distinct(`group`) from " . DB_PREFIX . "faq order by sort asc");
         foreach ($faq_group_list as $k => $v) {
             $faq_list[$v['group']] = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "faq where `group`='" . $v['group'] . "' order by sort asc");
         }
         $GLOBALS['tmpl']->assign("faq_list", $faq_list);
         $GLOBALS['tmpl']->assign("page_title", "常见问题");
     }
     //获得文章列表
     $artilce_cate = load_auto_cache("article_cates");
     foreach ($artilce_cate as $k => $v) {
         $artilce_cate[$k]['cate_id'] = $v['id'];
         $artilce_cate[$k]['titles'] = $v['title'];
         if ($id > 0 && $v['id'] == $id) {
             $type_id = intval($v['type_id']);
             $cate_name = $v['title'];
         }
         if ($id == $artilce_cate[$k]['cate_id']) {
             $artilce_cate[$k]['current'] = 1;
         }
     }
     $GLOBALS['tmpl']->assign("artilce_cate", $artilce_cate);
     //文章头部导航
     $nav_top = set_nav_top($GLOBALS['module'], $GLOBALS['action']);
     $GLOBALS['tmpl']->assign('nav_top', $nav_top);
     $GLOBALS['tmpl']->assign('deal_type', 'article_type');
     $GLOBALS['tmpl']->display("faq_index.html", $cache_id);
 }
Beispiel #10
0
 public function investor_one()
 {
     require APP_ROOT_PATH . 'system/utils/tree.php';
     //股权众筹 发起项目项目基本信息
     if (!$GLOBALS['user_info']) {
         app_redirect(url("user#login"));
     }
     if (app_conf("INVEST_STATUS") == 1) {
         showErr("股权众筹已经关闭");
     }
     $id = intval($_REQUEST['id']);
     if ($id > 0) {
         $deal_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where id = " . $id . " and is_delete = 0  ");
         if (empty($deal_item)) {
             showErr("该项目不存在");
         }
         if ($deal_item['user_id'] != intval($GLOBALS['user_info']['id'])) {
             showErr("您没有该项目的权限!");
         }
     }
     $show_html = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "help where id=7");
     $GLOBALS['tmpl']->assign('show_html', $show_html);
     $cate_list_str = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_cate order by sort asc");
     $tree = new tree();
     $cate_list = $tree->toFormatTree($cate_list_str);
     $GLOBALS['tmpl']->assign("cate_list", $cate_list);
     if ($deal_item) {
         $GLOBALS['tmpl']->assign("page_title", $deal_item['name']);
         $region_pid = 0;
         $region_lv2 = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "region_conf where region_level = 2 order by py asc");
         //二级地址
         foreach ($region_lv2 as $k => $v) {
             if ($v['name'] == $deal_item['province']) {
                 $region_lv2[$k]['selected'] = 1;
                 $region_pid = $region_lv2[$k]['id'];
                 break;
             }
         }
         $GLOBALS['tmpl']->assign("region_lv2", $region_lv2);
         if ($region_pid > 0) {
             $region_lv3 = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "region_conf where pid = " . $region_pid . " order by py asc");
             //三级地址
             foreach ($region_lv3 as $k => $v) {
                 if ($v['name'] == $deal_item['city']) {
                     $region_lv3[$k]['selected'] = 1;
                     break;
                 }
             }
             $GLOBALS['tmpl']->assign("region_lv3", $region_lv3);
         }
         $deal_item['business_create_time'] = to_date($deal_item['business_create_time'], 'Y-m-d');
         $deal_item['limit_price'] = $deal_item['limit_price'] / 10000;
         $deal_item['invote_mini_money'] = $deal_item['invote_mini_money'] / 10000;
         //资质证明
         $audit_data_list = unserialize($deal_item['audit_data']);
         $GLOBALS['tmpl']->assign("audit_data_list", $audit_data_list);
         $GLOBALS['tmpl']->assign("deal_item", $deal_item);
         $GLOBALS['tmpl']->display("investor_one.html");
     } else {
         $g_links = get_link_by_id(14);
         $GLOBALS['tmpl']->assign("g_links", $g_links);
         if (!$GLOBALS['user_info']) {
             app_redirect(url("user#login"));
         }
         $region_lv2 = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "region_conf where region_level = 2 order by py asc");
         //二级地址
         $GLOBALS['tmpl']->assign("region_lv2", $region_lv2);
         $deal_image = es_session::get("deal_image");
         $GLOBALS['tmpl']->assign("deal_image", $deal_image);
         $GLOBALS['tmpl']->display("investor_one.html");
     }
 }
Beispiel #11
0
 public function index()
 {
     //links
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     if (!$GLOBALS['user_info']) {
         app_redirect(url("user#login"));
     }
     //(普通众筹)支持之前需要用户绑定手机号
     if (!$GLOBALS['user_info']['mobile']) {
         showErr("您未绑定手机,无法进行众筹", 0, url("settings#security", array('method' => 'setting-mobile-box')));
         //app_redirect(url("user#user_bind_mobile",array("cid"=>intval($_REQUEST['id']))));
         //app_redirect(url("settings#security",array('method'=>'setting-mobile-box')));
     }
     $id = intval($_REQUEST['id']);
     $iDI = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "iqianjin_deal_item where deal_item_id = " . $id);
     if ($iDI) {
         //检测爱钱进红包购买情况
         $iWL = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "iqianjin_winner where user_id = " . $GLOBALS['user_info']['id']);
         if ($iWL) {
             showErr("您已中奖!获得了爱钱进普通红包,请您到爱钱进领取。", 0, url("index"));
         }
         $iB2L = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "iqianjin_buy where type=2 and user_id = " . $GLOBALS['user_info']['id']);
         if ($iB2L) {
             if ($iDI['type'] == 2) {
                 showErr("您已经购买了本红包,请您到爱钱进领取。", 0, url("index"));
             }
         }
         $iBL = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "iqianjin_buy where type=1 and deal_item_id=" . $id . " and user_id = " . $GLOBALS['user_info']['id']);
         if ($iBL) {
             showErr("您今天已经购买了本红包,请明天12:00再来支持。", 0, url("index"));
         }
     }
     $deal_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_item where id = " . $id);
     if (!$deal_item) {
         app_redirect(url("index"));
     } elseif ($deal_item['support_count'] >= $deal_item['limit_user'] && $deal_item['limit_user'] != 0) {
         app_redirect(url("deal#show", array("id" => $deal_item['deal_id'])));
     }
     $deal_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where is_delete = 0 and is_effect = 1 and id = " . $deal_item['deal_id']);
     if (!$deal_info) {
         app_redirect(url("index"));
     } elseif ($deal_info['begin_time'] > NOW_TIME || $deal_info['end_time'] < NOW_TIME && $deal_info['end_time'] != 0) {
         app_redirect(url("deal#show", array("id" => $deal_item['deal_id'])));
     }
     $deal_info1 = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_item where deal_id = " . $deal_item['deal_id']);
     foreach ($deal_info1 as $k => $v) {
         // 统计所有真实+虚拟(钱)
         $deal_info1['total_virtual_price'] += intval($v['price'] * $v['virtual_person'] + $v['support_amount']);
     }
     $deal_info['support_amount'] = $deal_info1['total_virtual_price'];
     $deal_item['price_format'] = number_price_format($deal_item['price']);
     $deal_item['delivery_fee_format'] = number_price_format($deal_item['delivery_fee']);
     $deal_info['percent'] = round($deal_info['support_amount'] / $deal_info['limit_price'] * 100);
     $deal_info['remain_days'] = ceil(($deal_info['end_time'] - NOW_TIME) / (24 * 3600));
     $GLOBALS['tmpl']->assign("deal_item", $deal_item);
     $GLOBALS['tmpl']->assign("deal_info", $deal_info);
     if ($deal_info['seo_title'] != "") {
         $GLOBALS['tmpl']->assign("seo_title", $deal_info['seo_title']);
     }
     if ($deal_info['seo_keyword'] != "") {
         $GLOBALS['tmpl']->assign("seo_keyword", $deal_info['seo_keyword']);
     }
     if ($deal_info['seo_description'] != "") {
         $GLOBALS['tmpl']->assign("seo_description", $deal_info['seo_description']);
     }
     $GLOBALS['tmpl']->assign("page_title", $deal_info['name']);
     if ($deal_item['is_delivery']) {
         $consignee_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user_consignee where user_id = " . intval($GLOBALS['user_info']['id']));
         if ($consignee_list) {
             $GLOBALS['tmpl']->assign("consignee_list", $consignee_list);
         } else {
             $region_lv2 = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "region_conf where region_level = 2 order by py asc");
             //二级地址
             $GLOBALS['tmpl']->assign("region_lv2", $region_lv2);
         }
     }
     $GLOBALS['tmpl']->display("cart_index.html");
 }
 public function security()
 {
     $g_links = get_link_by_id();
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     if (!$GLOBALS['user_info']) {
         app_redirect(url("user#login"));
     }
     $method = strim($_REQUEST['method']);
     $method_array = array("setting-username-box", "setting-pwd-box", "setting-email-box", "setting-mobile-box", "setting-pass-box", "setting-id-box");
     if (!in_array($method, $method_array)) {
         $method = '';
     }
     $GLOBALS['tmpl']->assign("method", $method);
     $GLOBALS['tmpl']->display("settings_security.html");
 }
Beispiel #13
0
 public function index()
 {
     if (strim($_REQUEST['type']) == 1 && app_conf("INVEST_STATUS") == 1) {
         showErr("股权众筹已经关闭");
     }
     if (app_conf("INVEST_STATUS") == 2 && strim($_REQUEST['type']) == null) {
         showErr("产品众筹已经关闭");
     }
     //links
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     $GLOBALS['tmpl']->assign("page_title", "最新动态");
     $param = array();
     //参数集合
     //数据来源参数
     $r = strim($_REQUEST['r']);
     //推荐类型
     $param['r'] = $r ? $r : '';
     $GLOBALS['tmpl']->assign("p_r", $r);
     $id = intval($_REQUEST['id']);
     //分类id
     $param['id'] = $id;
     $GLOBALS['tmpl']->assign("p_id", $id);
     $loc = strim($_REQUEST['loc']);
     //地区
     $param['loc'] = $loc;
     $GLOBALS['tmpl']->assign("p_loc", $loc);
     $state = intval($_REQUEST['state']);
     //状态
     $param['state'] = $state;
     $GLOBALS['tmpl']->assign("p_state", $state);
     $tag = strim($_REQUEST['tag']);
     //标签
     $param['tag'] = $tag;
     $GLOBALS['tmpl']->assign("p_tag", $tag);
     $kw = strim($_REQUEST['k']);
     //关键词
     $param['k'] = $kw;
     $GLOBALS['tmpl']->assign("p_k", $kw);
     $type = intval($_REQUEST['type']);
     //推荐类型
     $param['type'] = $type;
     $GLOBALS['tmpl']->assign("p_type", $type);
     if (intval($_REQUEST['redirect']) == 1) {
         app_redirect(url("aps", $param));
     }
     $cate_list = load_dynamic_cache("INDEX_CATE_LIST");
     if (!$cate_list) {
         $cate_list = $GLOBALS['db']->getAll("select a.* from " . DB_PREFIX . "deal_cate as a where a.is_delete=0 and ( SELECT count( b.id ) AS num FROM xlc_deal AS b WHERE b.cate_id = a.id and b.is_ap>0) >0 order by sort asc");
         set_dynamic_cache("INDEX_CATE_LIST", $cate_list);
     }
     $cate_result = array();
     foreach ($cate_list as $k => $v) {
         if ($v['pid'] == 0) {
             $temp_param = $param;
             $cate_result[$k + 1]['id'] = $v['id'];
             $cate_result[$k + 1]['name'] = $v['name'];
             $temp_param['id'] = $v['id'];
             $cate_result[$k + 1]['url'] = url("aps", $temp_param);
         }
     }
     $GLOBALS['tmpl']->assign("cate_list", $cate_result);
     $pid = $id;
     //获取父类id
     if ($cate_list) {
         $pid = $this->get_child($cate_list, $pid);
     }
     /*子分类 start*/
     $cate_ids = array();
     $is_child = false;
     $temp_cate_ids = array();
     if ($cate_list) {
         $child_cate_result = array();
         foreach ($cate_list as $k => $v) {
             if ($v['pid'] == $pid) {
                 if ($v['id'] > 0) {
                     $temp_param = $param;
                     $child_cate_result[$v['id']]['id'] = $v['id'];
                     $child_cate_result[$v['id']]['name'] = $v['name'];
                     $temp_param['id'] = $v['id'];
                     $child_cate_result[$v['id']]['url'] = url("aps", $temp_param);
                     if ($id == $v['id']) {
                         $is_child = true;
                     }
                 }
             }
             if ($v['pid'] == $pid || $pid == 0) {
                 $temp_cate_ids[] = $v['id'];
             }
         }
     }
     //假如选择了子类 那么使用子类ID  否则使用 父类和其子类
     if ($is_child) {
         $cate_ids[] = $id;
     } else {
         $cate_ids[] = $pid;
         $cate_ids = array_merge($cate_ids, $temp_cate_ids);
     }
     $cate_ids = array_filter($cate_ids);
     $GLOBALS['tmpl']->assign("child_cate_list", $child_cate_result);
     $GLOBALS['tmpl']->assign("pid", $pid);
     /*子分类 end*/
     $city_list = load_dynamic_cache("INDEX_CITY_LIST");
     if (!$city_list) {
         $city_list = $GLOBALS['db']->getAll("select province from " . DB_PREFIX . "deal where is_ap>0 group by province order by sort asc");
         set_dynamic_cache("INDEX_CITY_LIST", $city_list);
     }
     foreach ($city_list as $k => $v) {
         $temp_param = $param;
         $temp_param['loc'] = $v['province'];
         $city_list[$k]['url'] = url("aps", $temp_param);
     }
     $GLOBALS['tmpl']->assign("city_list", $city_list);
     //============region_conf============
     $area_list = $GLOBALS['db']->getAll("select rc.* from " . DB_PREFIX . "region_conf as rc where rc.name in (select province from " . DB_PREFIX . "deal where is_ap>0) or  rc.name in (select city from " . DB_PREFIX . "deal where is_ap>0) or rc.is_hot=1 ");
     $area = array();
     $hot_area = array();
     foreach ($area_list as $k => $v) {
         $temp_param['loc'] = $v['name'];
         $area[strtoupper($v['py'][0])][$v['name']] = array('url' => url("aps", $temp_param), 'name' => $v['name']);
         if ($v['is_hot']) {
             $hot_area[] = array('url' => url("aps", $temp_param), 'name' => $v['name']);
         }
     }
     ksort($area);
     $area_array = array();
     $area_array = array_chunk(array_filter($area), 4, true);
     $area_array_num = array();
     foreach ($area_array as $k => $v) {
         foreach ($v as $k1 => $v1) {
             $area_array_str[$k] .= $k1;
         }
     }
     $GLOBALS['tmpl']->assign("area_array", $area_array);
     $GLOBALS['tmpl']->assign("area_array_str", $area_array_str);
     $GLOBALS['tmpl']->assign("hot_area", array_filter($hot_area));
     //=================region_conf==============
     if ($type == 1) {
         $state_list = array(1 => array("name" => "筹资成功"), 2 => array("name" => "筹资失败"), 3 => array("name" => "融资中"));
     } else {
         $state_list = array(1 => array("name" => "筹资成功"), 2 => array("name" => "筹资失败"), 3 => array("name" => "筹资中"));
     }
     foreach ($state_list as $k => $v) {
         $temp_param = $param;
         $temp_param['state'] = $k;
         $state_list[$k]['url'] = url("aps", $temp_param);
     }
     $GLOBALS['tmpl']->assign("state_list", $state_list);
     $page_size = 10;
     $step_size = 10;
     $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);
     $condition = " d.is_delete = 0 and d.is_effect = 1 and d.is_ap>0";
     if ($r != "") {
         if ($r == "new") {
             $condition .= " and " . NOW_TIME . " - d.begin_time < " . 24 * 3600 . " and " . NOW_TIME . " - d.begin_time > 0 ";
             //上线不超过一天
             $GLOBALS['tmpl']->assign("page_title", "最新上线");
         }
         if ($r == "rec") {
             $condition .= " and " . NOW_TIME . " <= d.end_time AND " . NOW_TIME . " >= d.begin_time and d.is_recommend = 1 ";
             $GLOBALS['tmpl']->assign("page_title", "推荐项目");
         }
         if ($r == "yure") {
             $condition .= " and " . NOW_TIME . " - d.begin_time < " . 24 * 3600 . " and " . NOW_TIME . " - d.begin_time <  0 ";
             //上线不超过一天
             $GLOBALS['tmpl']->assign("page_title", "正在预热");
         }
         if ($r == "nend") {
             $condition .= " and d.end_time - " . NOW_TIME . " < " . 24 * 3600 . " and d.end_time - " . NOW_TIME . " > 0 ";
             //当天就要结束
             $GLOBALS['tmpl']->assign("page_title", "即将结束");
         }
         if ($r == "classic") {
             $condition .= " and d.is_classic = 1 ";
             $GLOBALS['tmpl']->assign("page_title", "经典项目");
             $GLOBALS['tmpl']->assign("is_classic", true);
         }
         if ($r == "limit_price") {
             $condition .= " and max(d.limit_price) ";
             $GLOBALS['tmpl']->assign("page_title", "最高目标金额");
         }
     }
     switch ($state) {
         //筹资成功
         case 1:
             $condition .= " and d.is_success=1  ";
             $GLOBALS['tmpl']->assign("page_title", "筹资成功");
             break;
             //筹资失败
         //筹资失败
         case 2:
             $condition .= " and d.end_time < " . NOW_TIME . " and d.end_time!=0  and d.is_success=0  ";
             $GLOBALS['tmpl']->assign("page_title", "筹资失败");
             break;
             //筹资中
         //筹资中
         case 3:
             $condition .= " and (d.end_time > " . NOW_TIME . " or d.end_time=0 ) and d.begin_time < " . NOW_TIME . " and d.is_success=0  ";
             $GLOBALS['tmpl']->assign("page_title", "筹资中");
             break;
     }
     if (count($cate_ids) > 0) {
         $condition .= " and d.cate_id in (" . implode(",", $cate_ids) . ")";
         $GLOBALS['tmpl']->assign("page_title", $cate_result[$id]['name']);
     }
     if ($loc != "") {
         $condition .= " and (d.province = '" . $loc . "' or city = '" . $loc . "') ";
         $GLOBALS['tmpl']->assign("page_title", $loc);
     }
     if ($type !== "") {
         $type = intval($type);
         $condition .= " and type={$type} ";
         $GLOBALS['tmpl']->assign("page_title", $loc);
     }
     if ($tag != "") {
         $unicode_tag = str_to_unicode_string($tag);
         $condition .= " and match(d.tags_match) against('" . $unicode_tag . "'  IN BOOLEAN MODE) ";
         $GLOBALS['tmpl']->assign("page_title", $tag);
     }
     if ($kw != "") {
         $kws_div = div_str($kw);
         foreach ($kws_div as $k => $item) {
             $kws[$k] = str_to_unicode_string($item);
         }
         $ukeyword = implode(" ", $kws);
         $condition .= " and (match(d.name_match) against('" . $ukeyword . "'  IN BOOLEAN MODE) or match(d.tags_match) against('" . $ukeyword . "'  IN BOOLEAN MODE)  or d.name like '%" . $kw . "%') ";
         $GLOBALS['tmpl']->assign("page_title", $kw);
     }
     $result = get_deal_list($limit, $condition);
     foreach ($result['list'] as $key => $val) {
         $result['list'][$key]['limit_ap'] = $val['limit_price'] * $val['ap_ratio'];
         $result['list'][$key]['ap_amount'] = $val['support_amount'] * $val['ap_ratio'];
     }
     if ($type == 1) {
         $GLOBALS['tmpl']->assign("deal_list_invest", $result['list']);
     } else {
         $GLOBALS['tmpl']->assign("deal_list", $result['list']);
     }
     $GLOBALS['tmpl']->assign("deal_count", $result['rs_count']);
     $page = new Page($result['rs_count'], $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     if ($type == 1) {
         $GLOBALS['tmpl']->assign('deal_type', 'gq_type');
     } else {
         $GLOBALS['tmpl']->assign('deal_type', 'product_type');
     }
     if ($GLOBALS['tmpl']->_var['page_title'] == '') {
         $page_title = '';
         if ($type == 1) {
             foreach ($GLOBALS['nav_list'] as $k => $v) {
                 if ($v['u_module'] == 'deals' && $v['u_action'] == 'index' && $v['u_param'] == 'type=1') {
                     $page_title = $v['name'];
                 }
             }
             $page_title = $page_title ? $page_title : '股权项目';
         } else {
             foreach ($GLOBALS['nav_list'] as $k => $v) {
                 if ($v['u_module'] == 'deals' && $v['u_action'] == 'index' && $v['u_param'] == '') {
                     $page_title = $v['name'];
                 }
             }
             $page_title = $page_title ? $page_title : '产品项目';
         }
         $GLOBALS['tmpl']->assign("page_title", $page_title);
     }
     $GLOBALS['tmpl']->display("aps_index.html");
 }
 public function index()
 {
     $id = intval($_REQUEST['id']);
     $GLOBALS['tmpl']->assign("page_title", "文章列表");
     //改写
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     $GLOBALS['tmpl']->caching = true;
     $artilce_cate = load_auto_cache("article_cates");
     $type_id = 0;
     $cate_name = '';
     foreach ($artilce_cate as $k => $v) {
         $artilce_cate[$k]['cate_id'] = $v['id'];
         $artilce_cate[$k]['titles'] = $v['title'];
         if ($id > 0 && $v['id'] == $id) {
             $type_id = intval($v['type_id']);
             $cate_name = $v['title'];
         }
         if ($id == $artilce_cate[$k]['cate_id']) {
             $artilce_cate[$k]['current'] = 1;
         }
     }
     $GLOBALS['tmpl']->assign("cate_name", $cate_name);
     $GLOBALS['tmpl']->assign("artilce_cate", $artilce_cate);
     //分页
     $page_size = DEALUPDATE_PAGE_SIZE;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     //条件判断
     $where = '1=1 and a.is_delete=0 and a.is_effect=1 ';
     if ($id > 0) {
         $where .= ' and c.type_id=' . $type_id . '  and a.cate_id=' . $id;
     } else {
         $where .= ' and c.type_id=0 ';
     }
     $temp_artilce_list = $GLOBALS['db']->getAllCached("SELECT a.*,c.type_id,c.title as cate_name from " . DB_PREFIX . "article a LEFT JOIN " . DB_PREFIX . "article_cate c on a.cate_id=c.id where {$where} order by a.update_time desc limit {$limit}");
     $temp_artilce_count = $GLOBALS['db']->getOne("select COUNT(*) from " . DB_PREFIX . "article a," . DB_PREFIX . "article_cate c WHERE a.cate_id=c.id and a.is_delete=0 AND a.is_effect=1 and c.type_id=0");
     $hot_article = array();
     $week_article = array();
     $artilce_item = array();
     foreach ($temp_artilce_list as $k => $v) {
         //最新智能头条type_id==0普通文章, type_id==1帮助文章,is_hot==1热门,is_week==1本周必读
         if ($v['id'] > 0) {
             $artilce_item[$k]['cate_title'] = $v['title'];
             $artilce_item[$k]['seo_keyword'] = $v['seo_keyword'];
             $artilce_item[$k]['title'] = $v['title'];
             $artilce_item[$k]['content'] = $v['content'];
             $artilce_item[$k]['update_time'] = $v['update_time'];
             $artilce_item[$k]['cate_name'] = $v['cate_name'];
             $artilce_item[$k]['cate_url'] = url('article_cate', array('id' => $v['cate_id']));
             if ($v['rel_url'] == "") {
                 $artilce_item[$k]['url'] = url('article', array('id' => $v['id']));
             } else {
                 $artilce_item[$k]['url'] = $v['rel_url'];
             }
         }
     }
     $page = new Page(intval($temp_artilce_count), $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     unset($temp_artilce_list);
     //文章头部导航
     $nav_top = set_nav_top($GLOBALS['module'], $GLOBALS['action'], $id);
     $GLOBALS['tmpl']->assign('nav_top', $nav_top);
     $GLOBALS['tmpl']->assign("id", $id);
     $GLOBALS['tmpl']->assign("artilce_list", $artilce_item);
     $GLOBALS['tmpl']->assign('deal_type', 'article_type');
     $GLOBALS['tmpl']->display("article_cate.html");
 }
Beispiel #15
0
 public function fav()
 {
     //links
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     $GLOBALS['tmpl']->assign("page_title", "最新动态");
     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);
     if (app_conf("INVEST_STATUS") == 0) {
         $condition = " 1=1 ";
     } elseif (app_conf("INVEST_STATUS") == 1) {
         $condition = " type=0 ";
     } elseif (app_conf("INVEST_STATUS") == 2) {
         $condition = " type=1 ";
     }
     $rand_deals = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal where {$condition} and 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);
     if (app_conf("INVEST_STATUS") == 0) {
         $condition = " 1=1 ";
     } elseif (app_conf("INVEST_STATUS") == 1) {
         $condition = " de.type=0 ";
     } elseif (app_conf("INVEST_STATUS") == 2) {
         $condition = " de.type=1 ";
     }
     $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 left join " . DB_PREFIX . "deal as de on de.id=dl.deal_id where {$condition} and 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 left join " . DB_PREFIX . "deal as de on de.id=dl.deal_id where {$condition} and dfl.user_id = " . intval($GLOBALS['user_info']['id']);
     $log_list = $GLOBALS['db']->getAll($sql);
     $log_count = $GLOBALS['db']->getOne($sql_count);
     /*(最新动态)准备虚拟数据 start*/
     if ($log_count > 0) {
         $deal_item_ids = array();
         foreach ($log_list as $k => $v) {
             $log_list[$k]['pass_time'] = pass_date($v['create_time']);
             $log_list[$k] = cache_log_comment($log_list[$k]);
             $log_list[$k] = cache_log_deal($log_list[$k]);
             //$log_list[$k]['deal_info']['lin']=8;放进去
             //得到页面项目的ID
             $deal_item_ids[] = $log_list[$k]['deal_info']['id'];
         }
         //获得每个项目下的所有子项目信息
         $temp_deal_item_List = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_item where deal_id in(" . implode(",", $deal_item_ids) . ") order by deal_id desc");
         $virtual_price_list = array();
         //重新组装一个以项目ID为KEY的虚拟价格
         foreach ($temp_deal_item_List as $k => $v) {
             $virtual_price_list[$v['deal_id']]['total_virtual_price'] += $v['price'] * $v['virtual_person'];
         }
         unset($temp_deal_item_List);
         //放到项目动态表里面进行统计
         foreach ($log_list as $k => $v) {
             $log_list[$k]['deal_info']['percent'] = round(($v['deal_info']['support_amount'] + $virtual_price_list[$v['deal_id']]['total_virtual_price']) / $v['deal_info']['limit_price'] * 100);
             $log_list[$k]['deal_info']['support_amount'] += $virtual_price_list[$v['deal_id']]['total_virtual_price'];
         }
     }
     /*(最新动态)准备虚拟数据 end*/
     $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");
 }
Beispiel #16
0
 public function index()
 {
     get_mortgate();
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME);
     $image_list = load_dynamic_cache("INDEX_IMAGE_LIST");
     if ($image_list === false) {
         $image_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "index_image order by sort asc");
         set_dynamic_cache("INDEX_IMAGE_LIST", $image_list);
     }
     $GLOBALS['tmpl']->assign("image_list", $image_list);
     $cate_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_cate where is_delete=0 order by sort asc");
     $cate_result = array();
     foreach ($cate_list as $k => $v) {
         $cate_result[$v['id']] = $v;
     }
     $GLOBALS['tmpl']->assign("cate_list", $cate_result);
     send_deal_success_1();
     send_deal_fail_1();
     //===============首页项目列表START===================
     $page_size = 5;
     $limit = "0,5";
     $GLOBALS['tmpl']->assign("current_page", 1);
     $deal_result = get_deal_list($limit, 'is_recommend=1');
     $GLOBALS['tmpl']->assign("deal_list", $deal_result['list']);
     $deal_invest_result = get_deal_list($limit, '');
     $GLOBALS['tmpl']->assign("deal_list_invest", $deal_invest_result['list']);
     $shu = $GLOBALS['db']->getAll("select count(*) from " . DB_PREFIX . "deal where is_recommend=1 and type=0");
     $shu = $shu[0]['count(*)'];
     $GLOBALS['tmpl']->assign("shu", $shu);
     $all_shu = $GLOBALS['db']->getAll("select count(*) from " . DB_PREFIX . "deal where type=0");
     $all_shu = $all_shu[0]['count(*)'];
     $GLOBALS['tmpl']->assign("all_shu", $all_shu);
     //===============首页项目列表END===================
     //links
     $g_links = get_link_by_id();
     /*虚拟的累计项目总个数,支持总人数,项目支持总金额*/
     if (app_conf("INVEST_STATUS") == 0) {
         $condition = " and 1=1 ";
     } elseif (app_conf("INVEST_STATUS") == 1) {
         $condition = " and type=0 ";
     } elseif (app_conf("INVEST_STATUS") == 2) {
         $condition = " and type=1 ";
     }
     $virtual_effect = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal where is_effect = 1 and is_delete=0 {$condition}");
     $virtual_person = $GLOBALS['db']->getOne("select sum((support_count+virtual_num)) from " . DB_PREFIX . "deal where is_effect = 1 and is_delete=0 {$condition}");
     $virtual_money = $GLOBALS['db']->getOne("select sum(support_amount+virtual_price) from " . DB_PREFIX . "deal where is_effect = 1 and is_delete=0 {$condition}");
     $zhuce_num = $GLOBALS['db']->getOne("select count(*) as num from " . DB_PREFIX . "user where is_effect = 1");
     $GLOBALS['tmpl']->assign("zhuce_num", $zhuce_num);
     $virtual_effect = floor($virtual_effect * 2.3);
     $GLOBALS['tmpl']->assign("virtual_effect", $virtual_effect);
     //项目总个数
     $virtual_person = floor($virtual_person * 2.7);
     $GLOBALS['tmpl']->assign("virtual_person", $virtual_person);
     //累计支持人
     //$virtual_money = floor($virtual_money*2.1);
     $GLOBALS['tmpl']->assign("virtual_money", number_format($virtual_money, 2));
     //筹资总金额
     /*虚拟的累计项目总个数,支持总人数,项目支持总金额 结束*/
     //首页TAB选项卡
     if (app_conf("INVEST_STATUS") == 0) {
         $condition = " d.is_delete = 0 and d.is_effect = 1 ";
     } elseif (app_conf("INVEST_STATUS") == 1) {
         $condition = " d.is_delete = 0 and d.is_effect = 1 and d.type=0 ";
     } elseif (app_conf("INVEST_STATUS") == 2) {
         $condition = " d.is_delete = 0 and d.is_effect = 1 and d.type=1 ";
     }
     if ($GLOBALS['user_info']['user_level'] != 0) {
         $level = $GLOBALS['db']->getOne("SELECT level from " . DB_PREFIX . "user_level where id=" . $GLOBALS['user_info']['user_level']);
         $condition .= " AND (d.user_level ='' or d.user_level=0 or d.user_level <={$level})   ";
     } else {
         $condition .= " AND (d.user_level =0 or d.user_level =1 or d.user_level ='') AND d.is_recommend='1'";
     }
     //最后发起的项目,如果被设置为推荐,被选项卡显示
     $deal_cate_array = $GLOBALS['db']->getAll("select d.* from (select * from " . DB_PREFIX . "deal order by sort asc)  as d left join " . DB_PREFIX . "deal_cate as dc on dc.id=d.cate_id where {$condition} group by d.cate_id order by dc.sort asc ");
     $deal_cate = array();
     $now_time = NOW_TIME;
     foreach ($deal_cate_array as $k => $v) {
         if ($v['id'] > 0) {
             $v['cate_name'] = $cate_result[$v['cate_id']]['name'];
             $v['percent'] = round($v['support_amount'] / $v['limit_price'] * 100);
             $v['num_days'] = ceil(($v['end_time'] - $v['begin_time']) / (24 * 3600));
             $v['remain_days'] = ceil(($v['end_time'] - $now_time) / (24 * 3600));
             if ($v['begin_time'] > $now_time) {
                 $v['left_days'] = intval(($now_time - $v['create_time']) / 24 / 3600);
             }
             $v['num_days'] = ceil(($v['end_time'] - $v['begin_time']) / (24 * 3600));
             $deal_ids[] = $v['id'];
             $deal_cate[$v['id']] = $v;
         }
     }
     //将获取到的虚拟人数和虚拟价格拿到项目列表里面进行统计
     foreach ($deal_cate as $k => $v) {
         if ($v['type'] == 1) {
             $deal_cate[$k]['virtual_person'] = $deal_cate[$k]['invote_num'];
             $deal_cate[$k]['support_count'] = $deal_cate[$k]['invote_num'];
             $deal_cate[$k]['support_amount'] = $deal_cate[$k]['invote_money'];
             $deal_cate[$k]['percent'] = round($deal_cate[$k]['support_amount'] / $v['limit_price'] * 100);
         } else {
             $deal_cate[$k]['virtual_person'] = $deal_cate[$k]['virtual_num'];
             $deal_cate[$k]['support_count'] = $deal_cate[$k]['virtual_num'] + $deal_cate[$k]['support_count'];
             $deal_cate[$k]['support_amount'] = $deal_cate[$k]['virtual_price'] + $deal_cate[$k]['support_amount'];
             $deal_cate[$k]['percent'] = round($deal_cate[$k]['support_amount'] / $v['limit_price'] * 100);
         }
     }
     $GLOBALS['tmpl']->assign("deal_cate", $deal_cate);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     //获取专题列表
     $topic_num = $GLOBALS['db']->getOne("select count(*) as num from " . DB_PREFIX . "zhuanti where 1 ");
     $GLOBALS['tmpl']->assign("topic_num", $topic_num);
     $topic_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "zhuanti where state=1 order by sort desc limit 0,3");
     $GLOBALS['tmpl']->assign("topic_list", $topic_list);
     $GLOBALS['tmpl']->display("index.html");
 }
Beispiel #17
0
 function mail_check()
 {
     //links
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     if (app_conf("MAIL_ON") == 1) {
         $user_id = (int) $_REQUEST['uid'];
         //发邮件
         send_user_verify_mail($user_id);
         $user_email = $GLOBALS['db']->getOne("select email from " . DB_PREFIX . "user where id =" . $user_id);
         //开始关于跳转地址的解析
         $domain = explode("@", $user_email);
         $domain = $domain[1];
         $gocheck_url = '';
         switch ($domain) {
             case '163.com':
                 $gocheck_url = 'http://mail.163.com';
                 break;
             case '126.com':
                 $gocheck_url = 'http://www.126.com';
                 break;
             case 'sina.com':
                 $gocheck_url = 'http://mail.sina.com';
                 break;
             case 'sina.com.cn':
                 $gocheck_url = 'http://mail.sina.com.cn';
                 break;
             case 'sina.cn':
                 $gocheck_url = 'http://mail.sina.cn';
                 break;
             case 'qq.com':
                 $gocheck_url = 'http://mail.qq.com';
                 break;
             case 'foxmail.com':
                 $gocheck_url = 'http://mail.foxmail.com';
                 break;
             case 'gmail.com':
                 $gocheck_url = 'http://www.gmail.com';
                 break;
             case 'yahoo.com':
                 $gocheck_url = 'http://mail.yahoo.com';
                 break;
             case 'yahoo.com.cn':
                 $gocheck_url = 'http://mail.cn.yahoo.com';
                 break;
             case 'hotmail.com':
                 $gocheck_url = 'http://www.hotmail.com';
                 break;
             default:
                 $gocheck_url = "";
                 break;
         }
         $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['REGISTER_MAIL_SEND_SUCCESS']);
         $GLOBALS['tmpl']->assign("user_email", $user_email);
         $GLOBALS['tmpl']->assign("gocheck_url", $gocheck_url);
         //end
         $GLOBALS['tmpl']->display("user_register_email.html");
     }
 }
Beispiel #18
0
 public function bank()
 {
     //links
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     $GLOBALS['tmpl']->assign("page_title", "最新动态");
     if (!$GLOBALS['user_info']) {
         app_redirect(url("user#login"));
     }
     /*	if($GLOBALS['user_info']['ex_real_name']!=""||$GLOBALS['user_info']['ex_account_info']!=""||$GLOBALS['user_info']['ex_contact']!="")
     		{
     			app_redirect_preview();
     		}
     	*/
     $GLOBALS['tmpl']->display("settings_bank.html");
 }
Beispiel #19
0
 public function init_deal_page($deal_info)
 {
     //links
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     $GLOBALS['tmpl']->assign("page_title", $deal_info['name']);
     if ($deal_info['seo_title'] != "") {
         $GLOBALS['tmpl']->assign("seo_title", $deal_info['seo_title']);
     }
     if ($deal_info['seo_keyword'] != "") {
         $GLOBALS['tmpl']->assign("seo_keyword", $deal_info['seo_keyword']);
     }
     if ($deal_info['seo_description'] != "") {
         $GLOBALS['tmpl']->assign("seo_description", $deal_info['seo_description']);
     }
     $deal_info['tags_arr'] = preg_split("/[ ,]/", $deal_info['tags']);
     $deal_info['support_amount_format'] = number_price_format($deal_info['support_amount']);
     if ($deal_info['type'] == 1) {
         $deal_info['limit_price_format'] = number_price_format($deal_info['limit_price'] / 10000);
     } else {
         $deal_info['limit_price_format'] = number_price_format($deal_info['limit_price']);
     }
     $deal_info['remain_days'] = ceil(($deal_info['end_time'] - time()) / (24 * 3600));
     $deal_info['person'] = 0;
     $GLOBALS['tmpl']->assign("now_time", time());
     //初始化与虚拟金额有所关联的几个比较特殊的数据 start
     foreach ($deal_info['deal_item_list'] as $k => $v) {
         //统计每个子项目真实+虚拟(人)
         $deal_info['deal_item_list'][$k]['virtual_person_list'] = intval($v['virtual_person'] + $v['support_count']);
     }
     if ($deal_info['type'] == 1) {
         $deal_info['person'] = $deal_info['invote_num'];
         $deal_info['total_virtual_price'] = number_price_format($deal_info['invote_money'] / 10000);
         $deal_info['percent'] = round($deal_info['invote_money'] / $deal_info['limit_price'] * 100);
     } else {
         $deal_info['person'] = $deal_info['support_count'] + $deal_info['virtual_num'];
         $deal_info['total_virtual_price'] = number_price_format($deal_info['support_amount'] + $deal_info['virtual_price']);
         $deal_info['percent'] = round(($deal_info['support_amount'] + $deal_info['virtual_price']) / $deal_info['limit_price'] * 100);
     }
     //项目等级放到项目详细页面模块(对详细页面进行控制)
     $deal_info['deal_level'] = $GLOBALS['db']->getOne("select level from " . DB_PREFIX . "deal_level where id=" . intval($deal_info['user_level']));
     $deal_info['virtual_person'] = $GLOBALS['db']->getOne("select sum(virtual_person) from " . DB_PREFIX . "deal_item where deal_id=" . $deal_info['id']);
     //初始化与虚拟金额有所关联的几个比较特殊的数据 end
     if (!empty($deal_info['vedio']) && !preg_match("/http://player.youku.com/embed/i", $deal_info['source_video'])) {
         $deal_info['source_vedio'] = preg_replace("/id_(.*)\\.html(.*)/i", "http://player.youku.com/embed/\${1}", baseName($deal_info['vedio']));
         $GLOBALS['db']->query("update " . DB_PREFIX . "deal set source_vedio='" . $deal_info['source_vedio'] . "'  where id=" . $deal_info['id']);
     }
     $GLOBALS['tmpl']->assign("deal_info", $deal_info);
     $deal_item_list = $deal_info['deal_item_list'];
     //开启限购后剩余几位
     foreach ($deal_item_list as $k => $v) {
         if ($v['limit_user'] > 0) {
             $deal_item_list[$k]['remain_person'] = $v['limit_user'] - $v['virtual_person'] - $v['support_count'];
         }
     }
     $GLOBALS['tmpl']->assign("deal_item_list", $deal_item_list);
     if ($GLOBALS['user_info']) {
         $is_focus = $GLOBALS['db']->getOne("select  count(*) from " . DB_PREFIX . "deal_focus_log where deal_id = " . $deal_info['id'] . " and user_id = " . intval($GLOBALS['user_info']['id']));
         $GLOBALS['tmpl']->assign("is_focus", $is_focus);
     }
 }
Beispiel #20
0
 public function support()
 {
     //links
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     $GLOBALS['tmpl']->assign("page_title", "最新动态");
     $id = intval($_REQUEST['id']);
     $home_user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $id . " and is_effect = 1");
     if (!$home_user_info) {
         app_redirect(url("index"));
     }
     $home_user_info['weibo_list'] = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user_weibo where user_id = " . $home_user_info['id']);
     $GLOBALS['tmpl']->assign("home_user_info", $home_user_info);
     $page_size = DEAL_PAGE_SIZE;
     $step_size = DEAL_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);
     if (app_conf("INVEST_STATUS") == 0) {
         $condition = " 1=1 ";
     } elseif (app_conf("INVEST_STATUS") == 1) {
         $condition = " d.type=0 ";
     } elseif (app_conf("INVEST_STATUS") == 2) {
         $condition = " d.type=1 ";
     }
     $sql = "select distinct(d.id) as id,d.* from " . DB_PREFIX . "deal as d left join " . DB_PREFIX . "deal_support_log as dsl on d.id = dsl.deal_id " . " where {$condition} and dsl.user_id = " . $home_user_info['id'] . " order by d.sort asc limit " . $limit;
     $sql_count = "select count(distinct(d.id)) from " . DB_PREFIX . "deal as d left join " . DB_PREFIX . "deal_support_log as dsl on d.id = dsl.deal_id " . " where {$condition} and dsl.user_id = " . $home_user_info['id'];
     //得到当前页面项目信息
     $deal_count = $GLOBALS['db']->getOne($sql_count);
     /*(home模块)准备虚拟数据 start*/
     $deal_list = array();
     if ($deal_count > 0) {
         $now_time = get_gmtime();
         $deal_list = $GLOBALS['db']->getAll($sql);
         $deal_ids = array();
         foreach ($deal_list as $k => $v) {
             $deal_list[$k]['remain_days'] = floor(($v['end_time'] - NOW_TIME) / (24 * 3600));
             if ($v['begin_time'] > $now_time) {
                 $deal_list[$k]['left_days'] = intval(($now_time - $v['create_time']) / 24 / 3600);
             }
             $deal_ids[] = $v['id'];
         }
         //获取当前项目列表下的所有子项目
         $temp_virtual_person_list = $GLOBALS['db']->getAll("select deal_id,virtual_person,price from " . DB_PREFIX . "deal_item where deal_id in(" . implode(",", $deal_ids) . ") ");
         $virtual_person_list = array();
         //重新组装一个以项目ID为KEY的 统计所有的虚拟人数和虚拟价格
         foreach ($temp_virtual_person_list as $k => $v) {
             $virtual_person_list[$v['deal_id']]['total_virtual_person'] += $v['virtual_person'];
             $virtual_person_list[$v['deal_id']]['total_virtual_price'] += $v['price'] * $v['virtual_person'];
         }
         unset($temp_virtual_person_list);
         //将获取到的虚拟人数和虚拟价格拿到项目列表里面进行统计
         foreach ($deal_list as $k => $v) {
             if ($v['type'] == 1) {
                 $deal_list[$k]['virtual_person'] = $deal_list[$k]['invote_num'];
                 $deal_list[$k]['support_count'] = $deal_list[$k]['invote_num'];
                 $deal_list[$k]['support_amount'] = $deal_list[$k]['invote_money'];
                 $deal_list[$k]['percent'] = round($deal_list[$k]['support_amount'] / $v['limit_price'] * 100);
                 $deal_list[$k]['limit_price_w'] = round($deal_list[$k]['limit_price'] / 10000);
                 $deal_list[$k]['invote_mini_money_w'] = round($deal_list[$k]['invote_mini_money'] / 10000);
             } else {
                 $deal_list[$k]['virtual_person'] = $virtual_person_list[$v['id']]['total_virtual_person'];
                 $deal_list[$k]['percent'] = round(($v['support_amount'] + $virtual_person_list[$v['id']]['total_virtual_price']) / $v['limit_price'] * 100);
                 $deal_list[$k]['support_count'] += $deal_list[$k]['virtual_person'];
                 $deal_list[$k]['support_amount'] += $virtual_person_list[$v['id']]['total_virtual_price'];
             }
         }
     }
     /*(home模块)准备虚拟数据 end*/
     $GLOBALS['tmpl']->assign("deal_list", $deal_list);
     $GLOBALS['tmpl']->assign("deal_count", $deal_count);
     $page = new Page($deal_count, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->display("home_support.html");
 }
Beispiel #21
0
 public function invester_list($from = 'web')
 {
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     $GLOBALS['tmpl']->assign("page_title", "天使投资人列表");
     $param = array();
     //参数集合
     //数据来源参数
     $r = strim($_REQUEST['r']);
     //投资人类型
     $r = $r ? $r : 'all';
     $param['r'] = $r;
     $GLOBALS['tmpl']->assign("p_r", $r);
     $loc = strim($_REQUEST['loc']);
     //地区
     $param['loc'] = $loc;
     $GLOBALS['tmpl']->assign("p_loc", $loc);
     $city = strim($_REQUEST['city']);
     //地区
     $param['city'] = $city;
     $GLOBALS['tmpl']->assign("p_city", $city);
     if (intval($_REQUEST['redirect']) == 1) {
         $param = array();
         if ($r != "") {
             $param = array_merge($param, array("r" => $r));
         }
         if ($loc != "") {
             $param = array_merge($param, array("loc" => $loc));
         }
         if ($city != "") {
             $param = array_merge($param, array("city" => $city));
         }
     }
     $city_list = load_dynamic_cache("INDEX_CITY_LIST");
     if (!$city_list) {
         $city_list = $GLOBALS['db']->getAll("select province from " . DB_PREFIX . "user group by province order by create_time desc");
         set_dynamic_cache("INDEX_CITY_LIST", $city_list);
     }
     foreach ($city_list as $k => $v) {
         $temp_param = $param;
         unset($temp_param['city']);
         $temp_param['loc'] = $v['province'];
         if ($from == 'web') {
             $city_list[$k]['url'] = url("investor#invester_list", $temp_param);
         } elseif ($from == 'wap') {
             $city_list[$k]['url'] = url_wap("investor#invester_list", $temp_param);
         }
     }
     $GLOBALS['tmpl']->assign("city_list", $city_list);
     $next_pid = 0;
     $region_lv2 = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "region_conf where region_level = 2 order by py asc");
     //二级地址
     foreach ($region_lv2 as $k => $v) {
         $temp_param = $param;
         unset($temp_param['city']);
         $temp_param['loc'] = $v['name'];
         if ($from == 'web') {
             $region_lv2[$k]['url'] = url("investor#invester_list", $temp_param);
         } elseif ($from == 'wap') {
             $region_lv2[$k]['url'] = url_wap("investor#invester_list", $temp_param);
         }
         if ($loc == $v['name']) {
             $next_pid = $v['id'];
         }
     }
     $GLOBALS['tmpl']->assign("region_lv2", $region_lv2);
     if ($next_pid > 0) {
         $region_lv3 = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "region_conf where region_level = 3 and `pid`='" . $next_pid . "' order by py asc");
         //二级地址
         foreach ($region_lv3 as $k => $v) {
             $temp_param = $param;
             $temp_param['city'] = $v['name'];
             if ($from == 'web') {
                 $region_lv3[$k]['url'] = url("investor#invester_list", $temp_param);
             } elseif ($from == 'wap') {
                 $region_lv3[$k]['url'] = url_wap("investor#invester_list", $temp_param);
             }
         }
         $GLOBALS['tmpl']->assign("region_lv3", $region_lv3);
     }
     //	print_r($region_lv2);exit;
     $page_size = 20;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $GLOBALS['tmpl']->assign("current_page", $page);
     $condition = "is_effect = 1 ";
     if ($r != "") {
         if ($r == "all") {
             if (app_conf("AVERAGE_USER_STATUS") == 0) {
                 if ($r == "all") {
                     $condition .= " and is_investor = (1 or 2)";
                 }
             }
             $GLOBALS['tmpl']->assign("page_title", "全部");
         }
         if ($r == "ordinary_user") {
             $condition .= " and is_investor = 0 ";
             $GLOBALS['tmpl']->assign("page_title", "普通用户");
         }
         if ($r == "invester") {
             $condition .= " and is_investor = 1 ";
             $GLOBALS['tmpl']->assign("page_title", "投资人");
         }
         if ($r == "institutions_invester") {
             $condition .= " and is_investor = 2 ";
             $GLOBALS['tmpl']->assign("page_title", "机构投资人");
         }
     }
     if ($loc != "") {
         $condition .= " and (province = '" . $loc . "') ";
         $GLOBALS['tmpl']->assign("page_title", $loc);
     }
     if ($city != "") {
         $condition .= " and (province = '" . $loc . "' and city = '" . $city . "') ";
         $GLOBALS['tmpl']->assign("page_title", $city);
     }
     /*投资人列表*/
     $invester_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user where " . $condition . " order by create_time desc limit " . $limit);
     foreach ($invester_list as $k => $v) {
         $invester_list[$k]['image'] = get_user_avatar($v["id"], "middle");
         //用户头像
     }
     $invester_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user where " . $condition);
     $GLOBALS['tmpl']->assign("invester_count", $invester_count);
     require APP_ROOT_PATH . 'app/Lib/page.php';
     $page = new Page($invester_count, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("invester_list", $invester_list);
     /*投资人推荐*/
     $new_invester = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user where investor_status = 1 and is_effect = 1 and (is_investor = 1 or is_investor = 2) order by create_time desc ");
     foreach ($new_invester as $kk => $vv) {
         $new_invester[$kk]['image'] = get_user_avatar($vv["id"], "middle");
         //用户头像
     }
     $GLOBALS['tmpl']->assign("new_invester", $new_invester);
     $GLOBALS['tmpl']->display("invester_list.html");
 }
Beispiel #22
0
    $GLOBALS['tmpl']->assign("seo_keyword", app_conf("SEO_KEYWORD"));
    $GLOBALS['tmpl']->assign("seo_description", app_conf("SEO_DESCRIPTION"));
    //删除超过三天的订单
    //$GLOBALS['db']->query("delete from ".DB_PREFIX."deal_order where order_status = 0 and credit_pay = 0 and  ".NOW_TIME." - create_time > ".(24*3600*3));
    $has_deal_notify = intval($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_notify"));
    define("HAS_DEAL_NOTIFY", $has_deal_notify);
    //存在待发的项目通知
    if ($user_info) {
        $user_notify_count = intval($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_notify where user_id = " . intval($user_info['id']) . " and is_read = 0"));
        $user_message_count = intval($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_message where user_id = " . intval($user_info['id']) . " and is_read = 0"));
        $GLOBALS['tmpl']->assign("USER_NOTIFY_COUNT", $user_notify_count);
        $GLOBALS['tmpl']->assign("USER_MESSAGE_COUNT", $user_message_count);
        $GLOBALS['tmpl']->assign("HIDE_USER_NOTIFY", intval(es_cookie::get("hide_user_notify")));
    }
}
$g_links = get_link_by_id();
$GLOBALS['tmpl']->assign("g_links", $g_links);
//页脚的文章分类信息 star
$help_cates = load_auto_cache("new_hepls");
$GLOBALS['tmpl']->assign("help_cates", $help_cates);
//页脚的文章分类信息 end
//get_mortgate();
$GLOBALS['tmpl']->assign("now", NOW_TIME);
$is_tg = intval(is_tg());
$is_user_tg = is_user_tg();
$is_user_investor = is_user_investor();
if ($is_tg) {
    $GLOBALS['tmpl']->assign("tg_register_url", APP_ROOT . "/index.php?ctl=collocation&act=CreateNewAcct&user_type=0&user_id=" . $GLOBALS['user_info']['id']);
}
$GLOBALS['tmpl']->assign("is_tg", $is_tg);
$GLOBALS['tmpl']->assign("is_user_tg", $is_user_tg);
Beispiel #23
0
 public function record()
 {
     $g_links = get_link_by_id(14);
     $GLOBALS['tmpl']->assign("g_links", $g_links);
     if (!$GLOBALS['user_info']) {
         app_redirect(url("user#login"));
     }
     $GLOBALS['tmpl']->assign("page_title", "充值记录");
     $page_size = ACCOUNT_PAGE_SIZE;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     //SELECT * FROM fanwe_payment_notice n WHERE n.order_id='0' AND n.deal_id='0' AND n.deal_item_id='0' AND deal_name='';
     $record_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "payment_notice where user_id = " . intval($GLOBALS['user_info']['id']) . " and order_id=0 AND deal_id=0 AND deal_item_id=0 AND deal_name='' order by create_time desc limit " . $limit);
     $record_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "payment_notice where user_id = " . intval($GLOBALS['user_info']['id']) . " and order_id=0 AND deal_id=0 AND deal_item_id=0 AND deal_name=''");
     foreach ($record_list as $k => $v) {
         if (!$v['is_paid']) {
             $record_list[$k]['url'] = url("account#record_pay", array("notice_id" => $v['id']));
         }
     }
     $page = new Page($record_count, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     /*
     foreach($record_list as $k=>$v)
     {
     	$record_list[$k]['deal_info'] = $GLOBALS['db']->getRow("select * from ".DB_PREFIX."deal where id = ".$v['deal_id']." and is_effect = 1 and is_delete = 0");
     }
     */
     $GLOBALS['tmpl']->assign('record_list', $record_list);
     $GLOBALS['tmpl']->display("account_record.html");
 }