Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/mentanet/
Upload File :
Current File : /var/www/cesa.co.za/mentanet/profile.php

<?php
include("inc_functions.php");

if (!isset($_SESSION["StudentID"]) || empty($_SESSION["StudentID"])) header("Location: http://www.cesa.co.za/mentanet/login.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>MentaNet</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<!--[if IE 5]>
<style type="text/css"> 
/* place css box model fixes for IE 5* in this conditional comment */
.twoColFixLtHdr #sidebar1 { width: 230px; }
</style>
<![endif]--><!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.twoColFixLtHdr #sidebar1 { padding-top: 30px; }
.twoColFixLtHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
</head>

<body class="twoColFixLtHdr">

<div id="container">
<?php include("inc_header.php"); ?>
<?php include("inc_sidebar.php"); ?>
  <div id="mainContent">
    <h1> Your Details</h1>
<?php
if (isset($_POST["go"])) {
	$sql = "UPDATE ";
	if ($_SESSION["UserType"]=="C") {
		$sql.="CCMStudents";
	} elseif ($_SESSION["UserType"]=="M") {
		$sql.="CCMMentors";
	} elseif ($_SESSION["UserType"]=="E") {
		$sql.="CCMEmployers";
	}
	$sql.=" SET Title='".$_POST["Title"]."', 
	FirstName='".addslashes(stripslashes($_POST["FirstName"]))."', 
	Surname='".addslashes(stripslashes($_POST["Surname"]))."', 
	KnownAs='".addslashes(stripslashes($_POST["KnownAs"]))."', IDNumber='".$_POST["IDNumber"]."',
	Telephone='".$_POST["Telephone"]."', Cellphone='".$_POST["Cellphone"]."', 
	EmailAddress='".$_POST["EmailAddress"]."', 
	WorkAddress='".addslashes(stripslashes($_POST["WorkAddress"]))."', 
	PostalAddress='".addslashes(stripslashes($_POST["PostalAddress"]))."',
	Organisation='".addslashes(stripslashes($_POST["Organisation"]))."',
	Department='".addslashes(stripslashes($_POST["Department"]))."',
	MentorName='".addslashes(stripslashes($_POST["MentorName"]))."',
	MentorDesig='".addslashes(stripslashes($_POST["MentorDesig"]))."',
	MentorProfRegNo='".addslashes(stripslashes($_POST["MentorProfRegNo"]))."',
	MentorTel='".addslashes(stripslashes($_POST["MentorTel"]))."',
	MentorCell='".addslashes(stripslashes($_POST["MentorCell"]))."',
	MentorEmail='".addslashes(stripslashes($_POST["MentorEmail"]))."'
	WHERE ";
	if ($_SESSION["UserType"]=="C") {
		$sql.="CCMStudentID";
	} elseif ($_SESSION["UserType"]=="M") {
		$sql.="CCMMentorID";
	} elseif ($_SESSION["UserType"]=="E") {
		$sql.="CCMEmployerID";
	}
	$sql.="=".$_SESSION["StudentID"];
	mysql_query($sql);
	echo "<p><b>Your details have been updated.</b</p>";
}

$sql = "SELECT * FROM ";
	if ($_SESSION["UserType"]=="C") {
		$sql.="CCMStudents";
	} elseif ($_SESSION["UserType"]=="M") {
		$sql.="CCMMentors";
	} elseif ($_SESSION["UserType"]=="E") {
		$sql.="CCMEmployers";
	}
	$sql.=" WHERE ";
	if ($_SESSION["UserType"]=="C") {
		$sql.="CCMStudentID";
	} elseif ($_SESSION["UserType"]=="M") {
		$sql.="CCMMentorID";
	} elseif ($_SESSION["UserType"]=="E") {
		$sql.="CCMEmployerID";
	}
	$sql.="=".$_SESSION["StudentID"];
$rec = mysql_query($sql);
$row = mysql_fetch_assoc($rec);
?>    
    <form id="form1" name="form1" method="post" action="profile.php">
    <input type="hidden" name="go" value="1" />
      <table border="0" cellpadding="5" cellspacing="0">
        <tbody>
          <tr>
            <td>Title:</td>
            <td><input name="Title" type="text" id="Title" size="50" value="<?php echo $row["Title"]; ?>" /></td>
          </tr>
          <tr>
            <td width="203"><p>First Name:</p></td>
            <td width="379"><p>
                <input name="FirstName" type="text" id="FirstName" size="50" value="<?php echo $row["FirstName"]; ?>" />
            </p></td>
          </tr>
          <tr>
            <td><p>Surname:</p></td>
            <td><input name="Surname" type="text" id="Surname" size="50" value="<?php echo $row["Surname"]; ?>" /></td>
          </tr>
          <tr>
            <td><p>Preferred Name (Known As):</p></td>
            <td><p>
                <input name="KnownAs" type="text" id="KnownAs" size="50" value="<?php echo $row["KnownAs"]; ?>" />
            </p></td>
          </tr>
          <tr>
            <td>ID Number:</td>
            <td><input name="IDNumber" type="text" id="IDNumber" size="30" value="<?php echo $row["IDNumber"]; ?>" /></td>
          </tr>
          <tr>
            <td><p>Telephone No:</p></td>
            <td><p>
                <input name="Telephone" type="text" id="Telephone" size="30" value="<?php echo $row["Telephone"]; ?>" />
            </p></td>
          </tr>
          <tr>
            <td><p>Cell No.&nbsp;:</p></td>
            <td><p>
                <input name="Cellphone" type="text" id="Cellphone" size="30" value="<?php echo $row["Cellphone"]; ?>" />
            </p></td>
          </tr>
          <tr>
            <td><p>E-mail Address:</p></td>
            <td><p>
                <input name="EmailAddress" type="text" id="EmailAddress" size="50" value="<?php echo $row["EmailAddress"]; ?>" />
            </p></td>
          </tr>
          <tr>
            <td valign="top"><p>Work Address:</p></td>
            <td><p>
                <textarea name="WorkAddress" id="WorkAddress" cols="45" rows="5"><?php echo stripslashes($row["WorkAddress"]); ?>
        </textarea>
            </p></td>
          </tr>
          <tr>
            <td valign="top"><p>Postal Address:</p></td>
            <td><p>
                <textarea name="PostalAddress" id="PostalAddress" cols="45" rows="5"><?php echo stripslashes($row["PostalAddress"]); ?>
      </textarea>
            </p></td>
          </tr>
<?php
	if ($_SESSION["UserType"]=="C") {
?>
          <tr>
            <td valign="top"><p>Employer (Company or Organisation Name):</p></td>
            <td><p>
                <input name="Organisation" type="text" id="Organisation" size="50" value="<?php echo $row["Organisation"]; ?>" />
            </p></td>
          </tr>
          <tr>
            <td valign="top"><p>Your Department:</p></td>
            <td><p>
                <input name="Department" type="text" id="Department" size="50" value="<?php echo $row["Department"]; ?>" />
            </p></td>
          </tr>
          <tr>
            <td valign="top"><p>Mentor's Name:</p></td>
            <td><p>
                <input name="MentorName" type="text" id="MentorName" size="50" value="<?php echo $row["MentorName"]; ?>" />
            </p></td>
          </tr>
          <tr>
            <td valign="top"><p>Mentor's Job Title:</p></td>
            <td><p>
                <input name="MentorDesig" type="text" id="MentorDesig" size="50" value="<?php echo $row["MentorDesig"]; ?>" />
            </p></td>
          </tr>
          <tr>
            <td valign="top"><p>Mentor's Prof Reg No:</p></td>
            <td><p>
                <input name="MentorProfRegNo" type="text" id="MentorProfRegNo" size="50" value="<?php echo $row["MentorProfRegNo"]; ?>" />
            </p></td>
          </tr>
          <tr>
            <td valign="top"><p>Mentor's Tel No:</p></td>
            <td><p>
                <input name="MentorTel" type="text" id="MentorTel" size="50" value="<?php echo $row["MentorTel"]; ?>" />
            </p></td>
          </tr>
          <tr>
            <td valign="top"><p>Mentor's Cell No:</p></td>
            <td><p>
                <input name="MentorCell" type="text" id="MentorCell" size="50" value="<?php echo $row["MentorCell"]; ?>" />
            </p></td>
          </tr>
          <tr>
            <td valign="top"><p>Mentor's Email Address:</p></td>
            <td><p>
                <input name="MentorEmail" type="text" id="MentorEmail" size="50" value="<?php echo $row["MentorEmail"]; ?>" />
            </p></td>
          </tr>
<?php
	}
?>
        </tbody>
      </table>
      <p>
        <label>
        <input type="submit" name="button" id="button" value="Update Now" />
        </label>
      </p>
    </form>
    <p>&nbsp;</p>
  </div>
<?php include("inc_footer.php"); ?>
<!-- end #container --></div>
</body>
</html>