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

<main class="h-full 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">Invest</span>ments
            </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.investments')); ?>">
                <?php echo csrf_field(); ?>
                <small class="text-gray-700 dark:text-gray-200">Sort By Package</small>
                <div class="flex items-center">              
                <select
                  name="plan" 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($investments == null || $planName == 'All'): ?>
                    <option class="active">All</option>
                    <?php else: ?>
                    <option class="active"><?php echo e($planName); ?></option>
                    <option>All</option>
                    <?php endif; ?>
                    <?php $__currentLoopData = $plans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option><?php echo e($plan->name); ?></option>                   
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                 </form>
               </div>
              </div>

              
              <div class="block w-full mr-4">
              <form id="filter-form" method="get" action="<?php echo e(route('admin.investments')); ?>">
                <?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($status_name == 'All'): ?>
                    <option value="All" class="active">All</option>
                    <option value="Pending" class="">Pending</option>
                    <option value="Ongoing" class="">Ongoing</option>
                    <option value="Completed" class="">Completed</option>
                    <option value="Declined" class="">Declined</option>
                    <?php elseif($status_name == 'Pending'): ?>
                    <option value="Pending" class="active">Pending</option>
                    <option value="All" class="">All</option>
                    <option value="Ongoing" class="">Ongoing</option>
                    <option value="Completed" class="">Completed</option>
                    <option value="Declined" class="">Declined</option>
                    <?php elseif($status_name == 'Ongoing'): ?>
                    <option value="Ongoing" class="active">Ongoing</option>
                    <option value="All" class="">All</option>
                    <option value="Pending" class="">Pending</option>
                    <option value="Completed" class="">Completed</option>
                    <option value="Declined" class="">Declined</option>
                    <?php elseif($status_name == 'Completed'): ?>
                    <option value="Completed" class="active">Completed</option>
                    <option value="All" class="">All</option>
                    <option value="Pending" class="">Pending</option>
                    <option value="Ongoing" class="">Ongoing</option>
                    <option value="Declined" class="">Declined</option>
                    <?php elseif($status_name == 'Declined'): ?>
                    <option value="Declined" class="active">Declined</option>
                    <option value="Completed" class="active">Completed</option>
                    <option value="All" class="">All</option>
                    <option value="Pending" class="">Pending</option>
                    <option value="Ongoing" class="">Ongoing</option>
                    <?php endif; ?>
                </select>
                 </form>
               </div>
              </div>
            </div>



            <p
              class="my-6 text-1xl font-semibold text-gray-700 dark:text-gray-200 pb-12"
            >
              <?php echo e($planName); ?> <?php if($planName == 'All'): ?> Plans <?php endif; ?> | <?php echo e($status_name); ?> Investment
            </p>
            <!-- New Table -->
            <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">Client</th>
                      <th class="px-4 py-3">Package</th>
                      <th class="px-4 py-3">Amount</th>
                      <th class="px-4 py-3">PoP</th>
                      <th class="px-4 py-3">Status</th>
                      <th class="px-4 py-3">Date Started</th>
                    </tr>
                  </thead>
                  <tbody
                    class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"
                  >

                  <?php $__empty_1 = true; $__currentLoopData = $investments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $investment): $__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 hidden w-8 h-8 mr-3 rounded-full md:block"
                          >
                            <img
                              class="object-cover w-full h-full rounded-full"
                              <?php if($investment->user->avatar == null): ?>
                              src="<?php echo e(asset('images/toy-avatar.png')); ?>"
                              <?php else: ?>
                              src="<?php echo e(asset('storage/images/'.$investment->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.investment.show', $investment->id)); ?>">
                            <p class="font-semibold"><?php echo e($investment->user->first_name); ?> <?php echo e($investment->user->last_name); ?></p>
                            <p class="text-xs text-gray-600 dark:text-gray-400">
                            <?php echo e($investment->user->email); ?>

                            </p>
                          </div></a>
                        </div>
                      </td>
                      <td class="px-3 py-3 text-sm">
                      <?php echo e($investment->plan->name); ?>

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

                      </td>
                      <td class="px-3 py-3 text-sm font-semibold">
                      <?php echo e($investment->reference); ?>

                      </td>
                      <td class="px-4 py-3 text-xs">
                        <?php if($investment->status == 1): ?>
                        <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"
                        >
                          Unapproved
                        </span>
                        <?php elseif($investment->status == 2): ?>
                        <span
                          class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:bg-orange-100 dark:text-orange-500"
                        >
                          Ongoing
                        </span>
                        <?php elseif($investment->status == 3): ?>
                        <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"
                        >
                          Completed
                        </span>
                        <?php elseif($investment->status == 4): ?>
                        <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"
                        >
                          Declined
                        </span>
                        <?php endif; ?>
                      </td>
                      <td class="px-4 py-3 text-sm">
                      <?php echo e(date('M j Y', strtotime($investment->created_at))); ?>

                      </td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <div align="center" class="my-3">
                        <p class="lead text-gray-700 dark:text-gray-200">No user in this category.</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>

           
              </div>
            </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 /home/jangodri/public_html/resources/views/admin/investments.blade.php ENDPATH**/ ?>