<?php
    session_start();
    include 'function/classes.php';
        if(!isset($_SESSION['SESS_MEMBER_ID']) ||
                  (trim($_SESSION['SESS_MEMBER_ID'])=="") || (trim($_SESSION['SESS_ADM'])=="FALSE") )
                      {
                          echo "You will need admin rights to view this page";
                          exit();
                      }
       else{
           $employeelist=getList('* ','tb_admin','');
       }

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Mobivation</title>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <link href="css/default.css" rel="stylesheet" type="text/css" />
    </head>


    <body>
        <div id="wrapper">
        <?php include 'include/header.php'; ?>
            <!-- end div#header -->
            <div id="page">
                <div id="content">
                    <div id="Admin">
                        <h1>Admin List</h1>
                        <!--body-->
                        <table class="list" cellspacing="0">
                            <tr>
                                <td class="listHeader">Admin ID</td>
                                <td class="listHeader">Username</td>
                                <td class="listHeader">Admin Name</td>
                                <td class="listHeader">Active Flag</td>
                                <td class="listHeader">Admin Flag</td>
                                <td class="listHeader">Created By</td>
                            </tr>
                       <?php if (count($employeelist > 0)){
                            while($employee=mysql_fetch_array($employeelist) ){
                             echo '<tr>
                                        <td><a href="editemployee.php?id='. $employee['admin_id'] .'">'. $employee['admin_id'] .'</a></td>
                                        <td>'. $employee['username'] .'</td>
                                        <td>'. $employee['admin_name'] .'</td>
                                        <td>';
                                    if($employee['is_active']==1)
                                        echo 'Yes';
                                    else {
                                        echo 'No';
                                    }
                              echo '</td> <td>';
                                    if( $employee['is_admin']==1)
                                        echo 'Yes';
                                    else {
                                        echo 'No';
                                    }
                              echo '</td>
                                        <td>'. $employee['created_by'] .'</td>
                                   </tr>';
                          }
                        }?>
                        </table>                     
                        <!--body ends-->
                    </div>

                    <!-- end div#welcome -->

                </div>
                <!-- end div#content -->
                <div id="sidebar">
                    <ul>
                    <?php include 'include/nav.php'; ?>
                        <!-- end navigation -->
                        <?php //include 'include/updates.php'; ?>
                        <!-- end updates -->
                    </ul>
                </div>
                <!-- end div#sidebar -->
                <div style="clear: both; height: 1px"></div>
            </div>
            <?php include 'include/footer.php'; ?>
        </div>
        <!-- end div#wrapper -->
    </body>
</html>


