Beispiel #1
0
 public function execute()
 {
     $arrCgi = Saf_SmartMain::getCgi();
     $arrRequest = $arrCgi['post'];
     if (isset($arrRequest['method'])) {
         $objDS = null;
         $strFunc = null;
         $arrParams = array();
         $arrOutput = array();
         $strApp = isset($arrRequest['app']) ? $arrRequest['app'] : APP;
         $res = $this->getMethod($arrRequest['method'], $strApp, $objDS, $strFunc, $arrParams, $arrOutput);
         if ($res == self::SUCCESS) {
             $arrInput = $this->getParmas($arrParams, $arrRequest);
             if (false === $arrInput) {
                 $errno = self::PARAM_ERROR;
                 return array('errno' => $errno);
             }
             try {
                 $res = call_user_func_array(array($objDS, $strFunc), $arrInput);
             } catch (Exception $e) {
                 $errno = $e->getCode();
                 return array('errno' => $errno);
             }
             if ($arrOutput == null) {
                 $arrData['output'] = $res;
             } else {
                 $arrData[$arrOutput[0]] = $res;
             }
             return array('errno' => self::SUCCESS, 'data' => $arrData);
         }
     }
 }
Beispiel #2
0
 public function execute()
 {
     //1. check if user is login as needed
     $arrUserinfo = Saf_SmartMain::getUserInfo();
     if (empty($arrUserinfo)) {
         //ouput error
     }
     //2. get and validate input params
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     if (!isset($arrInput['id'])) {
         //output error
     }
     Bd_Log::debug('request input', 0, $arrInput);
     //3. call PageService
     $objServicePageSample = new Service_Page_Sample();
     $arrPageInfo = $objServicePageSample->execute($arrInput);
     //4. chage data to out format
     $arrOutput = $arrPageInfo;
     //5. build page
     // smarty模板,以下渲染模板的代码依赖于提供一个tpl模板
     //$tpl = Bd_TplFactory::getInstance();
     //$tpl->assign($arrOutput);
     //$tpl->display('en/newapp/index.tpl');
     //这里直接输出,作为示例
     $strOut = $arrOutput['data'];
     echo $strOut;
     //notice日志信息打印,只需要添加日志信息,saf会自动打一条log
     Bd_Log::addNotice('out', $arrOutput);
 }
Beispiel #3
0
 public function invoke()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $pageService = new Service_Page_Operation_V2_Details(null);
     $arrPageInfo = $pageService->execute($arrInput);
     $arrOutput = $arrPageInfo;
     //
     if ($arrInput['is_data']) {
         echo json_encode($arrOutput);
     } else {
         $tpl = Bd_TplFactory::getInstance();
         /*
                     if(!Bd_PhpCas::isAuthenticated()) {
            $user_name = mb_strtoupper(Bd_PhpCas::login());
                     }
                     else {
            $user_name = mb_strtoupper(Bd_PhpCas::isAuthenticated());
                     }
         */
         $tpl->assign('user_name', $user_name);
         $tpl->assign('operation_details', $arrOutput['data']);
         $tpl->assign('type_list', $arrOutput['type_list']);
         if ($arrOutput['data']['status'] && $arrOutput['data']['stop_time'] < time()) {
             $tpl->display('naviServerAdmin/operation/v2/operation_message_details.tpl');
         } else {
             $tpl->display('naviServerAdmin/operation/v2/showupdatemessage.tpl');
         }
     }
 }
Beispiel #4
0
 public function execute()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $pageService = new Service_Page_Track_V1_GetDetailsTrack('param_get_details_track');
     $pageInfo = $pageService->execute($arrInput);
     //echo json_encode($pageInfo['data']['yaw_point']);
     if ($pageInfo['errno'] == 0) {
         $tpl = Bd_TplFactory::getInstance();
         $tpl->assign('track_details', json_encode($pageInfo['data']['gps']));
         $tpl->assign('yaw_point_list', $pageInfo['data']['yaw_point']);
         $tpl->assign('is_yaw', json_encode($pageInfo['data']['yaw_point']));
         $tpl->assign('track_count', json_encode($pageInfo['data']['track_count']));
         $tpl->assign('track_base_data', $pageInfo['data']['details']);
         /**
                     if(!Bd_PhpCas::isAuthenticated()) {
                         $user_name = mb_strtoupper(Bd_PhpCas::login());
                     }
                     else {
                         $user_name = mb_strtoupper(Bd_PhpCas::isAuthenticated());
                     }
                     **/
         $tpl->assign('user_name', $user_name);
         $tpl->display('naviServerAdmin/track/TrackDetails.tpl');
     } else {
         echo json_encode($pageInfo);
     }
 }
Beispiel #5
0
 public function invoke()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $tpl = Bd_TplFactory::getInstance();
     $tpl->display('naviServerAdmin/operation/v2/messagedetail.tpl');
 }
Beispiel #6
0
 public function execute()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $pageService = new Service_Page_Track_V1_GetOtherVersion('param_get_other_version_track');
     $pageInfo = $pageService->execute($arrInput);
     echo json_encode($pageInfo);
 }
Beispiel #7
0
 public function __execute()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $objServicePageSampleApi = new Service_Page_SampleApi();
     $arrPageInfo = $objServicePageSampleApi->execute($arrInput);
     return $arrPageInfo;
 }
Beispiel #8
0
 public function execute()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest["post"];
     $pageService = new Service_Page_Apiplatform_CurlProxy("param_apiplatform_curlproxy");
     $ret = $pageService->execute($arrInput);
     Navilib_View::output($ret, Navilib_View::JSON);
     Navilib_LogHook::addNotice('err_no', $ret["errno"]);
 }
 public function invoke()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['post'];
     $pageService = new Service_Page_Operation_V2_SaveOperationMessage('params_save_opmessage');
     $ret = $pageService->execute($arrInput);
     $msg = $ret['errmsg'];
     Net_Util::showAndReturn($msg, '/naviServerAdmin/v2/viewoperation');
 }
Beispiel #10
0
 public function invoke()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['post'];
     $pageService = new Service_Page_Operation_V2_Post('param_post_operation');
     $arrPageInfo = $pageService->execute($arrInput);
     $arrOutput = $arrPageInfo;
     echo json_encode($arrOutput);
 }
Beispiel #11
0
 public function invoke()
 {
     $pageService = new Service_Page_Operation_V2_ShowAddMessage(null);
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['post'];
     $data = $pageService->execute($arrInput);
     $tpl = Bd_TplFactory::getInstance();
     $tpl->assign('data', $data);
     $tpl->display('naviServerAdmin/operation/v2/showaddmessage.tpl');
 }
Beispiel #12
0
 public function execute()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $pageService = new Service_Page_Feedback_V1_PageList('param_pagelist_feedback');
     $arrPageInfo = $pageService->execute($arrInput);
     $arrOutput = json_encode($arrPageInfo);
     //        var_dump($arrOutput);
     echo $arrOutput;
 }
Beispiel #13
0
 public function execute()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest["get"];
     $pageService = new Service_Page_Apiplatform_GetAllAppName("param_apiplatform_getallappname");
     $ret = $pageService->execute($arrInput);
     //header("Access-Control-Allow-Origin: *"); //允许所有域名发起的跨域请求
     Navilib_View::output($ret, Navilib_View::JSON);
     Navilib_LogHook::addNotice('err_no', $ret["errno"]);
 }
Beispiel #14
0
 public function invoke()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['post'];
     $pageService = new Service_Page_Operation_V2_UpdateMessageType(null);
     $ret = $pageService->execute($arrInput);
     $refer = $_SERVER['HTTP_REFERER'] ? htmlspecialchars($_SERVER['HTTP_REFERER']) : "/naviServerAdmin/typelist";
     echo '<meta http-equiv="content-type" content="text/html; charset=UTF-8">';
     echo '<script>alert("' . $ret . '");location.href="' . $refer . '"</script>';
 }
Beispiel #15
0
 public function invoke()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $pageService = new Service_Page_Operation_V2_Preview(null);
     $arrOutput = $pageService->execute($arrInput);
     $tpl = Bd_TplFactory::getInstance();
     $tpl->assign('out', $arrOutput);
     #$tpl->assign('type_list',$arrOutput['type_list']);
     $tpl->display('naviServerAdmin/operation/v2/preview.tpl');
 }
Beispiel #16
0
 public function invoke()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $pageService = new Service_Page_Operation_V2_CallIntelligence(null);
     $arr = $pageService->execute($arrInput);
     if ($arr['errno'] !== 0) {
         $msg = $arr['errmsg'];
     }
     Net_Util::showAndReturn($msg, '/naviServerAdmin/v2/viewoperation');
 }
Beispiel #17
0
 public function invoke()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $pageService = new Service_Page_Operation_V2_PushStatics(null);
     $arr = $pageService->execute($arrInput);
     //echo json_encode($arr);
     $tpl = Bd_TplFactory::getInstance();
     $tpl->assign('out', $arr);
     $tpl->display('naviServerAdmin/operation/v2/pushstatics.tpl');
 }
Beispiel #18
0
 public function execute()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $this->strFromApi = isset($arrRequest['get']['fromapi']) ? $arrRequest['get']['fromapi'] : 0;
     $intLogId = $arrRequest['request_param']['logid'];
     $arrRes = $this->__execute();
     if (!$this->strFromApi) {
         $this->__render($arrRes);
     } else {
         $this->__value($arrRes);
     }
 }
Beispiel #19
0
 public function execute()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $pageService = new Service_Page_Common_V2_UEditor(null);
     $ret = $pageService->execute($arrInput);
     if ($arrInput['callback']) {
         $callback = htmlspecialchars($arrInput['callback']);
         echo "{$callback} && {$callback}( " . json_encode($ret) . ");";
     } else {
         echo json_encode($ret);
     }
 }
Beispiel #20
0
 public function invoke()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $pageService = new Service_Page_Operation_V1_View('param_view_operation');
     $arrPageInfo = $pageService->execute($arrInput);
     $arrOutput = $arrPageInfo;
     //        echo json_encode($arrOutput);
     $tpl = Bd_TplFactory::getInstance();
     //        echo json_encode($arrOutput['data']['operation_message_list']);
     $tpl->assign('operation_message_list', $arrOutput['data']['operation_message_list']);
     $tpl->assign('user_name', $arrOutput['data']['user_name']);
     $tpl->display('naviServerAdmin/operation/view_operation_message.tpl');
 }
Beispiel #21
0
 public function execute()
 {
     $pageService = new Service_Page_Common_V2_ImageUploader(null);
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $arrInput = array();
     $arr = $pageService->execute($arrInput);
     if (isset($arrInput['callback'])) {
         echo $arrInput['callback'] . "&" . $arrInput['callback'] . "(" . json_encode($arr) . ");";
     } else {
         echo json_encode($arr);
     }
     exit;
 }
Beispiel #22
0
 public function actionStartUp()
 {
     $state = parent::$arrDict[parent::ADAPT_INFO]['data']['needAdapt'];
     if ($state === false) {
         return false;
     }
     $needAdapt = false;
     $screenType = '';
     $arrRequest = Saf_SmartMain::getCgi();
     if (!isset($arrRequest['request_param']['bd_page_type'])) {
         $needAdapt = true;
     } elseif ($arrRequest['request_param']['bd_page_type'] == 0) {
         $screenType = 'wml';
     } elseif ($arrRequest['request_param']['bd_page_type'] == 1) {
         if (!isset($arrRequest['request_param']['pu'])) {
             $needAdapt = true;
         } else {
             $arrPU = self::parsePU($arrRequest['request_param']['pu']);
             if (!isset($arrPU['sz'])) {
                 $needAdapt = true;
             } elseif (preg_match('/1330_\\d+/', $arrPU['sz'])) {
                 $screenType = 'big';
             } elseif (preg_match('/1320_\\d+/', $arrPU['sz'])) {
                 $screenType = 'iphone';
             } elseif (preg_match('/1321_\\d+/', $arrPU['sz'])) {
                 $screenType = 'utouch';
             } elseif (preg_match('/1325_\\d+/', $arrPU['sz'])) {
                 $screenType = 'pad';
             } elseif (preg_match('/\\d+_\\d+/', $arrPU['sz'])) {
                 $screenType = 'middle';
             } else {
                 $needAdapt = true;
             }
         }
     } else {
         $needAdapt = true;
     }
     if ($needAdapt) {
         $data = $this->getScreenTypeFromWise();
         if ($data != false) {
             $screenType = $data['_adapt_result']['bd_page_type'] == 0 ? 'wml' : $data['_adapt_result']['tn'];
         }
     }
     $adaptInfo = array('pu' => $arrRequest['request_param']['pu'], 'screenType' => $screenType, 'adaptData' => $data);
     self::setAdaptInfo($adaptInfo);
 }
Beispiel #23
0
 public function execute()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $pageService = new Service_Page_Apiplatform_RegressionTest('param_apiplatform_regressiontest');
     $pageInfo = $pageService->execute($arrInput);
     Navilib_LogHook::addNotice('err_no', $pageInfo["errno"]);
     if (Navilib_CommonError::SUCCESS !== $pageInfo["errno"]) {
         Navilib_View::output($pageInfo, Navilib_View::JSON);
     } else {
         $tpl = Bd_TplFactory::getInstance();
         $tpl->assign('urlHost', $pageInfo['data']['urlHost']);
         $tpl->assign('proxyHost', $pageInfo['data']['proxyHost']);
         $tpl->assign('appName', $pageInfo['data']['appName']);
         $tpl->assign('userName', CURRENT_USER);
         $tpl->display('naviServerAdmin/apiplatform/RegressionTest.tpl');
     }
 }
Beispiel #24
0
 public function invoke()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $pageService = new Service_Page_Operation_V2_Delete('param_delete_operation');
     $arrPageInfo = $pageService->execute($arrInput);
     $arrOutput = $arrPageInfo;
     echo json_encode($arrOutput);
     //        $tpl = Bd_TplFactory::getInstance();
     //        if(!Bd_PhpCas::isAuthenticated()) {
     //            $user_name = mb_strtoupper(Bd_PhpCas::login());
     //        }
     //        else {
     //            $user_name = mb_strtoupper(Bd_PhpCas::isAuthenticated());
     //        }
     //        $tpl->assign('user_name',$user_name);
     //        $tpl->assign('operation_details',$arrOutput['data']);
     //        $tpl->display('feedbackAdmin/operation_message_details.tpl');
 }
Beispiel #25
0
 public function execute()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     //        $pageService = new Service_Page_Feedback_V1_View('param_view_feedback');
     //        $arrPageInfo = $pageService->execute($arrInput);
     //        $arrOutput = $arrPageInfo;
     $tpl = Bd_TplFactory::getInstance();
     /*
            if(!Bd_PhpCas::isAuthenticated()) {
                $user_name = mb_strtoupper(Bd_PhpCas::login());
            }
            else {
                $user_name = mb_strtoupper(Bd_PhpCas::isAuthenticated());
            }
     */
     $tpl->assign('user_name', $user_name);
     $tpl->display('naviServerAdmin/index.tpl');
 }
Beispiel #26
0
 public function execute()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $pageService = new Service_Page_Apiplatform_Testman('param_apiplatform_testman');
     $pageInfo = $pageService->execute($arrInput);
     Navilib_LogHook::addNotice('err_no', $pageInfo["errno"]);
     if (Navilib_CommonError::SUCCESS !== $pageInfo["errno"]) {
         Navilib_View::output($pageInfo, Navilib_View::JSON);
     } else {
         $tpl = Bd_TplFactory::getInstance();
         $tpl->assign('freqDomain', $pageInfo['data']['freqDomain']);
         $tpl->assign('freqModule', $pageInfo['data']['freqModule']);
         $tpl->assign('history', $pageInfo['data']['history']);
         $tpl->assign('offset', $pageInfo['data']['offset']);
         $tpl->assign('hasPre', $pageInfo['data']['hasPre']);
         $tpl->assign('hasNext', $pageInfo['data']['hasNext']);
         $tpl->assign('userName', CURRENT_USER);
         $tpl->display('naviServerAdmin/apiplatform/Testman.tpl');
     }
 }
Beispiel #27
0
 public function execute()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $pageService = new Service_Page_Feedback_V1_FeedbackDetails('param_details_feedback');
     $arrPageInfo = $pageService->execute($arrInput);
     $arrOutput = $arrPageInfo;
     //将数据传到前端渲染页面
     $tpl = Bd_TplFactory::getInstance();
     /**
             if(!Bd_PhpCas::isAuthenticated()) {
                 $user_name = mb_strtoupper(Bd_PhpCas::login());
             }
             else {
                 $user_name = mb_strtoupper(Bd_PhpCas::isAuthenticated());
             }
             **/
     $tpl->assign('user_name', $user_name);
     $tpl->assign('feedback_details', $arrOutput['data']);
     $tpl->assign('pic_list', json_decode($arrOutput['data']['opt'], true));
     $tpl->display('naviServerAdmin/feedback/feedback_details.tpl');
 }
Beispiel #28
0
 public function execute()
 {
     $arrRequest = Saf_SmartMain::getCgi();
     $arrInput = $arrRequest['get'];
     $currappid = $arrInput['appid'] ? $arrInput['appid'] : 1;
     $pageService = new Service_Page_Feedback_V1_View('param_view_feedback');
     $arrPageInfo = $pageService->execute($arrInput);
     $arrOutput = $arrPageInfo;
     $tpl = Bd_TplFactory::getInstance();
     $tpl->assign('feedback_list', $arrOutput['data']['feedback_list']);
     $tpl->assign('system_version_list', $arrOutput['data']['system_version_list']);
     $tpl->assign('app_version_list', $arrOutput['data']['app_version_list']);
     $tpl->assign('suggestion_type', $arrOutput['data']['suggestion_type']);
     $tpl->assign('product_list', $arrOutput['data']['product_list']);
     $tpl->assign('now_page', $arrOutput['data']['$now_page']);
     $tpl->assign('end_page', $arrOutput['data']['end_page']);
     $tpl->assign('pages', $arrOutput['data']['pages']);
     $tpl->assign('total_page_count', $arrOutput['data']['total_page_count']);
     $tpl->assign('currappid', $currappid);
     $tpl->assign('query', $arrInput);
     $tpl->assign('user_name', $arrOutput['data']['user_name']);
     $tpl->display('naviServerAdmin/feedback/view_feedback.tpl');
 }
Beispiel #29
0
 public function execute($arrInput)
 {
     Bd_Log::debug('sample api page service  called');
     if ($arrInput == null) {
         $arrCgi = Saf_SmartMain::getCgi();
         $arrInput = $arrCgi['get'];
     }
     $intId = intval($arrInput['id']);
     $arrResult = array();
     $arrResult['errno'] = 0;
     try {
         if ($intId <= 0) {
             $arrResult['errno'] = 222;
             //示例错误码
         } else {
             $strData = $this->objServiceDataSample->getSample($intId);
             $arrResult['data'] = $strData;
         }
     } catch (Exception $e) {
         Bd_Log::warning($e->getMessage(), $e->getCode());
         $arrResult['errno'] = $e->getCode();
     }
     return $arrResult;
 }
Beispiel #30
0
 public static function timgUrl($src, $size = "4", $quality = 60, $params = array())
 {
     if (!is_string($src)) {
         return;
     }
     $sec = time();
     $key = "wisetimgkey";
     $di = md5($key . $sec . $src);
     $scheme = "http://";
     $host = "cdn01.baidu-img.cn";
     // 判断是否在https协议下
     $ishttps = Wise_Utils::isHttps();
     if ($ishttps == 1) {
         $strDictRst = Wise_Utils::getValueFromDict($host, 'http_to_https');
         if (!empty($strDictRst)) {
             $scheme = "https://";
             $host = $strDictRst;
         }
     }
     $baseurl = $scheme . $host . "/timg";
     $arrParams = Saf_SmartMain::getCgi();
     if (!empty($arrParams['sampling']) && !empty($arrParams['sampling']['sids'])) {
         $sids = $arrParams['sampling']['sids'];
         if (stripos($sids, '12850') !== false || stripos($sids, '12851') !== false) {
             $quality = 100;
         }
         if (stripos($sids, '12850') !== false && $_COOKIE['webp'] == "1") {
             $imgtype = 4;
         }
     }
     if ($imgtype) {
         $url = "{$baseurl}?wisealaddin&size={$size}&imgtype={$imgtype}&quality={$quality}&sec={$sec}&di={$di}";
     } else {
         $url = "{$baseurl}?wisealaddin&size={$size}&quality={$quality}&sec={$sec}&di={$di}";
     }
     if (is_array($params)) {
         foreach ($params as $key => $value) {
             $url .= "&{$key}={$value}";
         }
     }
     $url .= "&src=" . urlencode($src);
     return $url;
 }