[ Mini Kiebo ]
Server: Windows NT AKFAR_SERVER 10.0 build 26200 (Windows 10) AMD64
Path:
D:
/
xampp
/
htdocs
/
simaku-aset
/
application
/
controllers
/
[
Home
]
File: Welcome.php
<?php defined('BASEPATH') or exit('No direct script access allowed'); class Welcome extends CI_Controller { /** * Index Page for this controller. * * Maps to the following URL * http://example.com/index.php/welcome * - or - * http://example.com/index.php/welcome/index * - or - * Since this controller is set as the default controller in * config/routes.php, it's displayed at http://example.com/ * * So any other public methods not prefixed with an underscore will * map to /index.php/welcome/<method_name> * @see https://codeigniter.com/user_guide/general/urls.html */ function __construct() { parent::__construct(); $this->load->model('Login_model', '', TRUE); // $this->load->model('Munit','', TRUE); $this->load->model('Minfo', '', TRUE); $this->load->model('Mpublik', '', TRUE); $this->load->model('Munit', '', TRUE); } public function getday($tgl) { $sepparator = '-'; //separator. contoh: '-', '/' $parts = explode($sepparator, $tgl); //2002-12-21 --> 21-12-2002 $d = date("l", mktime(0, 0, 0, $parts[1], $parts[0], $parts[2])); if ($d == 'Monday') { return 'Senin'; } elseif ($d == 'Tuesday') { return 'Selasa'; } elseif ($d == 'Wednesday') { return 'Rabu'; } elseif ($d == 'Thursday') { return 'Kamis'; } elseif ($d == 'Friday') { return 'Jumat'; } elseif ($d == 'Saturday') { return 'Sabtu'; } elseif ($d == 'Sunday') { return 'Minggu'; } else { return 'ERROR!'; } } public function index() { $this->profil(); } public function profil($e = null) { if ($this->session->userdata('login') == TRUE) { $q = $this->Minfo->info()->row(); $data['namapt'] = !empty($q->namapt) ? $q->namapt : $this->config->item('nameAPP'); $data['title'] = 'Selamat Datang'; $data['logo'] = !empty($q->logo) ? $q->logo : 'logo'; $data['view'] = 'profil'; $data['menu_beranda'] = 'active'; $data['edit'] = $e; $this->load->view('admin/beranda', $data); } else { redirect('login'); } } public function ganti_pass() { if ($this->session->userdata('login') == TRUE) { $q = $this->Minfo->info()->row(); $data['namapt'] = !empty($q->namapt) ? $q->namapt : $this->config->item('nameAPP'); $data['title'] = 'Selamat Datang'; $data['logo'] = !empty($q->logo) ? $q->logo : 'logo'; $data['view'] = 'gantipass'; $data['menu_gan'] = 'active'; $this->load->view('beranda', $data); } else { redirect(base_url()); } } public function simpan_edit_profil() { $q = array( 'nama' => $this->input->post('nama'), 'jabatan' => $this->input->post('jabatan'), 'unit' => $this->input->post('unit'), 'no' => $this->input->post('no'), ); $this->Mpublik->update_profil($q, $this->session->userdata('id_user')); $this->session->set_flashdata( 'msg', '<div class="alert alert-success"> <h4>Berhasil</h4> <p>Data Berhasil Diperbaharui</p> </div>' ); //redirect('welcome/form_kategori/'.$id_k); redirect('welcome/profil'); } public function simpan_ganti_pass() { $q = array( 'username' => $this->input->post('user'), 'password' => $this->input->post('pass'), ); $this->Mpublik->update_profil($q, $this->session->userdata('id_user')); $this->session->set_userdata('login', FALSE); $this->session->set_userdata('master_login', FALSE); $this->session->set_userdata('id_login', FALSE); $this->session->sess_destroy(); $this->session->set_flashdata('message', 'Silahkan Login Kembali'); redirect(base_url()); } }