<?php namespace App\Controllers;
/**
 * File			: History.php
 * Description  : Controller untuk halaman history/laporan
 * Created By	: Hendi
 * Created Date : 23 Mar 2021
 * Last Update  : 23 Mar 2021
**/
use \App\Models\AntrianModel;
class History extends MyBaseController
{
	public function index()
	{
	    # fn isLoggedIn di MyBaseController
		if (!$this->isLoggedIn()) return redirect()->to(base_url('/login'));
		# jika sudah menu dinamis diisi dari array hasil query
		$data_sidebar = []; 
		# jika dibutuhkan data untuk konten
		$tgl_awal = $this->request->getGet('tgl_awal') ?? date('Y-m-d');
		$tgl_akhir = $this->request->getGet('tgl_akhir') ?? date('Y-m-d');
		$data_content = [
			'mod' => 'history',
			'tgl_awal' => $tgl_awal,
			'tgl_akhir' => $tgl_akhir
		];
		$data = [
			'title' => 'History',
			'sidebar' => view('contents/sidebar', $data_sidebar),
			'content' => view('contents/history/history_list', $data_content),
		];
		return view('templates/index', $data);
	}
}
