function trendoo_get_sms_history_fmt($fromdate, $todate) { $post = new Trendoo_POST(); $post->add_param('from', $fromdate); $post->add_param('to', $todate); $rp = $post->do_post(TRENDOO_HISTORY_REQUEST); $res = $rp->get_result_array(); $count = 0; if ($rp->isok) { while ($rp->go_next_line()) { $res[] = new Trendoo_SENT_SMS($rp->next_string(), $rp->next_string(), $rp->next_string(), $rp->next_string(), $rp->next_string(), $rp->next_string()); $count++; } } $res['count'] = $count; return $res; }
function trendoo_get_message_status($order_id) { $post = new Trendoo_POST(); $post->add_param('order_id', $order_id); $rp = $post->do_post(TRENDOO_MSG_STATUS_REQUEST); $res = $rp->get_result_array(); $count = 0; if ($rp->isok) { while ($rp->go_next_line()) { $res[] = new Trendoo_SMS_STATUS($rp->next_string(), $rp->next_string(), $rp->next_string()); $count++; } } $res['count'] = $count; return $res; }
function send() { if (!$this->validate()) { return false; } $post = new Trendoo_POST(); $post->add_param('message', $this->message); $post->add_param('message_type', $this->sms_type); if ($this->scheduled_delivery != null) { $post->add_param('scheduled_delivery_time', $this->scheduled_delivery); } if ($this->order_id != null) { $post->add_param('order_id', $this->order_id); } if (trendoo_sms_type_has_custom_tpoa($this->sms_type)) { $post->add_param('sender', $this->sender); } $isfirst = true; $recipient_list = ''; foreach ($this->recipients as $recipient) { if ($isfirst) { $recipient_list = $recipient; $isfirst = false; } else { $recipient_list = $recipient_list . ',' . $recipient; } } $post->add_param('recipient', $recipient_list); $rp = $post->do_post(TRENDOO_SEND_SMS_REQUEST); $res = $rp->get_result_array(); $this->problem = null; if ($res['ok']) { $this->problem = $res['errmsg']; } if ($rp->isok) { $res['order_id'] = $rp->next_string(); $res['sentsmss'] = $rp->next_int(); } return $res; }
function unlockSubaccount() { $post = new Trendoo_POST(); $post->add_param('op', 'UNLOCK_SUBACCOUNT'); $post->add_param('subaccount', $this->login); $post->do_post(TRENDOO_SUBACCOUNTS_REQUEST); $this->active = true; }
function deletePurchase() { $post = new Trendoo_POST(); $post->add_param('op', 'DELETE_PURCHASE'); $post->add_param('subaccount', $this->subaccount_login); $post->add_param('id_purchase', $this->id_purchase); $post->do_post(TRENDOO_SUBACCOUNTS_REQUEST); }
function trendoo_get_sms_mo_byid($message_id) { $post = new Trendoo_POST(); $post->add_param('id', $message_id); return getAllSMS_MO($post->do_post(TRENDOO_MO_BYID_REQUEST)); }