<?php
	error_reporting(0);
	define('INCLUDE_CHECK',true);
	session_start();
	require ('classes/config1.php');
	require_once('classes/session.php');
	
	
?>
<title>OSCOTECH, ESA-OKE :: Admin-Dashboard > Admin User Setup</title>


        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">Admin User List</h1>
                    <a href="?action=new_administrator_setup" title="AddNew" class="btn btn-primary"><img src="images/icon-48-user-add.png" /></a>
            		<br /><br />
                </div>
                <!-- /.col-lg-12 -->            
            </div>
            <!-- /.row -->
            
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Users Details Table
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-bordered table-hover">
                                    <thead>
                                        <tr>
                                           <th>S/N</th>
                                            <th>USER NAME</th>
                                            <th>FULL NAME</th>
                                            <th>EMAIL</th>
                                            <th>ACCESS LEVEL</th>
                                            <th>ONLINE</th>
                                            <th>STATUS</th>
                                            <th>DATE REG</th>
                                            <th colspan="2">OPTION</th>
                                        </tr>
                                    </thead>
					<?php
                        
                        $key="";
                        if(isset($_POST['searchtxt']))
                            $key=$_POST['searchtxt'];
                        
                        if($key !="")
                            $sql=mysql_query("SElECT * FROM admins_account WHERE username='$key'");
                        else
                            $sql=mysql_query("SELECT * FROM admins_account");
                        
                            
                           
                        $i=0;
                        while($row=mysql_fetch_array($sql)){
                        $i++;
                        $color=($i%2==0)?"lightblue":"white";
                    ?>
                                    <tbody>
                                        <tr >
                                        	<td><?php echo $i;?></td>
                                            <td><?php echo $row['username'];?></td>
                                            <td><?php echo $row['surname']." ". $row['othernames'];?></td>
                                            <td><?php echo $row['email'];?></td>
                                            <td><?php echo $row['accessed_Level'];?></td>

                                            <?php 
                                           	 	if($row['is_online']=='yes') {
                                                    echo "<td><a href='?action=yes_no&opr=upd&user_id=$row[id]' class='btn btn-success'>".$row['is_online']."</a></td>";
												}else{
													 echo "<td><a href='?action=yes_no&opr=upd&user_id=$row[id]' class='btn btn-success'>".$row['is_online']."</a></td>";
												}

                                            
                                           	 	if($row['status']=='active') {
                                                    echo "<td><a href='?action=activate_deactivate&opr=upd&user_id=$row[id]' class='btn btn-danger'>".$row['status']."</a></td>";
												}else{
													echo "<td><a href='?action=activate_deactivate&opr=upd&user_id=$row[id]' class='btn btn-danger'>".$row['status']."</a></td>";
												}

                                            ?>
                                             <td><?php echo $row['datereg'];?></td>
                                            <td><a href="?action=update_student&opr=upd&rs_id=<?php echo $row['id'];?>" title="Update"><img src="images/icon-48-edit.png" /></a></td>
                                            <td><a href="?action=is_deleted&opr=del&rs_id=<?php echo $row['id'];?>" title="Delete"><img src="images/icon-48-delete.png" /></a></td>
                                        </tr>
                                    </tbody>
                          <?php	
							}
							// ----- for search studnens------	
								
							
							?>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                            
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->

        </div>
        <!-- /#page-wrapper -->
        

    </div>
    <!-- /#wrapper -->
    
