Exemple #1
0
 public function hapus_foto_pribadi($id = 0)
 {
     if ($id != 0) {
         $this->pegawaimodel->foto_pribadi_hapus($id);
         set_green_notification('Foto Berhasil Dihapus');
         redirect('sos/pegawai');
     } else {
         redirect('sos/pegawai');
     }
 }
Exemple #2
0
 public function kirim_pesan()
 {
     $this->form_validation->set_rules('nama', 'Name', 'required');
     $this->form_validation->set_rules('email', 'Email', 'required|valid_email');
     $this->form_validation->set_rules('subject', 'Judul', 'required');
     $this->form_validation->set_rules('pesan', 'Pesan', 'required');
     $id_sekolah = $this->input->post('id_sekolah');
     if ($this->form_validation->run() == FALSE) {
         $this->detail_sekolah($id_sekolah);
     } else {
         $email_sekolah = $this->input->post('email_sekolah');
         $nama = $this->input->post('nama');
         $email = $this->input->post('email');
         $subject = $this->input->post('subject');
         $pesan = $this->input->post('pesan');
         $config_pesan = array('protocol' => 'smtp', 'smtp_host' => 'smtp.gmail.com', 'smtp_port' => '465', 'smtp_crypto' => 'ssl', 'smtp_user' => '*****@*****.**', 'smtp_pass' => 'zenuddin123', 'mailtype' => 'html', 'charset' => 'iso-8859-1');
         $this->load->library('email', $config_pesan);
         $this->email->initialize($config_pesan);
         $this->email->set_newline("\r\n");
         $this->email->from('User Studentbook', $email);
         $this->email->to($email_sekolah);
         $this->email->subject($subject);
         $this->email->message($pesan);
         $this->email->send();
         set_green_notification('Pesan Berhasil Dikirim');
         redirect('sos/sekolah/detail_sekolah/' . $id_sekolah);
     }
 }