
<?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 option_status_user 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-ui-checks"></i> Access  Controls <span class="d-none"> <a href="option-status-add"> <i class="bi bi-plus-square-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>User</th>
							<th>Task</th>
							<th>Course</th>
							<th>Teacher</th>
							<th>Student</th>
							<th>SMS</th> 
							 
							<th>Update </th> 
                        </tr>
                        </thead>
						
                        <tbody>
							<?php
							  $sl=0;
								$eq=mysqli_query($con,"select * from option_status_user
                                left join `user` on user.userid=option_status_user.user_id   
                                left join `stuff` on stuff.userid=option_status_user.user_id  
								
								where access_level=4
								ORDER BY id ASC ");
								while($eqrow=mysqli_fetch_array($eq)){ 
									?>
										<tr> 
											<td><?php echo ++$sl; ?></td>
											<td><?php echo $eqrow['business_name']; ?></td>
											<td><?php if ($eqrow['task']=="d-none"){echo "No"; } else {echo $eqrow['task'];} ?></td>
											<td><?php if ($eqrow['course']=="d-none"){echo "No"; } else {echo $eqrow['course'];} ?></td> 
											<td><?php if ($eqrow['teacher']=="d-none"){echo "No"; } else {echo $eqrow['teacher'];} ?></td> 
											<td><?php if ($eqrow['student']=="d-none"){echo "No"; } else {echo $eqrow['student'];} ?></td> 
											<td><?php if ($eqrow['sms']=="d-none"){echo "No"; } else {echo $eqrow['sms'];} ?></td>  
											 
											
				<td><a  class="btn-sm btn-info" href="option-status-edit?edit_id=<?php echo $eqrow['id']; ?>" title="click for edit" 
                 onclick="return confirm('Do you want to Edit ?')"><i class="bi bi-pencil"></i> Update </a> </td>
				
				<td class="d-none"><a class="btn 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>
	  
	  <?php include('../includes/footer.php');?>
	  
    </section>

  </main>
  




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