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

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Invoice</title>
    <link rel="stylesheet" href="<?php echo e(asset('public/frontEnd/css/bootstrap.min.css')); ?>" />
    <link rel="stylesheet" href="<?php echo e(asset('public/frontEnd/css/all.min.css')); ?>" />
    <style>
        * {
            margin: 0px;
            padding: 0px;
        }

        table {
            width: 100%;
        }

        table,
        th,
        td {
            border: 1px solid gray;
            border-collapse: collapse;
        }

        th,
        td {
            padding: 5px;
            text-align: left;
        }

        table.table-with-info tr:nth-child(even) {
            background-color: #eee;
        }

        table.table-with-info tr:nth-child(odd) {
            background-color: #fff;
        }

        table.table-with-info th {
            background-color: black;
            color: white;
        }

        hr {
            border-top: 1px dashed red;
        }

        table.table-with-info,
        table.table-with-info td,
        table.table-with-info th {
            border: 0px solid black;
        }

        @media print {


            .div-section
            {
                display: flex;
                flex-direction: column;
                height: 33%;
                justify-content: start;

            }
            .page-section
            {
                width: 210mm; /* A4 width */
                height: 297mm!important; /* A4 height */
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                page-break-after: always; /* Ensures each .page starts on a new printed page */
            }
        }
    </style>
</head>

<body>

<?php $__currentLoopData = $orders->chunk(3); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $orderChunk): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <div class="page-section">
        <?php $__currentLoopData = $orderChunk; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $order): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="div-section" style="font-size: 12px;">
                <table class="table-with-info" cellspacing="0" cellpadding="0">
                    <tr>
                        
                        <td style="width: 50%; text-align:left">
                            <h5>COMPANY INFO</h5>
                            <strong>
                                <img src="<?php echo e(asset(App\Models\GeneralSetting::first()->white_logo)); ?>" style="width:100px">
                            </strong>
                            <br>
                            <strong>
                                <?php echo e(App\Models\Contact::first()->address); ?>

                                <br>Phone: <?php echo e(App\Models\Contact::first()->phone); ?>

                            </strong>
                        </td>
                        <td style="width: 50%; text-align:center; margin-left:0px;paddin-left:0px;">
                            <h5>Invoice #<?php echo e($order->invoice_id); ?></h5>
                            <span style="font-weight:700"> Bill to :</span><?php echo e($order->shipping ? $order->shipping->name : ''); ?> <br>
                            <span style="font-weight:700"> Address:</span> <?php echo e($order->shipping ? $order->shipping->address : ''); ?>  <br>
                           <span style="font-weight:700"> Phone: </span>    <?php echo e($order->shipping ? $order->shipping->phone : ''); ?><br>
                           <!--<span style="font-weight:700"> Shipping Area:</span>   <?php echo e($order->shipping ? $order->shipping->area : ''); ?><br>-->
                        </td>
                    </tr>
                </table>
                <table class="">
                    <tr>
                        <th style="width: 15%">Code</th>
                        <th style="width: 60%">Product</th>
                        <th style="width: 15%">Quantity</th>
                        <th style="width: 20%">Price</th>
                    </tr>
                   <?php $__currentLoopData = $order->orderdetails; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td> <?php echo e($order->invoice_id); ?></td>
                        <td>
                            <?php echo e($value->product_id); ?> <?php echo e($value->product_name); ?>

                            <?php echo e($value->product_color ? ' - (' . $value->product_color . ')' : ''); ?>

                            <?php echo e($value->product_size ? ' - (' . $value->product_size . ')' : ''); ?>

                        </td>
                        <td><?php echo e($value->qty); ?></td>
                        <td><?php echo e($value->sale_price * $value->qty); ?> Tk</td>
                    </tr>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <tfoot>
                    <tr>
                        <td colspan="2" style="border: none;"></td>
                        <th>Delivery :</th>
                        <td><?php echo e($order->shipping_charge); ?> Tk</td>
                    </tr>
                    <tr>
                        <td colspan="2" style="border: none;"></td>
                        <th>Total :</th>
                        <td><?php echo e($order->amount); ?> Tk</td>
                    </tr>
                    </tfoot>
                  
                </table>
                  <p class="my-3">Note: <?php echo e($order->note); ?></p>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <hr>
    </div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

<script>
    window.print();
</script>



</body>

</html>
<?php /**PATH /home/rankking/public_html/resources/views/backEnd/order/print.blade.php ENDPATH**/ ?>