0) { // assign values to the variables... while (list($key, $value) = each($vars_array)) { rmvQuotes($value); ${$key} = $value; } } // do a search to see if this email address already exits.. $db_CMS->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) { $fromEmailAddress = "sudhir@cs.auckland.ac.nz"; $replyEmailAddress = "sudhir@cs.auckland.ac.nz"; $line = "approve robvis01.admin subscribe robvis01 ".$anbEmail; mail("majordomo@tui.tcs.auckland.ac.nz", "", $line,"From: ".$fromEmailAddress."\nReply-To: ".$replyEmailAddress."\nX-Mailer: PHP/".phpversion()); } function storeAnbInDb() { global $db_CMS, $anbTbl, $vars_array; reset($vars_array); if (sizeof($vars_array) > 0) { // 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, anbAddress, anbPCode, anbCountry, anbEmail, anbSEmail"; $fldValue = "'$anbTitle', '$anbFName', '$anbLName', '$anbAddress', '$anbPCode', '$anbCountry', '$anbEmail', '$anbSEmail'"; $db_CMS->db_process_query("insert",$anbTbl,$fldName,$fldValue,"none","none"); return $db_CMS->dbNewID; } function storePymInDb() { global $pymTbl, $db_CMS, $keyCode, $vars_array; reset($vars_array); if (sizeof($vars_array) > 0) { // 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, pymParticipantNote, pymStatus"; $fldValue = "'$pymMethod', '$pymCardType', '$pymCardHolderName', '$pymCardNumber', '$pymCardExpiryDate', '$pymParticipantNote', 'unpaid'"; $db_CMS->db_process_query("insert",$pymTbl,$fldName,$fldValue,"none","none"); return $db_CMS->dbNewID; } function createRegRecInDb($athUserName, $pymID) { global $rgsTbl, $cnfTbl, $db_CMS, $vars_array; reset($vars_array); if (sizeof($vars_array) > 0) { // assign values to the variables... while (list($key, $value) = each($vars_array)) { rmvQuotes($value); ${$key} = $value; } } $rgsRegistrationDate = gmdate ("Y-m-d h:i:s", time()); // represent some the short forms in understandable format... switch ($rgsCategory) { case "robvis01Full" : $rgsCategory = "Full"; break; case "robvis01Stdn" : $rgsCategory = "Stdn"; break; } // Find the conference ID matching the given conference name.. $db_CMS->db_process_query("select",$cnfTbl,"*","none","cnfName = '$cnfName'","none"); $sRsltSet_cnf = $db_CMS->dbRsltSet; $sCurRow_cnf = $db_CMS->db_fetch_array($sRsltSet_cnf); $cnfID = $sCurRow_cnf["cnfID"]; // create the query to store the information.. $fldName = "rgsParticipantNote, cnfID, athUserName, pymID, rgsStatus, rgsCategory, rgsRegistrationDate"; $fldValue = "'$rgsParticipantNote', '$cnfID', '$athUserName', '$pymID', 'requested','$rgsCategory','$rgsRegistrationDate'"; $db_CMS->db_process_query("insert",$rgsTbl,$fldName,$fldValue,"none","none"); return $db_CMS->dbNewID; } function storeMscInDb($rgsID) { global $mscTbl, $db_CMS, $vars_array; reset($vars_array); if (sizeof($vars_array) > 0) { // 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', 'Monday plan', '$mondayPlan'"; $db_CMS->db_process_query("insert",$mscTbl,$fldName,$fldValue,"none","none"); } function createAthRecInDb(&$athUserName, &$athPassword, $anbID) { // create the user name and password... global $anbTbl, $idnTbl, $athTbl, $db_CMS, $vars_array; // global variables.... reset($vars_array); if (sizeof($vars_array) > 0) { // assign values to the variables... while (list($key, $value) = each($vars_array)) { rmvQuotes($value); ${$key} = $value; } } //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","'$athUserName','$athPassword'","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) { global $odlTbl, $actTbl, $acdTbl, $db_CMS, $vars_array; global $totalPrice; $totalPrice = 0.00; reset($vars_array); if (sizeof($vars_array) > 0) { // 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", $actTbl, "*", "none", "actName = '$rgsCategory'", "none"); $sRsltSet_act = $db_CMS->dbRsltSet; if ($db_CMS->dbNumRow > 0) { $sCurRow_act = $db_CMS->db_fetch_array($sRsltSet_act); $actID = $sCurRow_act["actID"]; $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); $acdPrice = $sCurRow_acd["acdPrice"]; $acdName = $sCurRow_acd["acdName"]; $acdDescription = $sCurRow_acd["acdDescription"]; $totalPrice += $acdPrice; // insert the registration category order line first.. $db_CMS->db_process_query("insert", $odlTbl, "odlName, odlDescription, odlPrice, odlStartDate, odlEndDate, rgsID, odlOrderedAmount","'$acdName','$acdDescription','$acdPrice','2000-12-13','2000-12-16','$rgsID',1","none","none"); } // now the information about miscellaneous stuff....... // first the pre-conference activity.. if ($preConfAct == "yes") { $db_CMS->db_process_query("select", $actTbl, "*", "none", "actName = 'preConfAct'", "none"); $sRsltSet_act = $db_CMS->dbRsltSet; if ($db_CMS->dbNumRow > 0) { $sCurRow_act = $db_CMS->db_fetch_array($sRsltSet_act); $actID = $sCurRow_act["actID"]; $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); $acdPrice = $sCurRow_acd["acdPrice"]; $acdName = $sCurRow_acd["acdName"]; $acdDescription = $sCurRow_acd["acdDescription"]; $totalPrice += $acdPrice; // insert the pre-conference activity cost order line first.. $db_CMS->db_process_query("insert", $odlTbl, "odlName, odlDescription, odlPrice, odlStartDate, odlEndDate, rgsID, odlOrderedAmount","'$acdName','$acdDescription','$acdPrice','2000-12-13','2000-12-16','$rgsID',1","none","none"); } } // now the extra tickets if ($xtraTicket > 0) { $db_CMS->db_process_query("select", $actTbl, "*", "none", "actName = 'xtraTicket'", "none"); $sRsltSet_act = $db_CMS->dbRsltSet; if ($db_CMS->dbNumRow > 0) { $sCurRow_act = $db_CMS->db_fetch_array($sRsltSet_act); $actID = $sCurRow_act["actID"]; $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); $acdPrice = $sCurRow_acd["acdPrice"]; $acdName = $sCurRow_acd["acdName"]; $acdDescription = $sCurRow_acd["acdDescription"]; $totalPrice += $acdPrice * $xtraTicket; // insert the number of xtra tickets cost order line first.. $db_CMS->db_process_query("insert", $odlTbl, "odlName, odlDescription, odlPrice, odlStartDate, odlEndDate, rgsID, odlOrderedAmount","'$acdName','$acdDescription','$acdPrice','2000-12-13','2000-12-16','$rgsID','$xtraTicket'","none","none"); } } } function emailLoginDetails($athUserName, $athPassword) { //call the mail user function..to mail information... global $anbTbl, $db_CMS, $vars_array; // global variables... global $totalPrice; $fromEmailAddress = "sudhir@cs.auckland.ac.nz"; $replyEmailAddress = "sudhir@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 ROBVIS01 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/CITR/robvis01 \n\n"; $msgStr = $msgStr."For any queries please feel free to contact either of the following people \n\n"; $msgStr = $msgStr."Reinhard Klette - Conference Chair - \n"; $msgStr = $msgStr."Cecilia Lourdes - Conference Administrator - \n"; $msgStr = $msgStr."Sharon Walker - Financial Administrator - \n"; $msgStr = $msgStr."Best regards,\n\n"; $msgStr = $msgStr."Sudhir Reddy - ROBVIS01 Web Pages \n"; mail($anbEmail, "ROBVIS01 - 2001", $msgStr,"From: ".$fromEmailAddress."\nReply-To: ".$replyEmailAddress."\nX-Mailer: PHP/".phpversion()); // mail reinhard klette & webmaster... $ccEmail = "r.klette@auckland.ac.nz,sudhir@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 ROBOT VISION CONFERENCE MANAGEMENT SYSTEM.\n"; mail($ccEmail, "ROBVIS01 - 2001 - Notification", $msgStr,"From: ".$fromEmailAddress."\nReply-To: ".$replyEmailAddress."\nX-Mailer: PHP/".phpversion()); } ?>