function send_sms_message($userId, $messageDetails) { $isSent = false; $messageDetails['emailfrom'] = NOREPLY_EMAIL; $messageDetails['fromname'] = SITE_GENERAL_NAME; if (!empty($messageDetails['telephone'])) { #Attempt sending by SMS and then by API $this->load->model('_provider'); $providerEmailDomain = $this->_provider->get_email_domain($messageDetails['telephone']); if (!empty($providerEmailDomain)) { $this->email->to($messageDetails['telephone'] . '@' . $providerEmailDomain); $this->email->from($messageDetails['emailfrom'], $messageDetails['fromname']); $this->email->reply_to($messageDetails['emailfrom'], $messageDetails['fromname']); if (!empty($messageDetails['copyadmin']) && $messageDetails['copyadmin'] == 'Y') { $this->email->bcc(SITE_ADMIN_MAIL); } $this->email->subject(''); $this->email->message(limit_string_length($messageDetails['sms'], 150, FALSE)); $isSent = $this->email->send(); $this->email->clear(TRUE); } } #Else use the SMS-Global gateway to send the SMS if (!$isSent && !empty($messageDetails['telephone']) && !empty($messageDetails['sms'])) { $this->load->library('Sms_global', array('user' => SMS_GLOBAL_USERNAME, 'pass' => SMS_GLOBAL_PASSWORD, 'from' => SMS_GLOBAL_VERIFIED_SENDER)); $this->sms_global->to($messageDetails['telephone']); $this->sms_global->from(SMS_GLOBAL_VERIFIED_SENDER); $this->sms_global->message(limit_string_length($messageDetails['sms'], 150, FALSE)); $this->sms_global->send(); # only use this to output the message details on screen for debugging #$this->sms_global->print_debugger(); $isSent = !empty($this->sms_global->get_sms_id()) ? true : false; } #Record messsage sending event $this->log_message_event($userId, $isSent, 'sms__message_sent', $messageDetails); return $isSent; }
<?php $stopHtml = "<input name='paginationdiv__faq_stop' id='paginationdiv__faq_stop' type='hidden' value='1' />"; $listCount = count($list); $i = 0; echo "<table>"; if (!empty($list)) { echo "<tr><th style='width:1%;'> </th><th>Question</th><th>Answer</th>"; if ($this->native_session->get('__user_type') == 'admin') { echo "<th>Status</th><th>Date Added</th>"; } echo "</tr>"; foreach ($list as $row) { $i++; if (strlen($row['answer']) > 150) { $answer = html_entity_decode(limit_string_length($row['answer'], 150, FALSE), ENT_QUOTES) . "<a href='" . base_url() . "faqs/details/d/" . $row['faq_id'] . "' class = 'shadowbox closable grey-box'>Details</a>"; } else { $answer = html_entity_decode($row['answer'], ENT_QUOTES); } echo "<tr> \n\t\t<td>"; if ($this->native_session->get('__user_type') != 'provider') { echo "<input id='select_" . $row['faq_id'] . "' name='selectall[]' type='checkbox' value='" . $row['faq_id'] . "' class='bigcheckbox'><label for='select_" . $row['faq_id'] . "'></label>"; } else { echo " "; } echo "</td>\n\t\t<td>" . html_entity_decode($row['question'], ENT_QUOTES) . "</td>\n\t\t<td>" . $answer; if ($this->native_session->get('__user_type') == 'admin') { echo "</td><td>" . strtoupper($row['status']) . "</td>\n\t\t\t<td>" . date(FULL_DATE_FORMAT, strtotime($row['date_entered'])); } # Check whether you need to stop the loading of the next pages if ($i == $listCount && (!empty($n) && $listCount < $n || empty($n) && $listCount < NUM_OF_ROWS_PER_PAGE)) {