{% extends "base.html" %}

{% block head %}
	<script type="text/javascript">
		$(document).ready(function() {
			for (i = new Date().getFullYear(); i >= 2007; i--)
			{
			    $('#yearpicker').append($('<option />').val(i).html(i));
			}
		});

	</script>
{% endblock %}
    
{% block logo %}
	<h1><a href="#">{{year}}年度 神經外科 手術病例統計</a></h1>
{% endblock %}

{% block search %}
<form name="input" action="." method="post">{% csrf_token %}
	Year: <select name="year" id="yearpicker"></select>
	<input type="submit" value="Go" />
</form>
{% endblock %}


{% block content %}
<table>
	<tr>
		<td><nobr>項目</nobr></td>
		<td><nobr>一月</nobr></td>
		<td><nobr>二月</nobr></td>
		<td><nobr>三月</nobr></td>
		<td><nobr>四月</nobr></td>
		<td><nobr>五月</nobr></td>
		<td><nobr>六月</nobr></td>
		<td><nobr>七月</nobr></td>
		<td><nobr>八月</nobr></td>
		<td><nobr>九月</nobr></td>
		<td><nobr>十月</nobr></td>
		<td><nobr>十一</nobr></td>
		<td><nobr>十二</nobr></td>
		<td><nobr>年度總計</nobr></td>
	</tr>
	{% for row in data %}
	<tr>
		{% for c in row %}
		<td>
			{% if c %}
			<pre>{{c}}</pre>
			{% endif %}        
		</td>
		{% endfor %}
    </tr>
	{% endfor %}
</table>
{% endblock %}
