當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XString::isMobile方法代碼示例

本文整理匯總了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;
 }/*}}}*/
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:13,代碼來源:mobilecontroller.php

示例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;
 }/*}}}*/
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:18,代碼來源:teltaskcontroller.php

示例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);
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:50,代碼來源:spacecontroller.php

示例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);
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:37,代碼來源:usercontroller.php

示例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 
    }
}
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:31,代碼來源:searchphonenumber.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配置格式有問題';
     }
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:44,代碼來源:taskmgrcontroller.php

示例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), '您填寫的手機號碼不合要求,請修改後重新提交');
         }
     }
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:22,代碼來源:adminsetupcontroller.php

示例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);
 }/*}}}*/
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:35,代碼來源:telordercontroller.php

示例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;
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:24,代碼來源:intentioncontroller.php

示例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);
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:31,代碼來源:messagecontroller.php

示例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>
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:30,代碼來源:checkuser.php

示例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;
 }/*}}}*/
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:22,代碼來源:doctordatabucket.php

示例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; 
    }/*}}}*/
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:38,代碼來源:databucket.php

示例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>
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:31,代碼來源:conversationlist.php

示例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">
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:31,代碼來源:smssend.php


注:本文中的XString::isMobile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。