
<?php $__env->startSection('content'); ?>
    <div class="pagetitle">
        <h1>Order</h1>
        <nav>
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                <li class="breadcrumb-item">Tables</li>
                <li class="breadcrumb-item active">Order</li>
            </ol>
        </nav>
    </div><!-- End Page Title -->

    <section class="section">
        <div class="row">
            <div class="col-lg-12">

                <div class="card">
                    <div class="d-flex justify-content-end align-items-center me-5">
                        <div class="w-25 mt-5">
                            
                        </div>
                    </div>

                    <div class="card-body" id="printableArea">
                        <div class="d-flex align-items-center p-5">
                            <div class="billinv">
                                <div>
                                    <h4 class="fw-bold">Order Summary</h4>
                                    <div class="mt-4">
                                        <p class="p-0 m-0 fw-semibold">Billed to: <?php echo e($orders->name); ?></p>
                                        <p class="p-0 m-0 fw-semibold">Phone: <?php echo e($orders->phone); ?></p>
                                        <p class="p-0 m-0 fw-semibold">Address: <?php echo e($orders->address); ?></p>
                                    </div>
                                </div>
                            </div>
                            <div class="invid">
                                <div>
                                    <div>
                                        <img src="<?php echo e(asset('assets/img/logo/Logo.jpg')); ?>" alt="">
                                        <p class="p-0 m-0 logo-text fst-italic">The Brain</p>
                                    </div>

                                    <p class="p-0 m-0 fw-semibold mt-4">Invoice Id: <?php echo e($orders->id); ?></p>
                                    <p class="p-0 m-0 fw-semibold">Date: <?php echo e($orders->created_at); ?></p>
                                    <p class="p-0 m-0 fw-semibold">Type: Cash on delivery</p>
                                </div>
                            </div>
                        </div>

                        <h5 class="fw-bold">Order Details</h5>
                        <!-- Default Table -->
                        <table class="table border">
                            <thead>
                                <tr>
                                    <th scope="col">#</th>
                                    <th scope="col">Name</th>
                                    <th scope="col">image</th>
                                    <th scope="col">Size</th>
                                    <th scope="col">Quantity</th>
                                    <th scope="col">Product Code</th>
                                    <th scope="col">Price</th>
                                    <th scope="col">Subtotal</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $orderDetails; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <th scope="row"><?php echo e($loop->iteration); ?></th>
                                        <td><?php echo e($item->product->name); ?></td>
                                        <td>
                                            <img src="<?php echo e(asset('storage/' . $item->product->thumbnail)); ?>" alt=""
                                                width="80" height="80">
                                        </td>
                                        <td><?php echo e($item->size); ?></td>
                                        <td><?php echo e($item->quantity); ?></td>
                                        <td><?php echo e($item->product_code); ?></td>
                                        <td><?php echo e($item->product->price); ?></td>
                                        <td><?php echo e($item->price); ?></td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <th></th>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td class="fw-bolder">Total (included shipping charge and discount):</td>
                                    <td><?php echo e($orders->total_price); ?></td>
                                </tr>
                               
                            </tbody>
                        </table>

                        <!-- End Default Table Example -->
                    </div>

                    <div class="d-flex justify-content-end align-items-center p-5">
                        <div class="me-5">
                            <button onclick="printOrder()" class="btn btn-primary">Print</button>
                        </div>
                        <div>
                            <h6 class="m-0 fw-bold">Update Status :</h6>
                        </div>
                        <form action="<?php echo e(route('admin.order-update', $orders->id)); ?>"
                            class="w-25 d-flex justify-content-end" method="POST">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('put'); ?>
                            <button type="submit" name="status" value="pending"
                                class="border border-0 badge bg-primary pending m-1">Pending</button>
                            <button type="submit" name="status" value="on-hold"
                                class="border border-0 badge bg-warning on-hold m-1">On-hold</button>
                            <button type="submit" name="status" value="completed"
                                class="border border-0 badge bg-success completed m-1">Completed</button>
                            <button type="submit" name="status" value="cancelled"
                                class="border border-0 badge bg-danger cancelled m-1">Cancelled</button>
                        </form>
                    </div>
                </div>

            </div>

        </div>
    </section>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('style'); ?>
    <style>
        .billinv {
            width: 60%;
        }

        .invid {
            width: 40%;
            margin-left: 20%;
        }

        .logo-text {
            font-size: 13px;
        }
    </style>
<?php $__env->stopPush(); ?>
<?php $__env->startPush('script'); ?>
    <script>
        function printOrder() {
            var printContent = document.getElementById("printableArea").innerHTML;
            var originalContent = document.body.innerHTML;

            document.body.innerHTML = printContent;
            window.print();
            document.body.innerHTML = originalContent;
            location.reload(); 
        }
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('backend.admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/emdadtwa/sefcard.com/resources/views/backend/order/details.blade.php ENDPATH**/ ?>