{% extends 'doctor_base.html' %}


{% block content %}

{% if user.is_authenticated %}

<h1 class="section-title" id="services">
	<span>showHistory</span>
</h1><!-- End Title -->
	
<!--breadcrum start-->
<ol class="breadcrumb text-left">
  <li><a href=" {% url 'index' %} ">Dashboard</a></li>
  <li class="active">History</li>
</ol><!--breadcrum end-->
<div class="no-table-blank-state row">
		<!--no table found blank state-->
		<div class="pmd-card pmd-z-depth">
		<div class="pmd-card-body">	
		<form class="row" role="form" method="post" action="{% url 'doctorshowhisttory' p %}">
				{% csrf_token %}
				<div class="form-group pmd-textfield">
				<label class="col-sm-1 control-label" for="lname">Start Date:</label>
				<div class="col-sm-11">
				<input type="date" id="lname" class="form-control input-sm" name="date1">
				</div>
				</div>
				<div class="form-group pmd-textfield">
				<label class="col-sm-1 control-label" for="lname">End Date:</label>
				<div class="col-sm-11">
				<input type="date" id="lname" class="form-control input-sm" name="date2">
				</div>
				</div>
				<div class="form-group">
				<div class="col-sm-10">
				<input type="submit" class="btn btn-primary pmd-checkbox-ripple-effect">
				</div>
				</div>
				
		</form>
		</div>
		</div><br><br><div class="col-md-9">
			<div class="component-box">
			<div class="pmd-card pmd-z-depth pmd-card-custom-view">
			<h2>&nbsp;&nbsp;&nbsp;Prescriptions</h2>
			</div>
			</div>
			</div>
			<div class="col-md-9">
			<div class="component-box">
			<div class="pmd-card pmd-z-depth pmd-card-custom-view">
			<table id="example-checkbox" class="table pmd-table table-hover table-striped display responsive nowrap" cellspacing="0" width="100%">
			<thead>
				<tr>
					<th><b><center>Patient Name</center></b></th>
					<th><b><center>Doctor Name</center></b></th>
					<th><b><center>Medication</center></b></th>
					<th><b><center>Description</center></b></th>
					<th><b><center>Date</center></b></th>
				</tr>
			</thead>
			<tbody>
				{% for row in val %}
					{% for col in row %}
						<td> {{col}} </td> 
					{% endfor %}
				</tr>
				{% endfor %}
			</tbody>
			</table>
			</div>
			</div>
			</div>
		<br><br><div class="col-md-9">
			<div class="component-box">
			<div class="pmd-card pmd-z-depth pmd-card-custom-view">
			<h2>&nbsp;&nbsp;&nbsp;Common Blood Counts</h2>
			</div>
			</div>
			</div>
			<div class="col-md-9">
			<div class="component-box">
			<div class="pmd-card pmd-z-depth pmd-card-custom-view">
			<table id="example-checkbox" class="table pmd-table table-hover table-striped display responsive nowrap" cellspacing="0" width="100%">
			<thead>
				<tr>
					<th><b><center>Date</center></b></th>
					<th><b><center>WBC</center></b></th>
					<th><b><center>RBC</center></b></th>
					<th><b><center>Hemoglobin</center></b></th>
					<th><b><center>Hematocrit</center></b></th>
					<th><b><center>MCV</center></b></th>
					<th><b><center>MCH</center></b></th>
					<th><b><center>MCHC</center></b></th>
					<th><b><center>RDW</center></b></th>
					<th><b><center>Platelets</center></b></th>
					<th><b><center>Neutrophils</center></b></th>
					<th><b><center>Lymphs</center></b></th>
					<th><b><center>Monocytes</center></b></th>
				</tr>
			</thead>
			<tbody>
				{% if cbc|length <= 0 %}
				<td colspan="13" >No Test Records found!</td>
				{% else %}
				{% for row in cbc %}
					{% for col in row %}
						<td> {{col}} </td> 
					{% endfor %}
				</tr>
				{% endfor %}
				{% endif %}
			</tbody>
			</table>
			</div>
			</div>
			</div>
		<br><br><div class="col-md-9">
			<div class="component-box">
			<div class="pmd-card pmd-z-depth pmd-card-custom-view">
			<h2>&nbsp;&nbsp;&nbsp;Basic Metabolism Panel</h2>
			</div>
			</div>
			</div>
			<div class="col-md-9">
			<div class="component-box">
			<div class="pmd-card pmd-z-depth pmd-card-custom-view">
			<table id="example-checkbox" class="table pmd-table table-hover table-striped display responsive nowrap" cellspacing="0" width="100%">
			<thead>
				<tr>
					<th><b><center>Date</center></b></th>
					<th><b><center>Glucose</center></b></th>
					<th><b><center>Creatinine</center></b></th>
					<th><b><center>Sodium</center></b></th>
					<th><b><center>Potassium</center></b></th>
					<th><b><center>Chloride</center></b></th>
					<th><b><center>Carbon Dioxide</center></b></th>
				</tr>
			</thead>
			<tbody>
				{% if meta|length <= 0 %}
				<td colspan="7" >No Test Records found!</td>
				{% else %}
				{% for row in meta %}
					{% for col in row %}
						<td> {{col}} </td> 
					{% endfor %}
				</tr>
				{% endfor %}
				{% endif %}
			</tbody>
			</table>
			</div>
			</div>
			</div>
		<br><br><div class="col-md-9">
			<div class="component-box">
			<div class="pmd-card pmd-z-depth pmd-card-custom-view">
			<h2>&nbsp;&nbsp;&nbsp;MRI</h2>
			</div>
			</div>
			</div>
			<div class="col-md-9">
			<div class="component-box">
			<div class="pmd-card pmd-z-depth pmd-card-custom-view">
			<table id="example-checkbox" class="table pmd-table table-hover table-striped display responsive nowrap" cellspacing="0" width="100%">
			<thead>
				<tr>
					<th><b><center>Date</center></b></th>
					<th><b><center>MRI</center></b></th>
				</tr>
			</thead>
			<tbody>
				{% if mri|length <= 0 %}
				<td colspan="2" >No Test Records found!</td>
				{% else %}
				{% for row in mri %}
					<td> {{ row.0 }} </td> 
					<td><img src="{{ row.1 }}" style="width:500px;height:500px" /></td>
				</tr>
				{% endfor %}
				{% endif %}
			</tbody>
			</table>
			</div>
			</div>
			</div>
		<br><br><div class="col-md-9">
			<div class="component-box">
			<div class="pmd-card pmd-z-depth pmd-card-custom-view">
			<h2>&nbsp;&nbsp;&nbsp;X-Ray</h2>
			</div>
			</div>
			</div>
			<div class="col-md-9">
			<div class="component-box">
			<div class="pmd-card pmd-z-depth pmd-card-custom-view">
			<table id="example-checkbox" class="table pmd-table table-hover table-striped display responsive nowrap" cellspacing="0" width="100%">
			<thead>
				<tr>
					<th><b><center>Date</center></b></th>
					<th><b><center>X-Ray</center></b></th>
				</tr>
			</thead>
			<tbody>
				{% if xray|length <= 0 %}
				<td colspan="2" >No Test Records found!</td>
				{% else %}
				{% for row in xray %}
					<td> {{ row.0 }} </td> 
					<td><img src="{{ row.1 }}" style="width:500px;height:500px"/></td>
				</tr>
				{% endfor %}
				{% endif %}
			</tbody>
			</table>
			</div>
			</div>
			</div>
</div>
		<!-- end no table found blank state-->

</div>

{% else %}
  <p>You are not logged in</p>
  <a href="{% url 'register' %}">Log In</a>
{% endif %}


{% endblock %}
