<?
    $title = 'Shipping Label';
    date_default_timezone_set("Asia/Jakarta");
    $date = date("Y-m-d");
    function rupiah($nilai)
    {
    	$hasil = number_format($nilai,0,',','.').',-';
    	return $hasil;
    }
?>

<!DOCTYPE html>
</html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="AR pendiri, merupakan kepanjangan dari Abdul Rahman (AR) yang memulai usaha bisnis pertamanya dibidang Ladscape atau taman pada tahun 2018.">
    <meta name="author" content="AR Group">
    <title>PT. AR GROUP BERKAH BERSAMA</title>
    
    <!-- font icons -->
    <!--<link rel="stylesheet" href="assets/vendors/themify-icons/css/themify-icons.css">-->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

    <!-- Bootstrap + Creative Studio main styles -->
    
	<link rel="stylesheet" href="assets/css/creative-studio.css">
	<!--<link rel="stylesheet" href="assets/css/styles.css">-->
    
    <!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">-->
    @include('admin/ar-css')
    <style>

    /* Invoice*/
    .text-danger strong {
        	color: #9f181c;
		}
		.receipt-main {
			background: #ffffff none repeat scroll 0 0;
			border-bottom: 12px solid #333333;
			border-top: 12px solid #74164B;
			/*margin-top: 50px;*/
			/*margin-bottom: 50px;*/
			margin:20px auto;
			padding: 40px 30px !important;
			position: relative;
			box-shadow: 0 1px 21px #acacac;
			color: #333333;
			font-family: open sans;
		}
		.receipt-main p {
			color: #333333;
			font-family: open sans;
			line-height: 1.42857;
		}
		.receipt-footer h1 {
			font-size: 15px;
			font-weight: 400 !important;
			margin: 0 !important;
		}
		.receipt-main::after {
			background: #414143 none repeat scroll 0 0;
			content: "";
			height: 5px;
			left: 0;
			position: absolute;
			right: 0;
			top: -13px;
		}
		.receipt-main thead {
			/*background: #414143 none repeat scroll 0 0;*/
			background-color: #74164B !important;
		}
		.receipt-main thead th {
			color:#fff;
		}
		.receipt-right h5 {
			font-size: 15px;
			font-weight: bold;
			margin: 0 0 7px 0;
		}
		.receipt-right p {
			font-size: 12px;
			margin: 0px;
		}
		.receipt-right p i {
			text-align: center;
			width: 18px;
		}
		.receipt-main td {
			padding: 9px 20px !important;
		}
		.receipt-main th {
			padding: 13px 20px !important;
		}
		.receipt-main td {
			font-size: 13px;
			font-weight: initial !important;
		}
		.receipt-main td p:last-child {
			margin: 0;
			padding: 0;
		}	
		.receipt-main td h2 {
			font-size: 20px;
			font-weight: 900;
			margin: 0;
			text-transform: uppercase;
		}
		.receipt-header-mid .receipt-left h1 {
			font-weight: 100;
			margin: 34px 0 0;
			text-align: right;
			text-transform: uppercase;
		}
		.receipt-header-mid {
			margin: 24px 0;
			overflow: hidden;
		}
		
		#container {
			background-color: #dcdcdc;
		}
        .table-invoice tr:nth-child(odd) {
          background-color: #f2f2f2;
        }
		
</style>
    
    <script>
        function printDiv(divName) {
            var divToPrint = document.getElementById(divName);
            var css = createInvoiceCss();
            //var htmlToPrint = createInvoiceCss();

            //htmlToPrint = divToPrint.outerHTML;
            var htmlToPrint = '<html><head><link rel="stylesheet" href="assets/css/creative-studio.css">' + css + '</head><body>' + divToPrint.outerHTML + '</body></html>';
            newWin = window.open();
            newWin.document.write(htmlToPrint);
            newWin.print();
            newWin.close();
        }
        

        function createInvoiceCss(){
            var data = '<style type="text/css">' +
                '.text-danger strong {color: #9f181c;}' +
		        '.receipt-main {background: #ffffff none repeat scroll 0 0;border-bottom: 12px solid #333333;border-top: 12px solid #9f181c;margin:20px auto;padding: 40px 30px !important;position: relative;box-shadow: 0 1px 21px #acacac;color: #333333;font-family: open sans;}' +
		        '.receipt-main p {color: #333333;font-family: open sans;line-height: 1.42857;}' +
		        '.receipt-footer h1 {font-size: 15px;font-weight: 400 !important;margin: 0 !important;}' +
		        '.receipt-main::after {background: #414143 none repeat scroll 0 0;content: "";height: 5px;left: 0;position: absolute;right: 0;top: -13px;}' +
		        '.receipt-main thead {background: #414143 none repeat scroll 0 0;}' +
		        '.receipt-main thead th {color:#fff;}' +
        		'.receipt-right h5 {font-size: 16px;font-weight: bold;margin: 0 0 7px 0;}' +
        		'.receipt-right p {font-size: 12px;margin: 0px;}' +
        		'.receipt-right p i {text-align: center;width: 18px;}' +
        		'.receipt-main td {padding: 9px 20px !important;}' +
        		'.receipt-main th {padding: 13px 20px !important;}' +
        		'.receipt-main td {font-size: 13px;font-weight: initial !important;}' +
        		'.receipt-main td p:last-child {margin: 0;padding: 0;}' +
        		'.receipt-main td h2 {font-size: 20px;font-weight: 900;margin: 0;text-transform: uppercase;}' +
        		'.receipt-header-mid .receipt-left h1 {font-weight: 100;margin: 34px 0 0;text-align: right;text-transform: uppercase;}' +
        		'.receipt-header-mid {margin: 24px 0;overflow: hidden;}' +
        		'#container {background-color: #dcdcdc;}</style>';
                return data;
            }

    </script>

</head>

<body data-spy="scroll" data-target=".navbar" data-offset="40" id="home">
    @include('admin/header_admin')

<!-- Test New Implementation-->
    <section id="dashboard" class="ar-dashboard-height">
        <div class="ar-dashboard-row" style="height:100%">
            <div id="ar-left-nav">
                @include('admin/left_nav')
            </div>
            
            <div style="flex:0 0 85%;max-width:85%">
                <!-- Start of Invoice -->
                    <div class="row">
                    		
                            <div id="invoice" class="receipt-main" style="width:80%;background-color:#f8f8f8">
                                
                                <div class="row">
                    				<div class="col-xs-6 col-sm-6 col-md-6">
                    					<div class="receipt-left">
                    						<img class="img-responsive" alt="iamgurdeeposahan" src="assets/imgs/ar-group.png" style="width: 71px; border-radius: 43px;">
                    					</div>
                    				</div>
                    			    <div class="col-xs-6 col-sm-6 col-md-6 text-right">
                    			        <div class="receipt-right">
                    				        <h5>PT. AR GROUP BERKAH BERSAMA</h5>
                    				        <p>088-9199-6485 <i class="fa fa-phone"></i></p>
                    				        <p>info@by-arsolution.com <i class="fa fa-envelope-o"></i></p>
                    				        <p>INDONESIA <i class="fa fa-location-arrow"></i></p>
                    				    </div>
                                    </div>
                                </div>
                    			
                    			<div class="row">
                    				<div class="col-xs-6 col-sm-6 col-md-6 text-left">
										<!--
                    					<div class="receipt-right" style="margin-bottom:5px">
                    						<h5>Kepada Yth: {{$billing->name ?? ''}} </h5>
                    						<p><b>Mobile :</b> {{$billing->phone ?? ''}}</p>
                    						<p><b>Email :</b> {{$billing->email ?? ''}}</p>
                    						<p><b>Address :</b> {{$billing->address ?? ''}}</p>                    						
                    					</div>
										-->
                    				</div>
                    				<div class="col-xs-6 col-sm-6 col-md-6 text-right">
                    					<div class="receipt-right">
                    						<h4>AWB # :{{$billing->id ?? ''}}</h4>

                    					</div>
                    				</div>
                                </div>
                    			
                                <div>
                                    <!--<table class="tablex table-bordered" style="width:100%">-->
                                    <table style="border:1px solid gray;width:100%">
                                        <thead style="background-color: #800020">
                                            <tr>
                                                <th class="col-md-6" style="border:1px solid gray">Pengirim</th>
                                                <th class="col-md-6" style="white-space:nowrap;border:1px solid gray">Penerima</th>
                                            </tr>
                                        </thead>
                                        <tbody class="table-invoicex">
                                            <!-- Begin of data-->
                                            
                                            <?
											echo '<tr>
														<td class="col-md-6" style="border-left:1px solid gray;border-top:1px solid #dcdcdc;vertical-align:baseline">
															PT. AR GROUP Berkah Bersama<br>
															<br>Jl. H. Abu Hasyim - Rt. 001/08<br>
															Kel. Jati Padang - Kec. Pasar Minggu<br>
															Jakarta Selatan - INDONESIA
														</td>
														<td class="col-md-6" style="border-left:1px solid gray;border-top:1px solid #dcdcdc;vertical-align:baseline">
															'.$order->customer.'<br>
															<br>'.$order->address.'
														</td>
										  			</tr>'
											?>
                                        </tbody>
                                        <tfoot>
                                            <?
												$myItems = '<ul>';
												foreach($items as $item){
													$myItems  .= '<li>'.$item->name.'</li>';
												}
												$myItems .= '</ul>';

                                                echo '<tr>
														<td class="text-right" style="border:1px solid gray;vertical-align:baseline"><strong>Isi Paket: </strong></td>
														<td class="text-left text-danger" style="border:1px solid gray">
															<strong>'.
															$myItems
															.'</strong>
														</td>
											  		</tr>';
												
												/*
												echo '<tr>
                                                        <td class="text-right" style="border:1px solid gray"><strong>Jenis Layanan: </strong></td>
                                                        <td class="text-left text-danger" style="border:1px solid gray"><strong>Reguler</strong></td>
                                                      </tr>';

                                                echo '<tr>
                                                        <td class="text-right" style="border:1px solid gray"><strong>COD: </strong></td>
                                                        <td class="text-left text-danger" style="border:1px solid gray"><strong>Rp. 50.000,-</strong></td>
                                                      </tr>';
                                                echo '<tr>
                                                        <td class="text-right" style="border:1px solid gray"><strong>Total: </strong></td>
                                                        <td class="text-left text-danger" style="border:1px solid gray"><strong>Rp. 50.000</strong></td>
                                                      </tr>';
												*/
                                            ?>

                                        </tfoot>
                                    </table>
                                </div>
                    			
                    			<div class="row">
                    				<div class="col-xs-8 col-sm-8 col-md-8 text-left">
                    					<div class="receipt-right">
                    						<p><b>Date :</b> <? echo date('d-m-Y')?></p>
                    						<h5 style="color: rgb(140, 140, 140);">Terima kasih sudah menggunakan jasa AR Solution!</h5>
                    					</div>
                    				</div>
                    				<div class="col-xs-4 col-sm-4 col-md-4">
                    					<div class="receipt-left">
                    						<!--<h1>Stamp</h1>-->
                    					</div>
                    				</div>
                                </div>
                                
                            </div>    
                    	
                    </div>
                    
                    <div style="margin:10px;text-align:center">
                        <button class="btn btn-success" style="margin-bottom:5px" onclick="printDiv('invoice')">Print Label</button>
                    </div>

                    <!-- End of Invoice -->                
                
            </div>
            
        </div>
    </section>


</body>
</html>