<?php include('parent/callMe.php');?>
<?php include('Sessioncheck.php');?>
<?php   

$m->where("branch_id", $_SESSION['branch']);
$branch1=$m->get("edu_branch_config");
  
$branch=$_SESSION['branch']; 

$sql = "SELECT * FROM eduportal_inventory_system as b where b.branch_id='$branch' order by inventory_id desc ";


// echo $sql;

$categories = $m->query($sql);
 //print_r($categories);


 ?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Print PayRoll Sheet</title>
<link rel="icon" type="image/png" href="img/favicon.png" sizes="32x32" />
<script type="text/javascript">
// window.print();
</script>
<style type="text/css">

tr th {border-top:1px solid gray;border-left:1px solid black;border-bottom:1px solid black;text-align:center;background-color:lightgray;font-size:14px; padding:3px;}
tr td {border-bottom:1px solid gray;border-left:1px solid black;font-size:14px; padding:3px;}
  
.border{border:1px solid black;}
.center{text-align:center;}
.alignment{padding-left:1%;text-align:left;}
.borderTop{
  border-top: none;
}
</style>
</head>
<body style="font-size:12px;">


<div style="text-align:center;font-size:24px;font-weight:bold;margin:0 auto;"><?php echo $branch1[0]['Branch_Name'];?> 
</div>

<br>

<div style="text-align:center;font-size:18px;font-weight:bold;"> INVENTORY / ASSETS SHEET

 </div>

<hr style="width:100%;">
<!-- <div style="width:33%; float:left;font-size:18px; margin-left:10px; "> <b> Month:</b> <?php echo $month[0]['Month_Name'];?> </div> -->


<br><br>

<table id="datatable" class="table table-striped table-bordered"style="background-color: white;">
                      <thead>
                        <tr>
                          <th width="1%">S.No</th>
                           <th width="10%">Item Name</th>
                          <th width="10%">Quantity</th>
                          <th width="20%">Details</th>
                          <th width="10%">Date</th>
                          <th width="10%">Month</th>
                          <th width="8%">Amount</th>
                          <th width="10%" style="border-right: 1px solid black;">Depriciation</th>
                        
                         

                        </tr>
                      </thead>
                      <tbody>

                        
<?php  $count=1;
$date= date("Y-m-d");

foreach($categories as $category){

  $m->where("category_id", $category['category_id']);
  $ctgry=$m->get("eduportal_expanse_category");

  $m->where("subcategory_id", $category['subcategory_id']);
  $sbctgry=$m->get("eduportal_expanse_subcategory");

  $m->where("Month_Id", $category['month_id']);
  $months=$m->get("eduportal_month_config");

$totalAssetsAmount+=$category['inventory_amount'];
$totalDepriceationAmount+=$category['annual_depreciation'];
?>
                        <tr>
                          <td style="text-align:center;"><?php echo $count; $count++;?></td>
                         

                          <td><?php echo $category['inventory_name'];?></td>
                          <td><?php echo $category['quantity_number'];?></td>
                          <td><?php echo $category['inventory_details'];?></td>
                          <td><?php echo $category['purchase_date'];?></td>
                          <td><?php echo $months[0]['Month_Name'];?></td>
                          <td><?php echo $category['inventory_amount'];?></td>
                          <td style="border-right: 1px solid black;"><?php echo $category['annual_depreciation'];?></td> 
                                                  

                          

                        </tr>
<?php } ?>

<tr>
  <td colspan="6" style="text-align:center;background-color:lightgray;font-size: 16px; font-weight: bold;">Total</td>
  <td style="background-color:lightgray;font-size: 16px; font-weight: bold;"><?php echo $totalAssetsAmount;?></td>
  <td style="background-color:lightgray;font-size: 16px; font-weight: bold;"><?php echo $totalDepriceationAmount;?></td>
</tr>
                      

                      </tbody>
                    </table>
   
    <br>
     
      
      

</body>
</html>
