{% extends '../template.html' %}
{% block style %}
<style type="text/css">
table.data {
	background:white;
}
table.data th {
	padding:1px 10px;
	border-bottom:1px solid #ccc;
	border-left:1px solid #ccc;
	text-align:center;
}
table.data td {
	text-align:center;
}
</style>
{% endblock %}
{% block title %}Report - Absensi Rider{% endblock %}
{% block subcontent %}
<h3>Report - Rider</h3>
<br/>
		<form>
<table class="data" style="float:left;">
	<tr>
		<td>
			{% combobox store text=kode value=id selected=get.store %}
		</td>
	</tr>
</table>
<table class="data" style="float:left;margin-left:-1px;">
	<tr>
		<td class="option">
			{% combobox rider text=nama value=id selected=get.rider %}
			&nbsp;
			{% date awal year[2011-2020] %}
			s.d.
			{% date akhir year[2011-2020] %}
			<label><input class="pilihan" value="a" type="checkbox" name="pilihan" />Export</label>
			<input type="submit" value="Go" />
		</td>
		<td style="display:none;" class="loading">Loading...</td>
	</tr>
</table>
		</form>
<div class="clearfix"></div>
<br/>
<table class="data">
	<tr>
		<th rowspan="3">
		TGL
		</th>
		<th colspan="6">JADWAL KERJA</th>
		<th colspan="2">KEHADIRAN</th>
		<th colspan="3">TOTAL</th>
		<th rowspan="3">KETERANGAN</th>
		<th colspan="2">PARAF</th>
	</tr>
	<tr>
		<th rowspan="2">KODE<br/>SHIFT</th>
		<th rowspan="2">JAM MASUK</th>
		<th rowspan="2">JAM KELUAR</th>
		<th colspan="3">LEMBUR</th>
		<th rowspan="2">KETERLAMBATAN</th>
		<th rowspan="2">OFF</th>
		<th rowspan="2">MIN. DSO</th>
		<th rowspan="2">LEBIH DSO</th>
		<th rowspan="2">JAM LEMBUR</th>
		<th rowspan="2">PIC</th>
		<th rowspan="2">RIDER</th>
	</tr>
	<tr>
		<th>MULAI</th>
		<th>SELESAI</th>
		<th>DURASI</th>
	</tr>
	{% for r in report %}
	<tr>
		<td><small><b>{{ r.tgl }}</b></small></td>
		<td>{{r.shift | upper }}</td>
		<td>{{r.jam_datang}}</td>
		<td>{{r.jam_keluar}}</td>
		<td>{{r.lembur_mulai}}</td>
		<td>{{r.lembur_selesai}}</td>
		<td>{{r.lembur_durasi}} </td>
		<td>{{r.keterlambatan}}</td>
		<td>{% if r.jam_datang == "" %} OFF {% endif %}</td>
		<td>{{r.hantaran}}</td>
		<td>{{r.lebih_dso}}</td>
		<td>{{r.jam_lembur}}</td>
		<td>{% if r.backup != "" %}BACKUP: {{r.backup}}{% endif %}</td>
		<td></td>
		<td></td>
	</tr>
	{% endfor %}
</table>
{% endblock %}
{% block script %}
<script type="text/javascript">
	$(document).ready(function(){
		function generate_param() {
			var s = "&awal_date="+$("select[name=awal_date]").val();
			s += "&awal_month="+$("select[name=awal_month]").val();
			s += "&awal_year="+$("select[name=awal_year]").val();
			s += "&akhir_date="+$("select[name=akhir_date]").val();
			s += "&akhir_month="+$("select[name=akhir_month]").val();
			s += "&akhir_year="+$("select[name=akhir_year]").val();
			return s;
		}
		
		$("select[name=store]").change(function() {
			$(".option").hide();
			$(".loading").show();
			location.href = "?store="+$(this).val()+ generate_param();
		});
		$("#container").width(1200);
	});
</script>
{% endblock %}