@extends('backend.header')
@section('index-content')
<style>
    .table-responsive {
        width: 100%;
        height: 75vh;
    }
    /*th,
    td {
        white-space: nowrap;
    }*/
    table tr td:first-child {
        position: sticky;
        width: 50px;
        left: 0;
        background: #fff;
        color: #000;
        z-index: 9;
    }
    table tr td:nth-child(2) {
        position: sticky;
        left: 65px;
        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: 65px;
/*        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;
    }
    tr.table-warning {
         top: 36px !important;
         position: sticky !important;
    }
    tr.table-warning,
    tr.table-success{
         position: sticky;
         left: 0;
         z-index: 10;
         background: #fff !important;
    }
    .table-success,
    .table-success > td,
    .table-success > th {
        background-color: #c3e6cb !important;
    }
    .table-warning, .table-warning>td, .table-warning>th {
        background-color: #ffeeba !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>Preliminary Survey Mandal Wise Report</h2>  
      </div>
    
      <div class="col-lg-5">
        <ol class="breadcrumbs">
          <li>
            <a href="{{url('index')}}">
              <i class="fa fa-home"></i>
            </a>
          </li>
           <li> <a href="{{url('ps_distict_view')}}"><span class="active">{{$district->area_name??'Districts'}}</span></a></li>
        </ol>
      </div>
      <div class="col-lg-2">
        <div>
            <button class="btn btn-primary back-btn" style="margin-right: 25px;" onclick="window.history.back()">Back</button>
          </div>
          @if(!Session::has('dashboardurl'))
                <div class="add-btn-div">
                  <a href="{{url('add_preliminary_survey')}}" style="margin-right: 95px;" class="btn btn-primary add-btn">Add </a>
                </div>
                @endif
      </div>
    </div>
  </header>
      <!-- <header class="page-header">
          <h2>Preliminary Survey Mandal Wise Report</h2>
      </header>
      <div class="row">
        <div class="col-xs-12">
          <div class="right-wrapper">
            <ol class="breadcrumbs">
              <li>
                <a href="{{url('index')}}">
                  <i class="fa fa-home"></i>
                </a>
              </li>
               <li> <a href="{{url('ps_distict_view')}}"><span class="active">{{$district->area_name??'Districts'}}</span></a></li>
            </ol>
          </div>
        </div>
        <div class="col-xs-12 mt-3">
          <div>
            <button class="btn btn-primary" onclick="window.history.back()">Back</button>
          </div>
        </div>
      </div> -->


      <!-- start: page -->
          <section class="panel pt-3">
            <!-- <header class="panel-heading mb-5">
              <h4 class="my-0">Preliminary Survey Mandal Wise Report</h4> 
                @if(!Session::has('dashboardurl'))
                <div class="add-btn-div">
                  <a href="{{url('add_preliminary_survey')}}" class="btn btn-primary add-btn">Add </a>
                </div>
                @endif
            </header> -->
            <div class="col-12 px-1">
             <table class="table table-bordered table-striped mb-none mt-0" id="datatable-default">
               <!-- <thead>
                  
                   <tr> 
                 <th  rowspan="2">S.NO</th>
                     <th rowspan="2">Mandal Name</th>
                     <th rowspan="2">No of Poles</th>
                      <th colspan="4">Pole Type</th>
                    
                     <th rowspan="2">Present Lights Available in GP </th>
                      <th colspan="4">Required type of LED lights</th>
              </tr>
                 <tr> 
                     
                     <th>8.1mts</th>
                     <th>9.1mts</th>
                     <th>12mts</th>
                     <th>Poles without 3rd Wire</th>
                     
                     <th>18 W </th>
                     <th>35 W </th>
                     <th>70 W </th>
                     <th>Others </th>
                     
                 </tr>
               </thead> -->
               <thead>
              <tr class="table-success"> 
                 <th></th>
                 <th></th>
                 <th></th>
                  <th colspan="4">Pole Type</th>
                  <th></th>
                  <th colspan="4">Required type of LED lights</th>
              </tr>
                 <tr class="table-warning"> 
                     <th>S.NO</th>
                     <th>Mandal Name</th>
                     <th>No of Poles</th>
                     <th>8.1mts</th>
                     <th>9.1mts</th>
                     <th>12mts</th>
                     <th>Poles without 3rd Wire</th>
                     <th>Present Lights Available in GP </th>
                     <th>18 W </th>
                     <th>35 W </th>
                     <th>70 W </th>
                     <th>Others </th>
                     
                 </tr>
             </thead>
               <tbody>
               

                <?php $i=0;?>
              @foreach($mandal_ps_list as $list)
               <?php $i++;?>
              <tr>
                   <td>{{$i}}</td>
                  <td><a href="{{url('gram_ps_list')}}?id={{$list['area_mandal']['id']}}">{{$list['area_mandal']['area_name']}}</a></td>

                   <td>{{$list['pole8mts']+$list['pole9mts']+$list['pole12mts']+$list['pole_withoutwire']}}</td>
                  <td>{{$list['pole8mts']}}</td>
                  <td>{{$list['pole9mts']}}</td>
                  <td>{{$list['pole12mts']}}</td>
                  <td>{{$list['pole_withoutwire']}}</td>
                 
                  <td>{{$list['18w']+$list['35w']+$list['70w']+$list['110w']+$list['190w']}}</td>
                  <td>{{$list['18w']}}</td>
                  <td>{{$list['35w']}}</td>
                  <td>{{$list['70w']}}</td>
                  <td>{{$list['110w']+$list['190w']}}</td>
                 
              </tr>
              @endforeach
               
               </tbody>
             </table>
           </div>
           <br>
       </section>
   </section>
 </div>
     @stop
