@extends('backend.header')
@section('index-content')
<style>
	.table-responsive {
        width: 100%;
        height: 75vh;
    }
    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: 51px;
        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: 51px;
        /*   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;
    } 
</style>
<?php
function convertToUnicodeNumber($input) {

	$standard_numsets = array("0","1","2","3","4","5","6","7","8","9");
	$devanagari_numsets = array("०","१","२","३","४","५","६","७","८","९");

	return str_replace($standard_numsets, $devanagari_numsets, $input);
}

?>
<div class="row px-4">


	<section role="main" class="content-body">
         <header class="page-header">
    <div class="row">
      <div class="col-lg-5">
        <h2>CCMS Reports District View</h2>  
      </div>
    
      <div class="col-lg-5">
        <ol class="breadcrumbs">
            <li>
                <a href="{{url('index')}}">
                    <i class="fa fa-home"></i>
                </a>
            </li>
            <li><span class="active">District list Reports View</span></li>
        </ol>
      </div>
      <div class="col-lg-2">
        <div class="back-btn-div">
          @if(!Session::has('dashboardurl')) 
            <div class="add-btn-div">
                <a href="{{url('add_ccmms_types')}}" class="btn btn-primary add-btn">Add </a>
            </div>
            @endif
        </div>
    </div>
  </header>
		<!-- <header class="page-header">
			<h2>CCMS Reports District View</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><span class="active">District list Reports View</span></li>
					</ol>
				</div>
			</div>
		</div> -->

		<!-- start: page -->
		<section class="panel">
			<!-- <header class="panel-heading">
				<h4 class="my-0">District Wise List Search</h4>
				 @if(!Session::has('dashboardurl')) 
					<div class="add-btn-div">
						<a href="{{url('add_ccmms_types')}}" class="btn btn-primary add-btn">Add </a>
					</div>
					@endif
				</header> -->
				<div class="panel-body px-0 pt-0">
					<div class="table-responsive">
			<table class="table table-bordered table-striped mb-none mt-0" >
           <thead>
               <tr class="table-success">
					<th>S.NO</th>
					<th class="text-left">District Name</th>
					<th>CCMS Type </th>
					<th>Survey Quantity </th>
					<th>Supply Quantity </th>
					<th>Installed Quantity  </th>
					<th>Balance Qty to be Installed </th>
					<th>Balance Qty to be Supplied </th>
					<th>Cable Used </th>
					                        
               </tr>
           </thead>
           <tbody>
            <?php $tw1=0;$tw2=0;$tw3=0;$tw4=0;$tw5=0;$tw6=0; $sum=0; $i=0;?>
           
            @foreach($area_dis as $list)

             <?php $i++;
             $counts=$list['sur_qty']+$list['sply_qty']+$list['instl_qty']+$list['blc_sply_qty']+$list['blc_instl_qty']+$list['cbl_usd'];
       
             ?>
            <tr>
                <td>{{$i}}</td>
				<td class="text-left"><a href="{{url('mandal_list_ccms')}}?id={{$list['area_district']['id']}}&&ccms_type={{$list['ccms_type']}}">{{$list['area_district']['area_name']}}</a></td>
				<td>{{$list['ccms_type']}}</td>
				<td>{{$list['sur_qty']}}</td>
				<td>{{$list['sply_qty']}}</td>
				<td>{{$list['instl_qty']}}</td>				
				<td>{{$list['blc_instl_qty']}}</td>
				<td>{{$list['blc_sply_qty']}}</td>
				<td>{{$list['cbl_usd']}}</td>             
            </tr>
             <?php 
       $tw1=$list['sur_qty']+$tw1;
       $tw2=$list['sply_qty']+$tw2;
       $tw3=$list['instl_qty']+$tw3;
       $tw4=$list['blc_instl_qty']+$tw4;
       $tw5=$list['blc_sply_qty']+$tw5;
        $tw6=$list['cbl_usd']+$tw6;
        

         $sum=$sum+$counts; 

        $excl_bufstk=$sum;?>
                                
       @endforeach
       <tr>
       	<td></td>
         <td><b>Total</b></td>
         
         <td></td>
          <td><b>{{$tw1}}</b></td>
          <td><b>{{$tw2}}</b></td>
          <td><b>{{$tw3}}</b></td>
          <td><b>{{$tw4}}</b></td>
          <td><b>{{$tw5}}</b></td>
          <td><b>{{$tw6}}</b></td>          
       </tr>

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

</div>



@stop