<?php
defined('BASEPATH') or exit('No direct script access allowed');

class ControllerSalery extends CI_Controller
{

    public function __construct()
    {
        parent::__construct();
        //validasi jika user belum login
        check_not_login();
        if ($this->session->userdata('level') != 2) {
            redirect();
        }
        $this->set_timezone();
        $this->load->library('encrypt');
        $this->load->library('form_validation');
        $this->load->library('Mycustom');
        $this->load->library('pdfgenerator');
        $this->load->library('Notifikasi');
        $this->load->model('bagian_manager/insert_model');
        $this->load->model('bagian_manager/select_model');
        $this->load->model('bagian_manager/update_model');
        $this->set_timezone();
    }
    public function set_timezone()
    {
        date_default_timezone_set("Asia/Jakarta");
    }
    public function index()
    {
        // NOtifikasi
        $notif = $this->notifikasi->notif_manager();
        $data_login                = $this->userlogin->user_login('isloggedin');
        $data_id_login             = $this->session->userdata('isloggedin');
        // Data Isian Konten
        // Query SQL Data atau isi data page 
        // Menampilkan histori gaji karyawan
        $data_gaji = $this->db->get_where('k_gaji', ['login_id' => $data_id_login])->result();
        // echo '<pre>';
        // var_dump($data_id_login);
        // die;
        $data = array(
            // Untuk memanggil halaman sesuai menu
            'folder'              => 'kas/gaji',
            'page'                => 'index',
            'judul'               => 'Histori Gaji Karyawan || Bagian Manager',
            'data_id_login'       => $data_id_login,
            'data_login'          => $data_login,
            'notif'               => $notif,
            // Isi data
            'data_gaji'           => $data_gaji
        );
        $this->load->view('manager/index', $data);
    }
}

/* End of file ControllerSalery.php and path \application\controllers\manager\ControllerSalery.php */