@extends('backend.header')
@section('index-content')
<style>
  .add-btn{
    width: auto !important;
    height: 31px !important;
    border-radius: 3px !important;
    line-height: 16px !important;
  }
</style>
<div class="row px-3">
  <section role="main" class="content-body">
    
      <header class="page-header">
          <h2>CCMS Inwards List</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="{{'armsclamps_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-4">
           
            <header class="panel-heading mb-5">
              <h4 class="my-2">CCMS Inwards List</h4> 
                        </header>

             <table class="table table-bordered table-striped mb-none mt-0" id="datatable-default">
               <thead>
                   <tr>
                      <th>S.NO</th>
          <th class="text-left">Mandals&nbsp;Names</th>
          <th>CCMS&nbsp;Ph&nbsp;Transfer&nbsp;Quantity</th>
          <th>Transfered&nbsp;cable </th>
          <th>Total</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['ccmsph']+$list['rcv_cbl']
             // $ex_buf_stock=$counts-$list['buffer_stk'];
             ?>
                <tr>
                  <td>{{$i}}</td>
                    <td><a href="">{{$list['area_mandal']['area_name']}}</a></td>
                     <td>{{$list['ccmsph']??'0'}}</td>
                      <td>{{$list['rcv_cbl']??'0'}}</td>
                      <td>{{$counts}}</td>
     
                </tr>
               <?php 
       $tw1=$list['ccmsph']+$tw1;
       $tw2=$list['rcv_cbl']+$tw2;
       $sum=$sum+$counts; ?>
                                
       @endforeach
       <tr>
        <td><b>Total</b></td>
         <td></td>
          <td><b>{{$tw1??'0'}}</b></td>
          <td><b>{{$tw2??'0'}}</b></td>
          <td><b>{{$sum??'0'}}</b></td>     
       </tr>
               
               </tbody>
           </table>
       </section>
   </section>
 </div>
     @stop