 <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.23/css/jquery.dataTables.css">
<!-- <link rel="stylesheet" href="https://cdn.datatables.net/1.10.23/css/dataTables.bootstrap4.min.css">  -->
<?php $__env->startSection('content'); ?>
<div class="common-content">
          <div class="page-content">
                <div class="page-heading">
                    <div class="headings">
                        <h6>Buyer Listing</h6>
                    </div>
                </div>
                <input type="hidden" id="token" name="_token" value="<?php echo e(csrf_token()); ?>">
                <a href="<?php echo e(url('admin/addbuyers')); ?>"><button class="btn btn-success" style="margin-top: 10px;margin-bottom: 10px;margin-left: 815px;">Add Buyer</button></a>
              
              <div class="hack1">
                                    <div class="hack2 hk3">
                                        <div class="tableBox wraper">
                <table id="example" class="table table-striped table-bordered" style="width:100%">
        <thead>
            <tr>
                <th>Id</th>
                <th>Name</th>
                <th>Email</th>
                <th>Phone No</th>
		       
                <th>Buyer Type</th>
                <th>Created Date</th>
                <th>Status</th>
                <th>Action</th>
            </tr>
        </thead>
        <tbody>
        <?php $__currentLoopData = $buyer_lists; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$buyers): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr>
                <td><?php echo e($key+1); ?></td>
                <td><?php echo e($buyers->name); ?></td>
                <td><?php echo e($buyers->email); ?></td>
                <td><?php echo e($buyers->phone_no); ?></td>
                <td>
                    <?php if($buyers->user_type=='1'): ?>

                        Individual Hospital
                    <?php endif; ?>

                   <?php if($buyers->user_type=='5'): ?>

                        Procurement Body
                    <?php endif; ?>

                    <?php if($buyers->user_type=='6'): ?>

                        Goverment Body
                    <?php endif; ?>

                    <?php if($buyers->user_type=='7'): ?>

                    Group Hospital
                     <?php endif; ?>
             
                 
                </td>
                <td><?php if(!empty($buyers->created_at)): ?><?php echo e(date("F j, Y",strtotime($buyers->created_at))); ?><?php endif; ?></td>
                <td> 
                    <?php if($buyers->user_status=='1'): ?>
                    <span style="color:green;display:block;" id="act_<?php echo e($buyers->id); ?>">Active</span>
                    <span style="color:red;display:none;" id="deact_<?php echo e($buyers->id); ?>" >Deactive</span>                       
                    <?php else: ?>
                    <span style="color:green;display:none;" id="act_<?php echo e($buyers->id); ?>" >Active</span>
                    <span style="color:red;display:block;" id="deact_<?php echo e($buyers->id); ?>">Deactive</span>                    
                    <?php endif; ?>
                </td>
                <td>
                <a href="<?php echo e(url('admin/editbuyers')); ?>/<?php echo e($buyers->id); ?>"><button class="btn"><i class="fa fa-edit"></i></button></a>
                <a href="<?php echo e(url('admin/deletebuyers')); ?>/<?php echo e($buyers->id); ?>" onclick="return confirm('Are you sure?')"><button class="btn"><i class="fa fa-trash"></i></button></a>
               
               
                <?php if($buyers->user_status == '0'): ?>

                <a href="#" id="activateb_<?php echo e($buyers->id); ?>" onclick="approveuser(<?php echo e($buyers->id); ?>)"><button class="btn">Activate</button></a>
                <a href="#"  id="deactivateb_<?php echo e($buyers->id); ?>"  onclick="rejectuser(<?php echo e($buyers->id); ?>)" style="display: none;" ><button class="btn">Deactivate</button></a>

                <?php else: ?>
                <a href="#" id="activateb_<?php echo e($buyers->id); ?>"   onclick="approveuser(<?php echo e($buyers->id); ?>)" style="display: none;"><button class="btn">Activate</button></a>
               <a href="#"  id="deactivateb_<?php echo e($buyers->id); ?>"  onclick="rejectuser(<?php echo e($buyers->id); ?>)" ><button class="btn">Deactivate</button></a>             
                <?php endif; ?>




                </td>
            </tr>

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



        </tbody>
        <!-- <tfoot>
            <tr>
                <th>Id</th>
                <th>Name</th>
                <th>Email</th>
                <th>Password</th>
                <th>Action</th>
            </tr>
        </tfoot> -->
    </table>
                                        </div>
                  </div>
              </div>

          </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>

<!-- <script src = "https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js"></script>
<script src = "https://cdn.datatables.net/1.10.23/js/dataTables.bootstrap4.min.js"></script> -->
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.23/js/jquery.dataTables.js"></script>
<script>
$(document).ready(function() {
 // executes when HTML-Document is loaded and DOM is ready
 $(".pageloader").show();
$(".pageloader").delay(200).fadeOut("slow");
});
$(document).ready(function() {
    $('#example').DataTable();
} );
</script>
<?php $__env->stopSection(); ?>

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