<?php
/**
 * File			: history_list.php
 * Description  : View untuk halaman history/laporan
 * Created By	: Hendi
 * Created Date : 23 Mar 2021
 * Last Update  : 23 Mar 2021
**/
?>
<div class="container-fluid">
	<div class="row">
		<div class="col-md-2">
			<div class="card">
				<div class="card-header card-header-info">
					<h4 class="card-title">History</h4>
					<p id="from-antrian-category" class="card-category">Preview</p>
				</div>
				<div class="card-body">
					<?php 
						# jika menggunakan form_open(), maka csrf token otomatis sudah dibuat.
						# esc() berfungsi menjaga serangan xss (cross site scripting)
					?>
					<?= form_open('history', ['id' => 'form-history', 'method' => 'GET']) ?>
						<div class="row">
							<div class="col-md-12">
								<label>Dari Tanggal</label>
								<div class="form-group">
									<input type="date" id="tgl-awal" name="tgl_awal" class="form-control" value="" required />
									<small></small>
								</div>
							</div>
						    <div class="col-md-12">
								<label>Sampai Tanggal</label>
								<div class="form-group">
									<input type="date" id="tgl-akhir" name="tgl_akhir" class="form-control" value="" required />
									<small></small>
								</div>
							</div>
						</div>
						<button type="submit" class="btn btn-info pull-right">Preview</button>
						<div class="clearfix"></div>
					<?= form_close() ?>
				</div>
			</div>
		</div>
		<div class="col-md-10">
			<div class="card">
				<div class="card-header card-header-info">
					<h4 class="card-title">List History Antrian</h4>
					<p class="card-category">Dari Tanggal <?=$tgl_awal?> sd. <?=$tgl_akhir?></p>
				</div>
				<div id="list-antrian" class="card-body">
					<div class="toolbar">
						
					</div>
					<div class="material-datatables">
						<table id="dt-<?= $mod ?>" class="table table-striped table-no-bordered table-hover dataTable dtr-inline" cellspacing="0" width="100%" role="grid">
							<thead>
								<tr role="row">
									<th>NO</th>
									<th>TANGGAL</th>
									<th>JAM</th>
									<th>MENU</th>
									<th>QTY</th>
									<th>NO ANTRIAN</th> 
									<th>MULAI</th> 
									<th>SELESAI</th> 
									<th>DURASI (Menit)</th>
								</tr>
							</thead>
							<tbody></tbody>
							<tfoot></tfoot>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
	//_mod dideklarasikan di myscrypt.js
	_mod = '<?= $mod ?>';
	_tglawal = '<?= $tgl_awal ?>';
	_tglakhir = '<?= $tgl_akhir ?>';
</script>