public function resend() { $this->load->model('Sms_model'); $this->load->model('Member_model'); $this->load->model('Content_model'); $smid = $_POST['smid']; $sid = $_POST['sid']; $member = $this->Member_model->getMemberFromSchedule($smid); foreach ($member as $mem) { } $content = $this->Content_model->getContentFromSchedule($sid); foreach ($content as $ct) { } $message = $ct->content; $mid = $mem->member_id; $phno = $mem->phone_no; $code = $mem->country_code; $phno = $code . $phno; $membercount = $this->Member_model->getTotalMemberStatusFromMemSchedule($sid); foreach ($membercount as $mc) { } $msum = $mc->msum; $mcount = $mc->mcount; $apiusername = '******'; $apipassword = '******'; $tonos = $phno; $smstext = $message; $sms = new Sms(); $res = $sms->smsAPI($apiusername, $apipassword, $tonos, $smstext); if ($res == true) { $data = array("delivery_status" => '1'); $this->Sms_model->updateDeliveryStatus($data, $mid); if ($msum == $mcount) { $sdata = array("schedule_status" => '1'); $this->Sms_model->updateScheduleStatus($sdata, $sid); } echo true; } else { echo false; } }