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_rsApadanadb = new KT_connection($rsApadanadb, $database_rsApadanadb); // Start trigger $formValidation = new tNG_FormValidation(); $formValidation->addField("Name", true, "text", "", "", "", ""); $formValidation->addField("vorname", true, "text", "", "", "", ""); $formValidation->addField("telefon", true, "text", "", "", "", ""); $formValidation->addField("email", true, "text", "email", "", "", ""); $formValidation->addField("Nachischte", true, "text", "", "", "", ""); $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("{email}"); $emailObj->setTo("info@apadana.de"); $emailObj->setCC(""); $emailObj->setBCC("{email}"); $emailObj->setSubject("[site] APADANA : Kontact"); //WriteContent method $emailObj->setContent("Kontakt Info:\n\nName: {Name}\nVorname: {vorname}\nTelefon: {telefon}\nE-Mail: {email}\n-----------------------------------------\n{Nachischte}\n----------------------------------------\nAPADANA"); $emailObj->setEncoding("ISO-8859-1"); $emailObj->setFormat("Text"); $emailObj->setImportance("Normal"); return $emailObj->Execute(); } //end Trigger_SendEmail trigger // Make a custom transaction instance $customTransaction = new tNG_custom($conn_rsApadanadb); $tNGs->addTransaction($customTransaction); // Register triggers $customTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Custom1"); $customTransaction->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation); $customTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "danke.php"); $customTransaction->registerTrigger("AFTER", "Trigger_SendEmail", 98); // Add columns $customTransaction->addColumn("Name", "STRING_TYPE", "POST", "Name"); $customTransaction->addColumn("vorname", "STRING_TYPE", "POST", "vorname"); $customTransaction->addColumn("telefon", "STRING_TYPE", "POST", "telefon"); $customTransaction->addColumn("email", "STRING_TYPE", "POST", "email"); $customTransaction->addColumn("Nachischte", "STRING_TYPE", "POST", "Nachischte"); // End of custom transaction instance // Execute all the registered transactions $tNGs->executeTransactions(); // Get the transaction recordset $rscustom = $tNGs->getRecordset("custom"); $row_rscustom = mysql_fetch_assoc($rscustom); $totalRows_rscustom = mysql_num_rows($rscustom); ?>