<?php
	error_reporting(0);
	define('INCLUDE_CHECK',true);
	session_start();
	require ('classes/config1.php');
	require_once('classes/session.php');
	$code = (substr(rand(1, 10000000000),0,6));
	if(isset($_POST['submit'])){
			$username = $_POST['username'];
			$password = $_POST['password'];
			$accesslevel = $_POST['accesslevel'];
			$query = mysql_query("INSERT INTO admins_account (username,password,accessed_Level,datereg) 
						VALUES('$username','$password','$accesslevel',NOW())") or die(mysql_error());
			header("location: dashboard.php?action=users_setup");	            
            }
?>
<title>OSCOTECH, ESA-OKE :: Admin-Dashboard > User Profile</title>


        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">Administrator Setup</h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            
            <div class="row">
                <div class="col-lg-12">
                	<?php echo $msg; ?>	
                    <div class="panel panel-info">
                        <div class="panel-heading">
                            User Profile Details
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-6">
                                    <form method="post" action="" role="form">
                                        <div class="form-group">
                                        	<label>Accessed Level:</label>
                                            <select name="accesslevel" class="form-control" id="accesslevel">
                                            <option value="">--Select Access Level--</option>
                                            <option value="super_admin">Super Admin</option>
                                            <option value="admin">Admin</option>
                                            <option value="rectory">Rectory</option>
                                            <option value="bursar">Bursary</option>
                                            <option value="registry">Registry</option>
                                            <option value="dr">Deputy Rector</option>
                                            <option value="personnel">personnel</option>
                                            <option value="MANAGEMENT SCIENCE">Faculty of Management Science</option>
                                            <option value="SCIENCE">Faculty of Applied Science</option>
                                            <option value="ENGINEERING">Faculty of Engineering</option>
                                            <option value="ENVIRONMENTAL STUDIES">Faculty of Environmental Studies</option>
                                            <option value="dpt_FO">DPT Faculty Officer</option>
                                            <option value="admission">admission</option>
                                            <option value="vocational">Vocational</option>
                                            <option value="user">User</option>
                                        </select>
                                        </div>
                                        <div class="form-group">
                                            <label>Username:</label>
                                            <input class="form-control" placeholder="Username" name="username" id="username" value="<?php echo $code; ?>"  require>
                                        </div>
                                        <div class="form-group">
                                            <label>Password: <span style="color:#F00; font-size:11px;">Minimum of Six Digit</span></label>
                                            <input class="form-control"  placeholder="Password" name="password" id="password" value="<?php echo $code; ?>"  require>
                                        </div>
                                        	<button type="submit" name="submit" class="btn btn-success">Submit</button>
                                        <button type="reset" class="btn btn-danger" VALUE="CLOSE" ONCLICK="window.location='dashboard.php?action=users_setup'">Close</button>
                                    </form>
                                </div>

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

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