本文整理汇总了PHP中Sms::sendMakeAnOffer方法的典型用法代码示例。如果您正苦于以下问题:PHP Sms::sendMakeAnOffer方法的具体用法?PHP Sms::sendMakeAnOffer怎么用?PHP Sms::sendMakeAnOffer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sms
的用法示例。
在下文中一共展示了Sms::sendMakeAnOffer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: make_an_offer
public function make_an_offer()
{
if ($this->request->is('post')) {
$this->layout = "ajax_layout";
$sms_data = $this->request->data;
$ad_title = $sms_data['ad_title'];
$offer_rs = $sms_data['offer_rs'];
$receiver_mobile = $sms_data['receiver_mobile'];
$sender_mobile = $sms_data['sender_mobile'];
$sender_name = $this->activeUser['User']['fb_name'];
$sender_email = $this->activeUser['User']['username'];
// save on cloudant
// get uuid
$guid = String::uuid();
// get todays datetime in seconds
$time_in_seconds = CakeTime::convert(time(), new DateTimeZone('Asia/Calcutta'));
// set array for cloudant DB
$msg_array['id'] = "msg_" . $time_in_seconds . '_' . $guid;
$msg_array['created_timestamp'] = $time_in_seconds;
$msg_array['doc_type'] = 'sms';
$msg_array['ad_id'] = $sms_data['ad_id'];
$msg_array['ad_fb_id'] = $sms_data['ad_fb_id'];
$msg_array['sender_fb_id'] = $this->activeUser['User']['fb_id'];
$msg_array['name'] = $sender_name;
$msg_array['mobile'] = $sender_mobile;
$msg_array['email'] = $sender_email;
// Set created timestamp
date_default_timezone_set('Asia/Calcutta');
$todays = new DateTime();
$msg_array['created'] = $todays->format('Y-m-d H:i:s');
// pr($msg_array);die();
$this->SetAdReply->setDataSource('cloudant_db');
if (!$this->SetAdReply->save($msg_array)) {
echo 0;
}
//send sms
if ($receiver_mobile != null) {
$sms = new Sms();
$sms->sendMakeAnOffer($ad_title, $sender_name, $sender_mobile, $sender_email, $offer_rs, $receiver_mobile);
//$msg_array['message'] = $sender_data['senderMsg'];
echo "1";
} else {
echo "0";
}
}
}