{% extends 'front.html.twig' %}
{% block title %}Bed Capacities{% endblock %}
{% block content %}
<div class="kt-subheader kt-grid__item"></div>
<div class="kt-container kt-grid__item kt-grid__item--fluid">
<div class="kt-portlet kt-portlet--mobile">
<div class="kt-portlet__head kt-portlet__head--lg">
<div class="kt-portlet__head-label">
<h3 class="kt-portlet__head-title">Bed Capacities</h3>
</div>
</div>
<div class="kt-portlet__body">
{% include 'facility_dashboard/_filter_form.html.twig' %}
<table class="table">
<thead>
<tr>
<th class="text-right">Sr. No.</th>
<th>District / Corporation</th>
<th class="text-right">Hospitals</th>
<th class="text-right">As per IPHS</th>
<th class="text-right">Available Beds</th>
<th class="text-right">Vacant Beds</th>
<th class="text-right">Vacant Available %</th>
<th class="text-right">Bed Occupancy %</th>
</tr>
</thead>
<tbody>
{% for bed in beds %}
<tr>
<td class="text-right">{{ loop.index }}</td>
<td>
<a href="{{ path('facilities_district', {'id': bed.district_id }) }}" data-toggle="kt-tooltip" title="View Details">{{ bed.district }}</a>
</td>
<td class="text-right">{{ bed.hospitals }}</td>
<td class="text-right">{{ bed.iphs }}</td>
<td class="text-right">{{ bed.available }}</td>
<td class="text-right">{{ bed.available > 0 ? bed.available - bed.occupied : '0' }}</td>
<td class="text-right">{{ bed.available > 0 ? (((bed.available - bed.occupied) * 100) / bed.available)|number_format(2) : '0' }}</td>
<td class="text-right">{{ bed.available > 0 ? ((bed.occupied * 100) / bed.available)|number_format(2) : '0' }}</td>
</tr>
{% else %}
<tr>
<td colspan="8" class="text-center">No data found.</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
{{ parent() }}
<script>
$('#type').val('{{ app.request.get('type') }}');
$('#level').val('{{ app.request.get('level') }}');
$('#department').val('{{ app.request.get('department_id') }}');
$('select').selectpicker();
</script>
{% endblock %}