<?php include("frontinc/connection.php"); ?>
<?php include("frontinc/header.php"); ?>
<?php include("frontinc/navbar.php"); ?>
<?php include("frontinc/server_config.php"); ?>

<!-- banner -->
<?php include("frontinc/banner.php"); ?>

    <!-- Heading -->
    <div class="container">
        <div class="row">
            <div class="col-xs-12">
                <h1 class="text-center">List of Staffs</h1>
                <!-- <p class="lead text-center">Proactively envisioned multimedia based expertise and cross-media growth strategies. Seamlessly visualize quality intellectual capital without superior collaboration and idea-sharing. Holistically pontificate installed base portals after maintainable products without collateral.</p> -->
            </div>
        </div>
    </div>
        <div class="container">
        <div class="right_col" role="main">
          <div class="">

            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12 col-sm-12 ">
                <div class="x_panel">
                  
                  <div class="x_content">
                      <?php
                        session_start();
                        
                        if(!isset($_SESSION['useremail'])){
                            header('location:Sign_in.php');
                            exit();
                        }
                      ?>
                      <div class="row">
                          <div class="col-sm-12">
                            <div class="card-box table-responsive">
                    <table id="datatable" class="table table-striped table-bordered" style="width:100%">
                        <!-- corestaff -->
                       <thead>
                        <tr>
                        <th>S/N</th>
                        <th>Name</th>
                        <th>Email</th>
						            <th>Department</th>
						            <th>Rank</th>
                        </tr>
                      </thead>


                      <tbody>
                      <?php
                        $core_staff = mysqli_query($con, "SELECT * FROM corestaff ");

                        //fetch all cars
                        if(mysqli_fetch_array($core_staff)){

                            //use foreach to echo the datas
                            foreach($core_staff as $staff){
                           
                    ?>
                        <tr>
                        <td><?php echo $staff['corestaff_id']; ?></td>
                        <td><?php echo $staff['fname']; ?></td>
                        <td><?php echo $staff['email']; ?></td>
                        <td><?php echo $staff['department']; ?></td>
						            <td><?php echo $staff['rank']; ?></td>
                        </tr>
                        <?php
                    
                        }
                    }
                    ?>
                      </tbody>
                      <!-- administrative staff -->
                      <thead>
                        <tr>
                        <th>S/N</th>
                        <th>Name</th>
                        <th>Email</th>
						            <th>Department</th>
						            <th>Rank</th>
                        </tr>
                      </thead>


                      <tbody>
                      <?php
                        $core_staff = mysqli_query($con, "SELECT * FROM administrativestaff ");

                        //fetch all cars
                        if(mysqli_fetch_array($core_staff)){

                            //use foreach to echo the datas
                            foreach($core_staff as $staff){
                           
                    ?>
                        <tr>
                        <td><?php echo $staff['administrativestaff_id']; ?></td>
                        <td><?php echo $staff['fname']; ?></td>
                        <td><?php echo $staff['email']; ?></td>
                        <td><?php echo $staff['department']; ?></td>
						            <td><?php echo $staff['rank']; ?></td>
                        </tr>
                        <?php
                    
                        }
                    }
                    ?>
                      </tbody>
                      <!-- technical staff -->
                      <thead>
                        <tr>
                        <th>S/N</th>
                        <th>Name</th>
                        <th>Email</th>
						            <th>Department</th>
						            <th>Rank</th>
                        </tr>
                      </thead>


                      <tbody>
                      <?php
                        $core_staff = mysqli_query($con, "SELECT * FROM technicalstaff ");

                        //fetch all cars
                        if(mysqli_fetch_array($core_staff)){

                            //use foreach to echo the datas
                            foreach($core_staff as $staff){
                           
                    ?>
                        <tr>
                        <td><?php echo $staff['technicalstaff_id']; ?></td>
                        <td><?php echo $staff['fname']; ?></td>
                        <td><?php echo $staff['email']; ?></td>
                        <td><?php echo $staff['department']; ?></td>
						            <td><?php echo $staff['rank']; ?></td>
                        </tr>
                        <?php
                    
                        }
                    }
                    ?>
                      </tbody>
                      <!-- service staff -->
                      <thead>
                        <tr>
                        <th>S/N</th>
                        <th>Name</th>
                        <th>Email</th>
						            <th>Department</th>
						            <th>Rank</th>
                        </tr>
                      </thead>


                      <tbody>
                      <?php
                        $core_staff = mysqli_query($con, "SELECT * FROM servicestaff ");

                        //fetch all cars
                        if(mysqli_fetch_array($core_staff)){

                            //use foreach to echo the datas
                            foreach($core_staff as $staff){
                           
                    ?>
                        <tr>
                        <td><?php echo $staff['servicestaff_id']; ?></td>
                        <td><?php echo $staff['fname']; ?></td>
                        <td><?php echo $staff['email']; ?></td>
                        <td><?php echo $staff['department']; ?></td>
						            <td><?php echo $staff['rank']; ?></td>
                        </tr>
                        <?php
                    
                        }
                    }
                    ?>
                      </tbody>
                    </table>
                  </div>
                  </div>
              </div>
            </div>
                </div>
              </div>
              </div>
            </div>
                </div>
	
        </div>
		
	<!-- Footer -->
	