<?php
$getGROUPS = mysql_query("SELECT * FROM ath_groups"); //GET GROUPS
if (!$getGROUPS){
echo("<p class=\"red\">adduserFORM.php COULD NOT GET GROUP INFO");
}
?>
<script language="JavaScript">
function check(){
if (adduser.username.value == ""){
window.alert("Username field cannot be left blank.");
return false;
}
if (adduser.password.value != adduser.passwordconfirm.value){
window.alert("Password and Password Confirmation do not match. Please re-type, do not copy and paste.");
return false;
}
if (adduser.username.password == ""){
window.alert("Password field cannot be left blank.");
return false;
}
}
var url;
var height;
var width;
var specs;
function openwinHELP(url, width, height){
specs = 'toolbar,scroll,status,resizable,width=' + width + ',height=' + height + ',top=75,left=150'
popupWin = window.open(url,'pop_tiny',specs);
}
</script>
<table border="0" cellspacing="0" cellpadding="1" bgcolor="#333333">
<tr>
<td class="cell_heading">ADD A NEW USER</td>
</tr>
<tr>
<td>
<form name="adduser" action="main.php?act=adduser" method="post" onSubmit="return check(this);">
<table width="450" border="0" cellspacing="0" cellpadding="2" bgcolor="white">
<tr>
<td class="form_right" bgcolor="#f0e68c" width="200">User Name:</td>
<td bgcolor="#f0e68c" width="150"><input type="text" name="username" value="<?php echo($_POST["username"]); ?>" size="25" maxlength="20" border="0"></td>
</tr>
<tr>
<td class="form_right" bgcolor="#f0e68c" width="200">Password:</td>
<td bgcolor="#f0e68c" width="150"><input type="password" name="password" value="" size="25" maxlength="16" border="0"></td>
</tr>
<tr>
<td class="form_right" bgcolor="#f0e68c" width="200">Confirm Password:</td>
<td bgcolor="#f0e68c" width="150"><input type="password" name="passwordconfirm" size="25" maxlength="16" border="0"></td>
</tr>
<?php if ($checkUSER["ath_groups_ADMINISTRATE"] == 1): ?>
<tr>
<td class="form_right" bgcolor="#f0e68c" width="200">Group:</td>
<td bgcolor="#f0e68c" width="150">
<?php include("../includes/show_groups.inc.php"); ?>
</td>
</tr>
<?php else: ?>
<tr>
<td class="form_right" bgcolor="#f0e68c" width="200">Group:</td>
<td bgcolor="#f0e68c" width="150">
<?php
$checkgroupid = $_SESSION["userGROUPID"];
$getGROUPNAME = mysql_query("SELECT * FROM ath_groups WHERE ath_groups_id=$checkgroupid");
if (!$getGROUPNAME){
echo("<p class=\"red\">ERROR: getGROUPNAME in adduserFORM failed!</p>");
echo(mysql_error());
exit();
}
$ROWgetGROUPNAME = mysql_fetch_array($getGROUPNAME);
echo($ROWgetGROUPNAME["ath_groups_name"]);
?>
<input type="hidden" name="group" value="<?php echo($_SESSION["userGROUPID"]); ?>" border="0">
</td>
</tr>
<?php endif; ?>
<tr>
<td class="form_right" bgcolor="#e9967a" width="200">Real Name:</td>
<td bgcolor="#e9967a" width="150"><input type="text" name="name" value='<?php echo($_POST["name"]); ?>' size="25" maxlength="80" border="0"></td>
</tr>
<tr>
<td class="form_right" bgcolor="#e9967a" width="200">E-mail:</td>
<td bgcolor="#e9967a" width="150"><input type="text" name="email" value='<?php echo($_POST["email"]); ?>' size="25" maxlength="255" border="0"></td>
</tr>
<tr>
<td class="form_right" bgcolor="#e9967a" width="200">Student #:</td>
<td bgcolor="#e9967a" width="150"><input type="text" name="studentnum" value='<?php echo($_POST["studentnum"]); ?>' size="25" maxlength="40" border="0"></td>
</tr>
<tr>
<td class="form_right" bgcolor="#e9967a" width="200">Address:</td>
<td bgcolor="#e9967a" width="150"><input type="text" name="address" value='<?php echo($_POST["address"]); ?>' size="25" maxlength="255" border="0"></td>
</tr>
<tr>
<td class="form_right" bgcolor="#e9967a" width="200">Phone:</td>
<td bgcolor="#e9967a" width="150"><input type="text" name="phone" value='<?php echo($_POST["phone"]); ?>' size="25" maxlength="100" border="0"></td>
</tr>
<!--<tr>
<td class="form_right" bgcolor="#e9967a" width="200">Can add resources to other projects in the group:</td>
<td valign="top" bgcolor="#e9967a" width="150">
<select name="canaddtogroup" size="1">
<?php
/*if ($_POST["canaddtogroup"] == 0){
echo("<option selected value=\"0\">no</option>");
echo("<option value=\"1\">yes</option>");
}
else{
echo("<option value=\"0\">no</option>");
echo("<option selected value=\"1\">yes</option>");
}
*/
?> <a href="#" onClick="openwinHELP('../helpfiles/aboutADDTOGROUP.html', 350, 350);"><img src="../images/help.jpg" alt="" height="14" width="14" border="0"></a></td>
</tr>-->
<tr>
<td class="form_right" bgcolor="#e9967a" width="200">Activate Now?:</td>
<td bgcolor="#e9967a" width="150"><select name="activate" size="1">
<option selected value="1">Yes</option>
<option value="0">No</option>
</select></td>
</tr>
<tr height="10">
<td class="form_right" bgcolor="#e9967a" width="200" height="10"> </td>
<td bgcolor="#e9967a" width="150" height="10"> </td>
</tr>
<tr>
<td class="form_right" bgcolor="#90ee90" width="200"> </td>
<td bgcolor="#90ee90" width="150"><input type="submit" name="adduser" value="Add User" border="0"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>