@extends('layouts.print')
 
@section('content')
<div class="main-content-wrapper">
	<div class="main-box">
		<div class="main-content">
			<div class="container">
				<div class="page">
					<div class="row">
						<div class="report-capital layout-print">
							<div class="header">
								<div class="logo">	
									<?php 
									$image_check = File::exists(asset('assets/images/resize/').$branch->branch_img)?true:false;
									?>
									@if($image_check==false)
									&nbsp;
									@else
									<img src="{{asset('assets/images/resize')}}/{{$branch->branch_img}}" alt="" width="200px">
									@endif
								</div>
								<div class="title">
									<h2>{{$branch->branch_kh}}</h2>
									<h2>{{$branch->branch_en}}</h2>
									<h3>{{$title}}</h3>
								</div>
								<div class="clear"></div>
								<div class="border-bottom"></div>
								<div class="table">
									<table>
										<thead>
											<tr>
									            <th>No</th>
									            <th>Project Name</th>
									            <th>Category Name</th>
												<th>Street No</th>
												<th>Item N°</th>
												<th>Zone</th>
									            {{-- <th>Item Code</th> --}}
									            <th>Size</th>
									            <th>Cost</th>
									            <th>Price</th>
									          </tr>
										</thead>
										<tbody>
											<?php 
												$total_cost = 0;
												$total_price = 0;
												$index = 0;
											?>
											@foreach($collect_items as $key => $value)
											<?php 
												$total_cost 	+= $value['item_cost'];
												$total_price 	+= $value['item_price'];
											?>
											<tr>
												<td >{{++$index}}</td>
												<td>{{$value['project_name']}}</td>
												<td>{{$value['category_name']}}</td>
												<td>{{$value['item_street']}}</td>
												<td>{{$value['item_house']}}</td>
												<td>{{$value['item_zone']}}</td>
												{{-- <td>{{$value->item_name}}</td> --}}
												<td>{{empty($value['item_size_house'])?$value['item_size_land']:$value['item_size_house']}}</td>
												<td>${{number_format($value['item_cost'],2)}}</td>
												<td>${{number_format($value['item_price'],2)}}</td>
											</tr>
											@endforeach
											<tr>
												<th colspan="7" style="text-align: right !important;">Total</th>
												<th>${{number_format($total_cost,2)}}</th>
												<th>${{number_format($total_price,2)}}</th>
											</tr>
										</tbody>
									</table>
									<div class="make-date">
										<p>ធ្វើនៅ​ <strong>ភ្នំពេញ</strong> ថ្ងៃទី <strong>{{\Globals::date_khmers(date('Y-m-d'))}}</strong></p>
									</div>
									<div class="sign">
										<h3>ហត្ថលេខា</h3>
										<p>_________________</p>
									</div>
								</div>
							</div>
						</div>
							
						
					</div>
					
					
				</div>
			</div>
		</div>
	</div>
</div>
{{-- <style>
	table,table>thead,table>thead>tr,table>thead>tr>th,table>tbody,table>tbody>tr,table>tbody>tr>td{
		font-size:140px !important;
	}
	@media print{
		.page{
			font-size: 140px !important;
		}
		table,table>thead,table>thead>tr,table>thead>tr>th,table>tbody,table>tbody>tr,table>tbody>tr>td{
			font-size:140px !important;
		}
	}
</style> --}}
@endsection


