
<?php $__env->startSection('title'); ?> কয়েন প্যাকেজ | TESTPAPER <?php $__env->stopSection(); ?>
<?php $__env->startSection('coin-package'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('coin-package.index'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('styles'); ?>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('main_content_section'); ?>
<div class="row py-3 ps-2">
  <div class="heading d-flex justify-content-start align-items-center">
    <h3 class="mb-0"><span> কয়েন প্যাকেজ তালিকা</span></h3>
  </div>
</div>

<div class="table_wrapper py-1 card min-vh-100">
  <div class="row my-2 aggregate-section-div">
    <div class="px-3 ">
      <div class=" d-flex justify-content-between align-items-center aggregate-section border">
        <div class="d-flex align-items-center">
          <p class="mb-0"><a href="<?php echo e(route('coin-package.index')); ?>"
              class="text-primary py-2 px-3">সব(<?php echo e($allCoinPackageCount); ?>)</a>
          </p>

          <p class="mb-0"><a href="<?php echo e(route('active-coin-package-list')); ?>"
              class="text-primary py-2 px-3 active">সক্রিয়(<?php echo e($coinPackages->count()); ?>)</a></p>
          <p class="mb-0"><a href="<?php echo e(route('inactive-coin-package-list')); ?>"
              class="text-primary py-2 px-3">নিষ্ক্রিয়(<?php echo e($inactiveCoinPackageCount); ?>)</a></p>
        </div>
        <div class="d-none d-sm-block">
          <a href="javascript:void(0)" class="btn btn-success rounded-0 d-flex align-items-center px-2 border-0"
            data-bs-toggle="modal" data-bs-target="#addCoinPackage"><span class="">নতুন কয়েন প্যাকেজ</span></a>
        </div>
      </div>

      <div class="mt-2 btn btn-success d-block rounded-0 d-sm-none" data-bs-toggle="modal"
        data-bs-target="#addCoinPackage">
        নতুন কয়েন প্যাকেজ</div>
    </div>
  </div>



  <div class="row px-3">
    <div class="table-container table-responsive">
      <table id="" class="table table-bordered">
        <thead class="text-uppercase">
          <tr class="me-3">
            <th class="text-center" scope="col"><span>প্যাকেজের নাম</span></th>
            <th class="text-center" scope="col"><span>প্যাকেজ টাইপ</span></th>
            <th class="text-center" scope="col"><span>কয়েন কুয়ান্টিটি</span></th>
            <th class="text-center" scope="col"><span>প্যাকেজের দাম</span></th>
            <th class="text-center" scope="col"><span>আইডি</span></th>
            <th class="text-center" scope="col"><span>বর্তমান অবস্থা</span></th>
          </tr>
        </thead>
        <tbody class="text-center">

          <?php $__currentLoopData = $coinPackages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
          <?php if(isset($item) && $item != null): ?>
          <tr class="">

            <td>
              <div class="row_title">
                <strong><a href="#"><?php echo e($item->coin_package_name); ?></a></strong>
              </div>
              <div class="row-actions">
                <span><button class="edit_class_modal border-0 bg-transparent" value="<?php echo e($item->id); ?>"
                    onclick="updateCoinPackage(<?php echo e($item->id); ?>)"> সম্পাদন </button> | </span>

                <?php if($item->status == true): ?>
                <span><a class="text-warning" href="<?php echo e(route('coin-package.inactive', $item->id)); ?>">নিস্ক্রিয়</a></span>
                <?php else: ?>
                <span><a class="text-success" href="<?php echo e(route('coin-package.active', $item->id)); ?>">সক্রিয়</a></span>
                <?php endif; ?>
              </div>
            </td>

            <td><?php echo e($item->coin_package_type); ?></td>

            <td>
              <?php echo e($item->coin_package_qty); ?> টি
            </td>

            <td>
              <?php echo e($item->coin_package_price); ?> টাকা
            </td>

            <td>
              <b><?php echo e($item->id); ?></b>
            </td>

            <td>
              <?php if($item->status == true): ?>
              <span class="badge bg-success">সক্রিয়</span>
              <?php else: ?>
              <span class="badge bg-danger">নিষ্ক্রিয়</span>
              <?php endif; ?>
            </td>

          </tr>

          
          <div class="modal fade" id="updateCoinPackage<?php echo e($item->id); ?>" tabindex="-1" aria-labelledby="oneInputModalLabel"
            aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered max-width-1000px">
              <div class="modal-content">
                <div class="modal-header">
                  <h1 class="modal-title fs-5" id="oneInputModalLabel">সম্পাদন কয়েন প্যাকেজ</h1>
                  <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <form action="<?php echo e(route('coin-package.update', $item->id)); ?>" method="post" enctype="multipart/form-data">
                  <?php echo csrf_field(); ?>
                  <?php echo method_field('put'); ?>
                  <div class="modal-body p-0">
                    <div class="row px-4 my-4">
                      <div class="col-md-6 mb-3">
                        <div class="form-group custom-select2-form">
                          <label for="name">প্যাকেজ টাইপ <span class=" text-danger">(required)</span> </label>
                          <select id="coin_package_type<?php echo e($item->id); ?>" name="coin_package_type"
                            class="form-select select2" required>
                            <option value="" selected disabled> প্যাকেজ টাইপ সিলেক্ট করুন </option>
                            <option value="প্রিমিয়াম" <?php echo e($item->coin_package_type == 'প্রিমিয়াম' ? "selected":""); ?>>
                              প্রিমিয়াম
                            </option>
                            <option value="ফ্রি" <?php echo e($item->coin_package_type == 'ফ্রি' ? "selected":""); ?>>
                              ফ্রি</option>
                          </select>
                        </div>

                        <?php $__errorArgs = ['coin_package_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <span class=text-danger><?php echo e($message); ?></span>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                      </div>

                      <div class="col-md-6 mb-3">
                        <div class="form-group">
                          <label for="name">প্যাকেজর নাম <span class="text-danger">(required)</span> </label>
                          <input type="text" name="coin_package_name" required class="form-control"
                            placeholder="প্যাকেজর নাম" value="<?php echo e($item->coin_package_name); ?>">
                        </div>

                        <?php $__errorArgs = ['coin_package_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <span class=text-danger><?php echo e($message); ?></span>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                      </div>

                      <div class="col-md-6 mb-3">
                        <div class="form-group">
                          <label for="name">কয়েনের পরিমান<span class="text-danger">(required)</span> </label>
                          <input type="text" name="coin_package_qty" required class="form-control"
                            placeholder="কয়েনের পরিমান" value="<?php echo e($item->coin_package_qty); ?>">
                        </div>

                        <?php $__errorArgs = ['coin_package_qty'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <span class=text-danger><?php echo e($message); ?></span>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                      </div>

                      <div class="col-md-6 mb-3">
                        <div class="form-group">
                          <label for="name">প্যাকেজর মূল্য <span class="text-danger">(required)</span> </label>
                          <input type="text" name="coin_package_price" required class="form-control"
                            placeholder="প্যাকেজর মূল্য" value="<?php echo e($item->coin_package_price); ?>">
                        </div>

                        <?php $__errorArgs = ['coin_package_price'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <span class=text-danger><?php echo e($message); ?></span>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                      </div>
                    </div>
                  </div>
                  <div class="modal-footer">
                    <button type="submit" class="btn btn-success">সম্পাদন</button>
                    <button type="button" class="btn btn-danger" data-bs-dismiss="modal">বাতিল</button>
                  </div>
                </form>
              </div>
            </div>
          </div>

          <?php endif; ?>
          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


        </tbody>
      </table>
    </div>

    <div class="clearfix d-flex">
      <div class="float-left">
        <p class="text-muted">
          <?php echo e(__('Showing')); ?>

          <span class="font-weight-bold"><?php echo e($coinPackages->firstItem()); ?></span>
          <?php echo e(__('to')); ?>

          <span class="font-weight-bold"><?php echo e($coinPackages->lastItem()); ?></span>
          <?php echo e(__('of')); ?>

          <span class="font-weight-bold"><?php echo e($coinPackages->total()); ?></span>
          <?php echo e(__('results')); ?>

        </p>
      </div>

      <div class="float-right custom-table-pagination">
        <?php echo $coinPackages->links('pagination::bootstrap-4'); ?>

      </div>
    </div>
  </div>


</div>



<div class="modal fade" id="addCoinPackage" tabindex="-1" aria-labelledby="oneInputModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered max-width-1000px">
    <div class="modal-content">
      <div class="modal-header">
        <h1 class="modal-title fs-5" id="oneInputModalLabel">নতুন কয়েন প্যাকেজ</h1>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <form action="<?php echo e(route('coin-package.store')); ?>" method="post">
        <?php echo csrf_field(); ?>
        <div class="modal-body p-0">
          <div class="row px-4 my-4">
            <div class="col-md-6 mb-3">
              <div class="form-group custom-select2-form">
                <label for="name">প্যাকেজ টাইপ <span class=" text-danger">(required)</span> </label>
                <select id="coin_package_type" name="coin_package_type" class="form-select select2" required>
                  <option value="" selected disabled> প্যাকেজ টাইপ সিলেক্ট করুন </option>
                  <option value="প্রিমিয়াম">প্রিমিয়াম </option>
                  <option value="ফ্রি">ফ্রি</option>
                </select>
              </div>

              <?php $__errorArgs = ['coin_package_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
              <span class=text-danger><?php echo e($message); ?></span>
              <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

            <div class="col-md-6 mb-3">
              <div class="form-group">
                <label for="name">প্যাকেজর নাম <span class="text-danger">(required)</span> </label>
                <input type="text" name="coin_package_name" required class="form-control" placeholder="প্যাকেজর নাম">
              </div>

              <?php $__errorArgs = ['coin_package_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
              <span class=text-danger><?php echo e($message); ?></span>
              <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

            <div class="col-md-6 mb-3">
              <div class="form-group">
                <label for="name">কয়েনের পরিমান<span class="text-danger">(required)</span> </label>
                <input type="text" name="coin_package_qty" required class="form-control" placeholder="কয়েনের পরিমান">
              </div>

              <?php $__errorArgs = ['coin_package_qty'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
              <span class=text-danger><?php echo e($message); ?></span>
              <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

            <div class="col-md-6 mb-3">
              <div class="form-group">
                <label for="name">প্যাকেজর মূল্য <span class="text-danger">(required)</span> </label>
                <input type="text" name="coin_package_price" required class="form-control" placeholder="প্যাকেজর মূল্য">
              </div>

              <?php $__errorArgs = ['coin_package_price'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
              <span class=text-danger><?php echo e($message); ?></span>
              <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="submit" class="btn btn-success">সংরক্ষন</button>
          <button type="button" class="btn btn-danger" data-bs-dismiss="modal">বাতিল</button>
        </div>
      </form>
    </div>
  </div>
</div>



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

<?php $__env->startSection('scripts'); ?>
<script>
  $(document).ready(function(){
        $("#coin_package_type").select2({
            dropdownParent: $('#addCoinPackage')
        });
    });

    //To show update modal...
    function updateCoinPackage(id) {
        $("#updateCoinPackage"+id).modal('show');

        $("#coin_package_type"+id).select2({
            dropdownParent: $('#updateCoinPackage'+id)
        });
    }

</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\Project\Personal-Project\Office-Project\update\test-paper-final\resources\views/admin/coinPackage/activeList.blade.php ENDPATH**/ ?>