<!DOCTYPE html>
<html >
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>SUHOL</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="{{asset('lte/bower_components/bootstrap/dist/css/bootstrap.min.css')}}">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="{{asset('lte/bower_components/font-awesome/css/font-awesome.min.css')}}">
  <!-- Ionicons -->
  <link rel="stylesheet" href="{{asset('lte/bower_components/Ionicons/css/ionicons.min.css')}}">
  <!-- Theme style -->
  <link rel="stylesheet" href="{{asset('lte/dist/css/AdminLTE.min.css')}}">

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

  <!-- Google Font -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body >
<div class="hidden-print text-center" style="float:left; margin:20px" >
        <a  class="btn btn-danger" href="{{URL::previous()}}">Back</a>
    </div>
<div class="wrapper"><br>
  <!-- Main content -->
   <section class="invoice">
      <!-- title row -->
      <div class="row">
        <div class="col-xs-12">
          <h2 class="page-header">
            <i class=""></i> MR Product Wise Report
            <small class="pull-right">Date: {{$date}}</small>
          </h2>
        </div>
        <!-- /.col -->
      </div>
      <!-- info row -->
      <div class="row invoice-info">
        <div class="col-sm-4 invoice-col">
         <strong> Category Name  :  </strong> {{$category}}<br>
          
        </div>
        <!-- /.col -->
        <div class="col-sm-4 invoice-col">
           <strong> Product Name : </strong> {{$product}} 
        </div>
       
      </div><br>
      <!-- /.row -->

      <!-- Table row -->
      <div class="row">
        <div class="col-xs-12 table-responsive">
          <table class="table table-bordered table-striped">
            <thead>
            <tr>
              <th>Sl No.</th>
              <th>Customer Name</th>
              <th>Customer Type</th>
              <th>Unit</th>
              <th>Grade</th>
              <th>Status</th>
              <th>Qty</th>
            </tr>
            </thead>
            <tbody>
            <?php $c = 1;  $qty = 0 ;?>
            @if($requests != NULL)
            @foreach($requests as $request)
            <tr>
              <td>{{$c++}}</td>
              <td>{{$request->customer->name}}</td>
              <td>{{$request->customer->type->name}}</td>
              <td>{{$request->unit }}</td>
              <td>{{$request->grade }}</td>
              <td>@if($request->status == 'APR')
                  APPROVED
                  @elseif($request->status == 'REQ')
                  PENDING
                  @else
                  PR GENERATED @endif</td>
              <td>{{$request->qty}}</td>
              <?php $qty = $qty + $request->qty ?>
            </tr>
            @endforeach
            @endif
            <tr>
               <th colspan="5"></th>
              <th >SubTotal(qty)</th>
              <th >{{$qty}}</th>
            </tr>
            @if($unitQty != NULL)
            @foreach($unitQty as $data)
            <tr>
              <th colspan="5"></th>
              <td>{{$data->unit}}</td>
              <td >{{$data->sum}}</td>
            </tr>
            @endforeach
            @endif
            </tbody>
          </table>
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->

      

      <!-- this row will not appear when printing -->
      <div class="row no-print">
        <div class="col-xs-12">
          <a  target="_blank"  class="btn btn-default pull-right" onclick="window.print();"><i class="fa fa-print"></i> Print</a>
         
        </div>
      </div>
    </section>
    <!-- /.content -->
  <!-- /.content -->
</div>
<!-- ./wrapper -->
</body>
</html>
