本文整理汇总了PHP中XString::isMobile方法的典型用法代码示例。如果您正苦于以下问题:PHP XString::isMobile方法的具体用法?PHP XString::isMobile怎么用?PHP XString::isMobile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XString
的用法示例。
在下文中一共展示了XString::isMobile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajaxCheckMobile
public function ajaxCheckMobile($request, $response)
{/*{{{*/
$mobile = $request->mobile;
if (XString::isMobile($mobile))
{
echo true;
}
else
{
echo false;
}
return parent::DIRECT_OUTPUT;
}/*}}}*/
示例2: ajaxShowTelSmsList
public function ajaxShowTelSmsList($request, $response)
{/*{{{*/
$mobile = $request->mobile;
$minCtimeOfTaskId = $request->minctimeoftaskid;
if(XString::isMobile($mobile) == false)
{
die("亲,电话不是手机号。没有短信哦");
}
if(isset($minCtimeOfTaskId) == false)
{
die("亲,没有任务");
}
$telTask = DAL::get()->find('TelTask', $minCtimeOfTaskId);
$filter = " mobile=:mobile and ctime >= :ctime order by ctime desc limit 20";
$binds = array(':mobile'=>$mobile, ':ctime'=>$telTask->ctime);
$mobileSmsLogs = DAL::get()->find_all_by_condition("smslog", $filter, $binds);
$response->mobileSmsLogs = $mobileSmsLogs;
}/*}}}*/
示例3: bind
/**
* bind user
*1.检查 用户存在?用户绑定其它对象?
*2.绑定流程
* 1)查space表中是否已经有该用户数据
* 2)有且数据相符 匹配 激活, 不符 报错
* 3)没有 插入
* 4)如果是医生更新user表的省市区为医院的
* 5)由host type 更新医生或医院科室表
*
* 参数要求, $data中必须包含 fld_UserId, fld_SpaceHostType, fld_SpaceHostId
* 可选参数 fld_SpaceRegisterSource
*/
public function bind($request, $response)
{
$data = $request->data;
$data['spaceHostId'] = $request->spaceHostId;
$data['spaceHostName'] = $request->spaceHostName;
$data['spaceHostType'] = $request->spaceHostType;
$options = array();
$options['registerSource'] = isset($data['spaceRegisterSource']) ? $data['spaceRegisterSource'] : '';
$user = DAL::get()->find('user', $data['userId']);
$valueUserMobile = UserClient::getInstance()->getSpaceByUserMobile($user->mobile, $user->id);
$options = array('userId' => $data['userId'], 'userName' => $data['userName'], 'spaceRegisterSource' => $data['spaceRegisterSource'], 'bindType' => $data['bindType'], 'operate' => 'bind');
if (isset($user->mobile) && false == XString::isMobile($user->mobile)) {
$msg = "手机号码格式错误";
} else {
if (isset($user->mobile) && false == XString::isMobile($user->mobile)) {
$msg = "您填写的手机号码不合要求,请修改后重新提交";
} else {
if (isset($user->mobile) && $valueUserMobile) {
$msg = "此手机号码已经绑定了注册医生,请重新确定手机号";
} else {
$res = SpaceClient::getInstance()->bind($data['userId'], $data['spaceHostId'], $data['spaceHostType'], $options);
//cleancache
$space = DAL::get()->find('space', $data['userId']);
$urls = $this->getSpaceCacheUrls($space);
Squid::clean($urls, true);
if ($res) {
$msg = "操作成功!";
$options = array();
$options = array('userId' => $data['userId'], 'userName' => $data['userName'], 'spaceRegisterSource' => $data['spaceRegisterSource'], 'hostName' => $data['spaceHostName'], 'hostType' => $data['spaceHostType'], 'spaceHostName' => $data['spaceHostName'], 'bindType' => $data['bindType'], 'msg' => $msg);
}
}
}
}
$options['msg'] = $msg;
$url = $response->router->urlfor('space/showopenspace', $options);
$response->setRedirect($url);
}
示例4: update
public function update($request, $response)
{
$id = $request->id;
//被修改的userid
$userInfo = $request->data;
//被修改的userid
//获取当前操作用户id
$user = UserClient::getInstance()->getCurrentUser();
$userInfo['modiferid'] = $user->id;
$updateUser = DAL::get()->find('user', $id);
$valueUserMobile = isset($userInfo['mobile']) ? UserClient::getInstance()->getSpaceByUserMobile($userInfo['mobile'], $id) : '';
if (isset($userInfo['mobile']) && $userInfo['mobile'] && false == XString::isMobile($userInfo['mobile'])) {
$msg = "您填写的手机号码不合要求,请修改后重新提交";
} else {
if ($updateUser->hasConfirmedSpace() && $updateUser->space->isDoctor() && isset($userInfo['mobile']) && $valueUserMobile) {
$msg = "此手机号码已经绑定了注册医生,请重新确定手机号";
} else {
if ($updateUser->hasSpace() && $userInfo['realName']) {
//自动更新space上冗余的spacehostname
SpaceClient::getInstance()->setProperties($id, array('name' => $userInfo['realName']));
}
$userId = UserClient::getInstance()->modifyInfoNew($id, $userInfo);
if ($userId) {
$msg = "操作成功了 ";
} else {
$msg = "操作失败了 ";
}
}
}
if (DoctorComment::hasRightToUpdateUserContent($this->inspector->id)) {
//获取被操作的用户
$operationedUser = DAL::get()->find('User', $request->id);
$logId = S3LogClient::getInstance()->add($this->inspector, $operationedUser->getLogable()->action(UserLog::ACTION_ADMIN_CONTENT, $request->adminContent));
}
$url = $response->router->urlfor('user/showuserdetail', array('id' => $id, 'msg' => $msg));
$response->setRedirect($url);
}
示例5:
<span style="padding-left:5px; cursor:pointer"><img title="呼叫" rel="<?php
echo XString::hiddenTelNumber($phoneNumber);
?>
" value="<?php
echo $phoneNumber;
?>
" class="callUser" src="http://i1.hdfimg.com/callcenter/images/icon01.png"></span>
<span style="padding-left:5px; cursor:pointer"><img title="历史会话" rel="<?php
echo XString::hiddenTelNumber($phoneNumber);
?>
" value="<?php
echo $phoneNumber;
?>
" class="historyConversationListByPhoneNumber cp" src="http://i1.hdfimg.com/callcenter/images/iconHideoffline01-01.png"></span>
<?php
if (XString::isMobile($phoneNumber)) {
?>
<span style="padding-left:5px; cursor:pointer"><img title="短信" rel="<?php
echo XString::hiddenTelNumber($phoneNumber);
?>
" value="<?php
echo $phoneNumber;
?>
" class="sendSMS " src="http://i1.hdfimg.com/callcenter/images/buttonMessage01-01.png"></span>
<?php
}
?>
</li>
<?php
}
}
示例6: validateSaveTasktemplate4Common
private function validateSaveTasktemplate4Common($request, array &$validateInfo)
{
/*{{{*/
if (false == TaskTemplate::scriptPathIsRight(trim($request->scriptpath))) {
$validateInfo['error'][] = '路径输入不正确';
}
if (trim($request->title) == '') {
$validateInfo['error'][] = 'title不可为空';
}
if (false == file_exists(trim($request->scriptpath))) {
$validateInfo['warning'][] = '你输入的脚本路径在现有代码中不存在';
}
if (trim($request->scriptauthoremail) == '') {
$validateInfo['error'][] = '脚本作者email不能为空';
} else {
if (false == XString::isEmail(trim($request->scriptauthoremail))) {
$validateInfo['error'][] = '脚本作者email格式不正确';
}
}
if (trim($request->scriptauthorleaderemail) == '') {
$validateInfo['error'][] = '团队Leader email不能为空';
} else {
if (false == XString::isEmail(trim($request->scriptauthorleaderemail))) {
$validateInfo['error'][] = '团队leader email格式不正确';
}
}
if (trim($request->scriptauthormobile) == '') {
$validateInfo['error'][] = '作者电话不可为空';
} else {
if (false == XString::isMobile($request->scriptauthormobile)) {
$validateInfo['error'][] = '您输入的11位作者手机号码格式不正确';
}
}
if (trim($request->scriptauthorleadermobile) == '') {
$validateInfo['error'][] = '团队leader电话不可为空';
} else {
if (false == XString::isMobile($request->scriptauthorleadermobile)) {
$validateInfo['error'][] = '您输入的11位团队leader手机号码格式不正确';
}
}
if (false == CronConfigMgr::cronConfigIsRight(CronConfigMgr::getCronConfigUseSSH())) {
$validateInfo['error'][] = '机器上的cron配置格式有问题';
}
}
示例7: doctorReceiveRemindSmsPost
public function doctorReceiveRemindSmsPost($request, $response)
{
/*{{{*/
DBC::requireTrue($this->space->user->verifyToken($request->token), '验证码错误');
$remindSms = $request->remindSms;
$mobile = trim($request->mobile);
if ($mobile && $remindSms == 1) {
DBC::requireTrue(XString::isMobile($mobile), '您填写的手机号码不合要求,请修改后重新提交');
$valueUserMobile = UserClient::getInstance()->getSpaceByUserMobile($mobile, $this->user->id);
DBC::requireTrue(false == $valueUserMobile, '此手机号码已经绑定了注册医生,请重新确定手机号');
UserClient::getInstance()->setMobile($this->space->id, $mobile, $this->user->id);
SpaceClient::getInstance()->setProperties($this->space->id, array('receiveLoginRemindSms' => $remindSms));
$this->message('信息修改成功', $response);
} else {
if ($remindSms == 0) {
SpaceClient::getInstance()->setProperties($this->space->id, array('receiveLoginRemindSms' => $remindSms));
$this->message('信息修改成功', $response);
} else {
DBC::requireTrue(XString::isMobile($mobile), '您填写的手机号码不合要求,请修改后重新提交');
}
}
}
示例8: smsSendExecute
public function smsSendExecute($request, $response)
{/*{{{*/
$phoneNos = $request->smsPhone;
$identity = $request->identity;
$smscontent = $request->getUnSafeData('smscontent');//转码后有的字符会被运营商屏蔽
$order = DAL::get()->find('telorder', $request->orderId);
if(false == empty($smscontent) && false == empty($phoneNos))
{
$taskId = $request->taskId;
foreach($phoneNos as $tel)
{
if(false == empty($tel) && XString::isMobile($tel))
{
//sendAsync sendSMS
if($identity == 'doctor')
{
SMSClient::getInstance()->sendSMS(array($tel), $smscontent, SMSLog::OPT_TYPE_TEL_ZIXUN, '', SMSMD::EXT_6);
$logContent = '给医生发送短信,号码:'.$tel.'短信内容:'.$smscontent;
TelOrderClient::getInstance()->createTelorderLog($order, $this->curUser, TelOrderLog::TYPE_DOCTOR_SMS_SEND, TelOrderLog::LOG_LEVEL_IMPORTANT, $logContent);
$type = TelOrderRemark::TYPE_MAKETIME_DOCTOR;
TelOrderRemarkClient::getInstance()->createOrderRemark($this->curUser, $order->getExecuterBySpace()->id, $taskId, $type, $smscontent, 0, $order->id);
}
else if($identity == 'patient')
{
SMSClient::getInstance()->sendAsync(array($tel), $smscontent, SMSLog::OPT_TYPE_TEL_ZIXUN);
$logContent = '给患者发送短信,号码:'.$tel.'短信内容:'.$smscontent;
TelOrderClient::getInstance()->createTelorderLog($order, $this->curUser, TelOrderLog::TYPE_DOCTOR_SMS_SEND, TelOrderLog::LOG_LEVEL_IMPORTANT, $logContent);
$type = TelOrderRemark::TYPE_SENDMESSAGE_PATIENT;
TelOrderRemarkClient::getInstance()->createOrderRemark($this->curUser, $order->getExecuterBySpace()->id, $taskId, $type, $smscontent, $order->patient->id, $order->id);
}
}
}
}
$response->setRedirect($request->url);
}/*}}}*/
示例9: showPatient
public function showPatient($request, $response)
{
/*{{{*/
$showPhoneNumber = $request->showPhoneNumber;
$phoneNumber = $request->phoneNumber;
if (false == is_numeric($phoneNumber)) {
$phoneNumber = Codec::getInstance()->decodeId($phoneNumber);
}
$mobileNumberArea = "";
$mobileNumberAreaArray = array();
if (XString::isMobile($phoneNumber)) {
$mobileNumber = substr($phoneNumber, 0, 7);
$mobileArea = DAL::get()->find_by_mobilenumber("MobileNumberArea", $mobileNumber);
if (false == $mobileArea->isNull()) {
$mobileNumberArea = $mobileArea->mobileArea;
$mobileNumberAreaArray = explode(" ", $mobileNumberArea);
}
}
$response->mobileNumberAreaArray = $mobileNumberAreaArray;
$response->phoneNumber = $phoneNumber;
$response->showPhoneNumber = $showPhoneNumber;
$response->relationList = Patient::relationDef();
$response->userId = $request->userId;
}
示例10: sendMessageByUserId
private function sendMessageByUserId($request, $response, $phoneNumber, $mobiles, $smsContent, $ext)
{
/*{{{*/
$userIds = strpos($phoneNumber, ',') !== false ? explode(',', $phoneNumber) : array($phoneNumber);
$users = DAL::get()->find('User', $userIds);
foreach ($userIds as $userId) {
if (is_numeric($userId) == false) {
$errorUserIds[] = $userId;
}
}
foreach ($users as $key => $user) {
if ($user->isNull()) {
$errorUserIds[] = $key;
continue;
}
if (XString::isMobile($user->mobile)) {
$mobiles[] = $user->mobile;
} else {
$errorUserIds[] = $user->id;
}
}
$msg = "短信已提交发送";
if (empty($errorUserIds) == false) {
$msg = "短信已提交发送, 其中有问题的userid: " . implode(', ', $errorUserIds);
}
if (empty($mobiles) == false && empty($smsContent) == false) {
SMSClient::getInstance()->sendSMSByManual($mobiles, $smsContent, $ext);
}
$url = $response->router->urlfor('message/showsendmessage', array('msg' => $msg));
$response->setRedirect($url);
}
示例11: print
if ($name)
{
$user = UserClient::getInstance()->getByUserName($name);
if ($user->isNull() == false) {
print("checkresult('该用户已经存在, 请选择其他名字', 'username');");
} elseif (User::isUserNameValid($name) == false) {
print("checkresult('该用户名不允许注册', 'username');");
} else {
print("checkresult('', 'username');");
}
}
else if ($mobile)
{
$err = "";
if(false == XString::isMobile($mobile))
$err = "您填写的手机号码不合要求,请修改后重新提交";
else
{
$valueUserMobile = UserClient::getInstance()->getSpaceByUserMobile($mobile);
if($valueUserMobile)
$err = "此手机号码已经绑定了注册医生,请重新确定手机号";
}
if ($err) {
print("checkresult('{$err}', 'mobile');");
}
}
?>
</script>
示例12: _checkUserInfos
private function _checkUserInfos($infos)
{/*{{{*/
if (count($infos) != count(array_filter($infos)))
return 141;
if (isset($infos['name']))
{
$utf8name = mb_convert_encoding($infos['name'], 'utf8', 'gbk');
if (empty($utf8name) || !preg_match("/^[\x{4e00}-\x{9fa5}A-Za-z0-9_]+$/u", $utf8name))
return 102;
else if (strlen($infos['name']) < 4 || strlen($infos['name']) > 16)
return 103;
}
if (isset($infos['password']) && (empty($infos['password']) || !preg_match("/^[0-9a-zA-Z]{4,16}$/", $infos['password'])))
return 108;
else if (isset($infos['email']) && (empty($infos['email']) || !preg_match("/^[_0-9a-zA-Z.]+@[_0-9a-zA-Z]+\..+$/i", $infos['email'])))
return 109;
else if (isset($infos['mobile']) && (empty($infos['mobile']) || false == XString::isMobile($infos['mobile'])))
return 110;
else if (isset($infos['isReceiveReply']) && (false == is_numeric($infos['isReceiveReply']) || false == in_array($infos['isReceiveReply'], array(User::RECIEVE_REPLY_YES, User::RECIEVE_REPLY_NO))))
return 111;
return 0;
}/*}}}*/
示例13: getUserListByMobileAndPwd
public function getUserListByMobileAndPwd($mobile, $pwd)
{/*{{{*/
$userInfos = array();
if (false == XString::isMobile($mobile))
{
$user = DAL::get()->find_by_name('user', $mobile, true);
if ($user->isNull() || !$user->validatePassword($pwd))
{
$this->setErrorCode(122);
return 0;
}
$userInfos[] = array("userName" => $user->name, "userId" => $user->id);
}
else
{
$users = DAL::get()->find_all_by_mobile('user', $mobile);
$user = DAL::get()->find_by_name('user', $mobile, true);
if (false == $user->isNull()) $users[$user->id] = $user;
if (0 == count($users))
{
$this->setErrorCode(122);
return 0;
}
foreach ($users as $user)
{
if ($user->validatePassword($pwd)) $userInfos[] = array("userName" => $user->name, "userId" => $user->id);
}
if (0 == count($userInfos))
{
$this->setErrorCode(122);
return 0;
}
}
$this->content = $userInfos;
}/*}}}*/
示例14:
?>
"
value="<?php
echo $conversation->customerPhoneNumber;
?>
" class="iframeCallUser cp" src="http://i1.hdfimg.com/callcenter/images/icon01.png">
<img title="历史会话" rel="<?php
echo XString::hiddenTelNumber($conversation->customerPhoneNumber);
?>
"
value="<?php
echo $conversation->id;
?>
" class="iframeRecoverCallUser cp" src="http://i1.hdfimg.com/callcenter/images/iconHideoffline01-01.png">
<?php
if (XString::isMobile($conversation->customerPhoneNumber)) {
?>
<img title="短信" rel="<?php
echo XString::hiddenTelNumber($conversation->customerPhoneNumber);
?>
"
value="<?php
echo $conversation->customerPhoneNumber;
?>
" class="iframeSendSms cp"
src="http://i1.hdfimg.com/callcenter/images/buttonMessage01-01.png">
<?php
}
?>
</span>
</td>
示例15: if
<input type="hidden" name="identity" value="<?=$identity?>">
<input type="hidden" name="taskId" value="<?=$taskId?>">
<div id="sms_box" >
<table width="600" height="280" cellpadding="5" cellspacing="0" border="0">
<tr height="20">
<td align="left"></td>
<td align="right"></td>
</tr>
<tr height="30">
<td width="15%" class="sunright"><span ><?php if($identity == 'doctor') {?>医生<?php }else{?>患者<?php }?>号码:</span></td>
<td width="85%">
<?php
$i = 1;
foreach($phoneNos as $phoneNo)
{
if(false == empty($phoneNo) && XString::isMobile($phoneNo))
{
?>
<input name="smsPhone[]" <?php if(1==$i){?>checked="checked"<?php }?> id="smsPhone_<?=$phoneNo?>" class="phoneNo" type="checkbox" value="<?=$phoneNo?>" onclick="$(this).addClass('phoneNoSelected')"> <span class='mr10'><?=$phoneNo?></span>
<?php
}
else
{
echo "<span class='mr10 gray'>$phoneNo</span>";
}
$i++;
}
?>
</td>
</tr>
<tr height="30">