Welcome Guest, Not a member yet? Register   Sign In
How to Count the number of receipients and insert in the database
#3

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 */
Reply


Messages In This Thread
RE: How to Count the number of receipients and insert in the database - by CharlesK - 02-19-2018, 11:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB