db_process_query("select",$sbsTbl,"*", "none","anbEmail = '$anbEmail' and sbsMailList = '$sbsMailList'","none");
$sRsltSet_sbs = $db_CMS->dbRsltSet;
if ($db_CMS->dbNumRow > 0) {
// user's email address already exists in the database..
return 1;
}
else {
// let's do an insert into the database..
$db_CMS->db_process_query("insert", $sbsTbl, "anbEmail, sbsMailList", "'$anbEmail','$sbsMailList'","none","none");
return 0;
}
}
function subscribe2Daemon($anbEmail) {
$line1 = "approve bruessel subscribe umc2k ".$anbEmail;
$doneFlag = mail("majordomo@auckland.ac.nz", "", $line1);
}
function verifyRegInput($vars_array, &$errMsg) {
// we go through all the form elements and verify whether the input is valid....
$errFlag = 0;
while (list($key, $value) = each($vars_array)) {
switch ($key) {
case "anbTitle" :
if (($value == null) || ($value == "")) {
$errMsg = $errMsg."Please choose a Title - note that fields with an asterik mark are mandatory.
";
$errFlag = 1;
}
break;
case "anbFName" :
if (($value == null) || ($value == "")) {
$errMsg = $errMsg."Please enter a First Name - note that fields with an asterik mark are mandatory.
";
$errFlag = 1;
}
break;
case "anbLName" :
if (($value == null) || ($value == "")) {
$errMsg = $errMsg."Please enter a Last Name - note that fields with an asterik mark are mandatory.
";
$errFlag = 1;
}
break;
case "anbAddr" :
if (($value == null) || ($value == "")) {
$errMsg = $errMsg."Please enter the address - note that fields with an asterik mark are mandatory.
";
$errFlag = 1;
}
break;
case "anbCntry" :
if (($value == null) || ($value == "")) {
$errMsg = $errMsg."Please choose a Country - note that fields with an asterik mark are mandatory.
";
$errFlag = 1;
}
break;
case "anbEmail" :
if (($value == null) || ($value == "")) {
$errMsg = $errMsg."Please enter a valid email address - note that fields with an asterik mark are mandatory.
";
$errFlag = 1;
}
break;
case "anbPhone" :
if (($value == null) || ($value == "")) {
$errMsg = $errMsg."Please enter a phone number - note that fields with an asterik mark are mandatory.
";
$errFlag = 1;
}
break;
case "rgsTgName" :
if (($value == null) || ($value == "")) {
$errMsg = $errMsg."Please enter a name for your tag - note that fields with an asterik mark are mandatory.
";
$errFlag = 1;
}
break;
case "rgsTgAddr" :
if (($value == null) || ($value == "")) {
$errMsg = $errMsg."Please enter a address for your tag - note that fields with an asterik mark are mandatory.
";
$errFlag = 1;
}
break;
case "ctgID" :
if (($value == null) || ($value == "")) {
$errMsg = $errMsg."Please choose a registration category - note that fields with an asterik mark are mandatory.
";
$errFlag = 1;
}
break;
case "pymMethod" :
if (($value == null) || ($value == "")) {
$errMsg = $errMsg."Please choose a method of payment - note that fields with an asterik mark are mandatory.
";
$errFlag = 1;
}
else {
$paymentMethod = $value;
}
break;
case "crdType" :
if ($paymentMethod == "crd") {
if (($value == null) || ($value == "")) {
$errMsg = $errMsg."You have selected credit card as mode of payment - please choose a valid card type.
";
$errFlag = 1;
}
}
break;
case "crdName" :
if ($paymentMethod == "crd") {
if (($value == null) || ($value == "")) {
$errMsg = $errMsg."You have selected credit card as mode of payment - please choose name of the card holder.
";
$errFlag = 1;
}
}
break;
case "crdNumber" :
if ($paymentMethod == "crd") {
if (($value == null) || ($value == "")) {
$errMsg = $errMsg."You have selected credit card as mode of payment - please enter the card number.
";
$errFlag = 1;
}
}
break;
case "crdDate" :
if ($paymentMethod == "crd") {
if (($value == null) || ($value == "")) {
$errMsg = $errMsg."You have selected credit card as mode of payment - please enter the expiry date of the card.
";
$errFlag = 1;
}
}
break;
}
}
return $errFlag;
}
function storeAnbInDb($vars_array) {
global $db_CMS, $anbTbl;
// assign values to the variables...
while (list($key, $value) = each($vars_array)) {
rmvQuotes($value);
${$key} = $value;
}
// create the query to store the information..
$fldName = "anbTitle, anbFName, anbLName, anbAddr, anbPCode, anbCntry, anbEmail, anbPhone, anbFax, anbSEmail";
$fldValue = "'$anbTitle', '$anbFName', '$anbLName', '$anbAddr', '$anbPCode', '$anbCntry', '$anbEmail', '$anbPhone', '$anbFax', '$anbSEmail'";
$db_CMS->db_process_query("insert",$anbTbl,$fldName,$fldValue,"none","none");
return $db_CMS->dbNewID;
}
function storePymInDb($vars_array) {
global $pymTbl, $db_CMS, $keyCode;
// assign values to the variables...
while (list($key, $value) = each($vars_array)) {
rmvQuotes($value);
${$key} = $value;
}
// create the query to store the information..
$fldName = "pymMethod, pymCardType, pymCardHolderName, pymCardNumber, pymCardExpiryDate, pymNote, pymStatus";
$fldValue = "'$pymMethod', '$pymCardType', '$pymCardHolderName', '$pymCardNumber', '$pymCardExpiryDate', '$pymNote', 'unpaid'";
$db_CMS->db_process_query("insert",$pymTbl,$fldName,$fldValue,"none","none");
return $db_CMS->dbNewID;
}
function createRegRecInDb($anbID, $pymID, $vars_array) {
global $rgsTbl, $db_CMS;
// assign values to the variables...
while (list($key, $value) = each($vars_array)) {
rmvQuotes($value);
${$key} = $value;
}
$rgsRegisterDate = gmdate ("Y-m-d h:i:s", time());
// create the query to store the information..
$fldName = "rgsTagName, rgsTagAddress, rgsNote, cnfID, ctgID, anbID, pymID, rgsStatus, rgsRegisterDate";
$fldValue = "'$rgsTagName', '$rgsTagAddress', '$rgsNote', '$cnfID', '$ctgID', '$anbID', '$pymID', 'requested', '$rgsRegisterDate'";
$db_CMS->db_process_query("insert",$rgsTbl,$fldName,$fldValue,"none","none");
return $db_CMS->dbNewID;
}
function storeMscInDb($rgsID, $vars_array) {
global $mscTbl, $db_CMS;
// assign values to the variables...
while (list($key, $value) = each($vars_array)) {
rmvQuotes($value);
${$key} = $value;
}
// create the query to store the information..
$fldName = "rgsID, mscName, mscDescription";
$fldValue = "'$rgsID', 'Reception Attendance', '$reception'";
$db_CMS->db_process_query("insert",$mscTbl,$fldName,$fldValue,"none","none");
// create the query to store the information..
$fldName = "rgsID, mscName, mscDescription";
$fldValue = "'$rgsID', 'Dinner request', '$dinner'";
$db_CMS->db_process_query("insert",$mscTbl,$fldName,$fldValue,"none","none");
}
function createAthRecInDb(&$athUserName, &$athPassword, $rgsID, $anbID, $vars_array) { // create the user name and password...
global $anbTbl, $idnTbl, $athTbl, $db_CMS; // global variables....
$anbFName = $vars_array['anbFName']; // mapped from the HTTP_POST_VARS..
$anbLName = $vars_array['anbLName'];
//parse the firstname to pickup the first character...
$matchExp = preg_match("/[A-Za-z]/",$anbFName, $result);
if ($matchExp) {
$vlFName = $result[0];
}
//parse the lastname to pickup up 3 characters at the max or 1 char at the least........
$matchExp = preg_match("/[A-Za-z]{1,3}/", $anbLName, $result);
if ($matchExp) {
$vlLName = $result[0];
}
//Form the ident initial..
$idnID = strtolower($vlFName.$vlLName);
// now let's query the identity table to find such a match if any..
$db_CMS->db_process_query("select",$idnTbl,"*","none","idnID = '$idnID'","none");
$sRsltSet_idn = $db_CMS->dbRsltSet;
if ($db_CMS->dbNumRow > 0) { // found such ident Initial..
$sCurRow_idn = $db_CMS->db_fetch_array($sRsltSet_idn);
$idnCount = $sCurRow_idn['idnCount'];
$idnCount += 1;
//now update the table..
$db_CMS->db_process_query("update",$idnTbl,"idnCount = $idnCount","none","idnID = '$idnID'","none");
}
else { //create the ident initial since it's not present in the database..
$db_CMS->db_process_query("insert",$idnTbl,"idnID, idnCount","'$idnID',100","none","none");
$idnCount = 100;
}
srand(date("s"));
$charSet = "2ab3cd4ef5gh6ij7kl8mn9pq2rs3tu5vw6xy7z";
//now let's assign a random password..
$athPassword = ""; //Initialize this variable...
while (strlen($athPassword) < 8) {
$athPassword .= substr($charSet,(rand()%(strlen($charSet))),1);
}
$athUserName = "";
$athUserName = $idnID.$idnCount;
// now create the link in the login privilege table..
$db_CMS->db_process_query("insert",$athTbl,"athUserName, athPassword, rgsID","'$athUserName','$athPassword', '$rgsID'","none","none");
// update the anybody table with the athUserName..
$db_CMS->db_process_query("update", $anbTbl, "athUsername = '$athUserName'","none","anbID = '$anbID'","none");
}
function storeOdlInDb($rgsID, $vars_array) {
global $odlTbl, $ctgTbl, $actTbl, $acdTbl, $db_CMS;
// assign values to the variables...
while (list($key, $value) = each($vars_array)) {
rmvQuotes($value);
${$key} = $value;
}
// let's find out the cost of the registration...
$db_CMS->db_process_query("select", $ctgTbl, "*", "none", "ctgID = '$ctgID'", "none");
$sRsltSet_ctg = $db_CMS->dbRsltSet;
if ($db_CMS->dbNumRow > 0) {
$sCurRow_ctg = $db_CMS->db_fetch_array($sRsltSet_ctg);
$ctgCost = $sCurRow_ctg["ctgCost"];
$ctgName = $sCurRow_ctg["ctgName"];
$ctgDescription = $sCurRow_ctg["ctgDescription"];
// insert the registration order line first..
$db_CMS->db_process_query("insert", $odlTbl, "odlName, odlDescription, odlPrice, odlStartDate, odlEndDate, rgsID","'$ctgName','$ctgDescription','$ctgCost','2000-12-13','2000-12-16','$rgsID'","none","none");
}
// next lets find out the cost of the extra proceedings..
if ($xtraProceedingNumber > 0) {
$db_CMS->db_process_query("select",$actTbl, "*", "none", "actName = 'xtraProceedingNumber'","none");
$sRsltSet_act = $db_CMS->dbRsltSet;
if ($db_CMS->dbNumRow > 0) {
$sCurRow_act = $db_CMS->db_fetch_array($sRsltSet_act);
$actID = $sCurRow_act["actID"];
$actName = $sCurRow_act["actName"];
$db_CMS->db_process_query("select",$acdTbl, "*", "none", "actID = '$actID'", "none");
$sRsltSet_acd= $db_CMS->dbRsltSet;
$sCurRow_acd = $db_CMS->db_fetch_array($sRsltSet_acd);
$acdDescription = $sCurRow_acd["acdDescription"];
$acdCost = $sCurRow_acd["acdCost"];
$totalCost = $acdCost * $xtraProceedingNumber;
// insert the extra proceedings order line now..
$db_CMS->db_process_query("insert", $odlTbl, "odlName, odlDescription, odlPrice, odlOrderedAmount, odlStartDate, odlEndDate, rgsID","'$actName','$acdDescription','$totalCost','$xtraProceedingNumber','2000-12-13','2000-12-16','$rgsID'","none","none");
}
}
// next lets find out the cost of the extra dinner tickets....
if ($xtraDinnerTicket > 0) {
$db_CMS->db_process_query("select",$actTbl, "*", "none", "actName = 'xtraDinnerTicket'","none");
$sRsltSet_act = $db_CMS->dbRsltSet;
if ($db_CMS->dbNumRow > 0) {
$sCurRow_act = $db_CMS->db_fetch_array($sRsltSet_act);
$actID = $sCurRow_act["actID"];
$actName = $sCurRow_act["actName"];
$db_CMS->db_process_query("select",$acdTbl, "*", "none", "actID = '$actID'", "none");
$sRsltSet_acd= $db_CMS->dbRsltSet;
$sCurRow_acd = $db_CMS->db_fetch_array($sRsltSet_acd);
$acdDescription = $sCurRow_acd["acdDescription"];
$acdCost = $sCurRow_acd["acdCost"];
$totalCost = $acdCost * $xtraDinnerTicket;
// insert the extra proceedings order line now..
$db_CMS->db_process_query("insert", $odlTbl, "odlName, odlDescription, odlPrice, odlOrderedAmount, odlStartDate, odlEndDate, rgsID","'$actName','$acdDescription','$totalCost','$xtraDinnerTicket','2000-12-15','2000-12-15','$rgsID'","none","none");
}
}
}
function emailLogDet($athUserName, $athPassword, $vars_array) { //call the mail user function..to mail information...
global $anbTbl, $db_CMS; // global variables...
$fromEmailAddress = "umc2kadmin@cs.auckland.ac.nz";
$replyEmailAddress = "umc2kadmin@cs.auckland.ac.nz";
$anbEmail = $vars_array["anbEmail"];
$msgStr = "Dear ".$vars_array["anbTitle"]." ".$vars_array["anbFName"]." ".$vars_array["anbLName"]."\n\n";
$msgStr = $msgStr."Thank you for registering for the UMC2K conference. Your registration \n";
$msgStr = $msgStr."details will be processed shortly. On acceptance of your registration you \n";
$msgStr = $msgStr."will receive an additional email confirmation. You have also been \n";
$msgStr = $msgStr."issued the following username & password which will allow you to modify your personal\n";
$msgStr = $msgStr."information.\n\n";
$msgStr = $msgStr." Username: ".$athUserName."\n";
$msgStr = $msgStr." Password: ".$athPassword."\n\n";
$msgStr = $msgStr."To log in, click on the \"Login\" menu item under the conference web page: \n\n";
$msgStr = $msgStr." http://www.cs.auckland.ac.nz/CDMTCS/umc2k \n\n";
$msgStr = $msgStr."For any queries please feel free to contact either of the following people \n\n";
$msgStr = $msgStr."Penny Barry - Financial Administrator \n";
$msgStr = $msgStr."Cris Calude - Conference Co-Chair \n";
$msgStr = $msgStr."Michael Dinneen - Conference Secretary \n";
$msgStr = $msgStr."Ulrich Guenther - Registration Administrator \n";
$msgStr = $msgStr."Anne De Nayer-Westcott - Brussels' Information \n\n";
$msgStr = $msgStr."Best regards,\n\n";
$msgStr = $msgStr."Sudhir Reddy - UMC2K Web Pages \n";
mail($anbEmail, "UMC2K-2000", $msgStr,"From: ".$fromEmailAddress."\nReply-To: ".$replyEmailAddress."\nX-Mailer: PHP/".phpversion());
// mail webmaster...
$ccEmail = "umc2kadmin@cs.auckland.ac.nz";
$msgStr = "Notification : The following participant has registered at the site. \n";
$msgStr = $msgStr.$vars_array["anbTitle"]." ".$vars_array["anbFName"]." ".$vars_array["anbLName"]."\n";
$msgStr = $msgStr."This message is an automatic reply from the UMC2K CONFERENCE MANAGEMENT SYSTEM.\n";
mail($ccEmail, "UMC2K - 2000 - Notification", $msgStr,"From: ".$fromEmailAddress."\nReply-To: ".$replyEmailAddress."\nX-Mailer: PHP/".phpversion());
}
?>