<?php $__env->startSection('content'); ?>



<main class="h-full pb-16 overflow-y-auto">
          <div class="container px-6 mx-auto grid">
            <h2
              class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200"
            >
            <span class="text-blue-500">Order</span> Details
            </h2>
            <!-- CTA -->
            <a
              class="flex bg-blue-600 items-center justify-between p-4 mb-8 text-sm font-semibold shadow-md focus:outline-none focus:shadow-outline-green"
              href="<?php echo e(route('admin.orders')); ?>" style="color: #fff;"
            >
              <div class="flex items-center">
                &LeftArrow;
                <span>Back To Orders</span>
              </div>
            </a>

            <!-- Big section cards -->
            <h4
              class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
            >
              Order Id: <?php echo e($order->ref_id); ?>

            </h4>
            <div
              class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"
            >
              <p class="text-sm text-gray-600 dark:text-gray-400">
                Status : 
                <?php if($order->status == 1): ?>
                <span style="color:green">Approved</span>
                <?php elseif($order->status == 3): ?>
                <span style="color:red">Declined</span>
                <?php elseif($order->status == 2): ?>
                <span style="color:orange">Pending...</span>
                <?php endif; ?>
              </p>
            </div>
             <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.alert','data' => []]); ?>
<?php $component->withName('alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?><br>
            <!-- Responsive cards -->
            
            
             <!-- Big section cards -->
            <h4
              class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
            >
            Order Details
            </h4>
            <div
              class="px-4 py-3 mb-8"
            >
              <p class="text-sm mb-4 text-gray-600 dark:text-gray-400">
                Name: <?php echo e($order->first_name); ?> <?php echo e($order->last_name); ?>

              </p>
              <p class="text-sm mb-4 text-gray-600 dark:text-gray-400">
                Email: <?php echo e($order->email); ?>

              </p>
              <p class="text-sm mb-4 text-gray-600 dark:text-gray-400">
                Phone Number: <?php echo e($order->mobile); ?>

              </p>
              <p class="text-sm mb-4 text-gray-600 dark:text-gray-400">
                State: <?php echo e($order->state); ?>

              </p>
              <p class="text-sm mb-4 text-gray-600 dark:text-gray-400">
                Address: <?php echo e($order->address); ?>

              </p>
            </div>
            
            
            <h4
              class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
            >
             Products Carted
            </h4>
            <div class="w-full overflow-hidden rounded-lg shadow-xs">
              <div class="w-full overflow-x-auto">
                <table class="w-full whitespace-no-wrap">
                  <thead>
                    <tr
                      class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800"
                    >
                      <th class="px-4 py-3 border">Product</th>
                      <th class="px-4 py-3 border">Quantity</th>
                      <th class="px-4 py-3 border">Unit Price</th>
                      <th class="px-4 py-3 border">Total Price</th>
                    </tr>
                  </thead>
                  <tbody
                    class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"
                  >
                  <?php $__empty_1 = true; $__currentLoopData = $details; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $detail): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr class="text-gray-700 dark:text-gray-400">
                      <td class="px-4 py-3 border">
                        <div class="flex items-center text-sm">
                          <!-- Avatar with inset shadow -->
                          <div
                            class="relative hidden w-8 h-8 mr-3 rounded-full md:block"
                          >
                            <div
                              class="absolute inset-0 rounded-full shadow-inner"
                              aria-hidden="true"
                            ></div>
                          </div>
                          <div>
                            <p class="font-semibold"><?php echo e($detail->product_name); ?></p>
                            <p class="text-xs text-gray-600 dark:text-gray-400">
<?php if($detail->product_name == 'Jumbo Size' || $detail->product_name == 'Medium Size' || $detail->product_name == 'Small Size' ): ?> 
                              (Eggs Category)
                              <?php else: ?>  
                              (Birds Category)
                              <?php endif; ?>
                            </p>
                          </div>
                        </div>
                      </td>
                      <td class="px-4 py-3 text-sm border">
                        <?php echo e($detail->quantity); ?>

                      </td>
                      <td class="px-4 py-3 text-sm border">
                        &#8358;<?php echo e(number_format($detail->price)); ?>

                      </td>
                      <td class="px-4 py-3 text-sm border font-semibold">
                        &#8358;<?php echo e(number_format($detail->price * $detail->quantity)); ?>

                      </td>
                    </tr>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                  <div class="mx-auto my-3">
                        <p class="text-center lead text-white">No Products Carted!!</p>
                  </div>
                  <br><br><br>
                  <?php endif; ?>
                  
        
                  </tbody>
                </table>
              </div>
              <div
                class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"
              >

              </div>
            </div>
            
            <h4
              class="mb-4 mt-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
            >
              Proof of Payment
            </h4>
            <div class="md:flex md:justify-start md:space-x-3">
              <?php if($order->pop == NULL): ?>
              <div class="image-preview" id="imagePreview">   
                <span class="profile-text" id="">No Image</span>
              </div>
              <?php else: ?>
              <?php 
              $imgs_array = explode("|", $order->pop);
              ?>
              <?php $__currentLoopData = $imgs_array; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $img): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
              <div class="image-preview" id="imagePreview">
                <img src="<?php echo e(asset('storage/images/'.$img)); ?>" alt="Image Preview" class="img-responsive profile-img">
              </div>
              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
              <?php endif; ?>   
            </div>
            
            <?php if($order->remark == NULL): ?>
            <?php else: ?>
            <h4
              class="mb-4 mt-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
            >
              Team's Remark
            </h4>
            
            
              <div
                class="min-w-0 p-4 rounded-lg shadow-xs" style="background-color: #e4ab0d; color: #fff;"
              >
                <h4 class="mb-4 font-semibold">
                  MESSAGE
                </h4>
                <p>
                  <?php echo e($order->remark); ?>

                </p>
              </div>
              <?php endif; ?>
              
              
               <?php if($order->status == 2): ?>
              <div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-6">
                  <div
                    class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-900"
                  >
                     <div class="mr-4">
                         
                      <form action="<?php echo e(route('admin.approve_order', $order->id)); ?>" method="post">
                          <?php echo csrf_field(); ?>
                          <?php echo method_field('patch'); ?>
                          <input type="hidden" name="order_id" value="<?php echo e($order->id); ?>">
                      <button
                          class="px-5 py-3 font-medium bg-blue-600 leading-5 text-white transition-colors duration-150 border border-transparent rounded-lg active:bg-green-500 hover:bg-green-700 focus:outline-none focus:shadow-outline-green"
                          type="submit" name="submit"
                               onclick="return confirm('Dear Admin, Are you sure you want to approve this Order Request?');"
                        >
                         Approve
                      </button>
                      </form>
                     </div>
                     
                      <div class="mr-4">
                         
                      <form action="<?php echo e(route('admin.decline_order', $order->id)); ?>" method="post">
                          <?php echo csrf_field(); ?>
                          <?php echo method_field('patch'); ?>
                          <input type="hidden" name="order_id" value="<?php echo e($order->id); ?>">
                      <button
                          class="px-5 py-3 font-medium leading-5 text-white transition-colors duration-150 border border-transparent rounded-lg active:bg-red-500 hover:bg-red-700 focus:outline-none focus:shadow-outline-green"
                          type="submit" style="background-color: red; color: #def7ec;" name="submit"
                               onclick="return confirm('Dear Admin, Are you sure you want to approve this Order Request?');"
                        >
                         Decline
                      </button>
                      </form>
                     </div>
                     
                  </div>
              </div>
              <?php else: ?>
              <?php endif; ?>
            </div>
          </div>
        </main>



<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin_layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\wamp64\www\jango\resources\views/admin/order_details.blade.php ENDPATH**/ ?>