{{ include('common/header.twig') }}
<div class="page-title">
	<div class="row align-items-center">
		<div class="col-sm-4">
			<h2 class="page-title-text d-inline-block">{{ page_title }}</h2>
			<div class="breadcrumbs d-inline-block">
				<ul>
					<li><a href="{{ common.info.url }}">Dashboard</a></li>
					<li>{{ page_title }}</li>
				</ul>
			</div>
		</div>
		<div class="col-sm-8 text-right">
			<div class="dropdown d-inline-block mr-2">
				<a class="btn btn-white btn-sm dropdown-toggle" data-toggle="dropdown"><i class="las la-cloud-download-alt text-primary pr-2"></i> Export</a>
				<ul class="dropdown-menu dropdown-menu-right export-button">
					<li><a href="#" class="pdf"><i class="las la-file-pdf pr-2"></i>PDF</a></li>
					<li><a href="#" class="excel"><i class="las la-file-excel pr-2"></i>Excel</a></li>
					<li><a href="#" class="csv"><i class="las la-file-csv pr-2"></i>CSV</a></li>
					<li><a href="#" class="print"><i class="las la-print pr-2"></i>Print</a></li>
					<li><a href="#" class="copy"><i class="las la-copy pr-2"></i>Copy</a></li>
				</ul>
			</div>
		</div>
	</div>
</div>

<div class="panel panel-default">
	<div class="panel-body">
		<div class="table-responsive">
			<table class="table table-middle table-bordered table-striped datatable-table">
				<thead>
					<tr>
						<th>#</th>
						<th>Medicine</th>
						<th>Company</th>
						<th>Unit</th>
						<th>Unit/Packing</th>
						<th>Category</th>
						<th>Storebox</th>
						<th>Reorderlevel</th>
						<th>Live Stock</th>
						<th>Status</th>
					</tr>
				</thead>
				<tbody>
					{% for value in result %}
						{% if value.livestock is empty or value.livestock < '.1' %}
							<tr>
								<td>{{ loop.index }}</td>
								<td>
									<p class="text-primary mb-0">{{ value.name }}</p>
									<p class="mb-0">{{ value.generic }}</p>
								</td>
								<td>{{ value.company }}</td>
								<th>{{ value.unit }}</th>
								<td>{{ value.unitpacking }}</td>
								<td>{{ value.category_name }}</td>
								<td>{{ value.storebox }}</td>
								<td>{{ value.reorderlevel }}</td>
								<td>{{ value.livestock }}</td>
								<td>
									{% if value.minlevel >= value.livestock %}
										<span class="badge badge-sm badge-danger">Minlevel</span>
									{% elseif value.reorderlevel >= value.livestock %}
										<span class="badge badge-sm badge-warning">Reorderlevel</span>
									{% else %}
										<span class="badge badge-sm badge-primary">Normal</span>
									{% endif %}
								</td>
							</tr>
						{% endif %}
					{% endfor %}
				</tbody>
			</table>
		</div>
	</div>
</div>
{{ include('common/footer.twig') }}