@extends('backend.header')
@section('index-content')
<style>
  .add-btn{
    width: auto !important;
    height: 31px !important;
    border-radius: 3px !important;
    line-height: 16px !important;
  }
  .table-responsive:nth-child(2) {
      width: 100%;
      height: 75vh;
  }
  .table-responsive:first-child{
      overflow-x: hidden;
  }
  /*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: #c3e6cb !important;
      color: #000;
      z-index: 10;
  }
  table tr th:nth-child(2) {
      position: sticky;
      left: 65px;
      background: #c3e6cb !important;
      color: #000;
      z-index: 10 !important;
  }
  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>
<div class="row px-3">
  <section role="main" class="content-body">

    <header class="page-header">
        <div class="row">
          <div class="col-lg-5">
            @if(session()->get('role')==6)
                  <h2>Inwards Armsclamps</h2>
              @else
                  <h2>Outwards Armsclamps</h2>
              @endif
          </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="{{'armsclamps_view'}}"><span class="active">{{$district->area_name??"Districts"}}</span></a></li>
            </ol>
          </div>
          <div class="col-lg-2">
            <!--  <div class="add-btn-div">               
            <a href="{{url('admin_outwards_armsclamps')}}" class="btn btn-primary add-btn" style="margin-right: 25px;">Add </a>
            </div> -->
          </div>
      </div>
    </header>
   <!--  @if(session()->get('role')==6)
      <header class="page-header">
          <h2>Inwards Armsclamps</h2>
      </header>
      @else
      <header class="page-header">
          <h2>Outwards Armsclamps</h2>
      </header>
      @endif
      <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> -->


      <!-- start: page -->
          <section class="pt-4">
           <!--  @if(session()->get('role')==0 )
            <header class="panel-heading mb-5">
              <h4 class="my-0">Outwards Armsclamps</h4> 
             <div class="add-btn-div">               
            <a href="{{url('admin_outwards_armsclamps')}}" class="btn btn-primary add-btn">Add </a>
            </div>
            </header>
            @else
            <header class="panel-heading mb-5">
              <h4 class="my-2">Inwards Armsclamps</h4> 
            </header>
            @endif

  
             <div class="col-lg-12">
               <table class="table table-bordered table-striped mb-none mt-0" id="datatable-default">-->


            <div>

             <table class="table table-bordered table-striped mb-none mt-0" id="datatable-default">
               <thead>

                 @if(session()->get('role')==0)
            <tr class="table-success">
            <td colspan="9" ><b>Outwards Armsclamps Quantity<b></td>
            </tr>
            
            @else
                <tr class="table-success">
            <td colspan="9"><b>Inwards Armsclamps Quantity<b></td>
            </tr>
            @endif
              

                   <tr class="table-success">

          <th>S.NO</th>
          <th class="text-left">District&nbsp;Names</th>
         <th>Arms Dia- 25-mm</th>
          <th>Arms Dia Inner- 32-mm</th>
            <th>Arms Dia inner- 40-mm</th>
          <th>Clams Set 25-mm</th>
            <th>Clams Set 40- 2-mm</th>
          <th>Clams Set 40- 3-mm</th>
          <th>1C *1.5 sq.mm</th>
                 
                   </tr>
               </thead>
               <tbody>
               <?php $tw1=0;$tw2=0;$tw3=0;$tw4=0;$tw5=0;$tw6=0;$tw7=0; $sum=0; $i=0;?>
           
            @foreach($area_dis as $list)

             <?php $i++;
             $counts=$list['arms_25']+$list['arms_32']+$list['arms_40']+$list['clamps_25']+$list['clamps_42']+$list['clamps_43']+$list['rcv_cbl']
             // $ex_buf_stock=$counts-$list['buffer_stk'];
             ?>
                <tr>
                  <td data-order="{{$i}}">{{$i}}</td>
                    <td><a href="{{url('outwards_armclampsvendor_list')}}?id={{$list['area_district']['id']}}">{{$list['area_district']['area_name']}}</a></td>
                     <td>{{$list['arms_25']??'0'}}</td>
                      <td>{{$list['arms_32']??'0'}}</td>
                       <td>{{$list['arms_40']??'0'}}</td>
                      <td>{{$list['clamps_25']??'0'}}</td>
                       <td>{{$list['clamps_42']??'0'}}</td>
                      <td>{{$list['clamps_43']??'0'}}</td>
                       <td>{{$list['rcv_cbl']??'0'}}</td>
                    
     
                </tr>
        <?php 
       $tw1=$list['arms_25']+$tw1;
       $tw2=$list['arms_32']+$tw2;
       $tw3=$list['arms_40']+$tw3;
       $tw4=$list['clamps_25']+$tw4;
       $tw5=$list['clamps_42']+$tw5;
       $tw6=$list['clamps_43']+$tw6;
       $tw7=$list['rcv_cbl']+$tw7;
       $sum=$sum+$counts; ?>
                                
       @endforeach
     </tbody><tfoot>
       <tr>
         <td data-order="{{$i}}"></td>
         <td><b>Total</b></td>
          <td><b>{{$tw1??'0'}}</b></td>
          <td><b>{{$tw2??'0'}}</b></td>
          <td><b>{{$tw3??'0'}}</b></td>
          <td><b>{{$tw4??'0'}}</b></td>
          <td><b>{{$tw5??'0'}}</b></td>
          <td><b>{{$tw6??'0'}}</b></td>
          <td><b>{{$tw7??'0'}}</b></td>
          <!-- <td><b>{{$sum??'0'}}</b></td>  -->    
       </tr>
               
               </tfoot>
           </table>
         </div>
       
<br>  @if(session()->get('role')==6)
             <div>

            <table class="table table-bordered table-striped mb-none mt-0 ">
               <thead>
                <tr><th colspan="9">Balance Armsclamps vendor</th></tr>
                   <tr>
          <th>S.NO</th>
          <th class="text-left">District&nbsp;Names</th>
          <th>Arms&nbsp;Dia*&nbsp;25</th>
          <th>Arms&nbsp;Dia&nbsp;Inner*&nbsp;32</th>
          <th>Arms&nbsp;Dia&nbsp;inner*&nbsp;40</th>
          <th>Clams&nbsp;Set*&nbsp;25</th>
          <th>Clams&nbsp;Set*&nbsp;40*&nbsp;2</th>
          <th>Clams&nbsp;Set*&nbsp;40*&nbsp;3</th>
        <th>1C&nbsp;*1.5&nbsp;sq.mm</th>
         <!--  <th>Total</th> -->          
                   </tr>
               </thead>
               <tbody>
               <?php $tw1=0;$tw2=0;$tw3=0;$tw4=0;$tw5=0;$tw6=0;$tw7=0; $sum=0; $i=0;?>
           
            @foreach($balance_view as $list)

             <?php $i++;
             $counts=$list['arms_25']+$list['arms_32']+$list['arms_40']+$list['clamps_25']+$list['clamps_42']+$list['clamps_43']+$list['rcv_cbl']
             // $ex_buf_stock=$counts-$list['buffer_stk'];
             ?>
                <tr>
                  <td>{{$i}}</td>
                    <td><a href="{{url('outwards_armclampsvendor_list')}}?id={{$list['area_district']['id']}}">{{$list['area_district']['area_name']}}</a></td>
                     <td>{{$list['arms_25']??'0'}}</td>
                      <td>{{$list['arms_32']??'0'}}</td>
                       <td>{{$list['arms_40']??'0'}}</td>
                      <td>{{$list['clamps_25']??'0'}}</td>
                       <td>{{$list['clamps_42']??'0'}}</td>
                      <td>{{$list['clamps_43']??'0'}}</td>
                       <td>{{$list['rcv_cbl']??'0'}}</td>
                      <!-- <td>{{$counts}}</td> -->
     
                </tr>
        <?php 
       $tw1=$list['arms_25']+$tw1;
       $tw2=$list['arms_32']+$tw2;
       $tw3=$list['arms_40']+$tw3;
       $tw4=$list['clamps_25']+$tw4;
       $tw5=$list['clamps_42']+$tw5;
       $tw6=$list['clamps_43']+$tw6;
       $tw7=$list['rcv_cbl']+$tw7;
       $sum=$sum+$counts; ?>
                                
       @endforeach
       <tr>
         <td></td>
         <td><b>Total</b></td>
          <td><b>{{$tw1??'0'}}</b></td>
          <td><b>{{$tw2??'0'}}</b></td>
          <td><b>{{$tw3??'0'??'0'}}</b></td>
          <td><b>{{$tw4??'0'}}</b></td>
          <td><b>{{$tw5??'0'}}</b></td>
          <td><b>{{$tw6??'0'}}</b></td>
          <td><b>{{$tw7??'0'}}</b></td>
          <!-- <td><b>{{$sum??'0'}}</b></td>  -->    
       </tr>
               
               </tbody>
           </table>
           </div>

@endif

  <table class="table table-bordered table-striped mb-none mt-0" >
               <thead>
                   <tr class="table-success">
                      <th>S.NO</th>
          <th class="text-left">Supplied&nbsp;Names</th>
           <th>Arms Dia- 25-mm</th>
          <th>Arms Dia Inner- 32-mm</th>
            <th>Arms Dia inner- 40-mm</th>
          <th>Clams Set 25-mm</th>
            <th>Clams Set 40- 2-mm</th>
          <th>Clams Set 40- 3-mm</th>
          <th>1C *1.5 sq.mm</th>
         <!--  <th>Total</th> -->         
                   </tr>
               </thead>
               <tbody>
               <?php $tw1=0;$tw2=0;$tw3=0;$tw4=0;$tw5=0;$tw6=0;$tw7=0; $sum=0; $i=0;?>
           
            @foreach($area_dis_supply as $list)

             <?php $i++;
             $counts=$list['arms_25']+$list['arms_32']+$list['arms_40']+$list['clamps_25']+$list['clamps_42']+$list['clamps_43']+$list['rcv_cbl']
             // $ex_buf_stock=$counts-$list['buffer_stk'];
             ?>
                <tr>
                  <td>{{$i}}</td>
                    <td>{{$list['suplied_by']??'0'}}</td>
                     <td>{{$list['arms_25']??'0'}}</td>
                      <td>{{$list['arms_32']??'0'}}</td>
                       <td>{{$list['arms_40']??'0'}}</td>
                      <td>{{$list['clamps_25']??'0'}}</td>
                       <td>{{$list['clamps_42']??'0'}}</td>
                      <td>{{$list['clamps_43']??'0'}}</td>
                       <td>{{$list['rcv_cbl']??'0'}}</td>
                      <!-- <td>{{$counts}}</td> -->
     
                </tr>
        <?php 
       $tw1=$list['arms_25']+$tw1;
       $tw2=$list['arms_32']+$tw2;
       $tw3=$list['arms_40']+$tw3;
       $tw4=$list['clamps_25']+$tw4;
       $tw5=$list['clamps_42']+$tw5;
       $tw6=$list['clamps_43']+$tw6;
       $tw7=$list['rcv_cbl']+$tw7;
       $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>{{$tw3??'0'}}</b></td>
          <td><b>{{$tw4??'0'}}</b></td>
          <td><b>{{$tw5??'0'}}</b></td>
          <td><b>{{$tw6??'0'}}</b></td>
          <td><b>{{$tw7??'0'}}</b></td>
          <!-- <td><b>{{$sum??'0'}}</b></td>  -->    
       </tr>
               
               </tbody>
           </table>
       </section>
   </section>
 </div>
     @stop