@extends('layouts.report-print')
@section('css')
	<style type="text/css">
	/* size landscape for landscape paper */
		@page{
			size: landscape;
		}
	</style>
@endsection
@section('content')
	<div class="container-print">
		<div class="row">
			<div class="col-md-12">
				<div class="UpperTitle"><img src="{{asset('assets/images/resize')}}/{{$branch->branch_img}}" alt="Logo">
					<div class="title">
						<h2 class="com-name">{{$branch->branch_kh}}</h2>
						<h2>{{$branch->branch_en}}</h2>
						<h3>Report Manage Using</h3>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<hr>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<table class="table table-print" width="100%">
					<tbody>
						<tr>
							<th>No</th>
							<th>Date</th>
							<th>Project Name</th>
							<th>Warehouse</th>
							<th>Zone</th>
							<th>House</th>
							<th>Product Name</th>
							<th>Category</th>
							<th>Sub Category</th>
							<th>Quantities</th>
							<th>Unit Name</th>
						</tr>
						<?php $total_qty = 0;$total_qty = 0; ?>
						@foreach($data as $key => $value)
						<?php 
						$total_qty += $value->product_use_qty;?>
						<tr>
							<td>{{ $key+1 }}</td>
							<td>{{ !empty($value->date)?date("d-m-Y",strtotime($value->date)):"" }}</td>
							<td>{{ $value->project_name }}</td>
							<td>{{ $value->warehouse_name }}</td>
							<td>{{ $value->zone_name }}</td>
							<td>{{ $value->house_name }}</td>
							<td>{{ $value->product_name }}</td>
							<td>{{ $value->product_category_name }}</td>
							<td>{{ $value->sub_category }}</td>
							<td>{{ $value->product_use_qty }}</td>
							<td>{{ $value->unit_name }}</td>
						</tr>
						@endforeach()
						<tr>
							<td colspan="9">Total</td>
							<td>{{ $total_qty }}</td>
							<td></td>
						</tr>
					</tbody>
				</table>
			</div>	
		</div>
		<div class="row">
			<div class="col-md-12">
				<table width="100%"​ class="tb-sign">
					<tr align="right">
						<td>
							<p>ធ្វើនៅ​ <strong>ភ្នំពេញ</strong> ថ្ងៃទី <strong>{{\Globals::date_khmers(date('Y-m-d'))}}</strong></p>
							<p style="padding-bottom: 80px;padding-right:40px">ហត្ថលេខា</p>
							<p>______________________</p>
						</td>
					</tr>	
				</table>
			</div>
		</div>
	</div>
@endsection
<style>
	#text-align-right{
		text-align: right !important;
	}
</style>



