<?php

class MY_Controller extends CI_Controller
{
    public $MY_response;
    public function __construct()
    {
        parent::__construct();
        $this->MY_response['csrf_token'] = $this->security->get_csrf_hash();

        // language
        $this->code_lang = $this->session->userdata('code_lang');
        $this->site_lang = $this->session->userdata('site_lang');
        $this->lang->load(array('menu', 'header', 'button', 'content', 'error_message', 'sales_activity/content', 'sales_activity/error_message', 'kpi/content'), $this->site_lang ?: 'indonesia');

        // user
        $this->level_user           = $this->session->userdata('level_user');
        $this->id_company           = $this->session->userdata('id_company');
        $this->multi_cabang         = $this->session->userdata('multi_cabang');
        $this->cabang_pusat         = $this->session->userdata('cabang_pusat');
        $this->id_cabang            = $this->session->userdata('id_cabang');
        $this->id_cabang_arr        = $this->session->userdata('id_cabang_arr');
        $this->multi_departemen     = $this->session->userdata('multi_departemen');
        $this->id_departemen        = $this->session->userdata('id_departemen');
        $this->id_departemen_arr    = $this->session->userdata('id_departemen_arr');
        $this->id_karyawan          = $this->session->userdata('id_karyawan');
        $this->nik_karyawan         = $this->session->userdata('nik');
        $this->nm_karyawan          = $this->session->userdata('nama_user');
        $this->id_paket             = $this->session->userdata('id_paket');
        $this->menu                 = $this->session->userdata('menu');
        $this->paket_informasi_gaji = $this->session->userdata('paket_informasi_gaji');
        $this->paket_payroll        = $this->session->userdata('paket_payroll');
        $this->paket_reimbursement  = $this->session->userdata('paket_reimbursement');
        $this->paket_arr            = $this->session->userdata('paket_arr');

        $this->adm_reimbursement            = $this->session->userdata('adm_reimbursement');
        $this->id_cabang_reimbursement_arr  = $this->session->userdata('id_cabang_reimbursement_arr');

        $this->adm_absensi     = $this->session->userdata('adm_absensi');
        $this->adm_payroll     = $this->session->userdata('adm_payroll');
        $this->level_user_prev = $this->session->userdata('level_user_prev');

        // sales activity
        $this->is_sales               = $this->session->userdata('is_sales');
        $this->is_sales_skip_approval = $this->session->userdata('is_sales_skip_approval');
        $this->is_sales_atasan        = $this->session->userdata('is_sales_atasan');
        $this->is_sales_admin         = $this->session->userdata('is_sales_admin');
        $this->sales_admin_group      = $this->session->userdata('sales_admin_group');
    }
}
