<?php ob_start(); ?> 
<!DOCTYPE html> 
<html lang="en"> 

<head>
<?php   require_once 'head_link.php'; ?>

</head>

<body>
 
<?php   require_once 'header1.php'; ?> 

<?php
	if(isset($_GET['delete_id']))
	{ 
		$stmt_delete = $DB_con->prepare('DELETE FROM assets_details WHERE id =:uid');
		$stmt_delete->bindParam(':uid',$_GET['delete_id']);
		$stmt_delete->execute();
		 
	}

?>

<?php  require_once 'sidebar.php'; ?>


  <main id="main" class="main">

    <div class="pagetitle bg-light rounded p-2"> 
	  <h1><i class="bi bi-box-arrow-up-right"></i>   Assets History  | 
	  
	  <span> <a href="asset-dam-sale-report-by-date">  <i class="bi bi-files"></i> </a> </span>  | 
	  <span> <a href="asset-dam-sale">  <i class="bi bi-plus-circle-fill"></i> </a> </span> 
	  </h1>
	
    </div> 

    <section class="section">
      <div class="row">
	  
        <div class="col-lg-12">

          <div class="card">
            <div class="card-body">
             
              <table class="table table-hover datatable">
                <thead class="bg-light">
                        <tr>
							<th>SL</th>
							<th>Name</th>
							<th>Details</th>
							<th>Buy </th>
							<th>Sale / Dam</th>
							<th>Price</th>
							<th>Causes </th>
							<th>Date</th>
							 
							<th>Delete</th>
                        </tr>
                  </thead>
				  
                 <tbody id="tbody">
							<?php
							$sl=0;
								$eq=mysqli_query($con,"select * from assets_details                             
 							  left join asset_cat on asset_cat.ast_id=assets_details.ast_cat
							  ORDER BY assets_details.id DESC ");
								while($eqrow=mysqli_fetch_array($eq)){ 
									?>
										<tr> 
											<td><?php echo ++$sl; ?></td> 
											<td><?php echo $eqrow['ast_name']; ?></td>
											<td><?php echo $eqrow['details']; ?></td>
											<td><?php echo $eqrow['buy_qty']; ?></td>
											<td><?php echo $eqrow['quantity']; ?></td>
											<td><?php echo $eqrow['price']; ?></td>
											<td><?php echo $eqrow['causes']; ?></td>
											<td><?php echo date("d-M-Y", strtotime($eqrow['entry_date'])); ?></td>
											
											
				 
				<td><a class="btn-sm btn-danger" href="?delete_id=<?php echo $eqrow['id']; ?>" title="click for delete" onclick="return confirm('Do You Want To Delete ?')"><span class="glyphicon glyphicon-remove-circle"></span> Delete</a> </td>
			
				
			</tr>
		<?php
		}  
		?>

</tbody>
              </table>
            
            </div>
          </div>

        </div>
      </div>
    </section>

  </main>
  
  <?php  require_once 'footer1.php'; ?>