![]() |
![]() |
||||||
|
|||||||
| Tags: form, insert, instead, link, record |
![]() |
|
|||
|
I've not had any luck setting the "select transaction starter event" First check variable. to a field ID.
My update form is populated by a record set which walks the database resets a field and sends an email which is customized by the recordset. The update form works great but I can't get it to submit onload. I'm missing some piece to the puzzle.. nick here is the page: <?php require_once('Connections/conn_catboats.php'); ?> <?php // Load the common classes require_once('includes/common/KT_common.php'); // Load the tNG classes require_once('includes/tng/tNG.inc.php'); // Make a transaction dispatcher instance $tNGs = new tNG_dispatcher(""); // Make unified connection variable $conn_conn_catboats = new KT_connection($conn_catboats, $database_conn_catboats); // Start trigger $formValidation = new tNG_FormValidation(); $formValidation->addField("EMail", true, "text", "email", "", "", ""); $tNGs->prepareValidation($formValidation); // End trigger //start Trigger_SendEmail trigger //remove this line if you want to edit the code by hand function Trigger_SendEmail(&$tNG) { $emailObj = new tNG_Email($tNG); $emailObj->setFrom("Catboats@Whispercom.com"); $emailObj->setTo("{rsLive.EMail}"); $emailObj->setCC(""); $emailObj->setBCC(""); $emailObj->setSubject("Catboats Web Site - {LNAME}"); //WriteContent method $emailObj->setContent("Dear {rsLive.FN_MI} {rsLive.LNAME}, After a year of study, development and testing, we are (finally) nearing the dawn of the new CBA web site. We are pleased to announce that the new web site will go live within the next week. It presents a slick new portal to the world of catboating. We have attempted to bring over all that the old site contained, adding new features, while fixing that which was broken. The old web site will live on for a short period of time, but will soon go off the air. Please be patient - the volunteers who have been hard at work are just that - volunteers. We would appreciate any and all feedback (the good, the bad, the ugly, the wish list) and we will attempt to fix the non-operational items as well as extend the capabilities of the site in the coming months and years. Some of the new features of the site will be accessible to members only, requiring a username and password. These items are listed below and will be usable from day one. We have provided this mass emailing to those members who have shared their email addresses with us. To use the new discussion board and Cats For Sale sections of the web site you will need to click the LOGIN link, on the left-hand menu and login as a member, most likely you are in the Cat Boat Association database in which case you shouldn't register as a new member. Instead login using the \"Username and Password\" provided below. After you login you will see another item added to the menu on the left titled \"MEMBERS ONLY\"! Click it and view a page where you can search for members, update your personal information and most importantly change your username and password to something more convenient. The username must be unique, like your email address. Your temporary username and password are: Username: {rsLive.username_usr} Password: {rsLive.password_usr} Catboats.org <\http://69.6.215.191/\> Don't hesitate to call if you have difficulty, 360-271-8659 or email me at Catboats@whispercom.com <\mailto:Catboats@whispercom.com\> (be sure and put the word \"Catboats\" as the first word on the subject line! Thanks for your patience while we get the new site working smoothly, Happy Sailing, Tim Lund, CBA Nick Jewett,Whispercom.com"); $emailObj->setEncoding("ISO-8859-1"); $emailObj->setFormat("HTML/Text"); $emailObj->setImportance("Normal"); return $emailObj->Execute(); } //end Trigger_SendEmail trigger if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } mysql_select_db($database_conn_catboats, $conn_catboats); $query_rsLive = "SELECT CBA_ID, username_usr, password_usr, LNAME, FN_MI, EMail, sent_live FROM CBA WHERE EMail LIKE '%@%' AND FN_MI='nick' AND sent_live=1 ORDER BY CBA_ID"; $rsLive = mysql_query($query_rsLive, $conn_catboats) or die(mysql_error()); $row_rsLive = mysql_fetch_assoc($rsLive); $totalRows_rsLive = mysql_num_rows($rsLive); // Make an update transaction instance $upd_CBA = new tNG_update($conn_conn_catboats); $tNGs->addTransaction($upd_CBA); // Register triggers $upd_CBA->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "EMail"); $upd_CBA->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation); $upd_CBA->registerTrigger("AFTER", "Trigger_SendEmail", 98); $upd_CBA->registerTrigger("END", "Trigger_Default_Redirect", 99, "live100.php"); // Add columns $upd_CBA->setTable("CBA"); $upd_CBA->addColumn("sent_live", "NUMERIC_TYPE", "POST", "sent_live"); $upd_CBA->addColumn("CBA_ID", "NUMERIC_TYPE", "CURRVAL", "CBA_ID"); $upd_CBA->addColumn("LNAME", "STRING_TYPE", "POST", "LNAME"); $upd_CBA->addColumn("FN_MI", "STRING_TYPE", "POST", "FN_MI"); $upd_CBA->addColumn("EMail", "STRING_TYPE", "POST", "EMail"); $upd_CBA->setPrimaryKey("CBA_ID", "NUMERIC_TYPE", "POST", "CBA_ID"); // Execute all the registered transactions $tNGs->executeTransactions(); // Get the transaction recordset $rsCBA = $tNGs->getRecordset("CBA"); $row_rsCBA = mysql_fetch_assoc($rsCBA); $totalRows_rsCBA = mysql_num_rows($rsCBA); ?> <?php echo $tNGs->getErrorMsg(); ?> <?php echo $row_rsLive['CBA_ID']; ?> Catboats.org <http://69.6.215.191/> <?php echo KT_escapeAttribute(KT_getFullUri()); ?>"> Sent_live: <?php echo $tNGs->displayFieldHint("sent_live");?> <?php echo $tNGs->displayFieldError("CBA", "sent_live"); ?> CBA_ID: <?php echo KT_escapeAttribute($row_rsLive['CBA_ID']); ?>" size="32" /> |
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise