Example #1
0
 public function handle_request_internel()
 {
     $params = $this->request->get_parameters();
     $page = isset($params['page']) ? (int) $params['page'] : 1;
     $kw = strip_tags($params['kw']);
     //分页的链接
     $prev = $page === 1 ? 1 : $page - 1;
     $next = $page + 1;
     $prev_uri = '/user/asksetting/?kw=' . $kw . '&page=' . $prev;
     $next_uri = '/user/asksetting/?kw=' . $kw . '&page=' . $next;
     $prev_url = PageHelper::gen_url($prev_uri);
     $next_url = PageHelper::gen_url($next_uri);
     //构造查询参数
     $offset = ($page - 1) * self::PAGE_SIZE;
     $city_setting = $this->get_config('cities', 'multicity');
     $city_id = 0;
     if (is_array($city_setting) and !empty($city_setting)) {
         $city_id = array_search($kw, $city_setting);
     }
     $list = Bll_AskSetting::get_ask_list($city_id, $offset, self::PAGE_SIZE);
     $list_data = array();
     if ($list && is_array($list)) {
         foreach ($list as $k => $v) {
             $v['edit_url'] = '/user/asksetting/edit?id=' . $v['id'];
             $v['del_url'] = '/user/asksetting/del?id=' . $v['id'];
             $list_data[$k] = $v;
         }
     }
     $this->request->set_attribute('kw', $kw);
     $this->request->set_attribute('list_data', $list_data);
     $this->request->set_attribute('prev_url', $prev_url);
     $this->request->set_attribute('next_url', $next_url);
     return 'Asksetting_List';
 }
Example #2
0
 public function handle_request_internel()
 {
     apf_require_class('Bll_App_Appparams');
     $params = $this->request->get_parameters();
     $page = isset($params['page']) ? (int) $params['page'] : 1;
     $page_size = 20;
     $offset = ($page - 1) * $page_size;
     $where = '';
     $kw = strip_tags($params['kw']);
     if ($kw) {
         $where = "cache_k like '%" . $kw . "%'";
     }
     $order = 'display_order asc,id desc';
     //分页的链接
     $prev = $page === 1 ? 1 : $page - 1;
     $next = $page + 1;
     $prev_uri = '/user/appsetting/?kw=' . $kw . '&page=' . $prev;
     $next_uri = '/user/appsetting/?kw=' . $kw . '&page=' . $next;
     $prev_url = PageHelper::gen_url($prev_uri);
     $next_url = PageHelper::gen_url($next_uri);
     $list = Bll_App_Appparams::get_instance()->fetchAll('*', $where, $order, $offset, $page_size);
     if ($list && is_array($list)) {
         $app_type = $this->get_config('app', 'app');
         foreach ($list as $k => $v) {
             $list[$k]['app_type'] = $app_type[$v['app']];
             $list[$k]['update_time'] = date('Y-m-d H:i:s', $v['updated']);
             $list[$k]['edit_url'] = '/user/appsetting/edit?id=' . $v['id'];
         }
     }
     $this->request->set_attribute('kw', $kw);
     $this->request->set_attribute('list_data', $list);
     $this->request->set_attribute('prev_url', $prev_url);
     $this->request->set_attribute('next_url', $next_url);
     return 'Appsetting_List';
 }
Example #3
0
 public static function communitySignTopSigner($communityId, $currentSignRange, $per = 3)
 {
     $signs = Model_Broker_CommunitySign::data_access(date('Ym', strtotime($currentSignRange[0])))->filter('communityId', $communityId)->filter_by_op_multi(array(array('signTime', '>=', $currentSignRange[0]), array('signTime', '<=', $currentSignRange[1])))->sort('signTime', 'asc')->limit(3)->find_all();
     $signers = array();
     if ($signs) {
         $brokerIds = array();
         foreach ($signs as $sign) {
             $brokerIds[] = $sign['brokerId'];
         }
         $brokers = Model_Broker_AjkBrokerExtend::data_access()->filter('brokerId', $brokerIds)->find_all();
         $indexedBrokers = array();
         foreach ($brokers as $broker) {
             $indexedBrokers[$broker['brokerId']] = $broker;
         }
         foreach ($signs as $sign) {
             if (!isset($indexedBrokers[$sign['brokerId']])) {
                 continue;
             }
             $broker = $indexedBrokers[$sign['brokerId']];
             $signer = array();
             $signer['brokerId'] = $broker['brokerId'];
             $signer['brokerTrueName'] = $broker['trueName'];
             // 图片地址替换
             if ($broker['userPhoto']) {
                 $signer['brokerPhoto'] = Util_DisplayImages::get_img_url($broker['userPhoto'], -1, '100x133');
             } else {
                 $signer['brokerPhoto'] = PageHelper::pure_static_url('/img/bknoimg.gif');
                 // 默认头像
             }
             $signers[] = $signer;
         }
     }
     return $signers;
 }
Example #4
0
 private function _login()
 {
     $oauth_url = APF::get_instance()->get_config('oauth_url');
     $oauth_cid = APF::get_instance()->get_config('oauth_cid');
     $oauth_secret = APF::get_instance()->get_config('oauth_secret');
     if (isset($_REQUEST['code']) && $_REQUEST['code']) {
         $data = array("client_id" => $oauth_cid, "client_secret" => $oauth_secret, "grant_type" => 'authorization_code', "code" => $_REQUEST['code']);
         header("HTTP/1.1 302 Found");
         header("Location: " . $oauth_url . '/token.php?' . http_build_query($data));
         exit;
     }
     if (isset($_REQUEST['access_token']) && $_REQUEST['access_token']) {
         $access_token = $_REQUEST['access_token'];
         $data = array("oauth_token" => $access_token);
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_URL, $oauth_url . "/resource.php");
         curl_setopt($ch, CURLOPT_POST, TRUE);
         curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
         $info = curl_exec($ch);
         if ($info) {
             $info = json_decode($info);
             $access_token = $info->access_token;
             $d = $detail = json_decode($this->_get_info_from_ldap($access_token, $oauth_url));
             $user_id = Biz_User::get_instance()->check_user($d->chinese_name, $d->english_name, $d->email);
             setcookie(APF::get_instance()->get_config('cookie_name'), $user_id, time() + 60 * 60 * 24 * 30, '/');
             $this->_response->redirect(PageHelper::get_domain() . '/project/list');
         } else {
             exit;
         }
     }
     exit;
 }
Example #5
0
 /**
  * 获取“闪电侠”图标
  *
  * @param $isTalent
  *
  * @return array
  */
 public static function getTalentIcon($isTalent, $app)
 {
     $talentIcon = array();
     // TODO 下次更换时,保留旧文件,新文件修改文件版本号
     if (in_array($isTalent, array(1, 0))) {
         if (self::isTalentEventOngoing()) {
             switch ($app) {
                 case 'a-broker':
                     $format = '/img/mobile/app/android/icon_talent_3.4_%s.png?v=3.5';
                     break;
                 case 'i-broker2':
                 default:
                     $format = '/img/mobile/app/ios/icon_talent_3.4_%s.png?v=3.5';
                     break;
             }
             if ($isTalent) {
                 $uri = sprintf($format, 'on');
             } else {
                 $uri = sprintf($format, 'off');
             }
             $talentIcon[] = PageHelper::pure_static_url($uri);
         }
     }
     return $talentIcon;
 }
Example #6
0
 public function handle_request_internel()
 {
     $p = $this->request->get_parameters();
     $page = 1;
     if (isset($p['page'])) {
         $page = (int) $p['page'];
     }
     //分页的链接
     $prev = $page === 1 ? 1 : $page - 1;
     $next = $page + 1;
     $prev_uri = '/user/topic/?page=' . $prev;
     $next_uri = '/user/topic/?page=' . $next;
     if ($p['key']) {
         $prev_uri .= '&key=' . $p['key'];
         $next_uri .= '&key=' . $p['key'];
     }
     $prev_url = PageHelper::gen_url($prev_uri);
     $next_url = PageHelper::gen_url($next_uri);
     $topic_list = Bll_Topic::get_list($p, $page);
     foreach ($topic_list as $k => $v) {
         $topic_list[$k]['topic_update'] = date('Y-m-d H:i:s', $v['topic_update']);
         $topic_list[$k]['topic_url'] = 'http://topic.anjuke.com/cms/' . $v['topic_id'] . '.html';
         $topic_list[$k]['edit_url'] = PageHelper::gen_url('/user/topic/edit/' . $v['topic_id']);
         $topic_list[$k]['del_url'] = PageHelper::gen_url('/user/topic/del/' . $v['topic_id']);
     }
     $this->request->set_attribute('topic_list', $topic_list);
     $this->request->set_attribute('prev_url', $prev_url);
     $this->request->set_attribute('next_url', $next_url);
     return 'Topic_List';
 }
Example #7
0
 public function handle_request()
 {
     $act = $this->request->get_parameter('act');
     if ($act == 'editBroker') {
         $this->editBeautifulBroker();
         exit;
     }
     $params = $this->request->get_router_matches();
     $beautifulbroberId = $params[1];
     $statusAll = PageHelper::gen_url('/user/beautifulbroker/');
     $editUrl = PageHelper::gen_url('/user/beautifulbroker/edit/');
     if (!$beautifulbroberId) {
         APF::get_instance()->get_response()->redirect($statusAll);
         exit;
     }
     $beautiful_one = Bll_BeautifulBroker::getOneBroker($beautifulbroberId);
     if (!empty($beautiful_one)) {
         $beautiful_one['is_verify_status'] = $beautiful_one['is_verify'] == 1 ? '已审核' : '待审核';
         $brokerInfo = $this->getBrokerInfo($beautiful_one['brokerid']);
         $this->request->set_attribute('brokerInfo', $brokerInfo);
     }
     //经纪人详细信息
     $this->request->set_attribute('beautiful_one', $beautiful_one);
     $this->request->set_attribute('statusAll', $statusAll);
     $this->request->set_attribute('editUrl', $editUrl);
     return 'Beautifulbroker_Edit';
 }
Example #8
0
 public function __construct()
 {
     parent::__construct();
     global $session;
     if ($session->get("estAdmin") !== null) {
         parent::LoadAdminSessionValues();
     }
 }
 public function __construct()
 {
     parent::__construct();
     global $config;
     parent::moduleIsActivated($config["mod_player"]["delete"]["activate"]);
     global $request;
     $this->objPlayer = parent::VerifMonJoueur(\Encryption::decrypt($request->query->get("idPlayer")));
 }
Example #10
0
 public static function use_javascripts()
 {
     $apf = APF::get_instance()->get_request();
     $path = apf_classname_to_path(__CLASS__);
     $pageType = $apf->get_attribute('pageType');
     $script = array($path . 'HouseManage.js', PageHelper::pure_static_url("/js/jquery.cookie.js"));
     if ($pageType == 'ajk') {
         $script = array($path . 'HouseManageAjk.js');
     }
     return array_merge(parent::use_javascripts(), $script);
 }
 public function handle_request_internal()
 {
     /**
      * 00:00
      *  获取前一天20:00 以后
      * 10:00
      *  获取10:00 以后
      * 15:00
      *  获取15:00 以后
      * 20:00
      *  获取20:00 以后
      *
      */
     // 获取参数;
     $commId = $this->_params['commId'];
     // 根据ID获取小区
     $community = Bll_Community_APIComm::getInstance()->getInfoByIdMapping($commId, 2);
     if (!$community || !$community['sosolat'] || !$community['sosolng']) {
         throw new Exception('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
     }
     $data = array();
     if (Bll_Broker_CommunitySign::isTopSignerActivityOngoing()) {
         $hour = intval(date('H'));
         if ($hour >= 0 && $hour < 10) {
             $theSignRange = array(date('Y-m-d 20:00:00', strtotime('-1 day')), date('Y-m-d 23:59:59', strtotime('-1 day')));
         } elseif ($hour >= 10 && $hour < 15) {
             $theSignRange = array(date('Y-m-d 10:00:00'), date('Y-m-d 14:59:59'));
         } elseif ($hour >= 15 && $hour < 20) {
             $theSignRange = array(date('Y-m-d 15:00:00'), date('Y-m-d 19:59:59'));
         } else {
             $theSignRange = array(date('Y-m-d 20:00:00'), date('Y-m-d 23:59:59'));
         }
         $brokerInfos = Bll_Commsign::getFirstThr($commId, $theSignRange[0]);
         //var_dump($data);exit;
         $data = array();
         if (!empty($brokerInfos)) {
             foreach ($brokerInfos as $k => $v) {
                 $brokerTmp = Bll_Commsign::getBrokerInfo($v['brokerId']);
                 if (!$brokerTmp) {
                     $broker = Model_Broker_AjkBrokerExtend::data_access()->filter('brokerId', $v['brokerId'])->find_only();
                     $broker_photo = Util_ImageUtils::get_broker_photo_url($broker['userPhoto'], '200x200');
                     $brokerTmp = array('brokerId' => $broker['brokerId'], 'username' => $broker['trueName'], 'userPhoto' => $broker_photo, 'cityId' => $broker['cityId']);
                     Bll_Commsign::redisBrokerInfo($v['brokerId'], $brokerTmp);
                 }
                 if (empty($brokerTmp['userPhoto'])) {
                     $brokerTmp['userPhoto'] = PageHelper::pure_static_url('/img/bknoimg.gif');
                 }
                 $dataTmp = array('brokerId' => $brokerTmp['brokerId'], 'brokerTrueName' => $brokerTmp['username'], 'brokerPhoto' => $brokerTmp['userPhoto']);
                 $data[] = $dataTmp;
             }
         }
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $data);
 }
Example #12
0
 private function _save()
 {
     $pid = intval($this->_param['pid']);
     $hostname = trim($this->_param['hostname']);
     $hostname = explode("\n", $hostname);
     $biz = Biz_Host::get_instance();
     $biz->delete_host($pid);
     foreach ($hostname as $h) {
         $biz->insert_host($pid, trim($h));
     }
     $this->_response->redirect(PageHelper::get_domain() . "/project/op?pid={$pid}");
 }
Example #13
0
 private function _save()
 {
     $pid = intval($this->_param['pid']);
     $pattern = trim($this->_param['pattern']);
     $pattern = explode("\n", $pattern);
     $biz = Biz_Exclude::get_instance();
     $biz->delete_exclude($pid);
     foreach ($pattern as $p) {
         $biz->insert_exclude($pid, trim($p));
     }
     $this->_response->redirect(PageHelper::get_domain() . "/project/op?pid={$pid}");
 }
Example #14
0
 public function getImageUrl()
 {
     $imageUrl = PageHelper::pure_static_url(APF::get_instance()->get_config('shop_background_image_url_default', 'weshop', '/img/mobile/app/weshop_bg_default.png'));
     if ($this->imageHash) {
         $config = APF::get_instance()->get_config('ais', 'weshop', array('format_host' => 'pic%d.ajkimg.com', 'path_prefix' => '/display/'));
         $host = sprintf($config['format_host'], $this->imageHostId);
         $pathPrefix = str_replace("anjuke", "e", $config['path_prefix']);
         //无水印格式
         $path = $pathPrefix . $this->imageHash . '/600x270c.jpg';
         $imageUrl = 'http://' . $host . $path;
     }
     return $imageUrl;
 }
Example #15
0
 public static function search($node, $keyword, $contentType = "")
 {
     $aryPages = PageHelper::getDescendants($node, $contentType);
     $aryResult = array();
     $strKeyword = strToLower($keyword);
     foreach ($aryPages as $objPage) {
         $aryFields = $objPage->getFields();
         foreach ($aryFields as $objField) {
             if (strstr(strtoLower($objField->getValue()), $strKeyword)) {
                 $aryResult[] = $objPage;
                 break;
             }
         }
     }
     return $aryResult;
 }
Example #16
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $app = $this->_params['app'];
     $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
     if (!$brokerInfo) {
         throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
     }
     /** 获取经纪人被关注的人数 */
     $brokerChatId = Model_Mobile_BrokerChatInfo::getBrokerChatInfo($brokerId, array('chatId'));
     $followerNum = 0;
     if ($brokerChatId['chatId']) {
         $followerNumInfo = Bll_Mobile_ChatInfoBll::getBrokerFollowerNum($brokerChatId['chatId']);
         if ($followerNumInfo['data']['status'] == 'OK') {
             $followerNum = $followerNumInfo['data']['result']['focus_count'];
         }
     }
     $analysis = Bll_Broker_CallAnalysis::getBrokerAnalysis($brokerId);
     $balanceInfo = Bll_Service_Payment::balance(Bll_Service_Payment::SITE_ANJUKE, array('userId' => Bll_Broker_MainBusiness::getDataByEsfId($brokerId)->memberId));
     $managerInfo = Bll_Broker::getWorkerNumInfo($brokerId);
     // 微聊达人
     $isTalent = -1;
     // 默认,微聊活动未开始或已结束
     if (Bll_Broker_CallAnalysis::isTalentEventOngoing()) {
         $isTalent = 0;
         // 活动中,默认不是微聊达人
         if ($analysis) {
             $isTalent = $analysis['isTalent'];
         }
     }
     $talentIcon = Bll_Broker_CallAnalysis::getTalentIcon($isTalent, $app);
     // 明星经纪人
     $isStarBroker = 0;
     $starBrokerIcon = '';
     try {
         $bllStarBroker = new Bll_Broker_StarIntermediary($brokerInfo['cityId']);
         $starBrokerInfo = $bllStarBroker->getBrokerNewestInfo($brokerId);
         if ($starBrokerInfo && $starBrokerInfo['broker']['isMingxing']) {
             $isStarBroker = 1;
             $starBrokerIcon = PageHelper::pure_static_url('/img/mobile/app/star_broker.png');
         }
     } catch (Exception $e) {
         // do nothing
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('replyRate' => $analysis['reply5minRate'] * 100, 'responseTime' => $analysis['avgRespondTime'], 'customNum' => $analysis['accChatUser'], 'loginDays' => $analysis['accLoginDays'], 'isTalent' => $isTalent, 'talentIcon' => $talentIcon, 'isStarBroker' => $isStarBroker, 'starBrokerIcon' => $starBrokerIcon, 'ajkContact' => $managerInfo['userName'], 'balance' => empty($balanceInfo['data']['balance']) ? 0 : round($balanceInfo['data']['balance'] / 100, 2), 'tel' => $managerInfo['mobile'], 'followerNum' => $followerNum));
 }
Example #17
0
 /**
  * 分页url信息
  * @return array
  */
 private function getInfos()
 {
     $prev = $this->page === 1 ? 1 : $this->page - 1;
     $next = $this->page + 1;
     $now_uri = '/user/beautifulbroker/?page=' . $this->page;
     $prev_uri = '/user/beautifulbroker/?status=' . $this->status . '&page=';
     $prev_url = PageHelper::gen_url($prev_uri . $prev);
     $next_url = PageHelper::gen_url($prev_uri . $next);
     //未审核
     $statusNo = PageHelper::gen_url($now_uri . '&status=0');
     //审核未通过
     $statusisNo = PageHelper::gen_url($now_uri . '&status=2');
     //审核已通过
     $statusisyes = PageHelper::gen_url($now_uri . '&status=1');
     //全部
     $statusAll = PageHelper::gen_url('/user/beautifulbroker/');
     return array('prev_url' => $prev_url, 'next_url' => $next_url, 'statusNo' => $statusNo, 'statusisNo' => $statusisNo, 'statusAll' => $statusAll, 'statusisyes' => $statusisyes, 'nowurl' => $prev_uri);
 }
 public static function imageUrl($fileName)
 {
     $imgBll = Bll_Image_EsfHouseImage::getInstance();
     $image_url = PageHelper::pure_static_url('/img/global/nopic_150x113.gif');
     if ($fileName) {
         $image_url = $fileName;
         if (preg_match("/,/", $image_url)) {
             $img = array();
             $arr = explode(",", $image_url);
             if ($arr[0] > 0) {
                 $img['host_id'] = $arr[0];
                 $img['FileName'] = $arr[1];
             }
             $image_url = $imgBll->convert_property_image_to_icon_url($img['FileName'], $img['host_id']);
             if (isset($image_url['photourl'])) {
                 $image_url = $image_url['photourl'];
             }
         }
     }
     return $image_url;
 }
Example #19
0
 protected function applyList()
 {
     $params = $this->request->get_parameters();
     $key = isset($params['key']) && trim($params['key']) ? trim($params['key']) : '';
     $page = isset($params['page']) ? intval($params['page']) : self::PAGE_DEFAULT;
     $page_size = isset($params['page_size']) ? intval($params['page_size']) : self::PAGE_SIZE_DEFAULT;
     //分页的链接
     $prev = $page === 1 ? 1 : $page - 1;
     $next = $page + 1;
     $uri = '/anlife/group/applyList?';
     $uri = $key != '' ? $uri . 'key=' . $key : $uri;
     $prev_uri = "{$uri}&page={$prev}";
     $next_uri = "{$uri}&page={$next}";
     $prev_url = PageHelper::gen_url($prev_uri);
     $next_url = PageHelper::gen_url($next_uri);
     $group_list = $this->group->get_list($page, $page_size);
     $this->request->set_attribute('keyword', $key);
     $this->request->set_attribute('group_list', $group_list);
     $this->request->set_attribute('prev_url', $prev_url);
     $this->request->set_attribute('next_url', $next_url);
     return 'Group_List';
 }
Example #20
0
 /**
  * 获取二手房房源图片地址
  *
  * @param $ProId
  * @param $CommId
  * @return string
  */
 public function getThumbImageUrl($ProId, $CommId)
 {
     $api = BLL_Service_JavaApi::getInstance(BLL_Service_JavaApi::ESFSITE);
     $url = 'service-internal/rest/image/getDef/' . $ProId;
     $mixResult = $api->useapi($url, array());
     $image_url = PageHelper::pure_static_url('/img/global/nopic_150x113.gif');
     if ($mixResult['status'] == 'ok') {
         $image_url = $mixResult['photo']['fileName'];
         if (preg_match("/,/", $image_url)) {
             $img = array();
             $arr = explode(",", $image_url);
             if ($arr[0] > 0) {
                 $img['host_id'] = $arr[0];
                 $img['FileName'] = $arr[1];
             }
             $image_url = $this->convert_property_image_to_icon_url($img['FileName'], $img['host_id']);
             if (isset($image_url['photourl'])) {
                 $image_url = $image_url['photourl'];
             }
         }
     }
     return $image_url;
 }
Example #21
0
 public static function use_javascripts()
 {
     return array_merge(parent::use_javascripts(), array(PageHelper::pure_static_url("/js/jquery.cookie.js")));
 }
Example #22
0
 public function __construct()
 {
     parent::__construct();
     $this->VerifyTheRight(\DroitsHelper::GERER_MONNAIES);
 }
Example #23
0
<?php

require_once getRootPath() . "/classes/helpers/PageHelper.php";
$keyword = $_REQUEST["keyword"];
$aryResult = PageHelper::Search("", $keyword);
Example #24
0
 public function __construct()
 {
     parent::__construct();
     $this->VerifyTheRight(\DroitsHelper::RECHERCHE_BANNISSEMENT);
 }
Example #25
0
 public function __construct()
 {
     parent::__construct();
     global $request;
     parent::VerifMonJoueur(\Encryption::decrypt($request->query->get("id")));
 }
 public static function use_styles()
 {
     return array(PageHelper::pure_static_url("/js/jquery-ui/jquery-ui-1.10.4.custom.min.css"));
 }
 public function __construct()
 {
     parent::__construct();
     $this->VerifyTheRight(\DroitsHelper::GERER_ITEMSHOP_CATEGORIE);
 }
 public function __construct()
 {
     parent::__construct();
     $this->VerifyTheRight(\DroitsHelper::SUPPORT_TICKET);
 }
Example #29
0
 public static function use_javascripts()
 {
     return array(array("APF.js", PHP_INT_MAX, true), array(PageHelper::pure_static_url("/js/zepto-v1.0rc1/zepto.js"), PHP_INT_MAX));
 }
Example #30
0
 public function __construct()
 {
     parent::__construct();
     $this->VerifyTheRight(\DroitsHelper::RECHERCHE_JOUEUR);
 }