本文整理汇总了PHP中XString::convertToUnicode方法的典型用法代码示例。如果您正苦于以下问题:PHP XString::convertToUnicode方法的具体用法?PHP XString::convertToUnicode怎么用?PHP XString::convertToUnicode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XString
的用法示例。
在下文中一共展示了XString::convertToUnicode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formatData
public function formatData()
{/*{{{*/
$item = "<item>\n";
$data = $this->data;
foreach($data as $key=>$value)
{
if ($key == 'diseasevotes')
{
$item .= "<diseasevotes>\n";
foreach ($value as $voteItems)
{
$item .= "<diseasevote>\n";
foreach ($voteItems as $voteKey => $voteValue)
{
$newkey = XString::convertToUnicode($voteKey);
$newvalue = XString::convertToUnicode($voteValue);
$item .= "<{$newkey}><![CDATA[{$newvalue}]]></{$newkey}>\n";
}
$item .= "</diseasevote>\n";
}
$item .= "</diseasevotes>\n";
}
else
{
$newkey = XString::convertToUnicode($key);
$newvalue = XString::convertToUnicode($value);
$item .= "<{$newkey}><![CDATA[{$newvalue}]]></{$newkey}>\n";
}
}
$item .= '</item>';
return $item;
}/*}}}*/
示例2: formatData
public function formatData()
{/*{{{*/
$item = "<display>\n";
$data = $this->data;
foreach($data as $key=>$value)
{
if($key == 'contents')
{
$contents = $data['contents'];
if(false == empty($contents))
{
foreach($contents as $content)
{
$newkey = XString::convertToUnicode($content['type']);
$newvalue = XString::convertToUnicode($content['content']);
$item .= "<{$newkey}><![CDATA[{$newvalue}]]></{$newkey}>\n";
unset($newkey, $newvalue, $content);
}
}
unset($contents);
}
else
{
$newkey = XString::convertToUnicode($key);
$newvalue = XString::convertToUnicode($value);
$item .= "<{$newkey}><![CDATA[{$newvalue}]]></{$newkey}>\n";
unset($newkey, $newvalue);
}
unset($key, $value);
}
$item .= '</display>';
unset($data);
return $item;
}/*}}}*/
示例3: before
public function before($context)
{
$userId = $context->request->userId;
$user = DAL::get()->find('user', $userId);
$action = strtolower($context->request->action);
$os = $context->request->os;
$ver = $context->request->v;
if(false !== strpos($action, 'doctoruser') || false !== strpos($action, 'main') || $context->request->xdoc || false !== strpos($action, 'flowref_uploadsound'))
{
}
else
{
if ($user->isNull() || $user->getCertificateForMobile() != $context->request->certificateToken)
{
$this->echoErrorCode();
}
if($user->hasSpace())
{
$space = $user->getSpace();
if($user->name != 'malijuanmlj' && $space->host instanceof Doctor && $space->host->hospitalfaculty->hospital->isInnerTestHospital() && false == RequestDelegate::isOfficeIp())
{
$this->echoErrorCode();
}
}
//绑定设备验证
if ($os == 'ios' && $ver >= '3.0.3' || $os == 'android' && $ver >= '3.0.8')
{
$deviceToken = $os == 'ios' ? $context->request->deviceOpenUDID : $context->request->deviceToken;
$doctorUser = DAL::get()->find_by_userid_and_status('doctoruser', $userId, DoctorUser::STATUS_BIND, true);
if($doctorUser->isNull() == false && $doctorUser->deviceToken != $deviceToken && false == in_array($userId, DoctorUser::$doctorId4Test))
{
$msg = "您的账号于 ".date('H:m', strtotime($doctorUser->ctime))." 在一台 ".$doctorUser->deviceType." 手机登录。如非本人操作,则密码可能已泄露,建议重新登录修改密码或直接联系我们 ".HdfPhoneNumber::PHONE_DOCTORHELP." 修改密码";
$msg = XString::convertToUnicode($msg);
echo '{"errorCode":"888","msg":"'.$msg.'","content":[]}';
exit;
}
}
}
if (($os == 'ios' && $ver >= '3.0.1' || $os == 'android' && $ver >= '3.0.5') && $this->actionIsNotInActions($context->action))
{
if ($user->id == 0) return;//用户id是0 的过滤
$doctorOwner = DAL::get()->find_by_userid('DoctorOwner', $user->id);
if (false == $doctorOwner->isNull() && $doctorOwner->isPreDoctor())
{
$predoctor = $doctorOwner->source;
if ($predoctor->isRefused())
{
echo '{"errorCode":"8000","msg":"","content":[]}';
exit;
}
if ($predoctor->isAbnormal())
{
echo '{"errorCode":"8001","msg":"","content":[]}';
exit;
}
}
}
}
示例4: ajaxDeleteGroupPost
public function ajaxDeleteGroupPost($request, $response)
{
/*{{{*/
$patientCategoryId = $request->category_id;
ForumClient::getInstance()->deleteGroup($patientCategoryId);
//$this->message('组已经被删除', $response, array('text' => '返回列表', 'url' => $response->router->urlfor('adminpatient/index')));
echo json_encode(array('status' => '0', 'content' => XString::convertToUnicode('组已经被删除')));
return parent::DIRECT_OUTPUT;
}
示例5: ajaxAddFlowChargeOrder
public function ajaxAddFlowChargeOrder($request, $response)
{/*{{{*/
$refId = $request->getRequest('refid', 0);
$ref = DAL::get()->find('DoctorPatientRef', $refId);
$cashAccount = $this->user->getCashAccount();
$product = ProductClient::getInstance()->getDoctorChargeFlowProduct($ref->space);
if (false == ($ref instanceof DoctorPatientRef && $ref->user->id == $this->user->id && $ref->space->isChargeOpened()))
{
$msg = "对不起,您不能预充值";
$res = "failure";
}
else if ($ref->isSpaceCanPost() && false == $ref->isLastSpaceReply())
{
$msg = "抱歉!现在不能购买。您已经提前购买了{$ref->space->name}医生的3次指导机会,为避免资源浪费,请在使用后再次购买。";
$res = "failure";
}
else if ($cashAccount->amount < $product->salePrice)
{
$msg = "您的余额不足,不能购买,请充值后重新购买。";
$res = "failure";
}
else
{
$serviceOrder = ServiceOrderClient::getInstance()->create($ref, $product, $this->user);
if(false == $serviceOrder->isNull())
{
ServiceOrderClient::getInstance()->pay($serviceOrder, $this->user);
$serviceOrder = DAL::get()->find('serviceOrder', $serviceOrder->id, true);
if ($serviceOrder->isPaid())
{
$msg = "支付成功!";
$res = "success";
}
else
{
$msg = "支付失败!";
$res = "failure";
}
}
else
{
$msg = "支付失败!";
$res = "failure";
}
}
$results = array('res' => $res, 'msg' => XString::convertToUnicode($msg));
echo json_encode($results);
return self::DIRECT_OUTPUT;
}/*}}}*/
示例6: ajaxValidSpace
public function ajaxValidSpace($request, $response)
{
/*{{{*/
$content = array();
$userName = $request->username;
$space = DAL::get()->find_by_userName('space', $userName);
if ($space->isNull() == false && $space->isConfirmed()) {
$content['id'] = $space->id;
$content['name'] = XString::convertToUnicode($space->host->name);
$content['faculty'] = XString::convertToUnicode($space->host->hospitalfaculty->name);
$content['hospital'] = XString::convertToUnicode($space->host->hospitalfaculty->hospital->name);
$content['key'] = md5('haodf2014' . $space->id . '0');
}
echo json_encode($content);
return parent::DIRECT_OUTPUT;
}
示例7: ajaxAnnouncePost
public function ajaxAnnouncePost($request, $response)
{
$titleUtf8 = $request->title;
$announceUtf8 = $request->announce;
$title = XString::convertToGbk($titleUtf8);
$announce = XString::convertToGbk($announceUtf8);
SpaceClient::getInstance()->setProperties($this->_newSpace->id, array('announceTitle'=>$title, 'announce'=>$announce));
$results = array('status' => 0, 'announce_title' => $title == '' ? '欢迎词':XString::convertToUnicode(XString::truncate($title, 66)),
'announce' => nl2br($announceUtf8));
echo json_encode($results);
exit;
}
示例8: encryptOrderInfo
public function encryptOrderInfo($sn, $type, $price, $callBackUrl, $name, $description = '')
{
/*{{{*/
$callBackUrl = urlencode($callBackUrl);
$sn = Pay::makeSN($sn, $type);
$partner = $this->partner;
$seller = $this->seller;
$out_trade_no = $sn;
$subject = $name . "-订单号({$sn})";
$body = $description;
$total_fee = number_format($price, 2, '.', '');
$notifyurl = $callBackUrl;
//异步返回
$waitSign = 'partner="' . $partner . '"&seller="' . $seller . '"&out_trade_no="' . $out_trade_no . '"&subject="' . $subject . '"&body="' . $body . '"&total_fee="' . $total_fee . '"¬ify_url="' . $notifyurl . '"';
// $waitSignArr = array('partner' => $partner, 'seller' => $seller, 'out_trade_no' => $out_trade_no, 'subject' => $subject, 'body' => $body, 'total_fee' => $total_fee, 'notify_url' => $notifyurl, 'signType' => 'RSA');
// $waitSign = $this->create_linkstring($waitSignArr);
$waitSign_utf8 = XString::convertToUnicode($waitSign);
//utf-8
$sign = $this->sign($waitSign_utf8);
$sign = urlencode($sign);
$string = $waitSign . '&sign_type="RSA"' . '&sign="' . $sign . '"';
return $string;
}
示例9: ajaxRemitBankList
public function ajaxRemitBankList($request, $response)
{
/*{{{*/
$bankType = $request->bankType;
$remitList = AccountClient::getInstance()->getRemit4OrderList(Remit::TYPE_UNCLAIMED, $bankType);
$res = array();
foreach ($remitList as $remit) {
if (false == $remit->isNull()) {
$res[$remit->id] = XString::convertToUnicode($remit->getBriefInfo());
}
}
echo json_encode($res);
exit;
}
示例10: getContentWithOutHtml
public static function getContentWithOutHtml($content)
{
$content = XString::convertToUnicode($content);
$content = html_entity_decode($content);
$content = preg_replace("/\&ldquo\;/i", '"', $content);
$content = preg_replace("/\&rdquo\;/i", '"', $content);
//error_log($content."\n",3,'/tmp/wap123.log');
//$content = strip_tags($content,'<br/> </p> </div> <br>');
$params = array('<br />', '</p>', '</div>', '<br>','<BR>', '<BR />', '<div>');
$content = str_replace($params, "\r\n", $content);
$content = preg_replace("/<div[^>]*>/i", "\r\n", $content);
$content = preg_replace("/<a[^>]*>/i", "", $content);
$content = preg_replace("/&#\d{3,6};/", "", $content);
$options = array(' ','&nbsp;');
$content = str_replace($options, " ", $content);
//这会丢失文本
$content = strip_tags($content);
//error_log($content."\n",3,'/tmp/wap123.log');
$content = preg_replace('/((\r\n )|(\r\n))+/', "\n", $content);
$content = preg_replace('/((\n )|(\n))+/', "\n", $content);
$content = XString::convertToGbk($content);
if(mb_strlen($content) > 6746)
{
$content = substr($content, 0, 6746).'...';
}
return $content;
}
示例11: ajaxGetHospitalFaculty
public function ajaxGetHospitalFaculty($request, $response)
{
/*{{{*/
$hfLevel = $hospitalLevel = '';
$hf = DAL::get()->find('hospitalfaculty', $request->hfid);
if (false == $hf->isNull()) {
$hfLevel = XString::convertToUnicode($hf->getHospitalFacultyLevelDesc());
$hospitalLevel = XString::convertToUnicode($hf->hospital->getGradeStr());
}
$results = array('hfLevel' => $hfLevel, 'hospitalLevel' => $hospitalLevel);
echo json_encode($results);
return self::DIRECT_OUTPUT;
}
示例12: include
<?php include('_treatment.php');?>
<!--治疗情况 end-->
<!--用药情况 start-->
<?php include('_medicine.php');?>
<!--用药情况 end-->
<!--内容 start-->
<?php include('_content.php');?>
<!--内容 end-->
<!--加号信息 start-->
<?php include('_booking.php');?>
<!--加号信息 end-->
<!--电话咨询信息 start-->
<?php include('_telorder.php');?>
<!--电话咨询信息 end-->
<!--附件 start-->
<?//php include("_attachment.php");?>
<!--附件 end-->
<?php
$html = ob_get_contents();
ob_end_clean();
header("Content-Type: text/html; charset=UTF-8");
echo $callback.'(';
echo json_encode(XString::convertToUnicode($html));
echo ');';
?>
示例13: ajaxCaseStatusTip
function ajaxCaseStatusTip()
{/*{{{*/
$tip = '';
if (false == $this->_newSpace->isCaseOpen())
{
$tip = XString::convertToUnicode('您关闭了此功能,患者不能向您提问,<a id="anchor_case_open" class="red" href="javascript: void(0);">点击打开</a>');
}
else if (false == $this->_newSpace->isNewCaseOpen())
{
$tip = XString::convertToUnicode('您限制了新患者提问,患者不能向您提问,<a href="#" onclick="space_edit_case_setup(this); return false;" class="red">点击设置</a>');
}
else if ($this->_newSpace->modulecase->allowNewMaxNumber == 0)
{
$tip = XString::convertToUnicode('您限制了新患者提问,患者不能向您提问,<a href="#" onclick="space_edit_case_new_max_number(this); return false;" class="red">点击设置</a>');
}
else if(ThreadClient::getInstance()->isAskedFullBySpace($this->_newSpace->user->id))
{
$tip = XString::convertToUnicode('您限制了患者提问数量,目前咨询已满,其他患者不能向您提问,<a href="#" onclick="space_edit_case_new_max_number(this); return false;" class="red">点击设置</a>');
}
echo json_encode(array('tip'=>$tip));
exit;
}/*}}}*/
示例14: stopAddSignPost
public function stopAddSignPost($request, $response)
{
ini_set('display_errors', false); // json output do no error information
$vars = $request->var;
$vars = XString::toGbkDeep($vars);
$beginTime = $vars["year1"].'-'.$vars['month1'].'-'.$vars['day1'].' '.$vars['time1'].':00:00';
$endTime = $vars["year2"].'-'.$vars['month2'].'-'.$vars['day2'].' '.$vars['time2'].':00:00';
$beginTime = $beginTime;
$endTime = $endTime;
$doctorUserId = $this->_newSpace->id;
if ($beginTime > $endTime){
echo json_encode(array(
'status' => 1,
'content' => XString::convertToUnicode('开始时间大于结束时间'),
));
exit;
} else {
$orderList = BookingClient::getInstance()->getSendSmsOrderList($this->_newSpace->id, $beginTime, $endTime);
if (empty($orderList)){
echo json_encode(array(
'status' => 1,
'content' => XString::convertToUnicode('选择时间内没有加号信息'),
));
exit;
} else {
foreach ($orderList as $order) {
try {
$user = DAL::get()->find('User', $this->_newSpace->id);
BookingClient::getInstance()->doctorCancelOrder($user, $order->id);
} catch(Exception $e) {
$msg = '发送失败,原因是可能你已经发送过了';
}
}
$msg = '停诊通知已告知相应患者';
echo json_encode(array(
'status' => 0,
'content' => XString::convertToUnicode($msg),
));
exit;
}
}
}
示例15: ajaxShareArticle
/** 获取文章内容*/
public function ajaxShareArticle($request, $response)
{
/*{{{*/
$article = DAL::get()->find('Article', $request->articleId);
$res['title'] = XString::convertToUnicode($article->title);
$res['content'] = XString::convertToUnicode(mb_substr(trim(preg_replace(array("/(&#[0-9]+;)/", "/(&\\w+;)/"), '', str_replace(array("\r", "\n"), '', strip_tags(htmlspecialchars_decode($article->content))))), 0, 110, 'GBK'));
echo json_encode($res);
return parent::DIRECT_OUTPUT;
$this->patient = $patient;
}