
<?php $__env->startSection('main-container'); ?>
<main id="main" class="main">
<?php echo $__env->make('cdn', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<div>
  <h4>Lead Category</h4>
</div>
<div class="text-end" style="margin-right:11px;">
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#addcategory"><i class="bi bi-plus-circle-fill"></i> Add Category</button>
</div>
<div class="container mt-2" style="margin-top: 100px; height: 550px;">
 <table class="table table-striped display nowrap " id="tabl">
            <thead>
                <tr>
                    <th>S.No</th>
                    <th>Name</th>
                    <th>Status</th>
                    <th>Action</th>
                </tr>
            </thead>
            <tbody> 
              <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e(++$key); ?></td>
                        <td style="text-transform:capitalize;"><?php echo e($value->name); ?></td>
                        <td>Active</td>
                        <td>
                          <a class="btn " role="button" data-toggle="modal" data-target="#editcategory-<?php echo e($value->id); ?>" style="color:black;"><i class="bi bi-pencil-fill"></i></a>

                            <!-- Modal -->
                            <div class="modal fade" id="editcategory-<?php echo e($value->id); ?>" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" aria-hidden="true">
                            <div class="modal-dialog" role="document">
                            <div class="modal-content">
                              <div class="modal-header">
                                <h5 class="modal-title" id="editModalLabel">Edit Category</h5>
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                  <span aria-hidden="true">&times;</span>
                                </button>
                              </div>
                             
                               <form action="<?php echo e(url('category-edit/'.$value->id)); ?>" method="post">
                                <?php echo e(csrf_field()); ?>

                              
                              <div class="modal-body">
                                <div class="row mb-3">
                                          <label for="inputText" class="col-sm-2 col-form-label">Category</label>
                                          <div class="col-sm-7">
                                            <input type="text" name="name" value="<?php echo e($value->name); ?>" class="form-control" style="text-transform:capitalize;" required>
                                          </div>          
                                </div>  
                              </div>
                              <div class="modal-footer">
                                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                                <button type="submit" class="btn btn-info">Edit</button>
                              </div>
                            </form>
                            </div>
                            </div>
                            </div>

                          <a href="<?php echo e(url('deletecategory/'.$value->id)); ?>" ><button type="button" class="btn"><i class="bi bi-trash"></i></button></a>
                        </td>
                           
                    </tr>
                   <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>

        </table>

</div>
<!-- Modal -->
<div class="modal fade" id="addcategory" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Add Category</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
       <form action="<?php echo e(url('/addcategory')); ?>" method="post">
        <?php echo e(csrf_field()); ?>

      <div class="modal-body">
        <div class="row mb-3">
                  <label for="inputText" class="col-sm-2 col-form-label">Category</label>
                  <div class="col-sm-7">
                    <input type="text" name="name" class="form-control" placeholder="Enter Category" required>
                  </div>
                </div>  
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-info">Add</button>
      </div>
    </form>
    </div>
  </div>
</div>
</main>


<?php $__env->stopSection(); ?>
<?php echo $__env->make('frontend.layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\CRM\resources\views/frontend/lead-category.blade.php ENDPATH**/ ?>