<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<body bgColor='#FFFFCC'>
<?
//$bbb = 5;
echo "haha = $haha <br>";
echo "bbb = $bbb <br>";
$msgs=$t0."#".$t1."#".$t1x."#".$t2."#".$t3."#".$t4."#".$t5."#".$t6;
echo "$msgs<br>";
switch($HTTP_POST["haha"])
{
case 0:
echo "
<b><BR><center>Please enter all information before downloading</center></b>
<hr>
<FORM action='regis.php?haha=1&bbb=2' method=post>
<INPUT TYPE=hidden name=haha value=1>
<font face='MS Sans Serif'>
<table>
<tr><td><font >First Name </font></td><td> <input type='text' size=40v name='t0' value='$t0'> (English) </td></tr>
<tr><td><font >Lastname </font></td><td> <input type='text' name='t1' ></td></tr>
<tr><td><font>Organization</font></td><td> <input type='text' size=60 name='t1x' ></td></tr>
<tr><td><font >Position </font></td><td><input type='text' name='t2' size=40 value='$t2'> </td></tr>
<tr><td>Address </td><td><input type='text' name='t3' size=70 value='$t3'></td></tr>
<tr><td>Telephone Number</td><td><input type='text' name='t4' size=40 value='$t4'></td></tr>
<tr><td><font >Email Address </font></td><td><input type='text' size=40 name='t5' value='$t5'> </td></tr>
<tr><td>Recommendations</td><td><input type='text' name='t6' size=60 value='$t6'> (Optional)</td></tr>
</table><br>";
echo "
<hr>Thank you very much for giving us your information
<br><b>Click sumit button below to start downloading</b>
<br><br><input type='submit' value=' Submit '> </form>";
break;
case 1:
if ($t0=='') { echo " Please enter your firstname <br>"; $haha=0; }
if ($t1=='') { echo " Please enter your lastname <br>"; $haha=0;}
if ($t1x=='') { echo " Please enter your organization <br>"; $haha=0;}
if ($t2=='') { echo " Please enter your position <br>"; $haha=0;}
if ($t3=='') { echo " Please enter your working address<BR>";$haha=0; }
if ($t5=='') { echo " Please enter your telephone number<br>"; $haha=0;}
if ($t5=='') { echo " Please enter your email address <br>";$haha=0; }
if ($haha==0)
{ include("regis.php"); }
else
{
$t8=date('d-m-Y, H:i '); $t7='normal';
$msg=$t0."#".$t1."#".$t1x."#".$t2."#".$t3."#".$t4."#".$t5."#".$t6;
$msg=$msg."#".$t7."#".$t8;
$nl=chr(13).chr(10);
$msg = ereg_replace($nl, "<BR>", $msg);
$msg=$msg.chr(10);
$fcoun="data/registrants.dat";
$fp=fopen($fcoun,"a");
fwrite($fp,$msg);
fclose($fp);
$usr=$t0;
$f1= ord(substr($usr,0,1));
$f2 = ord(substr($usr,strlen($usr)-1,1));
$f3 = $f1*$f2;
$passt= $f3 + $f1 + ($f2 * $f2) + ($f3 * 1234);
//$sender="ergonomics@siit.tu.ac.th";
//$reciever=$t5;
//$msg=" For installing Noise Manager Version 1, your username is $t0 and your password is $passt";
// include("zendmail.php");
//mail($sender, $reciever, $subject, $msg);
$to = $t5;
$subject="Noise Manager Installation";
$body = " For installing Noise Manager Version 1, \n\n your username is $t0 and your password is $passt \n\n If you have any question, please reply us. Thank you.";
$headers = "From: ergonomics@siit.tu.ac.th\r\n"."X-Mailer: php";
echo " Thank you very much for giving us your information<br><BR>";
// For installation, your username is <B>$t0</B> and your password is
// <FONT COLOR=red><B>$passt</B></FONT>. <BR>";
if (mail($to, $subject, $body, $headers))
{
echo("<p> The username and password are already sent to <B>$t5</B>. You need them for installing Noise Manager </p>");
}
else
{
echo("<p>The username and password CANNOT be sent to <B>$t5</B></p>");
}
echo " Please click <A HREF='nm1.exe'>here ( nm1.exe approx. 1MB) </A> to start downloading Noise Manager for Microsoft Excel 97/2000 .";
// echo " <BR>Noise Manager for Excel 97 will be available soon.";
}
break;
}
?>
</body></html>