<?
###################################################
#Copyright (C) 2001 Stuart Wigley (hide@address.com)
#
#mydetails.php 23/07/2001
#
#This file is part of workbench.
#
#workbench is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#workbench is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with workbench; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#####################################################
session_start();
require_once("../config.php");
#if user has logged in get $login from session
if ($HTTP_SESSION_VARS["login"] && session_is_registered("login")){
$login = $HTTP_SESSION_VARS["login"];
require_once("$path/connect.php");
require_once("$path/general.php");
if ($HTTP_POST_VARS["fName"] && $HTTP_POST_VARS["sName"] && $HTTP_POST_VARS["email"]){
$query = mysql_query("update users set fName='".$HTTP_POST_VARS["fName"]."', sName='".$HTTP_POST_VARS["sName"]."', email='".$HTTP_POST_VARS["email"]."' where login='$login'") or die(mysql_error());
header("Location: $relative/admin/mydetails.php");
exit;
}
include("$path/header.php");
?>
<form method="post" action="mydetails.php" name="mydetails" onSubmit="return validateForm('mydetails')">
<table cellspacing="0" class="table3">
<tr class="rowtitle">
<td colspan="2"><h5>My Details</h5></td>
</tr>
<tr>
<td colspan="2"><p>Use this page to change your details. You can change your Name and Email Address here. If you need to change
your Group or Project Access, ask your Administrator.</p></td>
</tr>
<tr>
<td colspan="2"><hr></td>
</tr>
<tr>
<?$query = mysql_query("select * from users where login='$login'") or die(mysql_error());
while ($result = mysql_fetch_array($query)){?>
<td width="200">Login</td>
<td width="400"><?=$result[login]?></td>
</tr>
<tr>
<td width="200">First Name</td>
<td width="400"><input type="text" name="fName" size="20" maxlength="<?=mysql_field_len($query, 2)?>" value="<?=$result[fName]?>"></td>
</tr>
<tr>
<td width="200">Surname</td>
<td width="400"><input type="text" name="sName" size="20" maxlength="<?=mysql_field_len($query, 3)?>" value="<?=$result[sName]?>"></td>
</tr>
<tr>
<td width="200">Email</td>
<td width="400"><input type="text" name="email" size="20" maxlength="<?=mysql_field_len($query, 4)?>" value="<?=$result[email]?>"></td>
</tr>
<?$query = mysql_query("select * from groups where grpID='$result[grpID]'") or die(mysql_error());
while ($result2 = mysql_fetch_array($query)){?>
<tr>
<td width="200">Group</td>
<td width="400"><?=$result2[grpName]?></td>
</tr>
<?}
}?>
<tr>
<td width="200"> </td>
<td width="400"><input type="Submit" value="Submit" onfocus="this.blur()"><input type="Reset" value="Reset" onfocus="this.blur()"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<?
include("$path/footer.php");
}
else{
include("$path/login.php");
}
?>