
<?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']))
	{
		
		
		// it will delete an actual record from db
		$stmt_delete = $DB_con->prepare('DELETE FROM orders_dues 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>Dues Details |  <span> <a href="students-only-dues">   <i class="bi bi-table"></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="alert-primary">
							
							<tr> 
                                <th>Date  </th> 
								
								<th>Inv.No</th> 
                                <th>Student Name</th> 
								
								<th>Pre.Due</th>
						<!--		<th>Today</th>
								<th>Total</th> -->
								<th>Paid</th>
								<th>Rec.Due</th>
								
								<th>Payment</th>
								<th>By</th>
								
                            </tr>
                        </thead>
						
						
              <tbody id="tbody">

	
	
	<?php
	$eq=mysqli_query($con,"select * from orders_details 
    Left JOIN customer ON customer.customer_id = orders_details.customer_id
	left join `payment_status` on payment_status.ps_id=orders_details.paym_type
	where orders_details.user_id='".$_SESSION['id']."' ORDER BY orders_details.id DESC Limit 100 ");
	while($eqrow=mysqli_fetch_array($eq)){
	//$eidm=$eqrow['member_id'];
	?>
			<tr>
			<td><?php echo date("M d,Y", strtotime($eqrow['order_date'])); ?></td>
			<td><?php echo $eqrow['custom_invoice']; ?>  </td> 
			<td> <a  target="_blank" href="due-paid-print?edit_id=<?php echo $eqrow['customer_id']; ?>"> <?php echo $eqrow['customer_name']; ?> </a></td> 
			 		
			
			<td><?php echo $eqrow['pre_due']; ?></td>
	<!--		<td><?php echo $eqrow['today_total']; ?></td>
			<td><?php echo $eqrow['grand_total']; ?></td> -->
			<td><?php echo $eqrow['paid']; ?></td>
			<td><?php echo $eqrow['recent_due']; ?>  </td>
			<td><?php echo $eqrow['paym_type']; ?>  </td>
			<td><?php echo $eqrow['cuses']; ?>  </td>
		<!--	<td>
		 		<a class="btn btn-info" href="dues_edit.php?edit_id=<?php echo $eqrow['id']; ?>" title="click for edit" onclick="return confirm('Are You Sure To Edit ?')"><span class="glyphicon glyphicon-edit"></span> Edit</a> 
				<a class="btn btn-danger" href="?delete_id=<?php echo $eqrow['id']; ?>" title="click for delete" onclick="return confirm('Are You Sure 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'; ?>