
<?php $__env->startSection('title', $title); ?>
<?php $__env->startSection('content'); ?>
    <!-- Page title -->
    <div class="content fs-6 d-flex flex-column flex-column-fluid" id="kt_content">
    
      <div class="toolbar" id="kt_toolbar">
          <div class="container-fluid d-flex flex-stack flex-wrap flex-sm-nowrap">
              <div class="d-flex flex-column align-items-start justify-content-center flex-wrap me-2">
                  <h1 class="text-dark fw-bolder my-1 fs-2">Transactions</h1>
                  <ul class="breadcrumb fw-semibold fs-base my-1">
                      <li class="breadcrumb-item text-muted">
                          <a href="<?php echo e(route('dashboard')); ?>" class="text-muted text-hover-primary">Dashboard </a>
                      </li>
                      <li class="breadcrumb-item text-dark">Transactions</li>
                  </ul>
              </div>
              <div class="d-flex align-items-center flex-nowrap text-nowrap py-1 mb-10">
                  <button data-bs-toggle="modal" data-bs-target="#filter" class="btn btn-white text-dark me-4"><i class="fal fa-filter-list"></i> Filter</button>
                  <button data-bs-toggle="modal" data-bs-target="#export" class="btn btn-dark"><i class="fal fa-file-export"></i> Export</button>
              </div>
          </div>
          <div class="post fs-6 d-flex flex-column-fluid min-vh-100" id="kt_post">
              <div class="container">
                  <div class="row g-xl-8">
                      <div wire:ignore.self class="modal fade" id="filter" tabindex="-1" role="dialog" aria-labelledby="modal-form" aria-hidden="true">
                          <div class="modal-dialog" role="document">
                              <div class="modal-content">
                                  <div class="modal-header">
                                      <h3 class="modal-title">Filter Transaction</h3>
                                      <div class="btn btn-icon btn-sm btn-active-light-primary ms-2" data-bs-dismiss="modal" aria-label="Close">
                                          <span class="svg-icon svg-icon-1">
                                              <i class="fal fa-times"></i>
                                          </span>
                                      </div>
                                  </div>
                                  <div class="modal-body">
                                      <div class="fv-row mb-6">
                                          <label class="form-label fs-6 fw-bolder text-dark">Date Range</label>
                                          <input class="form-control form-control-lg form-control-solid" placeholder="Pick date rage" value="1691490869836 - 1689485801227" name="date" id="range" onchange="this.dispatchEvent(new InputEvent('input'))" wire:model="date">
                                      </div>
                                      <div class="fv-row mb-6">
                                          <label class="form-label fs-6 fw-bolder text-dark">Status</label>
                                          <select class="form-select form-select-solid" wire:model="status">
                                              <option value="">Select status</option>
                                              <option value="COMPLETED">Completed</option>
                                              <option value="PENDING">Pending</option>
                                          </select>
                                      </div>
                                      <div class="fv-row mb-6">
                                          <label class="form-label fs-6 fw-bolder text-dark">Sort by</label>
                                          <select class="form-select form-select-solid" wire:model="orderBy">
                                              <option value="asc">ASC</option>
                                              <option value="desc">DESC</option>
                                          </select>
                                      </div>
                                      <div class="fv-row mb-6">
                                          <label class="form-label fs-6 fw-bolder text-dark">Per page</label>
                                          <select class="form-select form-select-solid" wire:model="perPage">
                                              <option value="10">10</option>
                                              <option value="25">25</option>
                                              <option value="50">50</option>
                                              <option value="100">100</option>
                                          </select>
                                      </div>
                                  </div>
                              </div>
                          </div>
                      </div>
                      <div wire:ignore.self class="modal fade" id="export" tabindex="-1" role="dialog" aria-labelledby="modal-form" aria-hidden="true">
                          <div class="modal-dialog" role="document">
                              <div class="modal-content">
                                  <div class="modal-header">
                                      <h3 class="modal-title">Export Transactions</h3>
                                      <div class="btn btn-icon btn-sm btn-active-light-primary ms-2" data-bs-dismiss="modal" aria-label="Close">
                                          <span class="svg-icon svg-icon-1">
                                              <i class="fal fa-times"></i>
                                          </span>
                                      </div>
                                  </div>
                                  <form wire:submit.prevent="save(Object.fromEntries(new FormData($event.target)))">
                                      <div class="modal-body">
                                          <input type="hidden" name="_token" value="qNuplysOgRVxc2sjYh0qmlz5SYKUtCZFmPKq0wJO">                                        <div class="fv-row mb-6">
                                              <label class="form-label fs-6 fw-bolder text-dark">File Format</label>
                                              <select class="form-select form-select-solid" name="exportType" required>
                                                  <option value="">Select file type</option>
                                                  <option value="csv">CSV</option>
                                                  <option value="excel">Excel</option>
                                              </select>
                                          </div>
                                                                                  <div class="fv-row mb-6">
                                              <label class="form-label fs-6 fw-bolder text-dark">Export as</label>
                                              <select class="form-select form-select-solid" name="exportAs" required>
                                                  <option value="">How do you want to receive this file?</option>
                                                  <option value="download">Download file</option>
                                                  <option value="email">Send file to email</option>
                                              </select>
                                          </div>
                                                                              </div>
                                      <div class="modal-footer">
                                          <button class="btn btn-block btn-primary" type="submit"><i class="fal fa-file-export"></i>
                                              <span wire:loading.remove wire:target="save">Export</span>
                                              <span wire:loading wire:target="save">Exporting file...</span>
                                          </button>
                                      </div>
                                  </form>
                              </div>
                          </div>
                      </div>
                      <div class="col-lg-12 col-md-12">
                          <div class="d-flex justify-content-center flex-column me-3">
                              <div class="col-md-12">
                                  <div class="input-group input-group-solid mb-5 rounded-4">
                                      <span class="input-group-text" id="basic-addon1"><i class="fal fa-search"></i></span>
                                      <input type="search" class="form-control form-control-solid text-dark" wire:model="search" placeholder="Transaction reference" />
                                  </div>
                              </div>
                          </div>
                                                  <div class="" wire:loading.class.delay="opacity-50" wire:target="search, status, orderBy, perPage, date, loadMore">
                              <div class="card-body pt-0">
                                  <div class="table-responsive">
                                      <table class="table align-middle table-row-bordered table-row-gray-300 gy-5 gs-7" id="kt_datatable_example_5">
                                          <thead>
                                              <tr class="text-start text-dark fw-bolder fs-7 text-uppercase px-7">
                                                  <th></th>
                                                  <th class="min-w-70px">Amount</th>
                                                  <th class="min-w-50px">Type</th>
                                                  <th class="min-w-50px">Status</th>
                                                  <th class="min-w-50px">Reference ID</th>
                                                  <th class="min-w-50px">Description</th>
                                                  <th class="min-w-200px">Created</th>
                                              </tr>
                                              <!--end::Table row-->
                                          </thead>
              <tbody class="fw-semibold text-dark fs-6">
              <?php $__currentLoopData = $withdrawals; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $withdrawal): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>	
              <tr class="cursor-pointer" id="kt_trx_110853544343568433_button">
             <td>
              <?php if($withdrawal->type !='Credit'): ?>
            <div class="symbol symbol-40px symbol-circle me-5">
           <div class="symbol-label fs-3 fw-bolder text-dark">
                                  <i class="fal fa-minus"></i>
           </div>
          </div>
          <?php else: ?>
          <div class="symbol symbol-40px symbol-circle me-5">
              <div class="symbol-label fs-3 fw-bolder text-dark">
                                     <i class="fal fa-plus"></i>
              </div>
             </div>
          <?php endif; ?>
      </td>
      <td><?php echo e($settings->currency); ?><?php echo e($withdrawal->amount); ?> <?php echo e($settings->s_currency); ?></td>
      
      <?php if($withdrawal->type=='Credit'): ?> 
<td><span class="badge badge-pill badge-success badge-sm">Credit</span></td>
<?php else: ?>
<td><span class="badge badge-pill badge-danger badge-sm">Debit</span></td>
<?php endif; ?>
      <?php if($withdrawal->status!='Pending'): ?>
          <td><span class="badge badge-pill badge-warning badge-sm"><?php echo e($withdrawal->status); ?></span></td>
          <?php else: ?>
          <td><span class="badge badge-pill badge-success badge-sm"><?php echo e($withdrawal->status); ?></span></td>
          <?php endif; ?>
          <td>  <?php echo e($withdrawal->txn_id); ?></td>
          <td><?php echo e($withdrawal->Description); ?></td>
      <td><?php echo e(\Carbon\Carbon::parse($withdrawal->created_at)->toDayDateTimeString()); ?></td>
  </tr>
  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  
  <?php $__currentLoopData = $deposits; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $withdrawal): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr class="cursor-pointer" id="<?php echo e($withdrawal->id); ?><?php echo e($withdrawal->txn_id); ?>">
    <?php if($withdrawal->type=='Credit'): ?> 
<td>
    <div class="symbol symbol-40px symbol-circle me-5">
        <div class="symbol-label fs-3 fw-bolder text-dark">
                            
            <i class="fal fa-plus"></i>
                        </div>
    </div>
   
</td>
<?php else: ?>
<td>
    <div class="symbol symbol-40px symbol-circle me-5">
        <div class="symbol-label fs-3 fw-bolder text-dark">
                            
            <i class="fal fa-minus"></i>
                        </div>
    </div>
   
</td>
<?php endif; ?>
<td><?php echo e($settings->currency); ?><?php echo e(number_format($withdrawal->amount , 2, '.', ',')); ?> <?php echo e($settings->s_currency); ?></td>
<td><span class="text-success">Credit</span></td>
<?php if($withdrawal->status=='Pending'): ?>  
<td><span class="badge badge-pill badge-warning badge-sm">Pending</span></td>
  <?php else: ?>
  <td><span class="badge badge-pill badge-success badge-sm">Completed</span></td>
  <?php endif; ?>  
<td><?php echo e($withdrawal->txn_id); ?></td>
<td><?php echo e($withdrawal->Description); ?></td>
<td><?php echo e(\Carbon\Carbon::parse($withdrawal->created_at)->toDayDateTimeString()); ?></td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  
                                          </tbody>
                                      </table>
                                </div>
                              </div>
                          </div>
                     </div>
                  </div>
              </div>
  
            
          </div>
      </div>
  </div>   </div>
      

<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.dash2', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/u215313542/domains/remedycodes.site/public_html/resources/views/user/transactions.blade.php ENDPATH**/ ?>