addField("nome_cognome", true, "text", "", "", "", ""); $formValidation->addField("Richiedente", true, "text", "", "", "", ""); $formValidation->addField("Telefono", true, "text", "", "", "", ""); $formValidation->addField("E_mail", true, "text", "email", "", "", ""); $formValidation->addField("privacy", true, "", "", "", "", "Per poter procedere occorre accettare le condizioni sulla privacy."); $tNGs->prepareValidation($formValidation); // End trigger //start SendEmail_richiesta_info trigger //remove this line if you want to edit the code by hand function SendEmail_richiesta_info(&$tNG) { $emailObj = new tNG_Email($tNG); $emailObj->setFrom("{KT_defaultSender}"); $emailObj->setTo("fabrizio@coccia.mi.it"); $emailObj->setCC(""); $emailObj->setBCC("webmaster@slogan.it"); $emailObj->setSubject("Nuova richiesta di preventivo dal sito Cocciasrl.it"); //WriteContent method $emailObj->setContent("Ecco i dati della richiesta:\nNome e cognome: {nome_cognome}\nRagione sociale: {Ragione_Sociale}\nRichiedente: {Richiedente}\nIndirizzo: {Indirizzo}\nTelefono: {Telefono}\nFax: {Fax}\nE-mail: {E_mail}\nNote: {Note}\n"); $emailObj->setEncoding("ISO-8859-1"); $emailObj->setFormat("Text"); $emailObj->setImportance("Normal"); return $emailObj->Execute(); } //end SendEmail_richiesta_info trigger //start senmail_curr trigger //remove this line if you want to edit the code by hand function senmail_curr(&$tNG) { $emailObj = new tNG_Email($tNG); $emailObj->setFrom("{KT_defaultSender}"); $emailObj->setTo("fabrizio@coccia.mi.it"); $emailObj->setCC(""); $emailObj->setBCC("webmaster@slogan.it"); $emailObj->setSubject("Nuovo Curriculum Vitae dal sito Coccia"); //WriteContent method $emailObj->setContent("
Nome e cognome: {curr_nome_cognome}
\nE-mail: {curr_email}
\nAnnotazioni: {curr_note}
\nCurriculum:
\n{curr_curr}\n
Accettato privacy (1=si): {curr_privacy}
\n"); $emailObj->setEncoding("UTF-8"); $emailObj->setFormat("HTML/Text"); $emailObj->setImportance("Normal"); return $emailObj->Execute(); } //end senmail_curr trigger // Start trigger $ValidationCurr = new tNG_FormValidation(); $ValidationCurr->addField("curr_nome_cognome", true, "text", "", "", "", ""); $ValidationCurr->addField("curr_email", true, "text", "email", "", "", ""); $ValidationCurr->addField("curr_curr", true, "text", "", "", "", ""); $ValidationCurr->addField("curr_privacy", true, "", "", "", "", "Per poter procedere occorre accettare le condizioni della Privacy"); $tNGs->prepareValidation($ValidationCurr); // End trigger // Make a custom transaction instance $richiesta_info = new tNG_custom($conn_conn_coccia); $tNGs->addTransaction($richiesta_info); // Register triggers $richiesta_info->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Custom1"); $richiesta_info->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation); $richiesta_info->registerTrigger("END", "Trigger_Default_Redirect", 99, "richiesta_informazioni_ok.php"); $richiesta_info->registerTrigger("AFTER", "SendEmail_richiesta_info", 98); // Add columns $richiesta_info->addColumn("nome_cognome", "STRING_TYPE", "POST", "nome_cognome"); $richiesta_info->addColumn("Ragione_Sociale", "STRING_TYPE", "POST", "Ragione_Sociale"); $richiesta_info->addColumn("Richiedente", "STRING_TYPE", "POST", "Richiedente"); $richiesta_info->addColumn("Indirizzo", "STRING_TYPE", "POST", "Indirizzo"); $richiesta_info->addColumn("Telefono", "STRING_TYPE", "POST", "Telefono"); $richiesta_info->addColumn("Fax", "STRING_TYPE", "POST", "Fax"); $richiesta_info->addColumn("E_mail", "STRING_TYPE", "POST", "E_mail"); $richiesta_info->addColumn("Note", "STRING_TYPE", "POST", "Note"); $richiesta_info->addColumn("privacy", "CHECKBOX_1_0_TYPE", "POST", "privacy", ""); // End of custom transaction instance // Make a custom transaction instance $curr2 = new tNG_custom($conn_conn_coccia); $tNGs->addTransaction($curr2); // Register triggers $curr2->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Custom3"); $curr2->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $ValidationCurr); $curr2->registerTrigger("END", "Trigger_Default_Redirect", 99, "curriculum_inviato_ok.php"); $curr2->registerTrigger("AFTER", "senmail_curr", 98); // Add columns $curr2->addColumn("curr_nome_cognome", "STRING_TYPE", "POST", "curr_nome_cognome"); $curr2->addColumn("curr_email", "STRING_TYPE", "POST", "curr_email"); $curr2->addColumn("curr_note", "STRING_TYPE", "POST", "curr_note"); $curr2->addColumn("curr_curr", "STRING_TYPE", "POST", "curr_curr"); $curr2->addColumn("curr_privacy", "CHECKBOX_1_0_TYPE", "POST", "curr_privacy", "0"); // 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); ?>
|