sorry for that, I want to insert the number of pages in a message, like the message text field in the view is able to count the number of words and limit them to 160 then count that as page 1, the same way when you send a sms , now i want to store that page count. When you look keenly in the script you will see how what am talking about: here is my controller and model respectively
Code:
<?php defined( 'BASEPATH' ) OR die('No direct script access allowed!');
class sms extends CI_Controller {
public function __construct() {
parent::__construct();
$this->config->load('facebook');
$this->load->library('form_validation');
$this->load->library('encrypt');
$this->load->model('countries');
$this->load->helper('text');
$this->load->model('sms_model');
}
public function index() {
}
public function sms_form(){
$sender = ('sender');
$numberofpages = '';
if(isset($_POST['messages'])){
$numberofpages .= $_POST['messages'];
};
$body = $this->input->post('body');
$sendscheduletime = '';
if(isset($_POST['datepicker'])){
$sendscheduletime .= $_POST['datepicker'];
}
if(isset($_POST['timepicker'])){
$sendscheduletime .= ' ' .$_POST['timepicker'];
};
$route = $this->input->post('route');
$category = $this->input->post('category');
$recepientscount = $this->input->post('recepientscount');
$receiver = $this->input->post('receiver');
$sumcharge = $this->input->post('sumcharge');
$sentstatus = $this->input->post('sentstatus');
$sms_data = array(
'body' => $body,
'numberofpages' => $numberofpages,
'sender' => 'inclusion',
'sendscheduletime' => $sendscheduletime,
'route' => $route,
'category' => $category,
'recepientscount' => $recepientscount,
'receiver' => $receiver,
'sumcharge' => $sumcharge,
'sentstatus' => $sentstatus,
);
var_dump($sms_data);die;
$this->sms_model->insert($sms_data);
echo "Message Send Successfully....!!!!";
// $this->load->view('modal_send_sms'); // Reloading after submit.
// $this->redirect('outbox');
}
}
/* End of file sms.php */
Code:
<?php defined( 'BASEPATH' ) OR die('No direct script access allowed!');
class sms_model extends CI_Model {
function __construct() {
// Call the Model constructor
parent::__construct();
}
function insert( $sms_data ) {
$this->db->insert('smslog', $sms_data);
}
}
/* End of file sms.php */