Postingan lainnya
Membetulkan isi colom yang eror
bang mau nanya.Saya kan buat aplikasi web menyimpan surat.nah pas yang buat surat itu pake email tapi emailnya tidak bisa beda.kalo emailnya beda nanti kalo di simpan balek sama lagi.
ini di controlernya bang=load->model('formModel'); }
public function index() { $this->load->library('form_validation');
$this->form_validation->set_rules('to', 'To', 'required'); $this->form_validation->set_rules('subject', 'Subject', 'required'); $this->form_validation->set_rules('message', 'Message', 'required');
$config['upload_path'] = './assets/template/back/dist/Gambar/'; $config['allowed_types'] = 'gif|jpg|png|jpeg';
$this->load->library('upload', $config);
if ($this->upload->do_upload('userfile')) { $this->uploadFile = $this->upload->data(); }
if ($this->form_validation->run() == FALSE) {
$data = array( 'role' => $this->session->userdata('role') == 'admin' ? 'admin' : 'user', );
$this->load->view('admin/form', $data); } else { $this->formModel->form($this->uploadFile['file_name'],1); redirect('home'); } }
public function email_check($str){ $this->load->model('authModel'); $result = $this->authModel->getAllEmail($str); if($result != TRUE || $result != 100){ $this->form_validation->set_message('email_check', 'Email penerima tidak tersedia'); return FALSE; } else { return TRUE; } }
public function reviewData() { $this->load->model('inbox_model');
$log["log"] = $this->inbox_model->getData();
$this->load->view('admin/tampil', $log); } }
pas ini di models nya= $this->session->userdata('email'), 'to_' => $this->session->userdata('email'), 'subject' => $this->input->post('subject', TRUE), 'message' => $this->input->post('message', TRUE), 'doc_date' => date("Y-m-d H:m:s"), 'file_path' => $filename, 'doc_type'=>$doc_type
); } else{ $formdata = array( 'from_' => $this->session->userdata('email'), 'to_' => $this->session->userdata('email'), 'subject' => $this->input->post('subject', TRUE), 'message' => $this->input->post('message', TRUE), 'doc_date' => date("Y-m-d H:m:s"), 'doc_type'=>$doc_type ); } $result = $this->db->insert('tb_doc', $formdata); return $result; }
}
Belum ada Jawaban. Jadi yang pertama Jawaban
Login untuk ikut Jawaban