<?php include('session.php'); ?>
<!DOCTYPE html>
<html lang="en">
  <head>
	<title>ECIMS ADMIN | ENGINEERS/TRADESMAN</title>
    <?php include('includes/head.php'); ?>
    <style>
        th,td {
            text-align:center;
        }
    </style>
  </head>
  <body>
    <div class="container-scroller">
      <div class="horizontal-menu">
        <?php include('includes/header.php'); ?>
      </div>
      <div class="container-fluid page-body-wrapper">
        <div class="main-panel">
          <div class="content-wrapper">
            <div class="page-header">
              <h3 class="page-title"> All Engineer/Tradesman </h3>
            </div>
            <div class="card grid-margin">
              <div class="card-body">
                <div class="row">
                  <div class="col-12">
                    <div class="table-responsive">
                      <table class="table table-striped table-bordered" width="100%">
                        <thead>
                          <tr>
                            <th>Sr No.</th>
                            <th>Name</th>
                            <th>Mobile No.</th>
                            <th>Designation</th>
                            <th>Update</th>
                          </tr>
                        </thead>
                        <tbody>
                            <?php if($_SESSION['admintype'] == 'dept'){
						      //$users_complaint = $conn->query("SELECT * FROM engineers_list WHERE dept_id='".$_SESSION['admin']."' AND status='1'"); 
						      $users_complaint = $conn->query("SELECT * FROM engineers_list WHERE status='1'"); 
						  } else {
						      $users_complaint = $conn->query("SELECT * FROM engineers_list WHERE status='1'"); 
						  }
						  $count=0; 
                            if($users_complaint->num_rows > 0) {
                            while($fetchusers_complaint = $users_complaint->fetch_assoc()) { $count++;
                            ?>
                              <tr>
                                <td><?php echo $count; ?></td>
                                <td><?php echo $fetchusers_complaint['name']; ?></td>
                                <td><?php echo $fetchusers_complaint['mobile']; ?></td>
                                <td><?php echo $fetchusers_complaint['designation']; ?></td>
                                <td><a href="editEngineer.php?id=<?php echo $fetchusers_complaint['id']; ?>" class="btn btn-xs btn-outline-primary">Update</a></td>
                                <!--<td><a onClick="javascript: return confirm('Are you Sure?');" href="deleteEngineer.php?id=<?php echo $fetchusers_complaint['id']; ?>" class="btn btn-xs btn-outline-danger">Delete</a></td>-->
                              </tr>
                          <?php }} else {
                          echo '<tr><td colspan="7"><center>No Records Found!</center></td></tr>';
                          } ?>
                        </tbody>
                      </table>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
		  <?php include('includes/footer.php'); ?>
        </div>
      </div>
    </div>
    </div>
    <?php include('includes/foot.php'); ?>
  </body>
</html>