

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



<main class="h-full pb-16 overflow-y-auto">
          <div class="container grid px-6 mx-auto">
            <h2
              class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200"
            >
            <span class="text-blue-500">List</span> of all Users Profile Info
            </h2>
             <!-- CTA -->
             <a
              class="flex items-center bg-blue-600 justify-between p-4 mb-8 text-sm font-semibold shadow-md focus:outline-none focus:shadow-outline-green"
              href="<?php echo e(url('/')); ?>" style="color: #fff;"
            >
              <div class="flex items-center">
                <svg
                  class="w-5 h-5 mr-2"
                  fill="currentColor"
                  viewBox="0 0 20 20"
                >
                  <path
                    d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
                  ></path>
                </svg>
                <span>Go to main website</span>
              </div>
              <span>View &RightArrow;</span>
            </a>



                <!-- Filter input -->
              <div class="flex items-center mb-4">
              <div class="block w-full mr-4">
              <form id="filter-form" method="get" action="<?php echo e(route('admin.profile_requests')); ?>">
                <?php echo csrf_field(); ?>
                <small class="text-gray-700 dark:text-gray-200">Sort By Status</small>
                <div class="flex items-center">              
                <select
                  name="status" class="block w-full mt-1 text-sm dark:text-gray-300 
                  dark:border-gray-600 dark:bg-gray-700 form-select focus:border-green-400 
                  focus:outline-none focus:shadow-outline-green dark:focus:shadow-outline-gray"
                  onchange="this.form.submit();">        
                    <?php if($title == 'Requests'): ?>
                    <option value="Requests" class="active">Requests</option>
                    <option value="Approved" class="">Approved</option>
                    <option value="Declined" class="">Declined</option>
                    <?php elseif($title == 'Approved'): ?>
                    <option value="Approved" class="active">Approved</option>
                    <option value="Requests" class="">Requests</option>
                    <option value="Declined" class="">Declined</option>
                    <?php elseif($title == 'Declined'): ?>
                    <option value="Declined" class="active">Declined</option>
                    <option value="Requests" class="">Requests</option>
                    <option value="Approved" class="active">Approved</option>
                    <?php endif; ?>
                </select>
                 </form>
               </div>
              </div>

            </div>

            

            <!-- With actions -->
            <h4
              class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
            >
            <?php if(!empty($title)): ?>
            <?php echo e($title); ?><br>
            <?php else: ?>
              List of Users In This Category
            <?php endif; ?>
            </h4>
            <?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>
            <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">Customer</th>
                      <th class="px-4 py-3">Picture Status</th>
                      <th class="px-4 py-3">User Status</th>
                      <th class="px-4 py-3">Registration Date</th>
                      <th class="px-4 py-3">Actions</th>
                    </tr>
                  </thead>
                  <tbody
                    class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"
                  >
                  <?php $__empty_1 = true; $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr class="text-gray-700 dark:text-gray-400">
                      <td class="px-4 py-3">
                        <div class="flex items-center text-sm">
                          <!-- Avatar with inset shadow -->
                          <div
                            class="relative w-8 h-8 mr-3 rounded-full md:block"
                          >
                            <img
                              class="object-cover w-full h-full rounded-full"
                              <?php if($user->avatar == null): ?>
                              src="<?php echo e(asset('images/toy-avatar.png')); ?>"
                              <?php else: ?>
                              src="<?php echo e(asset('storage/images/'.$user->avatar)); ?>"
                              <?php endif; ?>
                              alt=""
                              loading="lazy"
                            />
                            <div
                              class="absolute inset-0 rounded-full shadow-inner"
                              aria-hidden="true"
                            ></div>
                          </div>
                          <div><a href="<?php echo e(route('admin.user_info', $user->id)); ?>">
                            <p class="font-semibold"><?php echo e($user->first_name . ' ' . $user->last_name); ?></p>
                            <p class="text-xs text-gray-600 dark:text-gray-400">
                              <?php echo e($user->email); ?>

                            </p>
                           </a>
                          </div>
                        </div>
                      </td>
                      <td class="px-4 py-3 text-sm">
                        <?php if($user->avatar_status == NULL): ?>
                          <span
                            class="text-orange-700 dark:text-orange-200"
                          >
                            Unattended To
                          </span>
                        <?php elseif($user->avatar_status == 1): ?>
                          <span
                            class="text-green-700 dark:text-green-200"
                          >
                            Approved
                          </span>
                        <?php elseif($user->avatar_status == 2): ?>
                          <span
                            class="text-red-700 dark:text-red-200"
                          >
                            Declined
                          </span>
                        <?php endif; ?>
                      </td>
                      <td class="px-4 py-3 text-xs">
                      <?php if($user->status == 1): ?>
                        <span
                          class="px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full dark:bg-green-700 dark:text-green-100"
                        >
                          
                            Active
                          
                        </span>
                        <?php elseif($user->status == 0): ?>
                        <span
                          class="px-2 py-1 font-semibold leading-tight text-red-700 bg-red-100 rounded-full dark:bg-red-700 dark:text-red-100"
                        >
                            Banned
                        </span>
                       <?php endif; ?>
                      </td>
                      <td class="px-4 py-3 text-sm">
                        <?php echo e(date('M j Y', strtotime($user->created_at))); ?>

                      </td>
                      <td class="px-4 py-3">
                        <div class="flex items-center space-x-4 text-sm">
                          
                          <?php if($user->avatar_status == null): ?>
                              <form action="<?php echo e(route('admin.profile_approve', $user->id)); ?>" method="post">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('patch'); ?>
                                <button type="submit" class="font-semibold text-green-700 dark:text-green-200" 
                                title="Approve"
                                onclick="return confirm('Dear Admin, Are you sure you want to approve <?php echo e($user->first_name); ?>\'s profile picture?');" >
                                  <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" >
                                    <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
                                  </svg>
                                </button>
                              </form>
                              &nbsp; &nbsp; &nbsp;
                              <form action="<?php echo e(route('admin.profile_decline', $user->id)); ?>" method="post">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('patch'); ?>
                                <button type="submit" class="font-semibold text-red-700 dark:text-red-200" 
                                title="Decline"
                                onclick="return confirm('Dear Admin, Are you sure you want to decline <?php echo e($user->first_name); ?>\'s profile picture?');" >
                                <svg class="svg-icon h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
                                  <path d="M10.185,1.417c-4.741,0-8.583,3.842-8.583,8.583c0,4.74,3.842,8.582,8.583,8.582S18.768,14.74,18.768,10C18.768,5.259,14.926,1.417,10.185,1.417 M10.185,17.68c-4.235,0-7.679-3.445-7.679-7.68c0-4.235,3.444-7.679,7.679-7.679S17.864,5.765,17.864,10C17.864,14.234,14.42,17.68,10.185,17.68 M10.824,10l2.842-2.844c0.178-0.176,0.178-0.46,0-0.637c-0.177-0.178-0.461-0.178-0.637,0l-2.844,2.841L7.341,6.52c-0.176-0.178-0.46-0.178-0.637,0c-0.178,0.176-0.178,0.461,0,0.637L9.546,10l-2.841,2.844c-0.178,0.176-0.178,0.461,0,0.637c0.178,0.178,0.459,0.178,0.637,0l2.844-2.841l2.844,2.841c0.178,0.178,0.459,0.178,0.637,0c0.178-0.176,0.178-0.461,0-0.637L10.824,10z"></path>
                                </svg>
                                </button>
                              </form>
                              <?php elseif($user->avatar_status == 1): ?>
                              <button class="font-semibold text-gray-400 dark:text-muted-200 cursor-not-allowed" disabled>
                              <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" 
                              fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 
                              16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 
                                0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
                                </svg>
                              </button>
                              <?php elseif($user->avatar_status == 2): ?>
                              <button class="font-semibold text-gray-400 dark:text-muted-200 cursor-not-allowed" disabled>
                              <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" 
                              fill="currentColor">
                                <path d="M10.185,1.417c-4.741,0-8.583,3.842-8.583,8.583c0,4.74,3.842,8.582,8.583,8.582S18.768,14.74,18.768,10C18.768,5.259,14.926,1.417,10.185,1.417 M10.185,17.68c-4.235,0-7.679-3.445-7.679-7.68c0-4.235,3.444-7.679,7.679-7.679S17.864,5.765,17.864,10C17.864,14.234,14.42,17.68,10.185,17.68 M10.824,10l2.842-2.844c0.178-0.176,0.178-0.46,0-0.637c-0.177-0.178-0.461-0.178-0.637,0l-2.844,2.841L7.341,6.52c-0.176-0.178-0.46-0.178-0.637,0c-0.178,0.176-0.178,0.461,0,0.637L9.546,10l-2.841,2.844c-0.178,0.176-0.178,0.461,0,0.637c0.178,0.178,0.459,0.178,0.637,0l2.844-2.841l2.844,2.841c0.178,0.178,0.459,0.178,0.637,0c0.178-0.176,0.178-0.461,0-0.637L10.824,10z"></path>
                                </svg>
                              </button>
                          <?php endif; ?>


                          <?php if($user->status == 1): ?>
                          <!--<form action="<?php echo e(route('admin.ban', $user->id)); ?>" method="post">
                           <?php echo csrf_field(); ?>-->
                          <a
                            href="<?php echo e(route('admin.ban_page', $user->id)); ?>" class="flex items-center justify-between px-2 py-2 text-sm font-medium leading-5 text-green-600 rounded-lg dark:text-gray-400 focus:outline-none focus:shadow-outline-gray"
                            aria-label="Ban"
                          >
                            Ban
                          </a>
                         <!--</form>-->
                          <?php elseif($user->status == 0): ?>
                          <form action="<?php echo e(route('admin.unban', $user->id)); ?>" method="post">
                           <?php echo csrf_field(); ?>
                          <button
                            class="flex items-center justify-between px-2 py-2 text-sm font-medium leading-5 text-green-600 rounded-lg dark:text-gray-400 focus:outline-none focus:shadow-outline-gray"
                            aria-label="Ban"
                          >
                            UnBan
                          </button>
                          </form>
                          <?php endif; ?>

                        </div>
                      </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 user in this category!</p>
                  </div>
                  <br><br><br>
                  <?php endif; ?>
                  
                  </tbody>
                </table>
              </div>
              <div
                class="px-4 py-3 text-xs font-semibold text-gray-500 uppercase  dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" style="padding-top:50px !important;padding-bottom:20px !important;"
              >
                  
              <?php if($users->currentPage() != 1): ?>
                <span><a class="p-3 mb-3" href="<?php echo e($users->url(1)); ?>">«&nbsp;</a></span>
                <span><a class="p-3 mt-4" href="<?php echo e($users->previousPageUrl()); ?>"><&nbsp;</a></span>
                  <?php for($i=1; $i<=$users->lastPage(); $i++): ?> 
                    <?php if($i== $users->currentPage()): ?> 
                        <span><a class="p-1 mt-4 pranala text-center" style="background-color: #e4ab0d; color: #fff;border-radius:50%;"><b><?php echo e($i); ?></b>&nbsp;</a></span>
                     <?php else: ?>
                        <span class="mt-12"><a class="p-3" href="<?php echo e($users->url($i)); ?>"><?php echo e($i); ?>&nbsp;</a></span>
                     <?php endif; ?>
                  <?php endfor; ?>
                  <?php if($users->currentPage() != $users->lastPage()): ?>
                <span><a class="p-3 mt-4" href="<?php echo e($users->nextPageUrl()); ?>">>&nbsp;</a></span>
                <span><a class="p-3 mt-4" href="<?php echo e($users->url($users->lastPage())); ?>">»</a></span>
               <?php endif; ?>
               <?php else: ?>
               <span><a class="p-3 mb-3" href="<?php echo e($users->url(1)); ?>">1</a></span>
               <span><a class="p-3 mt-4" href="<?php echo e($users->nextPageUrl()); ?>">>&nbsp;</a></span>
               <span><a class="p-3 mt-4" href="<?php echo e($users->url($users->lastPage())); ?>">»</a></span>
               <?php endif; ?>
               
              </div>
              <div>
                  <small class="text-gray-500 dark:text-gray-400">Showing <?php echo e($users->firstItem()); ?>–<?php echo e($users->lastItem()); ?> of <?php echo e($users->total()); ?> results</small>
              </div>
            </div>
          </div>
        </main>







       <script>

              // If admin clicks on the ban btn, call the ban function 
              $(document).on('click', '#banned', function() {
                  
                  // Get the user id
                  var user_id = $('#banned').data('user_id');
                  //let user_name = $('.ban').data('user_name');
                  console.log(user_id);
                  // Call the ban function
                  //ban(user_id, user_name);
              });

        
            </script>


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