@extends('layouts.print')

@section('content')
<div class="content-wrapper">
    <div class="box">
        <div class="content">
            <div class="container">
                <div class="page">
                    <div class="row">
                        <div class="col-sm-2">
                        {{--<div>--}}
                            {{--<img src="{{asset('assets/images/resize')}}/{{$branch[0]->branch_img}}" width="130px">--}}
                        {{--</div>--}}

                        </div>
                        <div class="col-sm-8">
                            <h1 class="contract-title">{{$branch[0]->branch_kh}}</h1>
                            <center><p>អាសយដ្ឌាន : {{$branch[0]->branch_address}}</p>
                            <p>Tel : {{$branch[0]->branch_phone}}</p></center>
                        </div>
                        <div class="col-sm-2">

                        </div>
                    </div>

                    <div style="border: 1px solid gray; margin-bottom: 10px;"></div>
                    <table width="100%">
                        <tbody>
                            <tr>
                                <td>គម្រោង :</td>
                                <td>{{$load[0]->project_name}}</td>
                                <td>តម្លៃ :</td>
                                <td>${{number_format($load[0]->loan_amount,2)}}</td>
                                <td>ឈ្មោះអតិថិជន :</td>
                                <td>{{$load[0]->client_fullname}}</td>
                            </tr>
                            <tr>
                                <td>លេខឡូតិ៍ :</td>
                                <td>{{$load[0]->item_house}}</td>
                                <td>ប្រាក់កក់ :</td>
                                <td>${{number_format($load[0]->sale_receive,2)}}</td>
                                <td>លេខទូរស័ព្ទ :</td>
                                <td>{{$load[0]->client_phone1}}</td>
                            </tr>
                            <tr>
                                <td>ទំហំ :</td>
                                <td>{{$load[0]->item_size_land}}</td>
                                <td>បញ្ចុះតម្លៃ :</td>
                                <td>${{number_format($load[0]->sale_discount,2)}}</td>
                                <td>ទីភ្នាក់ងារ :</td>
                                <td>{{$load[0]->agency}}</td>
                            </tr>
                        </tbody>
                    </table><br>
                    <table class="table table-bordered schedul" border="1" cellpadding="0" cellspacing="0" width="100%">
                        <thead>
                            <tr>
                                <th>No</th>
                                <th>Payment Date</th>
                                <th>Principal</th>
                                <th>Interest</th>
                                <th>Principal Balance</th>
                                <th>Payment</th>
                                <th>Payment Owed</th>
                                <th>Status</th>
                            </tr>
                        </thead>

                        <tbody>
                            @foreach ($clientbooking as $key => $value)
                                <tr align="center">
                                    <td>{{$value->loanprocess_no}}</td>
                                    <td>{{date('Y-m-d', strtotime($value->loanprocess_datepayment))}}</td>
                                    <td>$ {{number_format($value->loanprocess_principle, 2)}}</td>
                                    <td>$ {{number_format($value->loanprocess_interest, 2)}}</td>
                                    <td>$ {{number_format($value->loanprocess_principleos, 2)}}</td>
                                    <td>$ {{number_format($value->loanprocess_owe, 2)}}</td>
                                    <td>$ {{number_format($value->loanprocess_owepay, 2)}}</td>
                                    <td>{{$value->loanprocess_paid == 1 ? "Paid" : " "}}</td>
                                </tr>
                            @endforeach
                        </tbody>
                    </table>

                    <br>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection