<!DOCTYPE html>
<html lang="en">

<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<head>
    <meta name="csrf-token" content="{{ csrf_token() }}" />
    <meta charset="utf-8" />
    <title>Earning BD Shop</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="shortcut icon" href="{{asset('webasset/img/favicon.png')}}" type="image/x-icon" />

    @include('web.layout.css')
    @include('web.layout.invcss')

</head>

<body>
<div class="body-wrapper">

    <div class="receipt-content">
        <div class="container bootstrap snippets bootdey">
            <div class="row">
                <div class="col-md-12">
                    <div class="invoice-wrapper">
                        <div id="pwdo">
                            <div class="intro">
                                <div class="row">
                                    <div class="col-sm-6">
                                        <img style="width:170px" src="{{asset('web/images/logo/logo.png')}}">
                                        <p style="margin-top: 10px;">
                                            Earning BD Shop<br>
                                            55/B, Purana Paltan, Noakhali Tower (Lift-08), Dhaka-1000.
                                        </p>
                                    </div>
                                    
                                    <div class="col-sm-6 text-right">
                                        <h1 style="font-size: 30px;">Invoice</h1>
                                        <p>
                                            No : #{{$ord_data->id}} <br>
                                            {{ date_format(date_create($ord_data->created_at), 'd M, Y') }}
                                        </p>
                                       
                                        <h5 style="margin-bottom: 4px;">Order TK: <span style="color: #3bb77e;"><?php echo number_format($ord_data->grand_total); ?></span></h5>
                                        @if($ord_data->payment_status == 'Paid')
                                        <h5 style="margin-bottom: 4px;">Paid: <span style="color: #00b4ff;"><?php echo number_format($ord_data->sub_total); ?></span></h5>
                                        <h5 style="margin-bottom: 4px;">Due: <span style="color: red;"><?php echo number_format($ord_data->grand_total-$ord_data->sub_total); ?></span></h5>
                                        @else
                                        <h5 style="margin-bottom: 4px;">Paid: <span style="color: red;">0</span></h5>
                                        <h5 style="margin-bottom: 4px;">Due: <span style="color: red;"><?php echo number_format($ord_data->grand_total); ?></span></h5>
                                        @endif
                                    </div>
                                </div>
                            </div>

                            <div class="payment-info">
                                <div class="row">
                                    <div class="col-sm-6">
                                        <strong>Ship & Bill To:</strong>
                                        <span>{{$ord_data->name}}</span><br>
                                        <span>{{$user_data->mobile}}</span><br>
                                        <span>{{$ord_data->address}}</span>

                                    </div>
                                    <div class="col-sm-6 text-right">
                                        <strong>Order Info:</strong>
                                        <span>Status: @if($ord_data->status == 0) <span style="color: red;">Pending</span> @else <span style="color: green;">Delivered</span> @endif</span><br>
                                        <span>Payment: {{$ord_data->payment_method}}</span>
                                    </div>
                                </div>
                            </div>

                            <div class="payment-details">
                                <div class="row">
                                    <div class="table-responsive">
                                        <table class="table" style="border: 1px solid #dee2e6;font-size: 14px;">
                                            <thead>
                                                <tr style="background: #8080802e;">
                                                    <th style="border-bottom: 0;" scope="col">No</th>   
                                                    <th style="border-bottom: 0;text-align: left;" scope="col">Product</th>
                                                    <th style="border-bottom: 0;text-align: left;" scope="col">Price</th>
                                                    <th style="border-bottom: 0;text-align: left;" scope="col">Qty</th>
                                                    <th style="border-bottom: 0;padding-right: 10px;" scope="col" class="text-right">Total</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                @foreach($pro_data as $pro)
                                                <tr>
                                                    <th scope="row">#</th>
                                                    <td>{{$pro->product_title}}</td>
                                                    <td>{{$pro->product_price}}</td>
                                                    <td>{{$pro->product_qty}}</td>                   
                                                    <td style="padding-right: 10px;" class="text-right">{{$pro->product_price*$pro->product_qty}}</td>
                                                </tr> 
                                                @endforeach   
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                            <div class="line-items">
                                <div class="total text-right">
                                    <p class="extra-notes">
                                        <strong>Extra Notes</strong>
                                        If you not received your product or you have any query, Please contact our support.
                                    </p>
                                    <div class="field">
                                        Subtotal <span><?php echo number_format($ord_data->grand_total); ?></span>
                                    </div>
                                    <div class="field">
                                        Shipping <span>@if(is_null($ord_data->shipping_charges)) 0.00 @else {{$ord_data->shipping_charges}} @endif</span>
                                    </div>
                                    <div class="field grand-total">
                                        Total <span><?php echo number_format($ord_data->grand_total); ?></span>
                                    </div>
                                </div>  
                            </div>

                            <div class="line-items">
                                <div class="total text-right" style="padding-top: 20px;">
                                    <p class="extra-notes">
                                        <strong>Contact Us</strong>
                                        <span>www.earningbdshop.com</span><br>
                                        <span>info@earningbdshop.com</span>
                                    </p>
                                    <div class="field" style="padding-top: 25px;">
                                        <strong>Authorized Signatory</strong>
                                    </div>
                                </div>  
                            </div>
                        </div>
                    </div>
                    <a style="color:gray;font-size:15px" href="javascript:window.print()"><i class="fa fa-print"></i> Print Invoice</a> 
                    <div class="footer">
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
    @include('web.layout.js')
</body>

</html>