addField("asig_responsable", true, "text", "", "", "", ""); $formValidation->addField("asig_fecha", true, "date", "", "", "", ""); $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("{KT_defaultSender}"); $emailObj->setTo("{RsAnalistas.usr_emailnot}"); $emailObj->setCC(""); $emailObj->setBCC("becheverry@mincit.gov.co"); $emailObj->setSubject(".:: ASIGNACION DE SOLICITUD CI ::"); //WriteContent method $emailObj->setContent("Se le ha asignado una nueva solicitud\n\n
{asig_fecha}
\n\n\n"); $emailObj->setEncoding("UTF-8"); $emailObj->setFormat("HTML/Text"); $emailObj->setImportance("High"); 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; } } $colname_RsInfoE = "-1"; if (isset($_SESSION['kt_login_id'])) { $colname_RsInfoE = $_SESSION['kt_login_id']; } mysql_select_db($database_oConnUser, $oConnUser); $query_RsInfoE = sprintf("SELECT * FROM q_global_info WHERE user_id = %s", GetSQLValueString($colname_RsInfoE, "int")); $RsInfoE = mysql_query($query_RsInfoE, $oConnUser) or die(mysql_error()); $row_RsInfoE = mysql_fetch_assoc($RsInfoE); $totalRows_RsInfoE = mysql_num_rows($RsInfoE); mysql_select_db($database_oConnUser, $oConnUser); $query_RsAnalistas = "SELECT * FROM q_analistas"; $RsAnalistas = mysql_query($query_RsAnalistas, $oConnUser) or die(mysql_error()); $row_RsAnalistas = mysql_fetch_assoc($RsAnalistas); $totalRows_RsAnalistas = mysql_num_rows($RsAnalistas); // Make an insert transaction instance $ins_sicex_radicados = new tNG_multipleInsert($conn_oConnUser); $tNGs->addTransaction($ins_sicex_radicados); // Register triggers $ins_sicex_radicados->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1"); $ins_sicex_radicados->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation); $ins_sicex_radicados->registerTrigger("END", "Trigger_Default_Redirect", 99, "includes/nxt/back.php"); $ins_sicex_radicados->registerTrigger("AFTER", "Trigger_SendEmail", 98); // Add columns $ins_sicex_radicados->setTable("sicex_radicados"); $ins_sicex_radicados->addColumn("asig_responsable", "STRING_TYPE", "POST", "asig_responsable"); $ins_sicex_radicados->addColumn("asig_fecha", "DATE_TYPE", "POST", "asig_fecha"); $ins_sicex_radicados->setPrimaryKey("consecutivo", "NUMERIC_TYPE"); // Make an update transaction instance $upd_sicex_radicados = new tNG_multipleUpdate($conn_oConnUser); $tNGs->addTransaction($upd_sicex_radicados); // Register triggers $upd_sicex_radicados->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1"); $upd_sicex_radicados->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation); $upd_sicex_radicados->registerTrigger("END", "Trigger_Default_Redirect", 99, "okasig.php"); $upd_sicex_radicados->registerTrigger("AFTER", "Trigger_SendEmail", 98); // Add columns $upd_sicex_radicados->setTable("sicex_radicados"); $upd_sicex_radicados->addColumn("asig_responsable", "STRING_TYPE", "POST", "asig_responsable"); $upd_sicex_radicados->addColumn("asig_fecha", "DATE_TYPE", "POST", "asig_fecha"); $upd_sicex_radicados->setPrimaryKey("consecutivo", "NUMERIC_TYPE", "GET", "consecutivo"); // Make an instance of the transaction object $del_sicex_radicados = new tNG_multipleDelete($conn_oConnUser); $tNGs->addTransaction($del_sicex_radicados); // Register triggers $del_sicex_radicados->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Delete1"); $del_sicex_radicados->registerTrigger("END", "Trigger_Default_Redirect", 99, "includes/nxt/back.php"); // Add columns $del_sicex_radicados->setTable("sicex_radicados"); $del_sicex_radicados->setPrimaryKey("consecutivo", "NUMERIC_TYPE", "GET", "consecutivo"); // Execute all the registered transactions $tNGs->executeTransactions(); // Get the transaction recordset $rssicex_radicados = $tNGs->getRecordset("sicex_radicados"); $row_rssicex_radicados = mysql_fetch_assoc($rssicex_radicados); $totalRows_rssicex_radicados = mysql_num_rows($rssicex_radicados); ?>