Exemplo n.º 1
0
 public function dosend()
 {
     $this->load->library('form_validation');
     $this->form_validation->set_rules('phone', 'Номер', 'required');
     $this->form_validation->set_rules('Content', 'Съобщение', 'required');
     if ($this->form_validation->run() == FALSE) {
         $head['Title'] = 'Изпрати SMS';
         $head['Description'] = 'Изпрати SMS :: SMSYS';
         $head['arCss'][] = 'static/css/form.css';
         $head['arJs'][] = 'static/js/sms.js';
         $this->load->model('contacts_model');
         $pContacts = new Contacts_model();
         $data['arConts'] = $pContacts->GetDropDownConts();
         $data['error'] = $this->upload->display_errors();
         $this->load->view('templates/header', $head);
         $this->load->view('sms/send', $data);
         $this->load->view('templates/footer');
     } else {
         require_once 'smsys_core/sms.php';
         SMScore::sendSMS($this->input->post('phone'), $this->input->post('Content'));
         $this->sms_model->send_sms();
         redirect('/sms/outbox');
     }
 }