コード例 #1
0
 public function callback($request,$response)
 {
     if (md5($request->msg_id . $request->task_id . $request->fault_time . BeanFinder::get('configs')->jiankongbaoToken)
         == $request->token)
     {
         $content = XString::convertEncoding($request->content, 'gbk', 'utf-8');
         SMSClient::getInstance()->sendSMS(HdfPhoneNumber::$opsPhoneNumbers, $content.' by jkb');
         echo 'OK';
         return parent::DIRECT_OUTPUT;
     }
     echo 'INVALID';
     return parent::DIRECT_OUTPUT;
 }
コード例 #2
0
ファイル: mobileapi.php プロジェクト: sdgdsffdsfff/hdf-client
 private function processInputData($request, $databucketObj, $action)
 {/*{{{*/
     $requestArgs = $request->collectAllRequest();
     self::_log($requestArgs);
     $rm = new ReflectionMethod($databucketObj, $action);
     $inputs = array();
     foreach($rm->getParameters() as $parameter)
     {
         $paramName = $parameter->getName();
         if(isset($requestArgs[$paramName]))
         {
             $inputs[] = $requestArgs[$paramName];
         }
         else
         {
             $inputs[] = null;
         }
     }
     return XString::convertEncoding($inputs, 'GBK', 'UTF-8');
 }/*}}}*/
コード例 #3
0
    public function build()
    {/*{{{*/
        $this->myEcho("\n处理: ".get_class($this)."\n");
        $this->totalTimes = $this->getTotalDBTimes();
        $this->myEcho('数据获取次数: '.$this->totalTimes.' ('.$this->stepLen."条/次)\n");
        $this->myEcho('标准模版路径: '.$this->workPath."\n\n");
        $nowTimes= 1;
        $dataPond = array();
        XString::clearDir($this->workPath);
        $this->nowFile = 0;

        do{
            $this->myEcho('   #'.$nowTimes.' 读取');
            $datas = null;
            $datas = $this->getData($nowTimes, $this->stepLen);
            $this->myEcho(' -> 切片 ');
            $dataPond = $this->edward->shred($datas, $nowTimes, $this->totalTimes);
            $this->myEcho((string)$this->edward);

            if (count($dataPond))
            {
                $this->myEcho(' -> 保存');
            }
            foreach($dataPond as $data)
            {
                $this->myEcho(' '.$this->nowFile.'.'.self::SUFFIX_XML);
                $data = XString::convertEncoding($data, $this->charset, 'gbk');
                $this->write2File($data);
                unset($data);
                if($this->fileCntLimit != 0 && $this->nowFile >= $this->fileCntLimit)
                {
                    break 2;
                }
            }

            $nowTimes++;
            unset($dataPond);
            $this->myEcho("\n");
        } while ($nowTimes <= $this->totalTimes + 1);
    }/*}}}*/
コード例 #4
0
<?php

$keyWords = array();
if (isset($proposal) && false == $proposal->isNull()) {
    $bingLiSet = BingLiDtoClient::getInstance()->getBingLiByRelatedObj($proposal);
    $bingLiSetArray = BingLiDto::transBingLiDtoInfos2Array($bingLiSet);
    $sensitiveWords = BeanFinder::get('ContentFilter')->getSensitiveWordsRecursive("Flow", $bingLiSetArray);
    $words = $proposal->getNecessaryWords();
    $keyWords = array_values(array_unique(array_merge($sensitiveWords, $words)));
}
?>

<script type="text/javascript" src="http://i1.hdfimg.com/js/highlighter/highlight.js?1"></script>
<script>
function highlightWords()
{
    heightLight($('.highlight'), <?php 
echo json_encode(XString::convertEncoding($keyWords, 'utf-8', 'gbk'));
?>
);
}
window.onload=highlightWords;

</script>

コード例 #5
0
<?php

if (isset($content)) {
    echo json_encode(XString::convertEncoding($content, 'utf8', 'gbk'));
}
コード例 #6
0
 /**
  * 生成任务
  *
  * 此方法是产生新的任务
  *
  * 逻辑:
  * 根据选择的source(proposal)来产生新的task,不判断当前task是否已经有未完成的任务,
  * 每次产生新的任务。
  * 
  * @param mixed $request 
  * @param mixed $response 
  * @access public
  * @return void
  */
 public function ajaxGenTask($request, $response)
 {
     /*{{{*/
     $toGroupId = $request->togroupid;
     DBC::requireFalse(empty($toGroupId), "togroupid 不可为空");
     $fromGroupId = $request->fromgroupid;
     DBC::requireFalse(empty($fromGroupId), "fromgroupid 不可为空");
     $fromGroup = InspectGroup::find($fromGroupId);
     $source = DAL::get()->mustFind($request->sourcetype, $request->sourceid);
     $taskLevel = $request->getRequest('tasklevel', 0);
     $isCreateSaleTask = $this->preIsCreateSaleTask($request, $response);
     if (null == $request->tasklevel && false == empty($isCreateSaleTask)) {
         echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('级别是必填项', 'utf-8', 'gbk')));
         return parent::DIRECT_OUTPUT;
     }
     $comment = XString::convertToGbk($request->comment);
     $src = $request->getRequest('tasksrc', '0');
     $toGroup = $this->getTaskGroup($toGroupId, $src, $source, $fromGroup, $taskLevel);
     if (empty($comment)) {
         echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('转任务备注是必填项', 'utf-8', 'gbk')));
         return parent::DIRECT_OUTPUT;
     }
     if ($toGroup instanceof SaleInspectGroup && empty($src)) {
         echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('来源是必填项', 'utf-8', 'gbk')));
         return parent::DIRECT_OUTPUT;
     }
     if ($toGroup instanceof InitialInspectGroup) {
         $this->genInitialTask($fromGroup, $toGroup, $source, $taskLevel, $comment, $src);
     } else {
         $this->genBuTask($fromGroup, $toGroup, $source, $taskLevel, $comment, $src, $request->ticketid);
     }
     echo json_encode(array('success' => 1, 'msg' => XString::convertEncoding('转任务成功', 'utf-8', 'gbk')));
     return parent::DIRECT_OUTPUT;
 }
コード例 #7
0
    public function testDiseaseHospitalWithArea()
    {/*{{{*/
        //标准 数据
        $standardFileList = $this->standardData(__FUNCTION__);
        $standardFile = array_pop($standardFileList);
        $this->assertTrue(isset($standardFileList),"before transform, standardFileList is null...");

        $standardDiseaseHospitalInfo = $this->xmlData($standardFile);
        $keys = array('key','url','showurl','date','title','content1','pagesize','form');
        $this->keyExists($standardDiseaseHospitalInfo, $keys);

        //$this->valueExists($standardDiseaseHospitalInfo);
        $standHospitalList = $standardDiseaseHospitalInfo['form'];
        $this->assertTrue(count($standHospitalList) == 5, "before tansform, the count of form is not 5"); 

        //xslt 转换后数据
        $completeFileList = $this->completeData(__FUNCTION__);
        $completeFile = array_pop($completeFileList);
        $this->assertTrue(isset($completeFile));

        $completeDiseaseHospitalInfo = $this->xmlData($completeFile);
        $this->keyExists($completeDiseaseHospitalInfo, array('key', 'display'));
        $keys = array('url', 'showurl','date','title','content1','pagesize','form'); 
        $this->keyExists($completeDiseaseHospitalInfo['display'], $keys);

        $completeDiseaseInfo = XString::convertEncoding($completeDiseaseHospitalInfo, 'gbk', 'utf-8');
        $completeHospitalList = $completeDiseaseHospitalInfo['display']['form'];
        $this->assertTrue(isset($completeHospitalList) && count($completeHospitalList) == 6, "form has wrong");

    }/*}}}*/
コード例 #8
0
ファイル: wapalipay.php プロジェクト: sdgdsffdsfff/hdf-client
 public function initCallBackData(array $data, $name)
 {
     /*{{{*/
     $sign = $data["sign"];
     $content = "notify_data=" . $data["notify_data"];
     $res = $this->verify($content, $sign);
     if (false == $res) {
         return $res;
     } else {
         $out_trade_no = $this->getDataForXML($data["notify_data"], '/notify/out_trade_no');
         list($sn, $type) = Pay::explodeSN($out_trade_no);
         Pay::checkNameInValidNames($name);
         $this->sn = $sn;
         $this->name = $name;
         $this->type = Pay::$typeDescs[$type];
         $arrcontent = XString::xmlToArray($data["notify_data"]);
         $arrcontent['name'] = $name;
         $arrcontent = XString::convertEncoding($arrcontent, 'gbk', 'utf8');
         $this->content = $arrcontent;
         $this->total_fee = $this->getDataForXML($data["notify_data"], '/notify/total_fee');
         $this->total_fee = (array) $this->total_fee;
         $this->total_fee = $this->total_fee[0];
         $this->trade_status = $this->getDataForXML($data["notify_data"], '/notify/trade_status');
         $this->trade_status = (array) $this->trade_status;
         $this->trade_status = $this->trade_status[0];
         $this->data = $arrcontent;
         return $this;
     }
 }
コード例 #9
0
 public function ajaxCreateMaintenanceDoctorTask($request, $response)
 {
     /*{{{*/
     $comment = $request->comment;
     $taskLevel = $request->tasklevel;
     $comment = XString::convertToGbk($comment);
     $taskId = HdfTaskClient::getInstance()->createMaintenanceDoctorTask($comment, $this->curInspector, $taskLevel);
     if (false == empty($taskId)) {
         echo json_encode(array('success' => 1, 'msg' => XString::convertEncoding('成功生成任务', 'utf-8', 'gbk')));
     } else {
         echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('生成任务失败', 'utf-8', 'gbk')));
     }
     return parent::DIRECT_OUTPUT;
 }
コード例 #10
0
 public function initCallBackData(array $data, $name)
 {
     /*{{{*/
     $waperAlipayFunction = wap_alipay_function::getInstance();
     $out_trade_no = $waperAlipayFunction->getDataForXML($data["notify_data"], '/notify/out_trade_no');
     list($sn, $type) = Pay::explodeSN($out_trade_no);
     Pay::checkNameInValidNames($name);
     $this->sn = $sn;
     $this->name = $name;
     $this->type = Pay::$typeDescs[$type];
     $arrcontent = XString::xmlToArray($data["notify_data"]);
     $arrcontent['name'] = $name;
     $arrcontent = XString::convertEncoding($arrcontent, 'gbk', 'utf8');
     $this->content = $arrcontent;
     $this->total_fee = $waperAlipayFunction->getDataForXML($data["notify_data"], '/notify/total_fee');
     $this->total_fee = (array) $this->total_fee;
     $this->total_fee = $this->total_fee[0];
     $this->trade_status = $waperAlipayFunction->getDataForXML($data["notify_data"], '/notify/trade_status');
     $this->trade_status = (array) $this->trade_status;
     $this->trade_status = $this->trade_status[0];
     $this->data = $arrcontent;
     return $this;
 }
コード例 #11
0
 public function updateWrapper($request, $response)
 {
     /*{{{*/
     DBC::requireNotEmptyString($request->id, '问题包id不可为空!');
     $arr = XString::convertEncoding($_REQUEST, 'gbk', 'utf8');
     $wrapper = WendaClient::getInstance()->modifyQuestionWrapper($request->id, $arr['wrappername'], $arr['wrapperinterval']);
     echo '{"res":"success", "name":"' . $wrapper->name . '", "interval":"' . $wrapper->intervalDay . '"}';
     return self::DIRECT_OUTPUT;
 }
コード例 #12
0
 private function formatOutput($os)
 {/*{{{*/
     if($os == MobileApi::IOS)
     {
         $preg = "/<script[\s\S]*?<\/script>/i";
         $info = json_encode(XString::convertEncoding($this->info, 'utf8', 'gbk'));
         $this->info = preg_replace($preg,"",$info);
     }
     else
     {
         $this->info = json_encode(XString::convertEncoding($this->info, 'utf8', 'gbk'));
     }
 }/*}}}*/
コード例 #13
0
 public function ajaxBindPatient($request, $response)
 {
     /*{{{*/
     $patientCaseId = $request->patientcaseid;
     $patientIds = $request->patientids;
     $patientCase = DAL::get()->find('patientcase', $patientCaseId);
     if ($patientCase->isNull()) {
         echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('要绑定的病例头不存在', 'utf-8', 'gbk')));
         return parent::DIRECT_OUTPUT;
     }
     if (empty($patientIds)) {
         echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('要绑定的病人不能为空', 'utf-8', 'gbk')));
         return parent::DIRECT_OUTPUT;
     }
     $patientList = DAL::get()->find('patient', $patientIds);
     foreach ($patientList as $patient) {
         if ($patient->isNull()) {
             echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('要绑定的病人Id' . +$patient->id . '不存在', 'utf-8', 'gbk')));
             return parent::DIRECT_OUTPUT;
         }
         $ref = DAL::get()->find_by_patientid_and_patientcaseid('patientcaseref', $patient->id, $patientCase->id);
         if (false == $ref->isNull() && $ref->isMatch()) {
             echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('要绑定的病人:' . $patient->name . '与病例头:' . $patientCase->name . '已经存在关联', 'utf-8', 'gbk')));
             return parent::DIRECT_OUTPUT;
         }
     }
     $patientIds = array_keys($patientList);
     PatientCourseClient::getInstance()->addPatientCaseRef($patientIds, $patientCase->id, $this->curInspector);
     echo json_encode(array('success' => 1, 'msg' => XString::convertEncoding('绑定成功', 'utf-8', 'gbk')));
     return parent::DIRECT_OUTPUT;
 }
コード例 #14
0
	public function replyTplAjaxUpdatePost($request, $response)
	{
        ReplyTemplateClient::getInstance()->modify($this->_newUser, $request->id, XString::convertEncoding($request->getRequest('content'), 'gbk', 'utf-8'));
		
		$result = array('status' => 0, 'content' => mb_substr($request->getRequest('content'), 0, 110, 'utf-8'));
        echo json_encode($result);
        exit;
	}
コード例 #15
0
 public function ajaxGetContractIds($request, $response)
 {/*{{{*/
     header('Content-Type: text/html; charset=gbk');
     $groupId = $request->groupId;
     $group = DAL::get()->find('telgroup', $groupId);
     $telOwner = DAL::get()->find_by_relatedObject('telowner', $group);
     $contractInfos = array();
     if (false == $telOwner->isNull())
     {
         $telcontractList = $telOwner->getConfirmedContractList(); 
         foreach ($telcontractList as $telcontract)
         {
             $appointment = $telcontract->service->relatedObject;
             $contractInfos[$telcontract->id] = "{$appointment->minute}分钟/{$appointment->price}元";
         }
     }
     $contractInfos = XString::convertEncoding($contractInfos, 'utf8', 'gbk');
     echo json_encode($contractInfos);
     return parent::DIRECT_OUTPUT;
 }/*}}}*/
コード例 #16
0
 public function replyTplAjaxUpdatePost($request, $response)
 {
     /*{{{*/
     $content = $request->getRequest('content');
     ReplyTemplateClient::getInstance()->modify($this->user, $request->id, XString::convertEncoding($content, 'gbk', 'utf-8'));
     echo json_encode(array('status' => 0, 'content' => mb_substr($content, 0, 110, 'utf-8')));
     return self::DIRECT_OUTPUT;
 }
コード例 #17
0
ファイル: reportbug.php プロジェクト: sdgdsffdsfff/hdf-client
$args['assigned_to'] = '*****@*****.**';
$args['cc'] = '';
$args['estimated_time'] = '0.0';
$args['deadline'] = '';
$args['bug_file_loc'] = 'http://';
$args['description'] = '';
$args['contenttypemethod'] = 'list';
$args['data'] = '';
$args['contenttypeselection'] = 'text/plain';
$args['contenttypeentry'] = '';
$args['dependson'] = '';
$args['blocked'] = '';
$args['form_name'] = 'enter_bug';
//$args[''] = '';

$newArgs = XString::convertEncoding($args, 'utf-8', 'gbk');

$postContent = $r->request('http://192.168.1.99/post_bug.cgi', 'post', $newArgs, $cookie, 10, true, 'bug.haodf.com');

$bugId = getBugId($postContent);
//var_dump($bugId);

//补充附件
foreach (array('exception_sys', 'exception_db') as $fileName)
{
	if ('' == $$fileName)
		continue;
	$getAttachContent = $r->request('http://192.168.1.99/attachment.cgi?bugid='.$bugId.'&action=enter', 'get', array(), $cookie, 10, true, 'bug.haodf.com');
	$args = array();
	$args['bugid'] = $bugId;
	$args['action'] = 'insert';