Пример #1
0
require_once '../includes/common/KT_common.php';
// Load the tNG classes
require_once '../includes/tng/tNG.inc.php';
// Load the KT_back class
require_once '../includes/nxt/KT_back.php';
// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("../");
// Make unified connection variable
$conn_ha = new KT_connection($ha, $database_ha);
//Start Restrict Access To Page
$restrict = new tNG_RestrictAccess($conn_ha, "../");
//Grand Levels: Any
$restrict->Execute();
//End Restrict Access To Page
// Start trigger
$formValidation = new tNG_FormValidation();
$formValidation->addField("id_cat", true, "numeric", "", "", "", "");
$formValidation->addField("pag", true, "text", "", "", "", "");
$formValidation->addField("contenido", true, "text", "", "", "", "");
$tNGs->prepareValidation($formValidation);
// End trigger
if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
        if (PHP_VERSION < 6) {
            $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";
Пример #2
0
<?php

require_once 'Connections/ha.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_ha = new KT_connection($ha, $database_ha);
// Start trigger
$formValidation = new tNG_FormValidation();
$formValidation->addField("kt_login_user", true, "text", "", "", "", "");
$formValidation->addField("kt_login_password", true, "text", "", "", "", "");
$tNGs->prepareValidation($formValidation);
// End trigger
// Make a login transaction instance
$loginTransaction = new tNG_login($conn_ha);
$tNGs->addTransaction($loginTransaction);
// Register triggers
$loginTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "kt_login1");
$loginTransaction->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$loginTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "{kt_login_redirect}");
// Add columns
$loginTransaction->addColumn("kt_login_user", "STRING_TYPE", "POST", "kt_login_user");
$loginTransaction->addColumn("kt_login_password", "STRING_TYPE", "POST", "kt_login_password");
// End of login transaction instance
// Execute all the registered transactions
$tNGs->executeTransactions();
// Get the transaction recordset
Пример #3
0
//Grand Levels: Any
$restrict->Execute();
//End Restrict Access To Page
//start Trigger_CheckPasswords trigger
//remove this line if you want to edit the code by hand
function Trigger_CheckPasswords(&$tNG)
{
    $myThrowError = new tNG_ThrowError($tNG);
    $myThrowError->setErrorMsg("Could not create account.");
    $myThrowError->setField("contrasena");
    $myThrowError->setFieldErrorMsg("The two passwords do not match.");
    return $myThrowError->Execute();
}
//end Trigger_CheckPasswords trigger
// Start trigger
$formValidation = new tNG_FormValidation();
$formValidation->addField("nombre", true, "text", "", "", "", "");
$formValidation->addField("apellidos", true, "text", "", "", "", "");
$formValidation->addField("email", true, "text", "email", "", "", "");
$formValidation->addField("usuario", true, "text", "", "", "", "");
$formValidation->addField("contrasena", true, "text", "", "", "", "");
$tNGs->prepareValidation($formValidation);
// End trigger
//start Trigger_CheckOldPassword trigger
//remove this line if you want to edit the code by hand
function Trigger_CheckOldPassword(&$tNG)
{
    return Trigger_UpdatePassword_CheckOldPassword($tNG);
}
//end Trigger_CheckOldPassword trigger
// Make an insert transaction instance
Пример #4
0
require_once '../includes/common/KT_common.php';
// Load the tNG classes
require_once '../includes/tng/tNG.inc.php';
// Load the KT_back class
require_once '../includes/nxt/KT_back.php';
// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("../");
// Make unified connection variable
$conn_ha = new KT_connection($ha, $database_ha);
//Start Restrict Access To Page
$restrict = new tNG_RestrictAccess($conn_ha, "../");
//Grand Levels: Any
$restrict->Execute();
//End Restrict Access To Page
// Start trigger
$formValidation = new tNG_FormValidation();
$formValidation->addField("servicio", true, "text", "", "", "", "");
$formValidation->addField("imagen", true, "", "", "", "", "");
$formValidation->addField("pag_serv", true, "text", "", "", "", "");
$tNGs->prepareValidation($formValidation);
// End trigger
//start Trigger_FileDelete trigger
//remove this line if you want to edit the code by hand
function Trigger_FileDelete(&$tNG)
{
    $deleteObj = new tNG_FileDelete($tNG);
    $deleteObj->setFolder("../imgs/servicios/");
    $deleteObj->setDbFieldName("imagen");
    return $deleteObj->Execute();
}
//end Trigger_FileDelete trigger
Пример #5
0
require_once '../includes/common/KT_common.php';
// Load the tNG classes
require_once '../includes/tng/tNG.inc.php';
// Load the KT_back class
require_once '../includes/nxt/KT_back.php';
// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("../");
// Make unified connection variable
$conn_ha = new KT_connection($ha, $database_ha);
//Start Restrict Access To Page
$restrict = new tNG_RestrictAccess($conn_ha, "../");
//Grand Levels: Any
$restrict->Execute();
//End Restrict Access To Page
// Start trigger
$formValidation = new tNG_FormValidation();
$formValidation->addField("banner", true, "", "", "", "", "");
$tNGs->prepareValidation($formValidation);
// End trigger
//start Trigger_FileDelete trigger
//remove this line if you want to edit the code by hand
function Trigger_FileDelete(&$tNG)
{
    $deleteObj = new tNG_FileDelete($tNG);
    $deleteObj->setFolder("../imgs/banners/");
    $deleteObj->setDbFieldName("banner");
    return $deleteObj->Execute();
}
//end Trigger_FileDelete trigger
//start Trigger_ImageUpload trigger
//remove this line if you want to edit the code by hand
Пример #6
0
require_once '../includes/common/KT_common.php';
// Load the tNG classes
require_once '../includes/tng/tNG.inc.php';
// Load the KT_back class
require_once '../includes/nxt/KT_back.php';
// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("../");
// Make unified connection variable
$conn_ha = new KT_connection($ha, $database_ha);
//Start Restrict Access To Page
$restrict = new tNG_RestrictAccess($conn_ha, "../");
//Grand Levels: Any
$restrict->Execute();
//End Restrict Access To Page
// Start trigger
$formValidation = new tNG_FormValidation();
$formValidation->addField("categoria", true, "text", "", "", "", "");
$tNGs->prepareValidation($formValidation);
// End trigger
// Make an insert transaction instance
$ins_categorias = new tNG_multipleInsert($conn_ha);
$tNGs->addTransaction($ins_categorias);
// Register triggers
$ins_categorias->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
$ins_categorias->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$ins_categorias->registerTrigger("END", "Trigger_Default_Redirect", 99, "../includes/nxt/back.php");
// Add columns
$ins_categorias->setTable("categorias");
$ins_categorias->addColumn("categoria", "STRING_TYPE", "POST", "categoria");
$ins_categorias->addColumn("liga_cat", "STRING_TYPE", "POST", "liga_cat");
$ins_categorias->setPrimaryKey("id_cat", "NUMERIC_TYPE");
Пример #7
0
<?php

require_once '../Connections/conn_cms.php';
// Load the common classes
require_once '../includes/common/KT_common.php';
// Load the tNG classes
require_once '../includes/tng/tNG.inc.php';
// Load the KT_back class
require_once '../includes/nxt/KT_back.php';
// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("../");
// Make unified connection variable
$conn_conn_cms = new KT_connection($conn_cms, $database_conn_cms);
// Start trigger
$formValidation = new tNG_FormValidation();
$formValidation->addField("tieudetin", true, "text", "", "", "", "Tiêu đề tin này đã có rồi.");
$tNGs->prepareValidation($formValidation);
// End trigger
//start Trigger_CheckUnique trigger
//remove this line if you want to edit the code by hand
function Trigger_CheckUnique(&$tNG)
{
    $tblFldObj = new tNG_CheckUnique($tNG);
    $tblFldObj->setTable("tintuc");
    $tblFldObj->addFieldName("tieudetin");
    $tblFldObj->setErrorMsg("Tiều đề tin này bạn đã nhập rồi");
    return $tblFldObj->Execute();
}
//end Trigger_CheckUnique trigger
//start Trigger_FileDelete trigger
//remove this line if you want to edit the code by hand
Пример #8
0
require_once '../includes/common/KT_common.php';
// Load the tNG classes
require_once '../includes/tng/tNG.inc.php';
// Load the KT_back class
require_once '../includes/nxt/KT_back.php';
// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("../");
// Make unified connection variable
$conn_ha = new KT_connection($ha, $database_ha);
//Start Restrict Access To Page
$restrict = new tNG_RestrictAccess($conn_ha, "../");
//Grand Levels: Any
$restrict->Execute();
//End Restrict Access To Page
// Start trigger
$formValidation = new tNG_FormValidation();
$formValidation->addField("id_cat", true, "numeric", "", "", "", "");
$formValidation->addField("subcat", true, "text", "", "", "", "");
$tNGs->prepareValidation($formValidation);
// End trigger
if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
        if (PHP_VERSION < 6) {
            $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;