Ejemplo n.º 1
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);
 }
Ejemplo n.º 2
0
 public function incharge_log()
 {
     $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_MONEY_INCHARGE_LOG']);
     //输出充值订单
     $page = intval($_REQUEST['p']);
     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']);
     $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("inc_file", "inc/uc/uc_money_incharge_log.html");
     $GLOBALS['tmpl']->display("page/uc.html");
 }
Ejemplo n.º 3
0
 public function incharge()
 {
     echo "404";
     exit;
     $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_MONEY_INCHARGE']);
     //输出支付方式
     $payment_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "payment where is_effect = 1 and class_name <> 'Account' and class_name <> 'Voucher' and class_name <> 'tenpayc2c' and online_pay = 1 order by sort desc");
     foreach ($payment_list as $k => $v) {
         if ($v['class_name'] == 'Alipay') {
             $cfg = unserialize($v['config']);
             if ($cfg['alipay_service'] != 2) {
                 unset($payment_list[$k]);
                 continue;
             }
         }
         $directory = APP_ROOT_PATH . "system/payment/";
         $file = $directory . '/' . $v['class_name'] . "_payment.php";
         if (file_exists($file)) {
             require_once $file;
             $payment_class = $v['class_name'] . "_payment";
             $payment_object = new $payment_class();
             $payment_list[$k]['display_code'] = $payment_object->get_display_code();
         } else {
             unset($payment_list[$k]);
         }
     }
     $GLOBALS['tmpl']->assign("payment_list", $payment_list);
     //输出充值订单
     $page = intval($_REQUEST['p']);
     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']);
     $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("inc_file", "inc/uc/uc_money_incharge.html");
     $GLOBALS['tmpl']->display("uc.html");
 }
Ejemplo n.º 4
0
 /**
  * 充值
  */
 public function incharge()
 {
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     init_app_page();
     $user_info = $GLOBALS['user_info'];
     //取出等级信息
     $level_data = load_auto_cache("cache_user_level");
     $cur_level = $level_data[$user_info['level_id']];
     //游标移动获取下一个等级
     reset($level_data);
     do {
         $current_data = current($level_data);
         if ($current_data['id'] == $cur_level['id']) {
             $next_data = next($level_data);
             break;
         }
     } while (next($level_data));
     $uc_query_data = array();
     $uc_query_data['cur_level'] = $cur_level['level'];
     //当前等级
     $uc_query_data['cur_point'] = $user_info['point'];
     $uc_query_data['cur_level_name'] = $cur_level['name'];
     if ($next_data) {
         $uc_query_data['next_level'] = $next_data['id'];
         $uc_query_data['next_point'] = $next_data['point'] - $user_info['point'];
         //我再增加:100 经验值,就可以升级为:青铜五
         $uc_query_data['next_level_name'] = $next_data['name'];
     }
     $uc_query_data['cur_score'] = $user_info['score'];
     $cur_group = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_group where id=" . $user_info['group_id']);
     $uc_query_data['cur_gourp'] = $cur_group['id'];
     $uc_query_data['cur_gourp_name'] = $cur_group['name'];
     $uc_query_data['cur_discount'] = doubleval(sprintf('%.2f', $cur_group['discount'] * 10));
     $GLOBALS['tmpl']->assign("uc_query_data", $uc_query_data);
     //输出支付方式
     $payment_list = load_auto_cache("cache_payment");
     $icon_paylist = array();
     //用图标展示的支付方式
     //$disp_paylist = array(); //特殊的支付方式(Voucher,Account,Otherpay)
     $bank_paylist = array();
     //网银直连
     foreach ($payment_list as $k => $v) {
         if ($v['class_name'] == "Voucher" || $v['class_name'] == "Account" || $v['class_name'] == "Otherpay" || $v['class_name'] == "tenpayc2c") {
             //$disp_paylist[] = $v;
         } else {
             if ($v['class_name'] == "Alipay") {
                 $cfg = unserialize($v['config']);
                 if ($cfg['alipay_service'] == 2) {
                     if ($v['is_bank'] == 1) {
                         $bank_paylist[] = $v;
                     } else {
                         $icon_paylist[] = $v;
                     }
                 }
             } else {
                 if ($v['is_bank'] == 1) {
                     $bank_paylist[] = $v;
                 } else {
                     $icon_paylist[] = $v;
                 }
             }
         }
     }
     $GLOBALS['tmpl']->assign("icon_paylist", $icon_paylist);
     //$GLOBALS['tmpl']->assign("disp_paylist",$disp_paylist);
     $GLOBALS['tmpl']->assign("bank_paylist", $bank_paylist);
     require_once APP_ROOT_PATH . "system/model/user_center.php";
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     //输出充值订单
     $page = intval($_REQUEST['p']);
     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']);
     $GLOBALS['tmpl']->assign("list", $result['list']);
     $page = new Page($result['count'], app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     //通用模版参数定义
     assign_uc_nav_list();
     //左侧导航菜单
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $GLOBALS['tmpl']->assign("page_title", "会员充值");
     //title
     $GLOBALS['tmpl']->display("uc/uc_money_incharge.html");
     //title
 }