<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>Manufacturer Listing</h6>
                    </div>
                </div>
                <input type="hidden" id="token" name="_token" value="<?php echo e(csrf_token()); ?>">
                <a href="<?php echo e(url('admin/addmanufacturers')); ?>"><button class="btn btn-success" style="margin-top: 10px;margin-bottom: 10px;margin-left: 815px;">Add Manufacturer</button></a>
                <div class="hack1">
                                    <div class="hack2">
                                        <div class="tableBox wraper" style="overflow: auto;" >
                        <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>GST/VAT</th>
                <th>Udyog Adhar / Manufacturer registration certificate</th>
                <th>Created Date</th>
                <th>Status</th>
                <th>Action</th>
            </tr>
        </thead>
        <tbody>
        <?php $__currentLoopData = $manufacturer_lists; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$manufacturers): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr>
			<?php 
			         if (!empty($manufacturers->location)) {
                            $val13 = '1';
                     } else {
                            $val13 = '0';
                            }
                      
                        if(!empty($manufacturers->name)){
                                $val2 = '1';
                            }else{
                                $val2 = '0';
                            }
                            
                            if(!empty($manufacturers->email)){
                                $val3 = '1';
                            }else{
                                $val3 = '0';
                            }
                            
                            if(!empty($manufacturers->phone_no)){
                                $val4 = '1';
                            }else{
                                $val4 = '0';
                            }
                            
                            
                            if(!empty($manufacturers->address)){
                                $val5 = '1';
                            }else{
                                $val5 = '0';
                            }
                            
                            
                            if(!empty($manufacturers->state)){
                                $val6 = '1';
                            }else{
                                $val6 = '0';
                            }
                            
                            if(!empty($manufacturers->city)){
                                $val7 = '1';
                            }else{
                                $val7 = '0';
                            }
                            
                            if(!empty($manufacturers->zipcode)){
                                $val8 = '1';
                            }else{
                                $val8 = '0';
                            }
                            
                            if(!empty($manufacturers->contact_name)){
                                $val9 = '1';
                            }else{
                                $val9 = '0';
                            }
                            
                            if(!empty($manufacturers->contact_phone_no)){
                                $val10 = '1';
                            }else{
                                $val10 = '0';
                            }
                            
                            $val11 = '1';
                             
                             
                             if(!empty($manufacturers->description)){
                                $val12 = '1';
                                }else{
                                    $val12 = '0';
                                }


                               
                               
                             
                                $total = round((($val2 + $val3 + $val4 + $val5 + $val6 + $val7 + $val8 + $val9 + $val10 + $val11 + $val12 +$val13) * 100) / 12);
                             
                           
                            
			?>
                <td><?php echo e($key+1); ?></td>
                <td><?php echo e($manufacturers->name); ?></td>
                <td><?php echo e($manufacturers->email); ?></td>
                <td><?php echo e($manufacturers->contact_phone_no); ?></td>
                <td>
                   <?php if($manufacturers->certificate1!=''): ?> 
                    <a target="_blank" class="eye" href="<?php echo e(url('uploaded_files/'.$manufacturers->certificate1)); ?>"><i class="fa fa-eye" aria-hidden="true"></i> View</a></td>
                    <?php endif; ?>
                
                    <td>
                        <?php if($manufacturers->certificate2!=''): ?>    
                        <a target="_blank" class="eye" href="<?php echo e(url('uploaded_files/'.$manufacturers->certificate2)); ?>"><i class="fa fa-eye" aria-hidden="true"></i> View</a></td>
                        <?php endif; ?>
                
                        <td><?php if(!empty($manufacturers->created_at)): ?><?php echo e(date("F j, Y",strtotime($manufacturers->created_at))); ?><?php endif; ?></td>

                    <td>

                        
                        <?php if($manufacturers->user_status=='1'): ?>
                        <span style="color:green;display:block;" id="act_<?php echo e($manufacturers->id); ?>">Active</span>
                        <span style="color:red;display:none;" id="deact_<?php echo e($manufacturers->id); ?>" >Deactive</span>                       
                        <?php else: ?>
                        <span style="color:green;display:none;" id="act_<?php echo e($manufacturers->id); ?>" >Active</span>
                        <span style="color:red;display:block;" id="deact_<?php echo e($manufacturers->id); ?>">Deactive</span>    
                        
                        <?php endif; ?>

                    </td>

                <td>
                <a href="<?php echo e(url('admin/editmanufacturers')); ?>/<?php echo e($manufacturers->id); ?>"><button class="btn"><i class="fa fa-edit"></i></button></a>
                <a href="<?php echo e(url('admin/deletemanufacturers')); ?>/<?php echo e($manufacturers->id); ?>" onclick="return confirm('Are you sure?')"><button class="btn"><i class="fa fa-trash"></i></button></a>
                
                        <?php if($manufacturers->user_status == '0'): ?>
                        <a href="#" id="activateb_<?php echo e($manufacturers->id); ?>" onclick="approveuser(<?php echo e($manufacturers->id); ?>)"><button class="btn">Activate</button></a>
                        <a href="#"  id="deactivateb_<?php echo e($manufacturers->id); ?>"  onclick="rejectuser(<?php echo e($manufacturers->id); ?>)" style="display: none;" ><button class="btn">Deactivate</button></a>
                        <?php else: ?>

                        <a href="#" id="activateb_<?php echo e($manufacturers->id); ?>"   onclick="approveuser(<?php echo e($manufacturers->id); ?>)" style="display: none;"><button class="btn">Activate</button></a>
                        <a href="#"  id="deactivateb_<?php echo e($manufacturers->id); ?>"  onclick="rejectuser(<?php echo e($manufacturers->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>
              </div>


          </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<!-- <script src = "https://code.jquery.com/jquery-3.5.1.js"></script>
<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/manufacturerlist.blade.php ENDPATH**/ ?>