本文整理汇总了PHP中SMS::readSMS方法的典型用法代码示例。如果您正苦于以下问题:PHP SMS::readSMS方法的具体用法?PHP SMS::readSMS怎么用?PHP SMS::readSMS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMS
的用法示例。
在下文中一共展示了SMS::readSMS方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: adminajaxAction
function adminajaxAction()
{
$testEnv = Zend_Registry::get('testEnv');
if ($testEnv == 0) {
// fetch msg from gateway
$smsSpace = new Zend_Session_Namespace('SMS');
$newclient = new SMS();
$respxml = $newclient->readSMS();
$smsSpace->xml = $newclient->sendXML;
$smsSpace->respxml = $respxml;
$code = $newclient->getCode();
$respArr = $newclient->toArray();
if ($respArr["id"][0] > 0) {
$sparkSmsModel = new SparkSms();
$message = $sparkSmsModel->createRow();
$message->msg = $respArr["msg"];
$message->sys_id = $respArr["id"][0];
$message->source = $respArr["src"][0];
$message->time = $respArr["time"][0];
$message->text = iconv("GB2312", "UTF-8", base64_decode($respArr["message"][0]));
$message->err = $respArr["err"][0];
$db = Zend_Registry::get('db');
$select = $db->select();
$select->from('consumer', '*');
$select->where('consumer.phone = ?', $message->source);
$consumer = $db->fetchRow($select);
$message->consumer_id = $consumer['id'];
$message->save();
$jsonMsg['name'] = $consumer['name'];
$jsonMsg["sys_id"] = $message->id;
$jsonMsg["source"] = $message->source;
$jsonMsg["time"] = $message->time;
$jsonMsg["text"] = $message->text;
$jsonMsg["err"] = $message->err;
$this->_helper->json($jsonMsg);
} else {
$jsonMsg["sys_id"] = -1;
$this->_helper->json($jsonMsg);
}
$this->_helper->layout->disableLayout();
// store msg into db
}
}