<?php 
	$header_file=APPPATH.'views/include/header.php';
	require($header_file);
	$sidenav_file=APPPATH.'views/include/sidenav.php';
	require($sidenav_file);	?>
<!-- BEGIN: Content-->
<style>
    th{
        font-size: 13px!important;
    }
</style>
    <div class="app-content content">
      <div class="content-overlay"></div>
      <div class="content-wrapper">
        <div class="content-header row">
          <div class="content-header-left col-md-6 col-12 mb-2 breadcrumb-new">
            <h3 class="content-header-title mb-0 d-inline-block">Inward</h3>
            <div class="row breadcrumbs-top d-inline-block">
              <div class="breadcrumb-wrapper col-12">
                <ol class="breadcrumb">
                  <li class="breadcrumb-item"><a href="#">Home</a>
                  </li>
                  <li class="breadcrumb-item"><a href="#">Inward List</a>
                  </li>
                  <li class="breadcrumb-item active">Inward
                  </li>
                </ol>
              </div>
            </div>
          </div>
         
        </div>
        <div class="content-body"><section class="card">
  <div id="invoice-template" class="card-body p-4">
    <!-- Invoice Items Details -->
    <div id="invoice-items-details" class="pt-2">
      <div class="row">
        <div class="table-responsive col-12">
          <table class="table table-bordered table-responsive-lg">
            <thead>
				<?php
					foreach($inward as $inw)
				?>
				<tr class="main_heading">
					<th colspan="11"><?php echo $inw->branchname; ?> - Inward View</span></th>
								</tr>
				 <tr class="data_details">
					<th>REQ No : <?php echo $inw->pr_req_no; ?></th>
					<th>REQ Date : <?php echo $inw->request_date; ?></th>
					<th>Issue No : <?php echo $inw->issue_no; ?></th>
					<th>Issue Date : <?php echo $inw->issue_date; ?></th>
					<th>RCP No : <?php echo $inw->req_rec_no; ?></th>
					<th>RCP Date : <?php echo $inw->receipt_date; ?></th>
					<th colspan="2">Store Name: <?php echo $inw->dept; ?></th>
				</tr>
				<tr class="data_heading">
					<th>Sl.No</th>
					<th>Product Name</th>
					<th>REQ Qty</th>
					<th>Issued Qty</th>
					<th>Recieved Qty</th>
					<th>Rate</th>
					<th>Total Rate</th>
					<th>Difference</th>
				</tr>
            </thead>
            <tbody>
             <?php
			$count=1;
			foreach($inward_item as $initem){
			?>
				<tr class="data_list">
					<td><?php echo $count; ?></td>
					<td><?php echo $initem->item_name; ?></td>
					<td><?php echo $initem->required_qty; ?></td>
					<td><?php echo $initem->issued_qty; ?></td>
					<td><?php echo $initem->quantity; ?></td>
					<td><?php echo $initem->price; ?></td>
					<td><?php echo $initem->total_price; ?></td>
					<td><?php echo $initem->issued_qty - $initem->quantity; ?></td>
				</tr>
			<?php 
				$count++; 
				} 
			?>
			<tr>
				<td colspan="6">Total Amount</td>
				<td><?php echo $inw->total_amount; ?></td>
				<td></td>
			</tr>
			</tbody>
          </table>
        </div>
      </div>
  
    </div>

    <!-- Invoice Footer -->
    <div id="invoice-footer">
      <div class="row">
        <div class="col-sm-7 col-12 text-center text-sm-left">
          <!--<h6>Terms & Condition</h6>
          <p>Test pilot isn't always the healthiest business.</p>-->
        </div>
        <div class="col-sm-5 col-12 text-center">
          <button type="button" id="print_receipt" class="btn btn-info print_receipt  btn-sm my-1"><i class="fa ft-printer"></i></button>
        </div>
      </div>
    </div>
    <!-- Invoice Footer -->

  </div>
</section>
</section>
<!-- // Basic form layout section end -->
        </div>
      </div>
    </div>
    <?php //require('include/theme_customizer.php');?>

   <?php 
  $footer_file=APPPATH.'views/include/footer.php';
	require($footer_file);
	?>
<script>
	$("#print_receipt").click(function() {
		window.print();
		setTimeout("closePrintView()", 50);
	});
	function closePrintView() {
		window.location = '<?php echo site_url('ProductRequest/carnival_InwardList');?>';
	} 
</script>