0) { reset($vars_array); // assign values to the variables... while (list($key, $value) = each($vars_array)) { ${$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) { global $mailinglistManagerEmailAddress, $mailingListListName, $mailingListPassword; global $mailingListAddress; $fromEmailAddress = $mailinglistManagerEmailAddress; $replyEmailAddress = $mailinglistManagerEmailAddress; $line = "approve ".$mailingListPassword." subscribe ".$mailingListListName." ".$anbEmail; mail($mailingListAddress, " ", $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)) { ${$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)) { ${$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"); if ($pymMethod == "other") { emailApprovalRequest(); } 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)) { ${$key} = $value; } } $rgsRegistrationDate = gmdate ("Y-m-d h:i:s", time()); // represent some the short forms in understandable format... switch ($rgsCategory) { case "DMTCS01Full" : $rgsCategory = "Full"; break; case "DMTCS01Stdn" : $rgsCategory = "Stdn"; break; } if ($rgsTagName == "") { $rgsTagName = $anbFName . $anbLName; } if ($rgsTagAddress == "") { $rgsTagAddress = $anbCountry; } // 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, rgsTagName, rgsTagAddress"; $fldValue = "'$rgsParticipantNote', '$cnfID', '$athUserName', '$pymID', 'requested','$rgsCategory','$rgsRegistrationDate', '$rgsTagName', '$rgsTagAddress'"; $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)) { ${$key} = $value; } } // create the query to store the information.. (don't have any misc items for DMTCS01) // $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)) { ${$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, athLevel, firstName, surName","'$athUserName','$athPassword','participant','$anbFName','$anbLName'","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)) { ${$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"); } } // second the post-conference tutorial.. if ($pstConfTut == "yes") { $db_CMS->db_process_query("select", $actTbl, "*", "none", "actName = 'pstConfTut'", "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 emailApprovalRequest() { global $vars_array, $regApprovalAddress, $fromEmailAddress, $replyEmailAddress; $anbEmail = $vars_array["anbEmail"]; $anbTitle = $vars_array["anbTitle"]; $anbFName = $vars_array["anbFName"]; $anbLName = $vars_array["anbLName"]; $pymParticipantNote = $vars_array["pymParticipantNote"]; $rgsParticipantNote = $vars_array["rgsParticipantNote"]; $msgStr = $anbTitle." ".$anbFName." ".$anbLName." has requested \n"; $msgStr = $msgStr."registration and wishes to pay by other means than credit card.\n\n"; $msgStr = $msgStr."The e-mail address of ".$anbFName." ".$anbLName." is:\n\n"; $msgStr = $msgStr." ".$anbEmail."\n\n"; $msgStr = $msgStr."Please contact ".$anbFName." ".$anbLName." to sort out the details.\n\n"; $msgStr = $msgStr."The participant made the following remarks regarding payment:\n\n"; $msgStr = $msgStr.$pymParticipantNote."\n\nand the following general remarks:\n\n"; $msgStr = $msgStr.$rgsParticipantNote."\n\nThis e-mail was sent automatically by the DMTCS'01 Conference Management System\n"; mail($regApprovalAddress, "DMTCS01 - Request for Approval ".$anbTitle." ".$anbFName." ".$anbLName, $msgStr,"From: ".$fromEmailAddress."\nReply-To: ".$replyEmailAddress."\nX-Mailer: PHP/".phpversion()); } function emailLoginDetails($athUserName, $athPassword) { //call the mail user function..to mail information... global $anbTbl, $db_CMS, $vars_array; // global variables... global $totalPrice, $fromEmailAddress, $replyEmailAddress; $anbEmail = $vars_array["anbEmail"]; $msgStr = "Dear ".$vars_array["anbTitle"]." ".$vars_array["anbFName"]." ".$vars_array["anbLName"]."\n\n"; $msgStr = $msgStr."Thank you for registering for DMTCS'01 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/conferences/dmtcs01/ \n\n"; $msgStr = $msgStr."For any queries please feel free to contact either of the following people \n\n"; $msgStr = $msgStr."Ulrich Guenther - Registration coordinator - \n\n"; $msgStr = $msgStr."Raluca Vernic - Local coordinator and contact for visa letters - \n\n"; $msgStr = $msgStr."Cris Calude - Conference Chair - \n\n"; $msgStr = $msgStr."Best regards,\n\n"; $msgStr = $msgStr."Ulrich Guenther - DMTCS'01 Web Pages \n"; mail($anbEmail, "DMTCS01", $msgStr,"From: ".$fromEmailAddress."\nReply-To: ".$replyEmailAddress."\nX-Mailer: PHP/".phpversion()); // mail webmaster... $ccEmail = "ulrich@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 \nDMTCS01 CORMORANT CONFERENCE MANAGEMENT SYSTEM.\n"; mail($ccEmail, "DMTCS01 - Notification", $msgStr,"From: ".$fromEmailAddress."\nReply-To: ".$replyEmailAddress."\nX-Mailer: PHP/".phpversion()); } ?>