Your IP : 216.73.216.40


Current Path : /var/www/html/ajay/tele/
Upload File :
Current File : /var/www/html/ajay/tele/admin.php

<!DOCTYPE html>
<?php
    ob_start();
?>
<?php
    require_once("includes/session.php");
    confirm_admin();
    require_once("includes/functions.php");
    require_once("includes/header.php");
    require_once("includes/ContentSanitize.class.php");
    $san = new Sanitize();
?>
<html>
<head>
<title>Admin</title>
<script src="assets/jquery-1.11.2.min.js"></script>
<script>
    $( document ).ready(function() {
	var ac;
	$("#acInput").change(function(){
	    //abort previous call
	    if(ac && ac.readystate != 4){
		ac.abort();
	    }
	    ac = $.ajax({
		url:'autocomplete.php?ac='.concat($("#acInput").val()),
		success:function(result){
		    $("#acOutput").html(result);
		}
	    });
	});
    });
</script>
</head>
<body align="center">
    <table align="right">
	<tr>
	    <td>Login:</td>
	    <td><?php echo user_name($_SESSION['uid']); ?> ( <?php echo $_SESSION['uid'] ?> )</td>
	</tr>
	<tr>
	    <td colspan=2><a href="logout.php">Logout</a></td>
	</tr>
	<tr>
	    <td colspan=2><a href="user.php">Edit Personal Details</a></td>
	</tr>
    </table>
    
    <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post">
    <table align="center">
	<tr>
	    <th colspan=2>ADD USER TO DB</th>
	</tr>
	<tr>
	    <td>LDAP Username: </td>
	    <td><input type="text" name="uid" required=""></td>
	</tr>
	<tr>
	    <td colspan=2><input id="button-style1" name="submit" type="submit" value="ADD USER"></td>
	</tr>
	<tr>
	    <td colspan=2>
<?php
    if (isset($_POST['submit'])) {
	extract($_POST);
	$uid = $san->cleanString($uid);
        
	if(isValidUserLdap($uid) == 1) {
	    createUser($uid, $dbh);
	} else {
	    echo "Invalid Username";
	}
    } else {
        $uid = "";
    }
?>
	    </td>
	</tr>
    </table>
    </form>
    
    <table align="center" style="margin-top: 5em">
	<tr>
	    <th>Enter username to search : </th>
	    <td><input type="text" placeholder="USERNAME" id="acInput" value=""></td>
	</tr>
	<br>
    </table>
    <br><br>
    <div id="acOutput"></div>
    <br><br>
    By: Gaurav Bansal
</body>
</html>
<?php
    ob_end_flush();
?>