當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Sms::sendMakeAnOffer方法代碼示例

本文整理匯總了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";
         }
     }
 }
開發者ID:riddhisoni1324,項目名稱:cakephp_fxchng,代碼行數:46,代碼來源:catcon.php


注:本文中的Sms::sendMakeAnOffer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。