Пример #1
0
 public function index()
 {
     if (!$GLOBALS['user_info']) {
         app_redirect(url_wap("user#login"));
     }
     //(普通众筹)支持之前需要用户绑定手机号
     if (!$GLOBALS['user_info']['mobile']) {
         app_redirect(url_wap("user#user_bind_mobile", array("cid" => intval($_REQUEST['id']))));
     }
     $GLOBALS['tmpl']->assign("user_info", $GLOBALS['user_info']);
     $id = intval($_REQUEST['id']);
     $deal_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_item where id = " . $id);
     if (!$deal_item) {
         app_redirect(url_wap("index"));
     } elseif ($deal_item['support_count'] + $deal_item['virtual_person'] >= $deal_item['limit_user'] && $deal_item['limit_user'] != 0) {
         app_redirect(url_wap("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']);
     $deal_info = cache_deal_extra($deal_info);
     init_deal_page_wap($deal_info);
     if (!$deal_info) {
         app_redirect(url_wap("index"));
     } elseif ($deal_info['begin_time'] > NOW_TIME || $deal_info['end_time'] < NOW_TIME && $deal_info['end_time'] != 0) {
         app_redirect(url_wap("deal#show", array("id" => $deal_item['deal_id'])));
     }
     $deal_item['consigee_url'] = url_wap("settings#add_consignee", array("deal_item_id" => $id));
     //无私奉献
     if ($deal_item['type'] == 1) {
         $pay_money = floatval($_REQUEST['pay_money']);
         if ($pay_money <= 0) {
             showErr("您输入的金额错误", 0, url_wap("deal#show", array("id" => $deal_item['deal_id'])));
         }
         $deal_item['price'] = $pay_money;
         $GLOBALS['tmpl']->assign('pay_money', $pay_money);
     }
     $deal_item['price_format'] = number_price_format($deal_item['price']);
     $deal_item['delivery_fee_format'] = number_price_format($deal_item['delivery_fee']);
     $deal_item['total_price'] = $deal_item['price'] + $deal_item['delivery_fee'];
     $deal_item['total_price_format'] = number_price_format($deal_item['total_price']);
     $deal_info['percent'] = round($deal_info['support_amount'] / $deal_info['limit_price'] * 100, 2);
     $deal_info['remain_days'] = ceil(($deal_info['end_time'] - NOW_TIME) / (24 * 3600));
     $GLOBALS['tmpl']->assign("deal_item", $deal_item);
     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);
         }
     }
     $payment_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "payment where is_effect = 1 and online_pay=2  order by sort asc ");
     $GLOBALS['tmpl']->assign("payment_list", $payment_list);
     $GLOBALS['tmpl']->assign("coll", is_tg(true));
     $GLOBALS['tmpl']->assign("page_title", "提交订单");
     $GLOBALS['tmpl']->display("cart_index.html");
 }
Пример #2
0
        $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);
$GLOBALS['tmpl']->assign("is_user_investor", $is_user_investor);
$app = array();
$app['web_url'] = SITE_DOMAIN . APP_ROOT;
$web_dir = APP_ROOT_PATH . "public/images/qrcode/zc.png";
$web_dir_logo = APP_ROOT_PATH . "public/images/qrcode/zc_logo.png";
if (!is_file($web_dir) || !is_file($web_dir_logo)) {
    get_qrcode_png($app['web_url'], $web_dir, $web_dir_logo);
}
 public function mortgate_pay()
 {
     if (!$GLOBALS['user_info']) {
         app_redirect(url("user#login"));
     }
     $GLOBALS['tmpl']->assign("page_title", "充值诚意金");
     $deal_id = $_REQUEST['deal_id'];
     $GLOBALS['tmpl']->assign("deal_id", $deal_id);
     $deal_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where is_delete = 0 and is_effect = 1 and id = " . $deal_id);
     $GLOBALS['tmpl']->assign("deal_info", $deal_info);
     $new_money = user_need_mortgate();
     $has_money = $GLOBALS['db']->getOne("select sum(amount) from " . DB_PREFIX . "money_freeze where platformUserNo=" . $GLOBALS['user_info']['id'] . " and deal_id=" . $deal_id . " and status=1 ");
     //$has_money=$GLOBALS['db']->getOne("select mortgage_money from ".DB_PREFIX."user where id=".$GLOBALS['user_info']['id']);
     $money = $new_money - $has_money;
     if ($money <= 0) {
         //app_redirect(url("account#mortgate_incharge"));
         showSuccess("您的诚意金已支付,无需再支付!");
     }
     $GLOBALS['tmpl']->assign("money", $money);
     if ($money > $GLOBALS['user_info']['money']) {
         $left_money = $money - floatval($GLOBALS['user_info']['money']);
     } else {
         $left_money = 0;
     }
     $GLOBALS['tmpl']->assign("left_money", $left_money);
     $payment_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "payment where is_effect = 1 and online_pay=1 order by sort asc ");
     $payment_html = "";
     foreach ($payment_list as $k => $v) {
         $class_name = $v['class_name'] . "_payment";
         require_once APP_ROOT_PATH . "system/payment/" . $class_name . ".php";
         $o = new $class_name();
         $payment_html .= "<div>" . $o->get_display_code() . "<div class='blank'></div></div>";
     }
     $GLOBALS['tmpl']->assign("payment_html", $payment_html);
     $GLOBALS['tmpl']->assign("coll", is_tg(true));
     $GLOBALS['tmpl']->display("mortgage_incharge.html");
 }
 public function pay()
 {
     if (!$GLOBALS['user_info']) {
         app_redirect(url("user#login"));
     }
     $id = intval($_REQUEST['id']);
     $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'])));
     }
     //无私奉献
     if ($deal_item['type'] == 1) {
         $pay_money = floatval($_REQUEST['pay_money']);
         if ($pay_money <= 0) {
             showErr("您输入的金额错误", 0, url("deal#show", array("id" => $deal_item['deal_id'])));
         }
         $deal_item['price'] = $pay_money;
         $GLOBALS['tmpl']->assign('pay_money', $pay_money);
     }
     $deal_item['price_format'] = number_price_format($deal_item['price']);
     $deal_item['delivery_fee_format'] = number_price_format($deal_item['delivery_fee']);
     $deal_item['total_price'] = $deal_item['price'] + $deal_item['delivery_fee'];
     $deal_item['total_price_format'] = number_price_format($deal_item['total_price']);
     $deal_info['percent'] = round($deal_info['support_amount'] / $deal_info['limit_price'] * 100, 2);
     $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']);
     $memo = es_session::get("cart_memo_" . $id);
     $consignee_id = intval($_REQUEST['did']);
     $GLOBALS['tmpl']->assign("memo", $memo);
     $GLOBALS['tmpl']->assign("consignee_id", $consignee_id);
     $payment_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "payment where is_effect = 1 and online_pay=1  order by sort asc ");
     $payment_html = "";
     foreach ($payment_list as $k => $v) {
         $class_name = $v['class_name'] . "_payment";
         require_once APP_ROOT_PATH . "system/payment/" . $class_name . ".php";
         $o = new $class_name();
         $payment_html .= "<div>" . $o->get_display_code() . "<div class='blank'></div></div>";
     }
     $GLOBALS['tmpl']->assign("payment_html", $payment_html);
     $GLOBALS['tmpl']->assign("coll", is_tg(true));
     $GLOBALS['tmpl']->display("cart_pay.html");
 }
Пример #5
0
 public function pay_()
 {
     if (!$GLOBALS['user_info']) {
         app_redirect(url("user#login"));
     }
     $id = intval($_REQUEST['id']);
     $pay_money = floatval($_REQUEST['pay_money']);
     $deal_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where is_delete = 0 and is_effect = 1 and id = " . $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'])));
     }
     /*$buy_right_number = 0;
     		if($deal_info['type']==3||$deal_info['type']==4){//企业众筹和币创投
     			$rights = $GLOBALS['db']->getAll("select * from ".DB_PREFIX."user_right where deal_id = ".$deal_info["id"]." and user_id = ".intval($GLOBALS['user_info']['id'])."");
     			if(count($rights)>0){ 
     				foreach ($rights as $k=>$v){
     					$buy_right_number += $v["right_amount"] + $v["frozen_right_amount"];
     			}
     			}  
     		}*/
     //方劲
     /*        $coin_pay_type = $GLOBALS['db']->getAll("select * from ".DB_PREFIX."coin_item where deal_id=".$id);
             for ($i=0; $i <count($coin_pay_type) ; $i++) { 
             	$pay_type = $coin_pay_type[$i]['pay_type'];
             	$pay_name = $GLOBALS['db']->getOne("select pay_name from ".DB_PREFIX."coin_type where id=".$pay_type);
             	$coin_pay_type[$i]['pay_name'] = $pay_name;
             }
             $GLOBALS['tmpl']->assign("coin_pay_type",$coin_pay_type);*/
     $buy_right_number = get_zc_right_number($deal_info["id"], intval($GLOBALS['user_info']['id']));
     $zc_amount = $pay_money / $deal_info["price_per_right"];
     if ($deal_info["zc_amount_limit"] > 0 && $zc_amount + $buy_right_number > $deal_info["zc_amount_limit"]) {
         showErr("对不起,您众筹数字权益份额已经超过上限!", 0, url("deal#show", array("id" => $deal_info["id"])));
     }
     $zc_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_order where deal_id = " . $deal_info["id"] . " and user_id = " . $GLOBALS['user_info']['id']);
     if ($deal_info["zc_count_limit"] != 0 and $zc_count >= $deal_info["zc_count_limit"]) {
         showErr("对不起,您参与次数超过上限,已经无法继续参与本项目!", 0, url("deal#show", array("id" => $deal_info["id"])));
     }
     $deal_info['percent'] = round($deal_info['support_amount'] / $deal_info['limit_price'] * 100, 2);
     $deal_info['remain_days'] = ceil(($deal_info['end_time'] - NOW_TIME) / (24 * 3600));
     //用券支付
     $ticket_id = intval($_REQUEST['ticket_id']);
     $ticket = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "ticket where id=" . $ticket_id);
     if (count($ticket) > 0) {
         $ticket_type = $ticket['ticket_type'];
         //无条件支付
         if ($ticket_type == 0) {
             $less_money = $ticket['money'];
             $pay_money = $pay_money - $less_money;
         } elseif ($ticket_type == 1) {
             if ($pay_money > $ticket['value']) {
                 $less_money = $ticket['money'];
             } else {
                 $less_money = 0;
             }
             $pay_money = $pay_money - $less_money;
         }
     }
     $pay_money = $pay_money > 0 ? $pay_money : 0;
     $GLOBALS['tmpl']->assign("pay_money", $pay_money);
     $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']);
     $payment_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "payment where is_effect = 1 and online_pay=1  order by sort asc ");
     $payment_html = "";
     foreach ($payment_list as $k => $v) {
         $class_name = $v['class_name'] . "_payment";
         require_once APP_ROOT_PATH . "system/payment/" . $class_name . ".php";
         $o = new $class_name();
         $payment_html .= "<div>" . $o->get_display_code() . "<div class='blank'></div></div>";
     }
     $GLOBALS['tmpl']->assign("payment_html", $payment_html);
     $GLOBALS['tmpl']->assign("coll", is_tg(true));
     $GLOBALS['tmpl']->display("cart_pay_.html");
 }
Пример #6
0
 public function mortgate_pay()
 {
     if (!$GLOBALS['user_info']) {
         app_redirect(url_wap("user#login"));
     }
     $GLOBALS['tmpl']->assign("page_title", "缴纳诚意金");
     $deal_id = $_REQUEST['deal_id'];
     $GLOBALS['tmpl']->assign("deal_id", $deal_id);
     $deal_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where is_delete = 0 and is_effect = 1 and id = " . $deal_id);
     $GLOBALS['tmpl']->assign("deal_info", $deal_info);
     $new_money = user_need_mortgate();
     $has_money = $GLOBALS['db']->getOne("select sum(amount) from " . DB_PREFIX . "money_freeze where platformUserNo=" . $GLOBALS['user_info']['id'] . " and deal_id=" . $deal_id . " and status=1 ");
     $money = $new_money - $has_money;
     if ($money <= 0) {
         //app_redirect(url_wap("account#mortgate_incharge"));
         showSuccess("您的诚意金已支付,无需再支付!");
     }
     $GLOBALS['tmpl']->assign("money", $money);
     if ($money > $GLOBALS['user_info']['money']) {
         $left_money = $money - floatval($GLOBALS['user_info']['money']);
     } else {
         $left_money = 0;
     }
     $GLOBALS['tmpl']->assign("left_money", $left_money);
     $payment_list = get_payment_list("wap");
     $GLOBALS['tmpl']->assign("payment_list", $payment_list);
     $GLOBALS['tmpl']->assign("coll", is_tg(true));
     $GLOBALS['tmpl']->display("account_mortgate_pay.html");
 }