Viewing file: include_acciones.php (5.41 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
///////////////////////////////////////
// Herramienta de manejo de acciones //
///////////////////////////////////////
// Inclusiones
include ('class_consulta_sql.php');
include ('class_listar.php');
include ('class_paginar.php');
include ('class_seleccion.php');
include ('class_seleccion_pg.php');
include ('class_cadena_constante.php');
include ('class_seleccion_constante.php');
include ('class_files.php');
include ('class_filtrar_select_edicion.php');
include ('include_imprimir.php');
include ('class_categorias.php');
include ('class_fechas.php');
include ('class_mover.php');
include ('class_copiar.php');
include ('class_password.php');
include ('class_tree.php');
include ('class_tree_1.php');
include ('class_tree_2.php');
include ('class_tree_simple.php');
include ('class_indice.php');
include ('class_indice_interno.php');
include ('class_resize.php');
include ('class_system.php');
include ('class_reemplazo.php');
include ('class_validar_datos.php');
include ('class_aviso.php');
include ('class_integridad.php');
include ('class_search.php');
include ('include_querys_admon.php');
if ($stop == 0) {
// 0. Despliegue inicial
if ($accion == "") {
// Por llenar.
}
// 1. Insercion Masiva
$reg_unit = 0;
$control_insercion = 0;
if (isset($links_numero) and $id_app=21) {
$reg_unit = 1;
if ($accion == "ins_") {
$s = 0;
foreach ($valores_insertar as $v_i) {
$query = "insert into " . $tabla . " values(" . $v_i . ")";
$insert = new Select($query, "ins_", 0 ,0);
//1.3 Registro Masivo
// 1.3.1 Cáculo del día
$f2 = new fecha;
$f2->sys_fecha();
$fecha_registro = $f2->FECHA_SYS;
// 1.3.2 Inserción de los valores en el registro
$valores_insertar_register = "'','$user','$id_app','$insert->LAST_ID','$tabla','$accion','$fecha_registro',''";
$query_register = "insert into administracion_registro values(" . $valores_insertar_register . ")";
$insert_register = new Select($query_register, "ins_", 0 ,0);
//1.2 Insercion Relacion Masiva
if (isset($tabla_rel)) {
for ($i = 0; $i < $repeticiones; $i++) {
$val = $insert->LAST_ID . "," . $valores_insertar_rel[$i];
$query = "insert into " . $tabla_rel . " values(" . $val . ")";
$insert_rel = new Select($query, "ins_", 0 ,0);
}
}
}
}
$control_insercion = 1;
}
if ($accion == "ins_" and $control_insercion == 0) {
if (isset($links_id)){
$last_insert_id = $links_id;
}else{
$query = "insert into " . $tabla . " values(" . $valores_insertar . ")";
$insert = new Select($query, "ins_", 0 ,0);
$last_insert_id = $insert->LAST_ID;
}
// 1.3 Insercion Relacion
if (isset($tabla_rel)) {
for ($i = 0; $i < $repeticiones; $i++) {
$valores_insertar_rel[$i] = $last_insert_id . "," . $valores_insertar_rel[$i];
$query = "insert into " . $tabla_rel . " values(" . $valores_insertar_rel[$i] . ")";
$insert_rel = new Select($query, "ins_", 0 ,0);
}
}
}
// 2. Eliminación
if ($accion == "del_") {
$query = "delete from " . $tabla . " where " . $campo_id . "=" . $id;
$delete = new Select($query, "del_", 0 ,0);
}
// 3. Edición
if ($accion == "-1") {
$cuando = $campo_id . "=" . $id;
$arreglo = new select_v1(0, "*", $tabla, $cuando, $numero_campos, 0, "", "", "");
}
if ($accion == "-1_opc") {
$cuando = $campo_id . "=" . $id;
$arreglo = new select_v1(0, "*", $tabla, $cuando, $numero_campos, 0, "", "", "");
}
// 4. Actualización
if ($accion == "edi_") {
$query = "update " . $tabla . " set " . $set . " where " . $campo_id . "=" . $id;
$update = new Select($query, "edi_", 0 ,0);
if (isset($dir_accion)) {
$accion = 9;
}
}
// 5. Especiales de Links
if ($accion == "3a") {
//echo $categoria_id;
}
// 6. Registro de Acciones
if ($accion != "x" and $accion != "-1" and $accion != "" and $reg_unit == 0) {
// 6.1 Cáculo del día
$f2 = new fecha;
$f2->sys_fecha();
$fecha_registro = $f2->FECHA_SYS;
// 6.2 Inserción de los valores en el registro
if ($accion == "ins_") {
$r_id = $last_insert_id;
}else{
$r_id = $id;
}
// 6.3 Muestra con ayuda de la clase aviso un mensaje diciendo que todo esta Ok
if ($accion == "ins_" or $accion == "edi_" or $accion == "del_") {
if ($accion == "ins_") {
$accion_label = "agregado";
}
if ($accion == "del_") {
$accion_label = "eliminado";
}
if ($accion == "edi_") {
$accion_label = "editado";
}
$mensaje_ok = "perfecto " . $user . ", el registro No. " . $r_id . " fue correctamente " . $accion_label . ". <br>Realizado en: " . $fecha_registro;
$aviso = new aviso($mensaje_ok, 1);
}
$valores_insertar_register = "'','$user','$id_app','$r_id','$tabla','$accion','$fecha_registro',''";
$query_register = "insert into administracion_registro values(" . $valores_insertar_register . ")";
$insert_register = new Select($query_register, "ins_", 0 ,0);
// 6.4 Recuerde que le registro tiene un alias en el control de inserción masiva de este mismo script
// en la línea 52
}
}
?>
|