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


PHP sms::checkTagFormat方法代码示例

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


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

示例1: inputValidation

 private function inputValidation($tag)
 {
     $okay = true;
     /*
      * Order of validation. Order done to reduce database calls. Check formatting is correct. Then check if activated next. 
      * This cuts out 2 other DB checks as it must be in the group table if activated. 
      * Same reason to check group table next, then if logged.
      */
     /*
      * Make sure tag is in the correct format
      */
     $okay = parent::checkTagFormat($tag);
     if ($okay == false) {
         debug::output("Invalid: " . $this->errors[$tag]);
         return false;
     }
     debug::output("Validated: Tag ({$tag}) is correctly formatted.");
     /*
      * Make sure tag not already activated
      */
     $okay = $this->checkTagAlreadyActivated($tag);
     if ($okay == false) {
         debug::output("Invalid: " . $this->errors[$tag]);
         return false;
     }
     debug::output("Validated: Tag ({$tag}) not already activated.");
     /*
      *
      * Do we want to do this check? Better that the user gets a standard registration msg and continues as if it's the first time it's been registered. 
      * If logged by another user we should inform the current user that this tag is already in use
      *
      * Make sure tag not already registered to another user
      */
     $okay = $this->checkTagAlreadyLogged($tag);
     if ($okay == false) {
         debug::output("Invalid: " . $this->errors[$tag]);
         return false;
     }
     debug::output("Validated: Tag ({$tag}) not already registered.");
     /*
      * Make sure tag exists in database
      */
     $okay = $this->checkTagValidityDatabase($tag);
     if ($okay == false) {
         debug::output("Invalid: " . $this->errors[$tag]);
         return false;
     }
     debug::output("Validated: Tag ({$tag}) exists in database.");
     return true;
 }
开发者ID:Git-Host,项目名称:sms,代码行数:50,代码来源:register.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, $live)
 {
     parent::__construct($input, $live);
     $sql = "TRUNCATE log_check_lost_bag_inbox_notified";
     mysql::i()->query($sql);
     $host = config::get('sita_imap_host');
     $email_address = config::get('sita_imap_email_address');
     $password = config::get('sita_imap_password');
     $connection = $host . '~' . $email_address . '~' . $password;
     imap::i($connection);
     $mc = imap::i()->check();
     $result = imap::i()->fetch_overview("1:{$mc->Nmsgs}");
     if (!empty($result)) {
         $this->old_lost_tags_notified = $this->getPreviousSITAEmailsNotified();
         $old_lost_tags_invalid = $this->getPreviousSITAEmailsInvalid();
         foreach ($result as $overview) {
             $message_body = imap::i()->fetch_body($overview->msgno);
             $message_body = utils::removeMultiSpaces($message_body);
             list($prefix, $tag, $iata, $world_tracer_ref) = explode(' ', $message_body);
             if (empty($tag)) {
                 debug::output("No tag!\n");
                 continue;
             }
             //skip any tags already handled
             if ($this->old_lost_tags_notified[$tag]) {
                 debug::output("{$tag} owner previously notified\n");
                 continue;
             }
             debug::output("Checking tag format for tag {$tag}...");
             if (parent::checkTagFormat($tag) == true) {
                 debug::output("{$tag} valid format");
                 //do one query to establish if tag exists in database and is associated with a customer
                 $tag_registered = $this->getCustomer($tag);
                 //check that the tag is registered
                 if ($tag_registered == true) {
                     //Check has user got a registered email address ?
                     if (!empty($this->customer_details['email'])) {
                         //is the account 'active'?
                         if ($this->customer_details['status'] == 'ACTIVE') {
                             debug::output("Tag Active. Notify user by email.");
                             $lostBag = utils::getAirportbyIATA($iata);
                             //Owner recieves email containing the report
                             //****This mail function is for mailing ACTIVE Tag holder email****//
                             $mail = new Mail();
                             $mail->protocol = config::get('config_mail_protocol');
                             $mail->parameter = config::get('config_mail_parameter');
                             $mail->hostname = config::get('config_smtp_host');
                             $mail->username = config::get('config_smtp_username');
                             $mail->password = config::get('config_smtp_password');
                             $mail->port = config::get('config_smtp_port');
                             $mail->timeout = config::get('config_smtp_timeout');
                             $mail->setTo($this->customer_details['email']);
                             $mail->setFrom('');
                             $mail->setSender('');
                             $mail->setSubject(html_entity_decode(sprintf('Lost Bag Report')));
                             $report_foundbag_emailtext = "Dear " . $this->customer_details['firstname'] . " <br />  \n\nA lost bag report has been completed and your tag number has been reported.<br /><br />\n\nDetails of the find<br />\n<b>Tag Number: OC </b>" . $this->customer_details['tag_no'] . "<br />\n<b>Name of Finder:</b>" . " " . $this->customer_details['firstname'] . " " . $this->customer_details['lastname'] . "<br />\n<b>Email Address of Finder:</b>" . " " . $this->customer_details['email'] . "<br />\n<b>Telephone Number of Finder:</b>" . " " . $this->customer_details['telephone'] . "<br />\n<b>Mobile Number:</b>" . " " . $this->customer_details['mobile'] . "<br />\n<b>Post Code:</b>" . " " . $this->customer_details['postcode'] . "<br />\n<b>Location of Bag:</b> {$lostBag['airport']}, {$lostBag['place']}, {$lostBag['state']}, {$lostBag['country']}<br /><br />\n\nSincerely</n>\nLost Baggage Team";
                             $mail->setText(strip_tags($report_foundbag_emailtext));
                             //                        echo "<pre>";
                             //                        print_r($mail);
                             //                        die;
                             $mail->send();
                             // End mail for ACTIVE TagNo
                             $this->logCheckLostBagTagInboxNotified($tag, $iata, $world_tracer_ref, true, 'email', $this->customer_details['email']);
                             $this->logDB->logCheckLostBagEmail($this->customer_details['customer_id'], strip_tags($report_foundbag_emailtext), $this->customer_details['email'], $status, $tag);
                         } else {
                             //not active
                             debug::output("{$tag} inactive. Notify user by email.");
                             /* Owner recieves an email to ask them to contact  
                              * who will provide them with the information once they 
                              * have paid a fee. 
                              * (Would like to automate this so email is kept in 
                              * user's acocunt until they have paid a premium of 
                              * £15.00 then they can view the report)*/
                             //****This mail function is for mailing ACTIVE Tag holder email****//
                             $mail = new Mail();
                             $mail->protocol = config::get('config_mail_protocol');
                             $mail->parameter = config::get('config_mail_parameter');
                             $mail->hostname = config::get('config_smtp_host');
                             $mail->username = config::get('config_smtp_username');
                             $mail->password = config::get('config_smtp_password');
                             $mail->port = config::get('config_smtp_port');
                             $mail->timeout = config::get('config_smtp_timeout');
                             $mail->setTo($this->customer_details['email']);
                             $mail->setFrom('');
                             $mail->setSender('');
                             $mail->setSubject(html_entity_decode(sprintf('Lost Bag Report')));
                             //print_r($this->customer_details);
                             $report_foundbag_emailtext = "Dear " . $this->customer_details['firstname'] . " <br />  \nA lost bag report has been completed and your tag number has been reported.<br /><br />                            \nBut we are sorry, your tag is not ACTIVE please call " . config::get('lost_bag_number') . " to reactivate your tag.<br /><br />\n\nSincerely</n>\nLost Baggage Team";
                             $mail->setText(strip_tags($report_foundbag_emailtext));
                             //                        echo "<pre>";
                             //                        print_r($mail);
                             //                        die;
                             $mail->send();
                             // End mail for ACTIVE TagNo
                             $this->logCheckLostBagTagInboxNotified($tag, $iata, $world_tracer_ref, true, 'email', $this->customer_details['email']);
                             $this->logDB->logCheckLostBagEmail($this->customer_details['customer_id'], strip_tags($report_foundbag_emailtext), $this->customer_details['email'], $status, $tag);
                         }
                         //else
                     } else {
                         //not registered
//.........这里部分代码省略.........
开发者ID:Git-Host,项目名称:sms,代码行数:101,代码来源:checkLostBagEmail.class.php

示例4: inputValidation

 private function inputValidation($tag)
 {
     $okay = true;
     /*
      * Order of validation. Order done to reduce database calls. Check formatting is correct. Then check if activated next. 
      * This cuts out 2 other DB checks as it must be in the group table if activated. 
      * Same reason to check group table next, then if logged.
      */
     /*
      * Make sure tag is in the correct format
      */
     $okay = parent::checkTagFormat($tag);
     if ($okay == false) {
         debug::output("Invalid: " . $this->errors[$tag]);
         return false;
     }
     debug::output("Validated: Tag ({$tag}) is correctly formatted.");
     /*
      * Make sure tag exists in database (do we need to do this check?)
      */
     $okay = $this->checkTagValidityDatabase($tag);
     if ($okay == false) {
         debug::output("Invalid: " . $this->errors[$tag]);
         return false;
     }
     debug::output("Validated: Tag ({$tag}) exists in database.");
     /*
      * Make sure tag exists in database
      */
     $okay = $this->checkDueForRenew($tag);
     if ($okay == false) {
         debug::output("Invalid: " . $this->errors[$tag]);
         return false;
     }
     debug::output("Validated: Tag ({$tag}) is due for renewal.");
     return true;
 }
开发者ID:Git-Host,项目名称:sms,代码行数:37,代码来源:renew.class.php


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