Location: PHPKode > projects > Radtracker > radtracker/profile.php
<?php
session_register("lname");
session_register("pass");
include("pagefunctions.php");
include("checkuser.php");
$userstatus = checkuser($lname, $pass);

if ($userstatus == "isvalid") {
  gentop("Add a Topic");
  
/*post response to updating profile*/
if ($stage == 1)
{
global $connection;
$db = mysql_select_db("radTracker", $connection) or die ("Couldn't connect to DB Radtracker");
	if ($HTTP_POST_VARS)
	{
		$sql_command = "delete from expertise where name='$Pname'";
		$sql_result = mysql_query($sql_command,$connection) or die (mysql_error());
		while (list($lvar,$lvalue)=each($HTTP_POST_VARS))
		{
		if (($lvar!='Pname') && ($lavr!='stage'))
			{
			$sql_command = "Insert into expertise(CUID,name)
			values('$lvar','$Pname')";
			$sql_result = mysql_query($sql_command,$connection) or die (mysql_error());
			}
		}
	}

}
/*end post response*/
/* issue.php written for radtracker program
	created 7/5/01
*/
$temp=$Pname;
echo "<table align='left' border='1' cellpadding='2' cellspacing='2'>";
echo "<form action='profile.php' method='post'>";
echo "<TR><TD>Please select support person</td><td>";
echo "<select name='Pname' size='1' onChange='submit()'>";
$sql_command = "SELECT Name FROM personnel ORDER BY Name";
$sql_result = mysql_query($sql_command,$connection) or die (mysql_error());
while ($row = mysql_fetch_array($sql_result)) {
$name = $row["Name"];
if ($temp=="") $temp=$name; /*initial condition*/
if ($name==$temp) 
{$sel="selected";}
else
{$sel="";}
echo "<option $sel value=\"$name\">$name</option>";
}?></select></td></tr>
</form>
<form action='profile.php' method='post'>
<tr><TD align=middle colspan=2><b>Category Subscriptions</b></td></tr>
<?php
$sql_command = "SELECT * FROM category ORDER BY Category";
$sql_result = mysql_query($sql_command,$connection) or die (mysql_error());
while ($row = mysql_fetch_array($sql_result)) {
	$catname = $row["Category"];
	$cuid=$row["CUID"];
	$sql_command2 = "Select count(*) as cnt from expertise where CUID='$cuid' and name='$temp'";
	$sql_result2 = mysql_query($sql_command2,$connection) or die (mysql_error());
	$res = mysql_fetch_array($sql_result2);
	$check=$res["cnt"];
	$checkval="";
	if ($check>0) $checkval="checked";
	echo "<tr><TD>$catname</td><td><input name='$cuid' $checkval type=checkbox></td></tr>";
}
echo "<tr><td colspan=2 align=middle><input type=submit value='Update Profile'></td></tr></table>";
echo "<input type=hidden name='Pname' value='$temp'>";
echo "<input type=hidden name='stage' value='1'></form>";

genbottom();
}

else {
    global $serverhome;
  header("Location: " . $serverhome . "/radtracker/login.php?from=$PHP_SELF");
}


?>
Return current item: Radtracker