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

class ControllerMacet extends CI_Controller
{

    public function __construct()
    {
        parent::__construct();
        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');
    }
    public function set_timezone()
    {
        date_default_timezone_set("Asia/Jakarta");
    }
    public function index()
    {
        $notif                 = $this->notifikasi->notif_manager();
        // Data Login
        $data_login            = $this->userlogin->user_login();
        $data_id_login         = $this->session->userdata('isloggedin');
        // Data Isian Konten
        // Tampilkan Jenis Pinjaman
        $pinjaman_macet        = $this->select_model->vd_PinjamanMacet();
        $data_jaminan          = $this->select_model->vd_jaminanPinjaman();
        // Jumlah Pinjaman
        $jml_mingguan          = count($this->select_model->vd_PinjamanMacetMingguan());
        $jml_2mingguan         = count($this->select_model->vd_PinjamanMacet2Mingguan());
        $jml_BulananC          = count($this->select_model->vd_PinjamanMacetBulananC());
        $jml_BulananA          = count($this->select_model->vd_PinjamanMacetBulananA());
        $jml_BulananK          = count($this->select_model->vd_PinjamanMacetBulananK());
        $jml_Musiman           = count($this->select_model->vd_PinjamanMacetMusiman());
        $data = array(
            // Untuk memanggil halaman sesuai menu
            'folder'              => 'laporan/koperasi/macet',
            'page'                => 'index',
            'judul'               => 'Pinjaman Macet || Bagian Manager',
            'data_id_login'       => $data_id_login,
            'data_login'          => $data_login,
            'notif'               => $notif,
            // Isi dalam konten
            'pinjaman_macet'      => $pinjaman_macet,
            'data_jaminan'        => $data_jaminan,
            // Jumlah Macet
            'p_mingguan'          => $jml_mingguan,
            'p_2mingguan'         => $jml_2mingguan,
            'p_BulananC'          => $jml_BulananC,
            'p_BulananA'          => $jml_BulananA,
            'p_BulananK'          => $jml_BulananK,
            'p_musiman'           => $jml_Musiman
        );
        $this->load->view('manager/index', $data);
    }
}

/* End of file ControllerMacet.php and path \application\controllers\kabag_marketing\operasional\ControllerMacet.php */