<?php
@session_start();
@ob_start();
include "header.php";
?>


<div class="content">
<div class="content-header">
<h3 class="head-dashboard">Damage List </h3>
<div style="float:right; margin-top:-30px;">

</div>

</div>
<div class="content-container">
<div class="entry-head">
<h4><strong>Damage List</strong>


  <div style="color:#FFFFFF; float:right"><a href="damage_alter.php"><img src="<?php echo IMAGE_PATH?>add.png" title="Add New Record" width="18" height="18" /></a></div> </h4>

</div>

<div class="entry-content">
 <table id="example23" class="display nowrap table table-hover table-striped table-bordered" cellspacing="0" width="100%">
 <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>Item Name</th>
                                             <th>Quantity</th>
											 <th>Purchase Price</th>
											 <th>Total Amount</th>
                                           
                                        </tr>
                                    </thead>
                                    <tbody>
                                       <?php
							

 	 $q = "SELECT * FROM tbl_itemdamage_details order by id desc";
	 $query = mysql_query($q);
	 $i=1;
	 $grand_total = 0;
								while($row=mysql_fetch_assoc($query)){  
     
	
				
  ?>
  <tr>
  <td><?php echo $i++;?></td>
   <td><?php  $sql_itm = "SELECT * FROM tbl_item where id = '".$row["item_id"]."'";
	 $query_item = mysql_query($sql_itm);
	 $row_item=mysql_fetch_assoc($query_item);
	 echo $row_item['item_name'];
	 ?></td>
      <td><?php echo $row["dem_qty"];?></td>
	   <td><?php echo $row["pur_price"];?></td>
	   <td><?php echo $total = $row["dem_qty"] * $row["pur_price"];?></td>
    
                                           
                                        </tr>
                                       <?php
									   $grand_total +=$total;
									    }?>
										<tr><td colspan="4" align="right">Grand Total</td>
										<td><?php echo $grand_total; ?></td>
										</tr>
                                    </tbody>
</table>
<?php include "footer.php"?>

</body></html>
		