本文整理汇总了PHP中sms类的典型用法代码示例。如果您正苦于以下问题:PHP sms类的具体用法?PHP sms怎么用?PHP sms使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了sms类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: handle_inbox
function handle_inbox()
{
if (!$_REQUEST['msisdn']) {
return;
}
extract($_REQUEST);
$data = array('text' => $text, 'message_id' => $messageId, 'msisdn' => $msisdn, 'type' => $type, 'to' => $to, 'keyword' => $keyword, 'timestamp' => $_REQUEST['message-timestamp']);
$sms = new sms($data);
$sms->save_inbound();
header("HTTP/1.1 200 OK");
exit;
}
开发者ID:xflash8,项目名称:staff-2016,代码行数:12,代码来源:sms-inbound.card.php
示例2: index
function index()
{
$variables = ORM::factory('private_gateway')->find_all();
foreach ($variables as $variable) {
$phonenumber = $variable->phonenumber_variable;
$message = $variable->message_variable;
}
if (isset($_GET['key'])) {
$private_gateway_key = $_GET['key'];
}
if (isset($_GET[$phonenumber])) {
$message_from = $_GET[$phonenumber];
// Remove non-numeric characters from string
$message_from = preg_replace("#[^0-9]#", "", $message_from);
}
if (isset($_GET[$message])) {
$message_description = $_GET[$message];
}
if (!empty($private_gateway_key) and !empty($message_from) and !empty($message_description)) {
// Is this a valid sync Key?
$keycheck = ORM::factory('private_gateway')->where('private_gateway_key', $private_gateway_key)->find(1);
if ($keycheck->loaded == TRUE) {
sms::add($message_from, $message_description);
}
}
}
开发者ID:kamaulynder,项目名称:private_gateway,代码行数:26,代码来源:private_gateway.php
示例3: sendSms
/**
* @param string $smsGatewayName
*/
public static function sendSms($information = array())
{
$smsGatewayName = self::getSmsGateway();
$option = self::getSmsGatewayOption($smsGatewayName);
self::includeSmsGatewayClass($smsGatewayName);
return sms::sendSms($information, $option);
}
开发者ID:osw17,项目名称:oledrion,代码行数:10,代码来源:oledrion_sms.php
示例4: send
/**
* Send The SMS Message Using Default Provider
* @param to mixed The destination address.
* @param from mixed The source/sender address
* @param text mixed The text content of the message
*
* @return mixed/bool (returns TRUE if sent FALSE or other text for fail)
*/
public static function send($to = NULL, $from = NULL, $message = NULL)
{
if (!$to or !$message) {
return "Missing Recipients and/or Message";
}
// 1. Do we have an SMS Provider?
$provider = Kohana::config("settings.sms_provider");
if ($provider) {
// 2. Does the plugin exist, and if so, is it active?
$plugin = ORM::factory("plugin")->where("plugin_name", $provider)->where("plugin_active", 1)->find();
if ($plugin->loaded) {
// Plugin exists and is active
// 3. Does this plugin have the SMS Library in place?
$class = ucfirst($provider) . '_SMS';
$path = sms::find_provider($provider);
if ($path) {
// File Exists
$sender = new $class();
// 4. Does the send method exist in this class?
if (method_exists($sender, 'send')) {
$response = $sender->send($to, $from, $message);
return $response;
}
}
}
}
return "No SMS Sending Provider In System";
}
开发者ID:kjgarza,项目名称:ushahidi,代码行数:36,代码来源:sms.php
示例5: index
function index()
{
$secret = "";
if (isset($this->request['secret'])) {
$secret = $this->request['secret'];
}
if (isset($this->request['from'])) {
$message_from = $this->request['from'];
// Remove non-numeric characters from string
$message_from = preg_replace("#[^0-9]#", "", $message_from);
}
if (isset($this->request['message'])) {
$message_description = $this->request['message'];
}
if (!empty($message_from) and !empty($message_description)) {
$secret_match = TRUE;
// Is this a valid Secret?
$smssync = ORM::factory('smssync')->find(1);
if ($smssync->loaded) {
$smssync_secret = $smssync->secret;
if ($smssync_secret and $secret != $smssync_secret) {
// A Secret has been set and they don't match
$secret_match = FALSE;
}
} else {
// Can't load table
$secret_match = FALSE;
}
if ($secret_match) {
sms::add($message_from, $message_description);
}
}
}
开发者ID:kh411d,项目名称:Ushahidi_Web,代码行数:33,代码来源:smssync.php
示例6: index
function index()
{
$xmlstr = file_get_contents('php://input');
$messagein = new SimpleXMLElement($xmlstr);
$message_from = $messagein->From;
$message_to = $messagein->To;
$message_txt = $messagein->MessageText;
sms::add($message_from, "{$message_txt}");
}
开发者ID:rabbit09,项目名称:Taarifa_Web,代码行数:9,代码来源:esendex.php
示例7: index
function index()
{
$secret = "";
if (isset($this->request['secret']))
{
$secret = $this->request['secret'];
}
if (isset($this->request['from']))
{
$message_from = $this->request['from'];
// Remove non-numeric characters from string
$message_from = preg_replace("#[^0-9]#", "", $message_from);
}
if (isset($this->request['message']))
{
$message_description = $this->request['message'];
}
if ( ! empty($message_from) AND ! empty($message_description))
{
$secret_match = TRUE;
// Is this a valid Secret?
$smssync = ORM::factory('smssync_settings')
->find(1);
if ($smssync->loaded)
{
$smssync_secret = $smssync->smssync_secret;
if ($smssync_secret AND $secret != $smssync_secret)
{ // A Secret has been set and they don't match
$secret_match = FALSE;
}
}
else
{ // Can't load table
$secret_match = FALSE;
}
if ($secret_match)
{
sms::add($message_from, $message_description);
echo json_encode(array("payload" => array("success" => "true")));
}
else
{
echo json_encode(array("payload" => array("success" => "false")));
}
}
else
{
echo json_encode(array("payload" => array("success" => "false")));
}
}
开发者ID:nurous,项目名称:bushfireconnect,代码行数:56,代码来源:smssync.php
示例8: SendCode
public function SendCode()
{
$tel = I('tel');
if (preg_match("/1[3458]{1}\\d{9}\$/", $tel)) {
import('Vendor.Sms.sms');
$sms = new \sms();
$mobile_code = phone_random(0, 9);
$content = "您的验证码是:" . $mobile_code . "。请不要把验证码泄露给其他人。";
$result = $sms->sendTo($tel, $content);
$date = array('tel' => $tel, 'authcode' => $mobile_code, 'create_time' => date("Y-m-d H:i:s"));
if (2 == $result['code']) {
M('t_authcode')->add($date);
$this->ajaxReturn("1");
} else {
$this->ajaxReturn($result);
}
} else {
$this->ajaxReturn('手机号码不正确');
}
}
开发者ID:elliott-hs,项目名称:ld,代码行数:20,代码来源:IntegralController.class.php
示例9: __construct
function __construct()
{
global $prefix;
$db_connection = new dbConnection();
$this->link = $db_connection->connect();
ini_set("soap.wsdl_cache_enabled", "0");
self::$sms_client = new SoapClient('http://87.107.121.54/post/Send.asmx?wsdl', array('encoding' => 'UTF-8'));
$this->parameters['username'] = "";
$this->parameters['password'] = "";
$this->parameters['from'] = "";
return $this->link;
}
开发者ID:amirmasoud,项目名称:sms,代码行数:12,代码来源:class.sms.php
示例10: _receive
private function _receive()
{
$secret = "";
$success = "false";
//Sometimes user send blank SMSs or GSM operators will
//send promotional SMSs with no phone number, so this way
//these messages will always end up on the backend and not float around
//on the phones forever.
$message_description = Kohana::lang("ui_main.empty");
$message_from = "00000000";
$non_numeric_source = false;
if (isset($this->request['secret'])) {
$secret = $this->request['secret'];
}
if (isset($this->request['from']) && strlen($this->request['from']) > 0) {
$message_from = $this->request['from'];
$original_from = $message_from;
$message_from = preg_replace("#[^0-9]#", "", $message_from);
if (strlen($message_from) == 0) {
$message_from = "00000000";
$non_numeric_source = true;
}
}
if (isset($this->request['message']) && strlen($this->request['message']) > 0) {
$message_description = $this->request['message'];
}
if ($non_numeric_source) {
$message_description = '<div style="color:red;">' . Kohana::lang("ui_main.message_non_numeric_source") . " \"" . $original_from . "\" </div>" . $message_description;
}
if (!empty($message_from) and !empty($message_description)) {
$secret_match = TRUE;
// Is this a valid Secret?
$smssync = ORM::factory('smssync_settings')->find(1);
if ($smssync->loaded) {
$smssync_secret = $smssync->smssync_secret;
if ($smssync_secret and $secret != $smssync_secret) {
// A Secret has been set and they don't match
$secret_match = FALSE;
}
} else {
// No Secret Set
$secret_match = TRUE;
}
if ($secret_match) {
sms::add($message_from, $message_description);
$success = "true";
}
}
echo json_encode(array("payload" => array("success" => $success)));
}
开发者ID:kjgarza,项目名称:ushahidi,代码行数:50,代码来源:smssync.php
示例11: _send_mobile_alert
public static function _send_mobile_alert($post)
{
// For Mobile Alerts, Confirmation Code
$alert_mobile = $post->alert_mobile;
$alert_lon = $post->alert_lon;
$alert_lat = $post->alert_lat;
$alert_radius = $post->alert_radius;
// Should be 6 distinct characters
$alert_code = text::random('distinct', 8);
$settings = ORM::factory('settings', 1);
if (!$settings->loaded) {
return FALSE;
}
// Get SMS Numbers
if (!empty($settings->sms_no3)) {
$sms_from = $settings->sms_no3;
} elseif (!empty($settings->sms_no2)) {
$sms_from = $settings->sms_no2;
} elseif (!empty($settings->sms_no1)) {
$sms_from = $settings->sms_no1;
} else {
$sms_from = "000";
// User needs to set up an SMS number
}
$message = Kohana::lang('ui_admin.confirmation_code') . $alert_code . '.' . Kohana::lang('ui_admin.not_case_sensitive');
if (sms::send($alert_mobile, $sms_from, $message) === true) {
$alert = ORM::factory('alert');
$alert->alert_type = self::MOBILE_ALERT;
$alert->alert_recipient = $alert_mobile;
$alert->alert_code = $alert_code;
$alert->alert_lon = $alert_lon;
$alert->alert_lat = $alert_lat;
$alert->alert_radius = $alert_radius;
if (isset($_SESSION['auth_user'])) {
$alert->user_id = $_SESSION['auth_user']->id;
}
$alert->save();
self::_add_categories($alert, $post);
return TRUE;
}
return FALSE;
}
开发者ID:rabbit09,项目名称:Taarifa_Web,代码行数:42,代码来源:alert.php
示例12: inbound
/**
* Processes incoming messages
*/
public function inbound()
{
// Get the received data
$data = array_merge($_GET, $_POST);
// Verify the API key and incoming messageId parameters
if (!empty($data['key']) and !empty($data['messageId']) and Nexmo_Model::is_valid_api_key($data['key'], 'inbound_message_key')) {
// Extract fields from the submitted data
$log_data = array('message_id' => $data['messageId'], 'message_type' => 1, 'message_sender' => $data['msisdn']);
// Initialize model for updating the internal nexmo message log
$log_entry = new Nexmo_Message_Log_Model();
if ($log_entry->validate($log_data)) {
// Success, save
$log_entry->save();
}
// Add entry to the main messages list
sms::add($data['msisdn'], $data['text']);
} else {
Kohana::log('error', Kohana::lang('nexmo.invalid_url_auth_key'));
}
}
开发者ID:uws-eresearch,项目名称:invisiblecity-ushahidi,代码行数:23,代码来源:nexmo.php
示例13: index
function index()
{
if (isset($_GET['key'])) {
$frontlinesms_key = $_GET['key'];
}
if (isset($_GET['s'])) {
$message_from = $_GET['s'];
// Remove non-numeric characters from string
$message_from = preg_replace("#[^0-9]#", "", $message_from);
}
if (isset($_GET['m'])) {
$message_description = $_GET['m'];
}
if (!empty($frontlinesms_key) and !empty($message_from) and !empty($message_description)) {
// Is this a valid FrontlineSMS Key?
$keycheck = ORM::factory('frontlinesms')->where('frontlinesms_key', $frontlinesms_key)->find(1);
if ($keycheck->loaded == TRUE) {
sms::add($message_from, $message_description);
}
}
}
开发者ID:kjgarza,项目名称:ushahidi,代码行数:21,代码来源:frontlinesms.php
示例14: index
/**
* Clickatell 2 way callback handler
* @param string $key (Unique key that prevents unauthorized access)
* @return void
*/
function index($key = NULL)
{
if (isset($this->request['from'])) {
$message_from = $this->request['from'];
// Remove non-numeric characters from string
$message_from = preg_replace("#[^0-9]#", "", $message_from);
}
if (isset($this->request['to'])) {
$message_to = $this->request['to'];
// Remove non-numeric characters from string
$message_to = preg_replace("#[^0-9]#", "", $message_to);
}
if (isset($this->request['text'])) {
$message_description = $this->request['text'];
}
if (!empty($message_from) and !empty($message_description)) {
// Is this a valid Clickatell Key?
$keycheck = ORM::factory('clickatell')->where('clickatell_key', $key)->find(1);
if ($keycheck->loaded == TRUE) {
sms::add($message_from, $message_description, $message_to);
}
}
}
开发者ID:Dirichi,项目名称:Ushahidi_Web,代码行数:28,代码来源:clickatell.php
示例15: sendsms
function sendsms()
{
$type = $_POST['type'];
$amt = $_POST['amt'];
$msg = $_POST['msg'];
$when = $_POST['when'];
// get numbers
if ($type == "thai") {
$query = $this->db->query('SELECT `id`,`name`,`number` FROM `contact_numbers` WHERE `status` = "1" AND `sent` != "1" LIMIT ' . $amt . '');
}
$contacts = $query->result();
include "/home/www/xxxxxx.com/htdocs/js/sms/sms.class.php";
$result_message = 'SMS RESULTS<br />';
//print_r($contacts);
foreach ($contacts as $c) {
$username = 'xxxxxx';
$password = '528051';
//$username = 'thaibulksms';
//$password = 'thisispassword';
$ph = str_replace('+66', '0', $c->number);
$msisdn = $ph;
$message = str_replace('**NAME**', $c->name == "" ? '' : $c->name, $msg);
$message = str_replace('**Name**', $c->name == "" ? '' : $c->name, $message);
$message = str_replace('**name**', $c->name == "" ? '' : $c->name, $message);
$sender = 'xxxxxx';
//$sender = 'THAIBULKSMS';
$ScheduledDelivery = $when;
$force = 'standard';
$result = sms::send_sms($username, $password, $msisdn, $message, $sender, $ScheduledDelivery, $force);
$result_message .= 'Id: ' . $c->id . ' name: ' . $c->name . ' number: ' . $ph . ' result:' . $result . '<br /><br />';
// update number
$query = $this->db->query('UPDATE `contact_numbers` SET `sent` = 1 WHERE `id` = "' . $c->id . '"');
}
echo $result_message;
exit;
}
开发者ID:Nkelliny,项目名称:MobileDatingApp,代码行数:36,代码来源:ajax.php
示例16: define
<?php
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
require_once ROOT_PATH . 'includes/cls_sms.php';
$action = isset($_REQUEST['act']) ? $_REQUEST['act'] : 'display_my_info';
$sms = new sms();
switch ($action) {
// /* 注册短信服务。*/
// case 'register' :
// $email = isset($_POST['email']) ? $_POST['email'] : '';
// $password = isset($_POST['password']) ? $_POST['password'] : '';
// $domain = isset($_POST['domain']) ? $_POST['domain'] : '';
// $phone = isset($_POST['phone']) ? $_POST['phone'] : '';
//
// $result = $sms->register($email, $password, $domain, $phone);
//
// $link[] = array('text' => $_LANG['back'],
// 'href' => 'sms.php?act=display_my_info');
//
// if ($result === true)//注册成功
// {
// sys_msg($_LANG['register_ok'], 0, $link);
// }
// else
// {
// @$error_detail = $_LANG['server_errors'][$sms->errors['server_errors']['error_no']]
// . $_LANG['api_errors']['register'][$sms->errors['api_errors']['error_no']];
// sys_msg($_LANG['register_error'] . $error_detail, 1, $link);
// }
//
开发者ID:a494008974,项目名称:bzbshop,代码行数:31,代码来源:sms.php
示例17: local_date
$smarty->assign('order', $order);
$smarty->assign('send_time', local_date($_CFG['time_format']));
$smarty->assign('shop_name', $_CFG['shop_name']);
$smarty->assign('send_date', local_date($_CFG['date_format']));
$smarty->assign('sent_date', local_date($_CFG['date_format']));
$smarty->assign('confirm_url', $ecs->url() . 'receive.php?id=' . $order['order_id'] . '&con=' . rawurlencode($order['consignee']));
$smarty->assign('send_msg_url', $ecs->url() . 'user.php?act=message_list&order_id=' . $order['order_id']);
$content = $smarty->fetch('str:' . $tpl['template_content']);
if (!send_mail($order['consignee'], $order['email'], $tpl['template_subject'], $content, $tpl['is_html'])) {
$msg = $_LANG['send_mail_fail'];
}
}
/* 如果需要,发短信 */
if ($GLOBALS['_CFG']['sms_order_shipped'] == '1' && $order['mobile'] != '') {
include_once '../includes/cls_sms.php';
$sms = new sms();
$sms->send($order['mobile'], sprintf($GLOBALS['_LANG']['order_shipped_sms'], $order['order_sn'], local_date($GLOBALS['_LANG']['sms_time_format']), $GLOBALS['_CFG']['shop_name']), 0);
}
}
/* 清除缓存 */
clear_cache_files();
/* 操作成功 */
$links[] = array('text' => $_LANG['09_delivery_order'], 'href' => 'order.php?act=delivery_list');
$links[] = array('text' => $_LANG['delivery_sn'] . $_LANG['detail'], 'href' => 'order.php?act=delivery_info&delivery_id=' . $delivery_id);
sys_msg($_LANG['act_ok'], 0, $links);
} elseif ($_REQUEST['act'] == 'delivery_cancel_ship') {
/* 检查权限 */
admin_priv('delivery_view');
/* 取得参数 */
$delivery = '';
$order_id = intval(trim($_REQUEST['order_id']));
开发者ID:norain2050,项目名称:benhu,代码行数:31,代码来源:order.php
示例18: date
$msisdn = $_REQUEST['msisdn'];
$msg = $_REQUEST['message'];
# # # # # # # # # LOG TO FILE # # # # # # # # #
$stamp = date("Y-m-d H:i:s");
$fp = fopen("sms.log", "a+");
foreach ($_REQUEST as $k => $v) {
fputs($fp, "[" . $stamp . "]" . $k . " => " . $v . "\n");
}
fclose($fp);
echo "received";
# # # # # # # # # END LOG TO FILE # # # # # # # # #
# # # # # # # # # LOG TO DB # # # # # # # # #
global $current_user;
$current_user->retrieve(1);
require_once "custom/sms/sms.php";
$sms = new sms();
$sms->retrieve_settings();
require_once "modules/sugartalk_SMS/sugartalk_SMS.php";
$sugartalk_SMS = new sugartalk_SMS();
require_once "modules/Administration/sugartalk_smsPhone/sms_enzyme.php";
$e = new sms_enzyme();
$result = $e->parse_sms_macro($msg);
if ($result['code'] != '') {
# recreate $e and retrieve the module's id
$e = new sms_enzyme($result['module']);
include_once $e->mod_bean_files;
$object = new $e->module_sing();
$where_array = array($result['field'] => $result['code']);
$object->retrieve_by_string_fields($where_array);
$parent_id = $object->id;
$parent_type = $result['module'];
开发者ID:omusico,项目名称:sugar_work,代码行数:31,代码来源:smsReceive.php
示例19: order_paid
/**
* 修改订单的支付状态
*
* @access public
* @param string $log_id 支付编号
* @param integer $pay_status 状态
* @param string $note 备注
* @return void
*/
function order_paid($log_id, $pay_status = PS_PAYED, $note = '')
{
/* 取得支付编号 */
$log_id = intval($log_id);
if ($log_id > 0) {
/* 取得要修改的支付记录信息 */
$sql = "SELECT * FROM " . $GLOBALS['ecs']->table('pay_log') . " WHERE log_id = '{$log_id}'";
$pay_log = $GLOBALS['db']->getRow($sql);
if ($pay_log && $pay_log['is_paid'] == 0) {
/* 修改此次支付操作的状态为已付款 */
$sql = 'UPDATE ' . $GLOBALS['ecs']->table('pay_log') . " SET is_paid = '1' WHERE log_id = '{$log_id}'";
$GLOBALS['db']->query($sql);
/* 根据记录类型做相应处理 */
if ($pay_log['order_type'] == PAY_ORDER) {
/* 取得订单信息 */
$sql = 'SELECT order_id, order_sn, consignee, address, tel, shipping_id ' . 'FROM ' . $GLOBALS['ecs']->table('order_info') . " WHERE order_id = '{$pay_log['order_id']}'";
$order = $GLOBALS['db']->getRow($sql);
$order_id = $order['order_id'];
$order_sn = $order['order_sn'];
/* 修改订单状态为已付款 */
$sql = 'UPDATE ' . $GLOBALS['ecs']->table('order_info') . " SET order_status = '" . OS_CONFIRMED . "', " . " confirm_time = '" . gmtime() . "', " . " pay_status = '{$pay_status}', " . " pay_time = '" . gmtime() . "', " . " money_paid = order_amount," . " order_amount = 0 " . "WHERE order_id = '{$order_id}'";
$GLOBALS['db']->query($sql);
/* 记录订单操作记录 */
order_action($order_sn, OS_CONFIRMED, SS_UNSHIPPED, $pay_status, $note, $GLOBALS['_LANG']['buyer']);
/* 如果需要,发短信 */
if ($GLOBALS['_CFG']['sms_order_payed'] == '1' && $GLOBALS['_CFG']['sms_shop_mobile'] != '') {
include_once ROOT_PATH . 'includes/cls_sms.php';
$sms = new sms();
$sms->send($GLOBALS['_CFG']['sms_shop_mobile'], sprintf($GLOBALS['_LANG']['order_payed_sms'], $order_sn, $order['consignee'], $order['tel']), 0);
}
/* 对虚拟商品的支持 */
$virtual_goods = get_virtual_goods($order_id);
if (!empty($virtual_goods)) {
$msg = '';
if (!virtual_goods_ship($virtual_goods, $msg, $order_sn, true)) {
$GLOBALS['_LANG']['pay_success'] .= '<div style="color:red;">' . $msg . '</div>' . $GLOBALS['_LANG']['virtual_goods_ship_fail'];
}
/* 如果订单没有配送方式,自动完成发货操作 */
if ($order['shipping_id'] == -1) {
/* 将订单标识为已发货状态,并记录发货记录 */
$sql = 'UPDATE ' . $GLOBALS['ecs']->table('order_info') . " SET shipping_status = '" . SS_SHIPPED . "', shipping_time = '" . gmtime() . "'" . " WHERE order_id = '{$order_id}'";
$GLOBALS['db']->query($sql);
/* 记录订单操作记录 */
order_action($order_sn, OS_CONFIRMED, SS_SHIPPED, $pay_status, $note, $GLOBALS['_LANG']['buyer']);
}
}
} elseif ($pay_log['order_type'] == PAY_SURPLUS) {
/* 更新会员预付款的到款状态 */
$sql = 'UPDATE ' . $GLOBALS['ecs']->table('user_account') . " SET paid_time = '" . gmtime() . "', is_paid = 1" . " WHERE id = '{$pay_log['order_id']}' LIMIT 1";
$GLOBALS['db']->query($sql);
/* 取得添加预付款的用户以及金额 */
$sql = "SELECT user_id, amount FROM " . $GLOBALS['ecs']->table('user_account') . " WHERE id = '{$pay_log['order_id']}'";
$arr = $GLOBALS['db']->getRow($sql);
/* 修改会员帐户金额 */
$_LANG = array();
include_once ROOT_PATH . 'languages/' . $GLOBALS['_CFG']['lang'] . '/user.php';
log_account_change($arr['user_id'], $arr['amount'], 0, 0, 0, $_LANG['surplus_type_0'], ACT_SAVING);
}
} else {
/* 取得已发货的虚拟商品信息 */
$post_virtual_goods = get_virtual_goods($pay_log['order_id'], true);
/* 有已发货的虚拟商品 */
if (!empty($post_virtual_goods)) {
$msg = '';
/* 检查两次刷新时间有无超过12小时 */
$sql = 'SELECT pay_time, order_sn FROM ' . $GLOBALS['ecs']->table('order_info') . " WHERE order_id = '{$pay_log['order_id']}'";
$row = $GLOBALS['db']->getRow($sql);
$intval_time = gmtime() - $row['pay_time'];
if ($intval_time > 0 && $intval_time < 3600 * 12) {
$virtual_card = array();
foreach ($post_virtual_goods as $code => $goods_list) {
/* 只处理虚拟卡 */
if ($code == 'virtual_card') {
foreach ($goods_list as $goods) {
if ($info = virtual_card_result($row['order_sn'], $goods)) {
$virtual_card[] = array('goods_id' => $goods['goods_id'], 'goods_name' => $goods['goods_name'], 'info' => $info);
}
}
$GLOBALS['smarty']->assign('virtual_card', $virtual_card);
}
}
} else {
$msg = '<div>' . $GLOBALS['_LANG']['please_view_order_detail'] . '</div>';
}
$GLOBALS['_LANG']['pay_success'] .= $msg;
}
/* 取得未发货虚拟商品 */
$virtual_goods = get_virtual_goods($pay_log['order_id'], false);
if (!empty($virtual_goods)) {
$GLOBALS['_LANG']['pay_success'] .= '<br />' . $GLOBALS['_LANG']['virtual_goods_ship_fail'];
}
//.........这里部分代码省略.........
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:101,代码来源:lib_payment.php
示例20: get_mail_template
}
/* 给商家发邮件 */
/* 增加是否给客服发送邮件选项 */
if ($_CFG['send_service_email'] && $_CFG['service_email'] != '') {
$tpl = get_mail_template('remind_of_new_order');
$smarty->assign('order', $order);
$smarty->assign('goods_list', $cart_goods);
$smarty->assign('shop_name', $_CFG['shop_name']);
$smarty->assign('send_date', date($_CFG['time_format']));
$content = $smarty->fetch('str:' . $tpl['template_content']);
send_mail($_CFG['shop_name'], $_CFG['service_email'], $tpl['template_subject'], $content, $tpl['is_html']);
}
/* 如果需要,发短信 */
if ($_CFG['sms_order_placed'] == '1' && $_CFG['sms_shop_mobile'] != '') {
include_once 'includes/cls_sms.php';
$sms = new sms();
$msg = $order['pay_status'] == PS_UNPAYED ? $_LANG['order_placed_sms'] : $_LANG['order_placed_sms'] . '[' . $_LANG['sms_paid'] . ']';
$sms->send($_CFG['sms_shop_mobile'], sprintf($msg, $order['consignee'], $order['tel']), 0);
}
/* 如果订单金额为0 处理虚拟卡 */
if ($order['order_amount'] <= 0) {
$sql = "SELECT goods_id, goods_name, goods_number AS num FROM " . $GLOBALS['ecs']->table('cart') . " WHERE is_real = 0 AND extension_code = 'virtual_card'" . " AND session_id = '" . SESS_ID . "' AND rec_type = '{$flow_type}'";
$res = $GLOBALS['db']->getAll($sql);
$virtual_goods = array();
foreach ($res as $row) {
$virtual_goods['virtual_card'][] = array('goods_id' => $row['goods_id'], 'goods_name' => $row['goods_name'], 'num' => $row['num']);
}
if ($virtual_goods and $flow_type != CART_GROUP_BUY_GOODS) {
/* 虚拟卡发货 */
if (virtual_goods_ship($virtual_goods, $msg, $order['order_sn'], true)) {
/* 如果没有实体商品,修改发货状态,送积分和红包 */
开发者ID:will0306,项目名称:bianli100,代码行数:31,代码来源:flow.php
注:本文中的sms类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论