session_start();
$id = $_SESSION['id'];
if ($_SESSION['approved'] != 'yes')
{
include 'loginform.html';
exit();
}
include 'connect.php';
$update = $_POST['update'];
if ($update == 'Update Profile')
{
$sql = mysql_query("select picname from users where id = '$id'");
$row = mysql_fetch_array($sql);
$pic = $row[0];
if ($pic != "")
{
unlink ("userpics/$pic");
}
$target_path = "userpics/";
$type = $_FILES['userpic']['type'];
if (ereg("gif",$type)) $ext = ".gif";
if (ereg("jpeg",$type)) $ext = ".jpg";
$name = "$id$ext";
$dest = "$target_path$name";
if(move_uploaded_file($_FILES['userpic']['tmp_name'], $dest))
{
echo "The file ". basename( $_FILES['userpic']['name']).
" has been uploaded
";
mysql_query("update users set picname = '$name' where id = '$id'");
} else {
echo "There was an error uploading the file, please try again!
";
}
$email= $_POST['email'];
$distance = $_POST['distance'];
$highway = $_POST['highway'];
$zip = $_POST['zip'];
$sql = mysql_query("update users set email = '$email', proximity = '$distance', zip = '$zip' , highway = '$highway' where id = '$id'");
}
$id = $_SESSION['id'];
$date = $_GET['date'];
$sql = mysql_query("select name from users where id = '$id'");
$row = mysql_fetch_row($sql);
$name = $row[0];
echo "Welcome $name
Choose from the links below what you would like to do today
";
//schedule control
//edit profile
//car control (seating)
//picture control
//possible messaging
//check current carpools
//remove capabilities
//current carpool proposals
?>
Add/Edit My Schedule
Add/Edit My Profile
Propose
$schedule = $_REQUEST['schedule'];
$editprofile = $_GET['editprofile'];
if ($editprofile == 'yes')
{
$sql = mysql_query("select * from users where id = '$id'");
echo "