session_start();
include("accesscontrol.php");
include("header.inc");
echo"
AGTL E-mail
";
if ( $emailsubmit)
{
//send email with the new password
$email = "$email1,$email2,$email3";
$subject = "$subject1";
$fromemail = "$fromemail1";
$body = "$message";
mail("$email", "$subject", "$body", "From: $fromemail");
echo"
Your email was succesfully sent.
";
}
else {
// Query #1
$sql2 ="SELECT agtlusers.email as agtluseremail, mentors.email, mentors.mentorregion,mentors.fname,mentors.lname FROM agtlusers LEFT JOIN mentors on agtlusers.mentor = mentors.mentorID WHERE ID = '$ID' ";
$result2 = mysql_query($sql2);
$myrow2 = mysql_fetch_array($result2);
$fromemail1 = $myrow2["agtluseremail"];
$mentoremail = $myrow2["email"];
$mentorfname = $myrow2["fname"];
$mentorlname = $myrow2["lname"];
$mentorregion = $myrow2["mentorregion"];
// Query #2
$sql3 ="SELECT
mentors.email,mentors.fname,mentors.lname FROM mentors WHERE mentors.mentorregion = '$mentorregion' AND mentors.coordinator = '1'";
$result3 = mysql_query($sql3);
$myrow3 = mysql_fetch_array($result3);
$coordinatoremail = $myrow3["email"];
$coordinatorfname = $myrow3["fname"];
$coordinatorlname = $myrow3["lname"];
echo "
";
}
include("mfooter.inc");
?>