<?php
/******************************************************************************
************** Simple SMS Site Software *********************************
************** SSSSv1.0*****************************************************
************** by (aq) limited http://aql.com *******************************
************** All Rights Reserved ******************************************
************** Please read COPYRIGHT file prior to modification********
********************************************************************************/
session_start();
$user = $_SESSION['user'];
$pass = $_SESSION['pass'];
$edited_user = $_POST['D1'];
include("inc/header.inc.php");
if ($access == "admin") {
$query = "SELECT * FROM users WHERE username = '$edited_user'";
$result = mysql_query($query);
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$row = mysql_fetch_row($result);
?>
<form method="POST" name="edit_form" action="do_admin_edit.php">
<tr>
<td width="50%">
<h1>Edit user details</h1>
<input type="hidden" name="theUser" value="<?echo $edited_user?>">
</td>
</tr>
<tr>
<td width="50%">
<h2>Full name</h2>
<input type="text" name="theName" size="20" value="<?echo $row[2];?>">
</td>
<td width="50%">
<h2>Email</h2>
<input type="text" name="email" size="20" value="<?echo $row[8];?>">
</td>
</tr>
<tr>
<td width="50%">
<h2>Mobile</h2>
<input type="text" name="theMobile" size="20" value="<?echo $row[9];?>">
</td>
<td width="50%">
<h2>Landline</h2>
<input type="text" name="theLandline" size="20" value="<?echo $row[10];?>">
</td>
</tr>
<tr>
<td width="50%">
<h2>Address</h2>
<input type="text" name="address1" size="20" value="<?echo $row[4];?>"><br>
<input type="text" name="address2" size="20" value="<?echo $row[5];?>"><br>
<input type="text" name="address3" size="20" value="<?echo $row[6];?>"><br>
<input type="text" name="postcode" size="10" value="<?echo $row[7];?>">
</td>
<td width="50%">
<h2>Username</h2>
<?echo $edited_user;?>
<h2>Password</h2>
******
</td>
</tr>
<tr>
<td width="50%">
<h2>Admin
<?
if ($row[12] == "yes") {
?>
<input type="checkbox" name="theAdmin" class="checkbox" checked value="1">
<?
}
else {
?>
<input type="checkbox" name="theAdmin" class="checkbox" value="1">
<?
}
?>
</h2>
</td>
<td width="50%">
<h2>Guest
<?
if ($row[11] == "yes") {
?>
<input type="checkbox" name="theGuest" class="checkbox" checked value="1">
<?
}
else {
?>
<input type="checkbox" name="theFlash" class="checkbox" value="1">
<?
}
?>
</h2>
</td>
</tr>
</table>
<table>
<tr>
<td>
<h2>Extra notes</h2>
<textarea name="theNotes" class="notesbox" rows="6" cols="50"><?echo $row[3];?></textarea>
<br>
<input type="submit" value="Submit" name="B1">
</form>
<?
}
else {
include("inc/restricted.inc.php");
}
include("inc/footer.inc.php");
?>