<?php $this->load->view("common/header"); ?>
<div style="top:5px;" class="panel-tools open">
  <button data-toggle="dropdown" class="btn btn-blue dropdown-toggle" onClick="window.print()"><i class="fa fa-print"></i></button>
</div>
<style type="text/css">
th {
	text-align: left !important;
}
.report_view_th {
	color: #000 !important;
	text-align: center !important;
}
body {
	background-color: #fff !important;
	font-size: 12px;
}
p {
	margin: 0;
}
.modal-body {
	padding: 2px 15px 15px;
	position: relative;
}
body .modal {
	/* new custom width */

	width: 750px;
	/* must be half of the width, minus scrollbar on the left (30px) */

	margin-left: -375px;
}
.print-table td, th {
	padding: 1px;
	vertical-align: top !important;
}
thead {
	display: table-header-group;
}
tfoot {
	display: table-footer-group;
}
.width_cus {
	width: 100px !important;
}
.width_qty {
	width: 100px !important;
}
.table_rtn > thead:first-child > tr:first-child > th, .table > thead:first-child > tr:first-child > td, .table-striped thead tr.primary:nth-child(2n+1) th {
    background-color: #d9534f;
    border-color: #d43f3a;
    border-top: 1px solid #d43f3a;
    color: white;
    text-align: center;
   }

</style>

<!--https://css-tricks.com/almanac/properties/p/page-break/-->

<!--onLoad="window.print()-->

<body onLoad="window.print()">
<div class="row">
  <div class="col-xs-12"> 
    
    <h4 class="center" style="font-family:'Times New Roman', Times, serif; margin-bottom:3px; letter-spacing:2px;">Product Available Report</h4>
    <div class="col-xs-6">
      <p>Generated date time - <?php
echo date("Y-m-d H:i:s"); ?></p>   
<p>Generated User - <?php
echo $this->session->userdata('ss_user_first_name'); ?></p>  
<p>Filters - <?php echo $filters;
?></p>   
    </div>
    <div class="col-xs-6 pull-right" style="padding-left:160px;"> </div>
  </div>
</div>
<div class="print-start">
  <table class="print-table" width="100%" style="border:1px solid #000; text-align:left">
    <thead>
                          <tr>
                            <th  class="col-md-1"style="border:1px solid #000;">Product Code</th>
                            <th class="col-md-3" style="border:1px solid #000;">Product Name</th>
                            <th class="col-md-1" style="border:1px solid #000;">Cost</th>
                            <th class="col-md-1" style="border:1px solid #000;">Retail Price</th>
                            <th class="col-md-1" style="border:1px solid #000;">Unit</th>
                            <th  class="col-md-1"style="border:1px solid #000;">Freez Quntity</th>
                            <th  class="col-md-1"style="border:1px solid #000;">Quntity In hand</th>
                            <th  class="col-md-1"style="border:1px solid #000;">Stock Value</th>
                          </tr>
                        </thead>
                        <tbody>
                          <?php
                          $total_stock_val=0;
                          $qty_total=0;
 foreach($product_list as $row){  
    $total_stock_val+=$row['availble_stock']*$row['product_cost'];
    $qty_total+=$row['availble_stock'];
   ?>




                          <tr data-item-id="144680019784" id="row_1446800197032">
                            <td style="text-align:center; vertical-align:center; border:1px solid #000;"><?php echo $row['product_code']?>  </td>
                            <td style="text-align:center; vertical-align:middle; border:1px solid #000;"><?php echo $row['product_name']?></td>
                            <td style="text-align:center; vertical-align:middle; border:1px solid #000;"><?php echo $row['product_cost']?></td>
                            <td style="text-align:center; vertical-align:middle; border:1px solid #000;"><?php echo $row['product_price']?></td>
                            <td style="text-align:center; vertical-align:middle; border:1px solid #000;"><?php echo $row['unit_code']?></td>
                            <td style="text-align:center; vertical-align:middle; border:1px solid #000;"><?php echo $row['freez_stock']?></td>
                            <td class="align-middle" style="text-align:center; vertical-align:middle; border:1px solid #000;textalign"><?php echo $row['availble_stock']?></td>
                            <td class="align-middle" style="text-align:center; vertical-align:middle; border:1px solid #000;textalign"><?php echo $row['availble_stock']*$row['product_cost'];?></td>
                          </tr>
                          <?php }?>
                        </tbody>
                        <tfoot>
                        <th  class="col-md-1"style="border:1px solid #000;">Product Code</th>
                            <th class="col-md-3" style="border:1px solid #000;">Product Name</th>
                            <th class="col-md-1" style="border:1px solid #000;">Cost</th>
                            <th class="col-md-1" style="border:1px solid #000;">Retail Price</th>
                            <th class="col-md-1" style="border:1px solid #000;">Unit</th>
                            <th  class="col-md-1"style="border:1px solid #000;">Freez Quntity</th>
                            <th  class="col-md-1"style="border:1px solid #000;"><?php echo $qty_total; ?></th>
                             <th  class="col-md-1"style="border:1px solid #000;"><?php echo $total_stock_val; ?></th>
                          </tr>
                        </tfoot>
  </table>
  
  
</div>
<div class="row">

</div>
</div>
</div>
</div>
</div>
<!--print-start-->

</body>
