public function index()
 {
     require_once APP_ROOT_PATH . "system/libs/user.php";
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     $pwd = strim($GLOBALS['request']['pwd']);
     $result = do_login_user($email, $pwd);
     $GLOBALS['user_info'] = $user_data = es_session::get('user_info');
     $user_data['id'] = intval($user_data['id']);
     $page = intval($GLOBALS['request']['page']);
     if ($page == 0) {
         $page = 1;
     }
     $home_uid = intval($GLOBALS['request']['uid']);
     $home_user_info_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $home_uid . " and is_effect = 1 and is_delete = 0");
     if (!$home_user_info_data) {
         $root['info'] = "非法的会员";
         output($root);
     }
     $user_info['uid'] = $user_data['id'];
     $user_info['email'] = $user_data['email'];
     $user_info['user_name'] = $user_data['user_name'];
     $user_info['user_avatar'] = get_abs_img_root(get_muser_avatar($user_data['id'], "big"));
     $root['user'] = $user_info;
     $home_user_info['uid'] = $home_user_info_data['id'];
     $home_user_info['email'] = $home_user_info_data['email'];
     $home_user_info['user_name'] = $home_user_info_data['user_name'];
     $home_user_info['user_avatar'] = get_abs_img_root(get_muser_avatar($home_user_info_data['id'], "big"));
     $home_user_info['fans'] = $home_user_info_data['focused_count'];
     $home_user_info['follows'] = $home_user_info_data['focus_count'];
     $home_user_info['photos'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic_image where user_id = " . $home_user_info_data['id']);
     $home_user_info['favs'] = $GLOBALS['db']->getOne("select sum(fav_count) from " . DB_PREFIX . "topic where user_id = " . $home_user_info_data['id']);
     $root['home_user'] = $home_user_info;
     $limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
     $follow_list = $GLOBALS['db']->getAll("select focused_user_id as id,focused_user_name as user_name from " . DB_PREFIX . "user_focus where focus_user_id = " . $home_user_info_data['id'] . " order by id desc limit " . $limit);
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_focus where focus_user_id = " . $home_user_info_data['id']);
     $follows = array();
     foreach ($follow_list as $k => $v) {
         $follows[$k]['uid'] = $v['id'];
         $follows[$k]['user_name'] = $v['user_name'];
         $follows[$k]['fans'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_focus where focused_user_id = " . $v['id']);
         $follows[$k]['user_avatar'] = get_abs_img_root(get_muser_avatar($v['id'], "big"));
         if ($v['id'] == $user_data['id']) {
             $follows[$k]['is_follow'] = -1;
         } else {
             $focus_uid = intval($v['id']);
             $focus_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_focus where focus_user_id = " . $user_info['uid'] . " and focused_user_id = " . $focus_uid);
             if ($focus_data) {
                 $follows[$k]['is_follow'] = 1;
             } else {
                 $follows[$k]['is_follow'] = 0;
             }
         }
     }
     $root['page'] = array("page" => $page, "page_total" => ceil($total / PAGE_SIZE));
     $root['item'] = $follows;
     $root['return'] = 1;
     $root['status'] = 1;
     output($root);
 }
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $dltid = intval($GLOBALS['request']['dltid']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $GLOBALS['db']->query("UPDATE " . DB_PREFIX . "deal_load_transfer SET status=0,callback_count = callback_count+1 where id=" . $dltid . " AND t_user_id=0 and user_id = " . $user_id);
         if ($GLOBALS['db']->affected_rows()) {
             $root['response_code'] = 1;
             $root['show_err'] = "撤销操作成功";
         } else {
             $root['response_code'] = 0;
             $root['show_err'] = "撤销操作失败";
         }
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
 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);
 }
 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);
 }
 public function index()
 {
     if (strim($_REQUEST['order_sn']) != '') {
         $condition['order_id'] = M("DealOrder")->where("order_sn='" . strim($_REQUEST['order_sn']) . "'")->getField("id");
     }
     if (strim($_REQUEST['notice_sn']) != '') {
         $condition['notice_sn'] = $_REQUEST['notice_sn'];
     }
     if (strim($_REQUEST['user_name']) != '') {
         $condition['user_id'] = M("User")->where("user_name='" . strim($_REQUEST['user_name']) . "'")->getField("id");
     }
     if (strim($_REQUEST['begin_time']) != '') {
         $start_time = strtotime($_REQUEST['begin_time'] . ' 00:00:00');
         $end_time = strtotime($_REQUEST['begin_time'] . ' 23:59:59');
         $condition['s_create_time'] = $start_time;
         //开始时间
         $condition['e_create_time'] = $end_time;
         //结束时间
     }
     $condition['is_payment_list'] = 1;
     if (intval($_REQUEST['payment_id']) == 0) {
         unset($_REQUEST['payment_id']);
     }
     $this->assign("default_map", $condition);
     $this->assign("payment_list", M("Payment")->findAll());
     parent::index();
 }
 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']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $root['page_title'] = "发起项目";
         $region_lv2 = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "region_conf where region_level = 2 order by py asc");
         //二级地址
         $root['region_lv2'] = $region_lv2;
         $cate_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_cate order by sort asc");
         $root['cate_list'] = $cate_list;
         $deal_image = es_session::get("deal_image");
         $root['deal_image'] = $deal_image;
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['biz_email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['biz_pwd']);
     //密码
     //检查用户,用户密码
     $biz_user = biz_check($email, $pwd);
     $supplier_id = intval($biz_user['supplier_id']);
     $deal_id = intval($GLOBALS['request']['deal_id']);
     //团购商品id
     if ($supplier_id > 0) {
         $root['user_login_status'] = 1;
         //用户登陆状态:1:成功登陆;0:未成功登陆
         $sql = "update " . DB_PREFIX . "message set is_read = 1 where is_read = 0 and rel_id = " . $deal_id . " and rel_table = 'deal' and pid = 0 and is_buy = 1";
         //$root['sql'] = $sql;
         $GLOBALS['db']->query($sql);
         $root['return'] = 1;
     } else {
         $root['return'] = 0;
         $root['user_login_status'] = 0;
         //用户登陆状态:1:成功登陆;0:未成功登陆
         $root['info'] = "商户不存在或密码错误";
     }
     output($root);
 }
 public function save_info()
 {
     $data = array();
     $ajax = intval($_REQUEST['ajax']);
     $data['user_name'] = strim($_REQUEST['user_name']);
     if (empty($data['user_name'])) {
         showErr("请填写您的姓名", $ajax);
     }
     $data['tel'] = strim($_REQUEST['tel']);
     if (empty($data['tel'])) {
         showErr("请填写您的联系方式", $ajax);
     }
     $data['content'] = strim($_REQUEST['content']);
     if (empty($data['content'])) {
         showErr("请填写您的留言内容", $ajax);
     }
     $data['cate_id'] = intval($_REQUEST['cate_id']);
     $data['create_time'] = NOW_TIME;
     $data['user_id'] = intval($_REQUEST['user_id']);
     $GLOBALS['db']->autoExecute(DB_PREFIX . "message", $data, "INSERT", "", "SILENT");
     $message_id = $GLOBALS['db']->insert_id();
     if ($message_id > 0) {
         showSuccess("申请成功!", $ajax, url_wap("index"));
     } else {
         showErr("发送失败,请重新申请!", $ajax);
     }
 }
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $id = intval($GLOBALS['request']['id']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         $root['is_faved'] = $GLOBALS['db']->getOne("SELECT count(*) FROM " . DB_PREFIX . "deal_collect WHERE deal_id = " . $id . " AND user_id=" . $user_id);
         $root['user_money'] = $user['money'];
         $root['user_money_format'] = format_price($user['money']);
         //用户金额
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
 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");
 }
 public function show()
 {
     //获得文章列表
     $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');
     $act = strim($_REQUEST['act']);
     $help_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "help where type = '" . $act . "' or id = " . intval($act));
     $GLOBALS['tmpl']->assign("help_item", $help_item);
     $GLOBALS['tmpl']->assign("page_title", $help_item['title']);
     $GLOBALS['tmpl']->display("help_show.html");
 }
Beispiel #12
0
 public function update()
 {
     B('FilterString');
     $data = M(MODULE_NAME)->create();
     $user_names = preg_split("/[ ,]/i", $data['user_names']);
     $user_ids = array();
     foreach ($user_names as $k => $v) {
         $uid = M("User")->where("user_name = '" . $v . "'")->getField("id");
         if ($uid) {
             $user_ids[] = str_pad($uid, 6, 0, STR_PAD_LEFT);
         }
     }
     $data['user_ids'] = implode(",", $user_ids);
     $data['end_time'] = strim($data['end_time']) == '' ? 0 : to_timespan($data['end_time']);
     $log_info = M(MODULE_NAME)->where("id=" . intval($data['id']))->getField("title");
     //开始验证有效性
     $this->assign("jumpUrl", u(MODULE_NAME . "/edit", array("id" => $data['id'])));
     if (!check_empty($data['content'])) {
         $this->error(L("MSY_CONTENT_EMPTY_TIP"));
     }
     // 更新数据
     $list = M(MODULE_NAME)->save($data);
     if (false !== $list) {
         //成功提示
         save_log($log_info . L("UPDATE_SUCCESS"), 1);
         $this->success(L("UPDATE_SUCCESS"));
     } else {
         //错误提示
         save_log($log_info . L("UPDATE_FAILED"), 0);
         $this->error(L("UPDATE_FAILED"), 0, $log_info . L("UPDATE_FAILED"));
     }
 }
Beispiel #13
0
 public function index()
 {
     $page = intval($GLOBALS['request']['page']);
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     if ($page == 0) {
         $page = 1;
     }
     $page_size = PAGE_SIZE;
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $event_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_event order by sort desc limit " . $limit);
     $count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_event");
     foreach ($event_list as $k => $v) {
         $now = get_gmtime();
         $event_list[$k]['end_time'] = $v['event_end_time'];
         $event_list[$k]['url'] = url("shop", "deal_event#show", array("id" => $v['id']));
         $event_list[$k]['event_end_time'] = to_date($v['event_end_time'], 'Y-m-d');
         $event_list[$k]['icon'] = get_abs_img_root(make_img($v['icon'], 592, 215, 1));
         $event_list[$k]['sheng_time_format'] = to_date($v['event_end_time'] - $now, "d天h小时i分");
     }
     $page_total = ceil($count / $page_size);
     $root = array();
     $root['return'] = 1;
     $root['item'] = $event_list;
     $root['page'] = array("page" => $page, "page_total" => $page_total, "page_size" => $page_size);
     $root['page_title'] = "活动专题";
     $root['city_name'] = $city_name;
     output($root);
 }
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $id = intval($GLOBALS['request']['id']);
     //检查用户,用户密码
     $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;
         $result = getUCInrepayRepayBorrowMoney($id);
         $root['status'] = $result['status'];
         if ($result['status'] == 2) {
             $root['response_code'] = 1;
             $root['app_url'] = $result['jump'];
         } else {
             $root['response_code'] = $result['status'];
             $root['show_err'] = $result['show_err'];
         }
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
Beispiel #15
0
 public function index()
 {
     $root = array();
     $root['return'] = 1;
     $page = intval($GLOBALS['request']['page']);
     //分页
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     $page = $page == 0 ? 1 : $page;
     $page_size = PAGE_SIZE;
     $limit = ($page - 1) * $page_size . "," . $page_size;
     //检查用户,用户密码
     $user = $GLOBALS['user_info'];
     $user_id = intval($user['id']);
     $url = get_domain() . APP_ROOT;
     $share_url = str_replace("sjmapi", "wap", $url);
     if ($user_id) {
         $share_url .= "?r=" . base64_encode(intval($user_id));
     }
     $root['share_url'] = $share_url;
     $root['city_name'] = $city_name;
     $root['page_title'] = "邀请链接";
     //fwb 2014-08-27
     output($root);
 }
 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']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         if (intval($user['idcardpassed']) == 0) {
             $root['response_code'] = 0;
             $root['show_err'] = "您的实名信息尚未认证,为保护您的账户安全,请先完成实名认证。";
         } else {
             $root['response_code'] = 1;
             $root['real_name'] = $user['real_name'];
             $bank_list = $GLOBALS['db']->getAll("SELECT * FROM " . DB_PREFIX . "bank ORDER BY is_rec DESC,sort DESC,id ASC");
             $root['item'] = $bank_list;
         }
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $id = strim($GLOBALS['request']['id']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $GLOBALS['db']->query("DELETE FROM " . DB_PREFIX . "user_bank where user_id=" . intval($GLOBALS['user_info']['id']) . " and id in (" . $id . ")");
         if ($GLOBALS['db']->affected_rows()) {
             $root['response_code'] = 1;
             $root['show_err'] = $GLOBALS['lang']['DELETE_SUCCESS'];
         } else {
             $root['response_code'] = 0;
             $root['show_err'] = "删除失败";
         }
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
Beispiel #18
0
 public function index()
 {
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     $root = array();
     $user_data = $GLOBALS['user_info'];
     //logUtils::log_obj($user_data);
     $user_id = intval($user_data['id']);
     if ($user_id == 0) {
         $root['user_login_status'] = 0;
         $root['info'] = "请先登陆";
         $root['page_title'] = "登陆";
     } else {
         $root['user_login_status'] = 1;
         $root['info'] = "用户中心";
         $root['page_title'] = "用户中心";
         $root['uid'] = $user_data['id'];
         $root['user_name'] = $user_data['user_name'];
         $root['user_email'] = $user_data['email'];
         $root['user_money'] = $user_data['money'];
         $root['user_money_format'] = format_price($user_data['money']);
         //用户金额
         $root['user_avatar'] = get_abs_img_root(get_muser_avatar($user_data['id'], "big"));
     }
     $root['mana_page_title'] = '经理中心';
     $root['user'] = $user_data;
     $root['city_name'] = $city_name;
     output($root);
 }
Beispiel #19
0
 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);
 }
 public function save()
 {
     $data = $_POST;
     foreach ($data as $k => $v) {
         if ($k == "description") {
             $data[$k] = replace_public(btrim($v));
         } else {
             $data[$k] = strim($v);
         }
     }
     $data['user_id'] = intval($GLOBALS['user_info']['id']);
     $mode = "INSERT";
     $where = "";
     if ($GLOBALS['db']->getOne("SELECT count(*) FROM " . DB_PREFIX . "user_company WHERE user_id=" . intval($GLOBALS['user_info']['id'])) > 0) {
         $mode = "UPDATE";
         $where = "user_id=" . intval($GLOBALS['user_info']['id']);
     }
     $GLOBALS['db']->autoExecute(DB_PREFIX . "user_company", $data, $mode, $where);
     if ($GLOBALS['db']->affected_rows() > 0) {
         $user_info_re = array();
         $user_info_re['enterpriseName'] = $data['enterpriseName'];
         $user_info_re['bankLicense'] = $data['bankLicense'];
         $user_info_re['orgNo'] = $data['orgNo'];
         $user_info_re['businessLicense'] = $data['businessLicense'];
         $user_info_re['taxNo'] = $data['enterpriseName'];
         $GLOBALS['db']->autoExecute(DB_PREFIX . "user", $user_info_re, "UPDATE", "id=" . intval($GLOBALS['user_info']['id']));
     }
     app_redirect(url("index", "uc_company#index"));
 }
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     //检查用户,用户密码
     $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;
         $paypassword = strim($GLOBALS['request']['paypassword']);
         $amount = floatval($GLOBALS['request']['amount']);
         $bid = intval($GLOBALS['request']['bid']);
         $result = getUcSaveCarry($amount, $paypassword, $bid);
         $root['response_code'] = $result['status'];
         $root['show_err'] = $result['show_err'];
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
Beispiel #22
0
 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);
 }
 public function update()
 {
     //$data = M(MODULE_NAME)->create ();
     $data = array();
     $data['id'] = intval($_REQUEST['id']);
     $data['name'] = strim($_REQUEST['name']);
     //$data['content'] = $_REQUEST['content'];
     $data['content'] = stripslashes($_REQUEST['content']);
     $data['is_html'] = intval($_REQUEST['is_html']);
     $return = array('info' => '', 'status' => '0');
     if ($data['name'] == '' || $data['id'] == 0) {
         $info = l("SELECT_MSG_TPL");
         header("Content-Type:text/html; charset=utf-8");
         echo $info;
     }
     $log_info = $data['name'];
     // 更新数据
     $list = M(MODULE_NAME)->save($data);
     if (false !== $list) {
         //成功提示
         save_log($log_info . L("UPDATE_SUCCESS"), 1);
         $info = '"' . L("LANG_" . $data['name']) . '"模板' . L("UPDATE_SUCCESS");
         $return['status'] = 1;
         header("Content-Type:text/html; charset=utf-8");
         echo $info;
     } else {
         //错误提示
         save_log($log_info . L("UPDATE_FAILED"), 0);
         $info = L("LANG_" . $data['name']) . "模板" . L("UPDATE_FAILED");
         $return['status'] = 0;
         header("Content-Type:text/html; charset=utf-8");
         echo $info;
     }
 }
 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']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $order_id = intval($_REQUEST['id']);
         $order_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_order where order_status = 0 and user_id = " . intval($GLOBALS['user_info']['id']) . " and id = " . $order_id);
         if (!$order_info) {
             $root['info'] = '无效的订单';
         } else {
             $money = $order_info['credit_pay'];
             $GLOBALS['db']->query("delete from " . DB_PREFIX . "deal_order where id = " . $order_id . " and user_id = " . intval($GLOBALS['user_info']['id']) . " and order_status = 0");
             if ($GLOBALS['db']->affected_rows() > 0) {
                 if ($money > 0) {
                     require_once APP_ROOT_PATH . "system/libs/user.php";
                     modify_account(array("money" => $money), intval($GLOBALS['user_info']['id']), "删除" . $order_info['deal_name'] . "项目支付,退回支付款。");
                 }
             }
             $root['response_code'] = 1;
             $root['info'] = '删除成功';
         }
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $id = intval($GLOBALS['request']['id']);
     //检查用户,用户密码
     $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;
         $result = getUcToTransfer($id);
         $root['transfer'] = $result['transfer'];
         $root['response_code'] = $result['status'];
         $root['show_err'] = $result['show_err'];
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     $root['program_title'] = "转让详情";
     output($root);
 }
Beispiel #26
0
 public function update_debit()
 {
     $borrow_amount_cfg = array();
     foreach ($_REQUEST["borrow_amount_cfg"] as $k => $v) {
         if ($v != "") {
             $borrow_amount_cfg[] = htmlspecialchars(addslashes(trim($v)));
         }
     }
     $data = array();
     $data["borrow_amount_cfg"] = serialize($borrow_amount_cfg);
     $data["loantype"] = intval($_REQUEST["loantype"]);
     $data["services_fee"] = floatval($_REQUEST["services_fee"]);
     $data["manage_fee"] = floatval($_REQUEST["manage_fee"]);
     $data["manage_impose_fee_day1"] = strim($_REQUEST["manage_impose_fee_day1"]);
     $data["manage_impose_fee_day2"] = strim($_REQUEST["manage_impose_fee_day2"]);
     $data["impose_fee_day1"] = strim($_REQUEST["impose_fee_day1"]);
     $data["impose_fee_day2"] = strim($_REQUEST["impose_fee_day2"]);
     $data["rate_cfg"] = intval($_REQUEST["rate_cfg"]);
     $data["enddate"] = intval($_REQUEST["enddate"]);
     $data["first_relief"] = floatval($_REQUEST["first_relief"]);
     $count = $GLOBALS["db"]->getOne("select count(*) from " . DB_PREFIX . "debit_conf");
     if ($count == 0) {
         $GLOBALS['db']->autoExecute(DB_PREFIX . "debit_conf", $data);
     } else {
         $GLOBALS['db']->autoExecute(DB_PREFIX . "debit_conf", $data, "UPDATE", " 1=1 ");
     }
     save_log(l("DEBIT_UPDATED"), 1);
     $this->success(L("UPDATE_SUCCESS"));
 }
 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);
 }
Beispiel #28
0
 public function index()
 {
     require_once APP_ROOT_PATH . "system/libs/user.php";
     $mobile = trim($GLOBALS['request']['mobile']);
     $pwd = strim($GLOBALS['request']['password']);
     if ($mobile == '') {
         $root['status'] = 0;
         $root['info'] = '手机号码不能为空';
         output($root);
     }
     if (!check_mobile($mobile)) {
         $root['status'] = 0;
         $root['info'] = "请输入正确的手机号码";
         output($root);
     }
     if (strlen($pwd) < 4) {
         $root['status'] = 0;
         $root['info'] = "密码不能低于四位";
         output($root);
     }
     $db_code = $GLOBALS['db']->getRow("select id from " . DB_PREFIX . "sms_mobile_verify where status=1 and mobile_phone = '{$mobile}' and type=0 order by id desc");
     if (!$db_code) {
         $root['status'] = 0;
         $root['info'] = "手机号码未通过验证";
         output($root);
     }
     $root = mobile_reg($mobile, $pwd);
     output($root);
 }
 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);
 }
 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']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         //$root['show_err'] = get_domain();
         //输出支付方式
         $payment_list = $GLOBALS['db']->getAll("select id,class_name,name,description,logo,total_amount,config from " . DB_PREFIX . "payment order by sort desc");
         foreach ($payment_list as $k => $v) {
             $payment_list[$k]['logo'] = get_domain() . $v['logo'];
         }
         $root['payment_list'] = $payment_list;
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }