<!DOCTYPE html>
<html>
	<head>
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
		
		<!-- Latest compiled and minified CSS -->
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
		
		<!-- Optional theme -->
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
		
		<!-- Latest compiled and minified JavaScript -->
		<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
		
		<script>
			$(function() {
				window.print();
			});
			
		</script>
		
		
		<style>
		tr.first  td {
			border-top: thin solid black; 
			border-bottom: none;
			padding-top: 8px; 
			padding-bottom: 8px; 
			padding-left: 4px;
			padding-right: 4px;
			}
		tr.second td {
			border-top: none; 
			border-bottom: thin solid black; 
			padding-top: 8px; 
			padding-bottom: 8px; 
			padding-left: 4px;
			padding-right: 4px;
			}

		.nobr {
			white-space: nowrap;
			}	
			
		</style>
		
				
		<title>
			{{date2}}
		</title>
	</head>
	
	<body>
		<h1 class="text-center">
			{{date2}}
		</h1>	
		<table class="nobr ">
			<thead>
				<tr class="second" style="background-color:#C0C0FF;">
					<!-- <td>選</td> -->
					<td>日期</td>
					<td>房</td>
					<td>序</td>
					<td>姓名</td>
					<td>病房</td>
					<td>病</td>
					<td>性</td>
					<td>齡</td>
					<td>診斷</td>
					<td>術式</td>
					<td>主治醫師</td>
					<td>起</td>
					<td>費</td>
				</tr>
			</thead>
			<tbody>
			{% for op in oplist %}
			{% if op.OpRoomNo in rooms %}
			    <tr class="first cAll c{{op.OPDate|date:"m-d"}}">
					<!-- <td>{{forloop.counter}}</td> -->
			    	<td>{{op.OPDate|date:"m/d"}}</td>
			    	<!-- <td>{{op.OPDate}}</td> -->
			    	<td>{{op.OpRoomNo}}</td>
			    	<td>{{op.OpSeqNo}}</td>
			    	<td>{{op.PatName}}</td>
			    	<td>{{op.PatWard}}</td>
					<td>{{op.PatChartNo}}</td>
					<td>{{op.PatSex}}</td>
					<td>{{op.PatAge|slice:":3"}}</td>
			    	<td>
			    		<div class="editable_text" id="PatDignosis_{{op.id}}">{{op.PatDignosis}}</div>
			    	</td>
			    	<td>{{op.MainOpMode}}</td>
			    	<td>{{op.OpDoctorName}}</td>
		            <td>{{op.StartTime|time:"H:i"}}</td>
		            <td>{{op.SpendTime}}</td>
			    </tr>
			    <tr class="second cAll c{{op.OPDate|date:"m-d"}}">
			    	<td colspan="100%">
			    		{{op.Remark}}
			    	</td>
			    </tr>
			{% endif %}
			{% endfor %}
			</tbody>
		</table>
	</body>
	
</html>


