<?php $__env->startSection('index-content'); ?>
<meta name="csrf-token" content="<?php echo e(csrf_token()); ?>" />
<style>
   .w100{
      width: 100px;
   }
   .table-responsive {
        width: 100%;
        height: 75vh;
    }
    table tr td{
      vertical-align: middle !important;
    }
    table .tr1 td:first-child {
        position: sticky;
        width: 50px;
        left: 0;
        background: #fff;
        color: #000;
        z-index: 9;
    }
    table .tr1 td:nth-child(2) {
        position: sticky;
        left: 50px;
        background: #fff;
        color: #000;
        z-index: 9;
    }
    table tr th:first-child {
        position: sticky;
        width: 50px;
        left: 0;
        /*   background: #fff;*/
        color: #000;
        z-index: 10;
    }
    table tr th:nth-child(2) {
        position: sticky;
        left: 50px;
        /*   background: #fff !important;*/
        color: #000;
        z-index: 10;
    }
    tr.table-success {
        position: sticky;
        left: 0;
        z-index: 10;
        background: #fff !important;
    }
    tr.table-success {
        top: 0px !important;
        position: sticky !important;
    }
    .table-success,
    .table-success > td,
    .table-success > th {
        background-color: #c3e6cb !important;
    } 
</style>
<div class="row px-3">
 <section role="main" class="content-body">
    <header class="page-header">
    <div class="row">
      <div class="col-lg-5">
        <h2>PR Resolution Approve</h2>  
      </div>
    
      <div class="col-lg-5">
        <ol class="breadcrumbs">
        <li>
         <a href="<?php echo e(url('index')); ?>">
          <i class="fa fa-home"></i>
       </a>
        </li>
        <li> <a href="<?php echo e(url('pr_distict_view')); ?>">
          <span><?php echo e($district->super_details->area_name); ?></span></a></li>
          <li> <a href="<?php echo e(url('mandal_pr_list')); ?>?id=<?php echo e($district->super_details->id); ?>">
           <span><?php echo e($district->parent_details->area_name); ?></span></a></li>
           <li> <a href="<?php echo e(url('gram_pr_list')); ?>?id=<?php echo e($district->parent_details->id); ?>">
            <span><?php echo e($district->area_name); ?></span> </a></li>

         </ol>
      </div>
  </div>
  </header>
  <!-- <header class="page-header">
   <h2>PR Resolution Approve</h2>
</header>
<div class="row">
   <div class="col-xs-12">
     <div class="right-wrapper">
       <ol class="breadcrumbs">
        <li>
         <a href="<?php echo e(url('index')); ?>">
          <i class="fa fa-home"></i>
       </a>
    </li>
    <li> <a href="<?php echo e(url('pr_distict_view')); ?>">
      <span><?php echo e($district->super_details->area_name); ?></span></a></li>
      <li> <a href="<?php echo e(url('mandal_pr_list')); ?>?id=<?php echo e($district->super_details->id); ?>">
       <span><?php echo e($district->parent_details->area_name); ?></span></a></li>
       <li> <a href="<?php echo e(url('gram_pr_list')); ?>?id=<?php echo e($district->parent_details->id); ?>">
        <span><?php echo e($district->area_name); ?></span> </a></li>

     </ol>
  </div>
</div>
</div> -->

<!-- start: page -->
<section class="panel">
   <!-- <header class="panel-heading mb-5">
     <h4 class="my-0">PR Resolution Approve List</h4> 
  </header>
 -->
  <?php if(session('error')): ?>
  <div class="alert alert-danger"><?php echo e(session('error')); ?></div>
  <?php endif; ?>
  <?php if(session('success')): ?>
  <div class="alert alert-success"><?php echo e(session('success')); ?></div>
  <?php endif; ?>
  <div class="col-12 px-2">
     <table class="table table-bordered table-striped mb-none mt-0" >
      <thead>
       <tr class="table-success">
         <th>S.NO</th>
        <th>Gram Name</th>
        <th>Resolution Unique Id</th>
        <th>18 W Count</th>
        <th>35 W Count</th>
        <th>70 W Count</th>
        <th>110 W Count</th>
        <th>190 W Count</th>
        <th>Document View</th>
        <th>Status</th>
        <th>Action</th>

     </tr>
  </thead>
  <tbody>
             <?php $i=0;?>
    <?php $__currentLoopData = $gram_pr_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <?php $i++;?>
    <tr>
      <td><?php echo e($i); ?></td>
     <td><?php echo e($list['area_gram']['area_name']); ?></td>
     <td><?php echo e($list['resolution_id']); ?></td>
     <td><?php echo e($list['light_18w']); ?></td>
     <td><?php echo e($list['light_35w']); ?></td>
     <td><?php echo e($list['light_70w']); ?></td>
     <td><?php echo e($list['light_110w']); ?></td>
     <td><?php echo e($list['light_190w']); ?></td>
     <td><a target="blank" href="<?php echo e(URL::asset('storage/app/'.$list['document'])); ?>" ><i class="fa fa-eye" aria-hidden="true"></i></i></a> <!-- <a target="blank" href="<?php echo e(URL::asset('storage/app/'.$list['document'])); ?>" download> <i class="fa fa-download" aria-hidden="true" > </i></a> --></td>
     <td>
		<span id="view1<?php echo e($list['gram_id']); ?>"></span>
		<span id="statu1<?php echo e($list['gram_id']); ?>">
		<?php if($list['status']==1): ?> Active <?php else: ?> In-Active <?php endif; ?>
		</span>
	</td>
	 <?php if(!Session::has('dashboardurl')): ?>
     <td>
		  <!-- <a href="" class="btn btn-primary">Edit</a> -->
		  <!--
		  <?php if($list['status']==1): ?>
		  <a href="<?php echo e(url('pr_status')); ?>?id=<?php echo e($list['id']); ?>&&status=0&&gram_id=<?php echo e($list['gram_id']); ?>" class="btn btn-primary w100">In-Activated</a>
		  <?php else: ?>
		  <a href="<?php echo e(url('pr_status')); ?>?id=<?php echo e($list['id']); ?>&&status=1&&gram_id=<?php echo e($list['gram_id']); ?>" class="btn btn-success my-1 w100">Activated</a>
		  <?php endif; ?>
		  -->
		<span id="view<?php echo e($list['gram_id']); ?>"></span>
		<span id="statu<?php echo e($list['gram_id']); ?>">
		<?php 
			$s=$list['status'];
			if($s=='1'){				
		?>
			<a onclick="change_active('<?php echo e($list['status']); ?>',<?php echo e($list['gram_id']); ?>)"  class="btn btn-success w100" id="statuschk" value="<?php echo e($list['status']); ?>">Active</a>
		<?php }else{ ?>
			<a onclick="change_active('<?php echo e($list['status']); ?>',<?php echo e($list['gram_id']); ?>)" class="btn btn-warning w100" id="statuschk"  value="<?php echo e($list['status']); ?>">Inactive</a>
		<?php } ?>
		</span>
		  <a href="<?php echo e(url('pr_delete')); ?>?id=<?php echo e($list['id']); ?>&&gram_id=<?php echo e($list['gram_id']); ?>" class="btn btn-danger w100 mt-2" onclick="return confirm('Are you sure you want to delete?')">Delete</a>
	  </td>
	   <?php endif; ?>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

</tbody>
</table>
<br>
</div>
</section>
</section>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
			
<script>
function change_active(ele,id){
	var status;var st;
	if(ele== "inactive"){
		status = 1;
		st = "'active'";
	}else{
		status = 0;
		st = "'inactive'";
	}
	$.ajax({
	        type: "POST",
			headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
	        url: './pr_status',
	        dataType : 'json',
	        data: {id:id,status:status},
	        success: function(response) {
	            if(response == 1){
					$('#statu'+id).css('display','none');
					$('#statu1'+id).css('display','none');
					if(st=="'active'"){
						var view = '<a onclick="change_active('+st.trim()+','+id+')" class="btn btn-success" id="statuschk'+id+'" value='+id+'>active</a>';
						var view1 = 'Active';
					}else{
						var view = '<a onclick="change_active('+st.trim()+','+id+')" class="btn btn-warning" id="statuschk'+id+'" value='+id+'>inactive</a>';
						var view1 = 'In-Active';
					}
					$('#view'+id).html(view);
					$('#view1'+id).html(view1);
	            }
	        }
	});
}
</script>

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

<?php echo $__env->make('backend.header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/neefc25/public_html/tgredco.fovea.in/resources/views/backend/pr_resolution/gram_approve_list.blade.php ENDPATH**/ ?>