{% block subcontent %}
<h2>Report - Rider ({{ kode.kode }})</h2>
<h3>{{ report.0.nama }}</h3>

<div class="clearfix"></div>
<br/>
<table class="data" border="1">
	<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 %}