当前位置: 首页>>代码示例>>PHP>>正文


PHP sms::updateTagGroup方法代码示例

本文整理汇总了PHP中sms::updateTagGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP sms::updateTagGroup方法的具体用法?PHP sms::updateTagGroup怎么用?PHP sms::updateTagGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sms的用法示例。


在下文中一共展示了sms::updateTagGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($input)
 {
     parent::__construct($input);
     if ($this->getValidTags() == false) {
         debug::output("There are no tags pending activation against this phone number: {$this->phone_number}");
         $this->send['body'] = 'There are no tags pending activation against this phone number. For support call customer services on ' . config::get('customer_services');
         parent::sendSMS();
     } else {
         foreach ($this->tags as $tag => $array) {
             debug::output("Checking tag... {$tag} ...");
             $okay = $this->tagValidation($tag);
             if ($okay == false) {
                 continue;
             }
             $this->valid[$tag] = $array;
         }
         //foreach tag
         if (!empty($this->errors)) {
             parent::logErrors();
             parent::sendErrors();
         }
         //if errors
         if (!empty($this->valid)) {
             $this->customer = new customer($this->logDB);
             debug::output("Create customer account...");
             $result = $this->customer->createCustomerAccount($this->phone_number);
             if ($result['success'] == false) {
                 debug::output($result['message']);
                 $this->errors[] = $result['message'];
             } else {
                 //iterate through each tag and register each tag
                 foreach ($this->valid as $tag => $array) {
                     debug::output("Register tag {$tag}");
                     $this->registerTag($tag);
                     parent::updateTagGroup($tag);
                     $this->logDB->unLogValidTags($tag);
                     $registerd[$tag]['message'] = 'Tag ' . $tag . ' activated successfully. ';
                     $registerd[$tag]['tag_type'] = $array['tag_type'];
                 }
                 //foreach tag
             }
             if (!empty($this->errors)) {
                 parent::sendErrors();
                 parent::logErrors();
             }
             //if errors
             /*
              * send as few sms as possible each time
              */
             if (!empty($registerd)) {
                 foreach ($registerd as $tag => $array) {
                     debug::output($message);
                     $activation_m .= $array['message'];
                     //$array['tag_type']; use type to determine premium or free sms
                 }
                 //foreach valid
                 $this->send['body'] = $activation_m . $result['message'];
                 $this->sendSMS();
             }
             //if not empty
         }
         //else
     }
     //else
 }
开发者ID:Git-Host,项目名称:sms,代码行数:65,代码来源:activate.class.php

示例2: __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::updateTagGroup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。