本文整理汇总了PHP中utils::formatPhoneNumber方法的典型用法代码示例。如果您正苦于以下问题:PHP utils::formatPhoneNumber方法的具体用法?PHP utils::formatPhoneNumber怎么用?PHP utils::formatPhoneNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils
的用法示例。
在下文中一共展示了utils::formatPhoneNumber方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formatPhoneNumber
protected function formatPhoneNumber()
{
if (!empty($this->oInput['originator'])) {
$this->phone_number = utils::formatPhoneNumber($this->oInput['originator']);
$this->send['destinations'] = $this->phone_number;
}
}
示例2: logValidationErrors
public function logValidationErrors($send, $errors)
{
$error = utils::captureString($errors);
$sql = "INSERT INTO log_validation_errors (destinations, error, datetime, ip) VALUES ('{$send['destinations']}', '{$error}', NOW() ,INET_ATON('{$this->ip}') ) \n";
mysql::i()->query($sql);
$send['destinations'] = utils::formatPhoneNumber($send['originator']);
$send['body'] = 'There was an error. Please check and try again or call ' . config::get('lost_bag_number');
utils::recursiveCall('sendSMS', $send, 1);
}
示例3: sendSMStoCustomer
private function sendSMStoCustomer($row, $message, $expirydate = '')
{
$tag_type = strtolower(trim($row['tag_type']));
debug::output("SMS: {$row['telephone']}, {$row['tag_type']}");
//$clientMessageReference = $thos->log->logSMS('sendSMS', $telephone);
$send['destinations'] = utils::formatPhoneNumber($row['telephone']);
switch ($message) {
case "INACTIVE":
switch ($tag_type) {
case "paper":
$send['body'] = "Tag {$row['tag_no']} has expired. Text PIN RENEW {$row['tag_no']} to renew for 3 months, or text PIN CANCEL {$row['tag_no']}. Text cost £1.50";
break;
case "plastic":
$send['body'] = "Tag {$row['tag_no']} has expired. Text PIN RENEW {$row['tag_no']} to renew for 12 months, or text PIN CANCEL {$row['tag_no']}. Text cost £3.00";
//$send['body'] = 'Text YES to renew for 12 months, text cost £tbc, text NO to cancel';
break;
default:
}
break;
case "DURATION":
switch ($tag_type) {
case "paper":
$send['body'] = "Tag {$row['tag_no']} will expire on {$expirydate}. Text PIN RENEW {$row['tag_no']} to renew for 3 months, or text PIN CANCEL {$row['tag_no']}. Text cost £1.50";
//$send['body'] = 'Text YES to renew for 3 months, text cost £1.50, text NO to cancel';
break;
case "plastic":
$send['body'] = "Tag {$row['tag_no']} will expire on {$expirydate}. Text PIN RENEW {$row['tag_no']} to renew for 12 months, or text PIN CANCEL {$row['tag_no']}. Text cost £3.00";
//$send['body'] = 'Text YES to renew for 12 months, text cost £tbc, text NO to cancel';
break;
default:
}
break;
default:
}
utils::recursiveCall('sendSMS', $send, 1, $live);
}
示例4: __construct
//.........这里部分代码省略.........
$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
debug::output("{$tag} has no registered email address ");
//is the account 'active'?
if ($this->checkTagNoStatus($tag) == 'ACTIVE') {
debug::output("{$tag} active\n");
//Owner receives SMS to say a report is waiting for you, please text YES to receive the details, text costs £1.50 or NO to cancel
$this->send['destinations'] = utils::formatPhoneNumber($this->customer_details['telephone']);
$this->logCheckLostBagTagInboxNotified($tag, $iata, $world_tracer_ref, true, 'sms', $this->send['destinations']);
$this->send['body'] = 'Lost bag report available for tag ' . $tag . '. For details text PIN REPORT. Text costs £1.50 each plus standard network rate. Text PIN STOP to cancel.';
parent::sendSMS();
} else {
debug::output("{$tag} inactive\n");
//not active
/*user recieves text to say account not active please contact
* directly on [telephone number] potentially we automate this and
* have them go online to pay the fee before receiving the info -
* your thoughts would be helpful*/
$this->send['destinations'] = utils::formatPhoneNumber($this->customer_details['telephone']);
$this->send['body'] = 'Lost bag report available for EXPIRED tag ' . $tag . '. Please contact customer services on ' . config::get('lost_bag_number') . ' Text PIN STOP to cancel.';
parent::sendSMS();
$this->logCheckLostBagTagInboxNotified($tag, $iata, $world_tracer_ref, true, 'sms', $this->send['destinations']);
}
//else
}
//else not registered
} else {
debug::output("{$tag} not registered to customer in database");
if (!$old_lost_tags_invalid[$tag]) {
$this->logDB->logCheckLostBagInvalidTag($tag);
//only log the tag once
}
}
} else {
debug::output("{$tag} invalid format\n");
$this->logDB->logCheckLostBagInvalidTag($tag, $old_lost_tags_invalid);
}
unset($this->send);
}
//for each message
} else {
debug::output("No messages in Inbox\n");
}
//empty
imap::i()->close();
}
示例5: checkSuppressionList
private function checkSuppressionList($originator)
{
$originator = utils::formatPhoneNumber($originator);
$sql = "SELECT * FROM log_sms_suppression_list WHERE originator='{$originator}' \n";
$q = mysql::i()->query($sql);
$rows = mysql::i()->num_rows($q);
if ($rows > 1) {
return true;
} else {
return false;
}
}
示例6: chdir
<?php
chdir('../');
include_once 'init.inc.php';
$lock = 'nolock';
config::set('process_name', "Inbox - Register Email Address Reminder");
include_once 'start.inc.php';
try {
$sql = "SELECT * FROM customer WHERE email='' AND approved=1 AND telephone<>'' AND username<>'' \n";
$q = mysql::i()->query($sql);
while ($r = mysql::i()->fetch_array($q)) {
$send['destinations'] = utils::formatPhoneNumber($r['telephone']);
$send['body'] = "Account {$r['username']} does not have a valid email address to recieve lost bag reports. Please log on to example.com to update your details. Text PIN STOP to cancel";
utils::recursiveCall('sendSMS', $send, 1);
}
} catch (emailException $e) {
debug::output($e->getMessage());
} catch (Exception $e) {
debug::output($e->getMessage());
//$status->status(CRITICAL);
}
include 'end.inc.php';