@extends('layouts.print')

@section('content')
<style>
	.container {
		width: 215mm !important;
		margin-top: 10px;
	}

	.panelBody {
		font-family: 'Khmer OS Content' !important;
	}

	.contract-title {
		font-family: 'Khmer OS Content' !important;
	}
	.letter-bold {
		font-weight: bold !important;
	}
	b {
		padding: 0 20px !important;
	}
	.colorsd {
		color: blue !important;
	}
	.line_hight {
		line-height:25px;
    }
    table.table-bordered tr th,table.table-bordered tr td{
        border: 1px rgb(117, 114, 114) solid !important;
    }
    .font-moul-light{
        font-family: 'Khmer OS Muol Light' !important;
    }
</style>
<div class="content-wrapper">
	<div class="box">
		<div class="content">
			<div class="container">
				<div class="page">
					<div id="exportContent">
						<div id="panelPrint">
							<div class="panelBody">
								<div class="bg_image">
                                    <div><button class="btn btn-primary hidden-print pull-right" onclick="myFunction()"><span class="glyphicon glyphicon-print" aria-hidden="true"></span> Print</button></div>

                                    <table width="100%" align="center">
                                        <tr>
                                            <td class="line_hight">

                                                <div class="contract-title">
                                                    <img src="{{asset('assets/images/logo.png')}}" style="width:200px;display:block;" />
                                                </div>
                                                <div style="text-align: right;margin-top:-80px">ថ្ងៃ....................ខែ.......... ឆ្នាំ...............ស័ក ព.ស ២៥៦......
                                                    <br/>រាជធានីភ្នំពេញ,ថ្ងៃទី..........ខែ............ឆ្នាំ ២០២.....
                                                </div>
                                                <br/><br/>
                                                <div style="text-align:center;font-family: 'Khmer OS Muol Light';">
                                                    <span style="font-size: 18px;">
                                                        បុរី ថៃ ឈុនគ្រី<br/>
                                                        លិខិតស្នើសុំកែប្រែសោភ័ណភាពផ្ទះ
                                                        </span><br/>
                                                    
                                                </div>
                                            </td>
                                        </tr>
                                        
                                        <tr>
                                            <td><br/>
                                                <div style="float: left;">
                                                    <span style="font-weight: bold;">យោង ៖ </span>
                                                    <span>កិច្ចសន្យាទិញ-លក់ផ្ទះ ៖ {{ $data->contract_number }}</span> <span style="margin-left: 10px;">, ចុះថ្ងៃ​ {{ \Globals::date_khmers(date($data->contract_date))}}</span>។
                                                    
                                                </div>
                                                {{-- <div style="text-align: right;">
                                                    <span style="margin-left: 10px;">,ចុះថ្ងៃទី..................ខែ................ឆ្នាំ20................ </span>
                                                </div> --}}
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="line_hight">
                                                <div>
                                                    <p style="text-indent: 50px;">
                                                        ខ្ញុំបាទ/នាងខ្ញុំឈ្មោះ <span  style="font-family: 'Khmer OS Muol Light'">{{ $client_info->client_fullname }}</span> កាន់អត្តសញ្ញាណប័ណ្ណលេខ {{ $client_info->client_cardid }} {!! $client_relationship !!} ជាភាគីអ្នកទិញផ្ទះប្រភេទ <span  style="font-family: 'Khmer OS Muol Light'">{{ $item_info->sub_category_names }}</span> ផ្ទះលេខ {{ $item_info->item_names }} ផ្លូវបេតុងលេខ {{ $item_info->item_street }} នៃបុរី ថៃ ឈុនគ្រី គម្រោង <span  style="font-family: 'Khmer OS Muol Light'">{{ $data->project_name }}</span> ដែលមានទីតាំងស្ថិតនៅ{{ $project_address }} គោលការណ៍បង់ប្រាក់ប្រភេទបង់ប្រាក់{{!empty($payment_policy)?($payment_policy."(".$payment_policy_detail.")"):"................................."}}។
                                                    </p>
                                                </div>
                                                <table class="table table-bordered">
                                                    <tr>
                                                        <td style="text-align: center;font-family: 'Khmer OS Muol Light';">ល.រ</td>
                                                        <td style="text-align: center;font-family: 'Khmer OS Muol Light';">បរិយាយនៃការស្នើសុំ</td>
                                                        <td style="text-align: center;font-family: 'Khmer OS Muol Light';">ខ្នាត</td>

                                                        <td style="text-align: center;font-family: 'Khmer OS Muol Light';">បរិមាណ</td>
                                                        <td style="text-align: center;font-family: 'Khmer OS Muol Light';">តម្លៃ</td>
                                                        <td style="text-align: center;font-family: 'Khmer OS Muol Light';">ឯកភាព</td>
                                                    </tr>
                                                    <?php $total = 0; ?>
                                                    @foreach($data_detail as $key=>$value)
                                                    <tr>
                                                        <td>{{ $key+1 }}</td>
                                                        <td>{{ $value->request_description }}</td>
                                                        <td>
                                                            {{ $value->unit }}
                                                        </td>
                                                        <td>
                                                            {{ $value->qty }}
                                                        </td>
                                                        <td>
                                                            {{ "$".$value->fee_price }}
                                                            <?php $total += $value->fee_price; ?>
                                                        </td>
                                                        <td></td>
                                                    </tr>
                                                    @endforeach
                                                    <tr>
                                                        <td colspan="4" style="text-align: right;">
                                                            តម្លៃសរុប =
                                                        </td>
                                                        <td>
                                                            {{ "$".$total }}
                                                        </td>
                                                        <td></td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <br>

                                                <table width="100%" border="0">

                                                    <tr style="text-align: center !important;">

                                                        <td style="font-family: 'Khmer OS Muol Light';text-align: center !important;">
                                                            <div style="text-align: center !important;">
                                                                ស្នាមមេដៃអ្នកស្នើសុំ     
                                                            </div>
                                                        </td>

                                                        <td style="font-family: 'Khmer OS Muol Light';text-align: center !important;">
                                                            <div style="text-align: center !important;margin-left:20px !important;">
                                                                អ្នកទទួល
                                                            </div>
                                                        </td>

                                                        <td style="font-family: 'Khmer OS Muol Light';text-align: center !important;">
                                                            <div style="text-align: center !important;margin-left:20px !important;">
                                                                អ្នកត្រួតពិនិត្យ           
                                                            </div>
                                                        </td>

                                                        <td style="font-family: 'Khmer OS Muol Light';text-align: center !important;">
                                                            <div style="text-align: center !important;margin-left:20px !important;">
                                                                អ្នកឯកភាព
                                                            </div>
                                                        </td>

                                                    </tr>

                                                    <tr style="text-align: center !important;">
                                                        <td>
                                                            <div style="text-align: center !important;font-family: 'Khmer OS Muol Light';">
                                                                <br/><br><br/><br>
                                                                ឈ្មោះ <span  style="font-family: 'Khmer OS Muol Light'">{{ $client_info->client_fullname }} {{ $client_relationship_name }}</span>
                                                            </div>
                                                        </td>
                                                        <td>
                                                            <div style="text-align: center !important;font-family: 'Khmer OS Muol Light';margin-left:20px !important;">
                                                                <br/><br><br/><br>
                                                                ..............................
                                                            </div>
                                                        </td>
                                                        <td>
                                                            <div style="text-align: center !important;font-family: 'Khmer OS Muol Light';margin-left:20px !important;">
                                                                <br/><br><br/><br>
                                                                ..............................
                                                            </div>
                                                        </td>

                                                        <td>
                                                            <div style="text-align: center !important;font-family: 'Khmer OS Muol Light';margin-left:20px !important;">
                                                                <br/><br><br/><br>
                                                                ..............................
                                                            </div>
                                                        </td>

                                                    </tr>

                                                </table>

                                                </td>

                                        </tr>

                                    </table>
                                </div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="divFooter" style="text-align: left; width: 100%;">
    <div style="text-align:right;font-size: 90%;color:#58ACFA"><i>Borey Thai Chhunkry - The House You Dream</i></div>
</div>

@endsection
<style>

    /* div.divFooter:after {
        counter-increment: page !important;
        content:"ទំព័រ " counter(page) !important;
    } */
    @media screen {
          div.divFooter {
            visibility: hidden !important;
          }
    }
    @media print {

      div.divFooter {
        position: fixed;
        bottom: 1;
        margin-bottom: -3px !important;
         display: block !important;

      }
       div.divFooter div{
           color: #58ACFA !important;
       }
       .panelBody{
           font-size: 15px !important;
           line-height: 28px !important ;
       }
       .panelBody tr td{
           font-size: 15px !important;
           line-height: 28px !important ;
       }
    }
</style>
<script>
    function myFunction() {
        window.print();
    }
</script>