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


PHP sms::checkHasContents方法代碼示例

本文整理匯總了PHP中sms::checkHasContents方法的典型用法代碼示例。如果您正苦於以下問題:PHP sms::checkHasContents方法的具體用法?PHP sms::checkHasContents怎麽用?PHP sms::checkHasContents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sms的用法示例。


在下文中一共展示了sms::checkHasContents方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct($input)
 {
     parent::__construct($input);
     if (parent::checkHasContents($this->fInput['body']) == true) {
         parent::getTags();
         foreach ($this->tags as $tag => $group) {
             debug::output("\n\nChecking tag... {$tag} ...\n\n");
             $okay = $this->inputValidation($tag);
             if ($okay == false) {
                 continue;
             }
             parent::formatTagArray($tag);
         }
         //foreach tag
         if (!empty($this->errors)) {
             parent::logErrors();
             parent::sendErrors();
         }
         //if errors
         if (!empty($this->valid)) {
             foreach ($this->valid as $tag => $array) {
                 debug::output("Checking lost bag report for tag {$tag}");
                 $lostBag = $this->getLostBagLocation($tag);
                 $this->send['body'] = $this->lostBagMessage($lostBag[0], $tag);
                 parent::sendSMS();
             }
             //foreach valid tag
         }
         //if valid tags
     } else {
         //no pin number supplied
         $lostBag = $this->getLostBagLocation();
         if (is_array($lostBag)) {
             foreach ($lostBag as $key => $array) {
                 $this->send['body'] = $this->lostBagMessage($array);
                 parent::sendSMS();
             }
             //foreach lost tag
         } else {
             $this->send['body'] = 'There are no reports available for your mobile number.';
             parent::sendSMS();
         }
     }
     //else
 }
開發者ID:Git-Host,項目名稱:sms,代碼行數:45,代碼來源:report.class.php

示例2: inputValidation

 private function inputValidation($tag)
 {
     $okay = true;
     /*
      * Make sure tag is not empty
      */
     $okay = parent::checkHasContents($tag);
     if ($okay == false) {
         return false;
     }
     debug::output("Validated: Tag ({$tag}) is not empty.");
     /*
      * Make sure tag is in the correct format
      */
     $okay = parent::checkTagFormat($tag);
     if ($okay == false) {
         return false;
     }
     debug::output("Validated: Tag ({$tag}) is correctly formatted.");
     return true;
 }
開發者ID:Git-Host,項目名稱:sms,代碼行數:21,代碼來源:cancel.class.php

示例3: __construct

 public function __construct($input)
 {
     parent::__construct($input);
     /*
      * Make sure tag is not empty
      */
     if (parent::checkHasContents($this->fInput['body']) == true) {
         parent::getTags();
         foreach ($this->tags as $tag => $group) {
             debug::output("\n\nChecking tag... {$tag} ...\n\n");
             $okay = $this->inputValidation($tag);
             if ($okay == false) {
                 continue;
             }
             parent::formatTagArray($tag);
         }
         //foreach tag
         if (!empty($this->errors)) {
             parent::logErrors();
             parent::sendErrors();
         }
         //if errors
         if (!empty($this->valid)) {
             foreach ($this->valid as $tag => $array) {
                 debug::output("Registering tag {$tag}");
                 $this->logDB->logValidTags($tag, $this->phone_number);
                 if ($array['type'] == 'PAPER') {
                     $this->send['body'] = "Tag {$tag} ready to be activated text PIN ACTIVATE to proceed. Tag valid for 3 months. Text cost £{$array['cost']} each plus standard network rate. Text PIN STOP to cancel.";
                 } else {
                     //plastic
                     $this->send['body'] = "Tag {$tag} ready to be activated text PIN ACTIVATE to proceed. Tag valid for 1 year. Text cost standard network rate each. Text PIN STOP to cancel.";
                 }
                 parent::sendSMS();
             }
             //foreach valid tag
         }
         //if valid tags
     }
     //not empty
 }
開發者ID:Git-Host,項目名稱:sms,代碼行數:40,代碼來源:register.class.php

示例4: __construct

 public function __construct($input)
 {
     $input['body'] = str_ireplace('RENEW', '', $input['body']);
     parent::__construct($input);
     if (parent::checkHasContents($this->fInput['body']) == true) {
         parent::getTags();
         foreach ($this->tags as $tag) {
             debug::output("\n\nChecking tag... {$tag} ...\n\n");
             $okay = $this->inputValidation($tag);
             if ($okay == false) {
                 continue;
             }
             $this->valid[$tag]['type'] = $tag;
             parent::formatTagArray($tag);
         }
         //foreach tag
         if (!empty($this->errors)) {
             parent::logErrors();
             parent::sendErrors();
         }
         //if errors
         if (!empty($this->valid)) {
             $customer = new customer($this->logDB);
             $customer->checkAccountExists($this->phone_number);
             foreach ($this->valid as $tag => $array) {
                 debug::output("Renew tag {$tag}");
                 if ($this->updateTagRegistered($tag, $customer->customer_id)) {
                     parent::updateTagGroup($tag);
                     //paper & plastic
                     //with & w/out email address
                     //is paper going to be renewed. Confirm.
                     $cost = parent::getTagCost($array['type'], true);
                     if (empty($customer->customer['email'])) {
                         $renewed[$tag] = "{$tag} renewed.  Text cost $cost} each plus standard network rate. Go to example.com to update your email address with username {$customer->customer['username']}. Text PIN STOP to cancel";
                     } else {
                         $renewed[$tag] = "{$tag} renewed.  Text cost $cost} each plus standard network rate. Manage your account at example.com with email {$customer->customer['email']}. Text PIN STOP to cancel";
                     }
                 }
                 //tag registered
             }
             //foreach valid tag
         }
         //if valid tags
         if (!empty($this->errors)) {
             parent::logErrors();
             parent::sendErrors();
         }
         //if errors
         if (!empty($renewed)) {
             foreach ($renewed as $tag => $message) {
                 debug::output($message);
                 $this->send['body'] = $message;
                 //$array['tag_type']; use type to determine �50 or �                    $this->sendSMS();
             }
             //foreach valid
         }
         //if not empty
     } else {
         //no tag provided
     }
 }
開發者ID:Git-Host,項目名稱:sms,代碼行數:61,代碼來源:renew.class.php


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