include '../inc/db.inc.php';
$adminPage = true;
$id = $_GET['alumID'];
if($id)
{
$result = mysql_query("select * FROM gns_alums WHERE alumID=$_GET[alumID]");
$alum = mysql_fetch_assoc($result);
}
echo "
Great Neck South Class of 1972: $alum[title]";
include '../inc/album.inc.php';
include '../inc/header.php';
if(!($id && $alum))
{
echo "No such alum
";
}
else
{
$access = $admin || $_POST['access'] || ( $alum['birthyear'] == $_POST['birthyear'] && $alum['birthmonth'] == $_POST['birthmonth'] && $alum['birthday'] == $_POST['birthday'] );
if($access && $_POST['addalum'])
{//Try to add
$title = $_POST['title'];
$firstname = $_POST['firstname'];
$middlename = $_POST['middlename'];
$lastname = $_POST['lastname'];
$maidenname = $_POST['maidenname'];
$suffix = $_POST['suffix'];
$street1 = nl2br($_POST['street1']);
$street2 = nl2br($_POST['street2']);
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$birthmonth = $_POST['birthmonth'];
$birthday = $_POST['birthday'];
$birthyear = $_POST['birthyear'];
$homephone = $_POST['homephone'];
$workphone = $_POST['workphone'];
$mobilephone = $_POST['mobilephone'];
$fax = $_POST['fax'];
$email = $_POST['email'];
$biography = addslashes(nl2br($_POST['biography']));
if(!($firstname && $lastname ))
{
$message = "
Error adding alum. First Name, Last Name must be included.
";
}
else
{
$query = "UPDATE gns_alums SET
title = '$title',
firstname = '$firstname',
middlename = '$middlename',
lastname = '$lastname',
maidenname = '$maidenname',
suffix = '$suffix',
street1 = '$street1',
street2 = '$street2',
city = '$city',
state = '$state',
zip = '$zip',
birthmonth = '$birthmonth',
birthday = '$birthday' ,
birthyear = '$birthyear',
homephone = '$homephone',
workphone = '$workphone',
mobilephone = '$mobilephone',
fax = '$fax',
email = '$email',
biography = '$biography', participating = 1, updated = now() WHERE alumID = '$id'";
$result = mysql_query($query);
if($result)
{
$message = "
\"$firstname $lastname\" Changed Succesfully
";
}
else
{
$message ="
Error Making Change
".
mysql_error()."";
}
}
echo $message."Return to alum
";
}
else if($access)
{
$addalumForm = "
";
// display the form on every page instance
echo $addalumForm;
}
else
{
?> echo "$alum[firstname] $alum[lastname]";?>
Enter your birthday (m/d/y)
}
}
include '../inc/footer.php';
?>