function index()
 {
     $tseries = new series();
     $series = "";
     if ($_SESSION["ROL_COD"] == "AA" || $_SESSION["ROL_COD"] == "AC" || $_SESSION["ROL_COD"] == "AI") {
         $series = $tseries->obtenerSelectTodas();
     } else {
         $series = $tseries->obtenerSelectSeries();
     }
     $departamento = new departamento();
     $this->registry->template->dep_id = $departamento->obtenerSelect();
     $fondo = new fondo();
     $this->registry->template->fon_id = $fondo->obtenerSelectFondos();
     $this->registry->template->uni_id = "";
     $this->registry->template->ser_id = "";
     //$this->registry->template->exp_id = "";
     $this->registry->template->tra_id = "";
     $this->registry->template->cue_id = "";
     $tmenu = new menu();
     $liMenu = $tmenu->imprimirMenu("buscarArchivo", $_SESSION['USU_ID']);
     $this->registry->template->men_titulo = $liMenu;
     $this->registry->template->UNI_ID = $_SESSION['UNI_ID'];
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "search";
     $this->registry->template->PATH_EVENT2 = "verifpass";
     $this->registry->template->PATH_EVENT_VERIF_PASS = "******";
     $this->registry->template->PATH_EVENT3 = "download";
     $this->registry->template->PATH_EVENT4 = "getConfidencialidad";
     $this->registry->template->PATH_EVENT_EXPORT = "exportar";
     $this->registry->template->GRID_SW = "false";
     $this->registry->template->PATH_J = "jquery-1.4.1";
     $this->registry->template->show('headerBuscador');
     $this->registry->template->show('archivo/buscarArchivo.tpl');
     $this->registry->template->show('footer');
 }
 function verifLogin()
 {
     $departamento = new departamento();
     $departamento->setRequest2Object($_REQUEST);
     $dep_codigo = $_REQUEST['dep_codigo'];
     $Path_event = trim($_POST['Path_event']);
     if ($Path_event != 'update') {
         if ($departamento->existeCodigo($dep_codigo)) {
             echo 'El código ya existe, escriba otro.';
         } else {
             echo '';
         }
     } else {
         echo '';
     }
 }
<?php

include "../ReglasNegocio/usuario.php";
include "../ReglasNegocio/departamento.php";
$departamento = new departamento();
$usuario = new usuario();
$editar = $_GET["editar"];
$cerrar = $_GET["cerrar"];
$boton = "verificaUsuario()";
$visible = true;
if (!empty($editar)) {
    $id_usuario = $usuario->Select($editar);
    $row = mysql_fetch_array($id_usuario);
    $id_departamento = $row['ID_DEPARTAMENTO'];
    $rut_usuario = $row['RUT_USUARIO'];
    $nombre_usuario = $row['NOMBRE_USUARIO'];
    $apellidos_usuario = $row['APELLIDOS_USUARIO'];
    $boton = "VerificaUsuarioUpdate()";
    $visible = false;
}
?>

<script language="JavaScript" src="js/java_script.js">  

</script>
<body>
<form method="post" action="AgregarUsuarioBD.php" name="form">
<p class="tituloHead">Usuarios</p>
<table  align="center" class="filaPar">

<tr>
<?php

include "../AccesoDatos/Controller.php";
include "../ReglasNegocio/departamento.php";
$departamento = $_POST["departamento"];
$id_direccion = $_POST["direccion"];
$hd_variable = $_POST["hd_variable"];
$id_variable = $_POST["id_variable"];
$address = new departamento();
if (empty($departamento) || $id_direccion == 0) {
    header("Location: paso.php?c=y");
} elseif (!empty($departamento) && empty($id_variable) && !empty($id_direccion)) {
    $value = $address->Select2($departamento);
    if (empty($value)) {
        $value = $address->Add($id_direccion, $departamento);
    }
    header("Location: paso.php?c=y");
} elseif (!empty($id_variable) && !empty($departamento) && !empty($id_direccion)) {
    $value = $address->Update($id_variable, $id_direccion, $departamento);
    header("Location: paso.php?c=y");
}
<?php

include "../ReglasNegocio/departamento.php";
include "../ReglasNegocio/direccion.php";
$departamento = new departamento();
$direccion = new direccion();
$editar = $_GET["editar"];
$boton = "verifica()";
if (!empty($editar)) {
    $id_departamento = $departamento->Select($editar);
    $row = mysql_fetch_array($id_departamento);
    $id_direccion = $row['ID_DIRECCION'];
    $nombre_departamento = $row['NOMBRE_DEPARTAMENTO'];
    $boton = "VerificaUpdate()";
}
?>
<script LANGUAGE="JavaScript">

function verifica()
{
	if (document.form.departamento.value.length==0)
   {
		alert("Debe ingresar un Nombre");
      return 0;
	}
	else if (document.form.direccion.value==0)
   {
		alert("Debe Seleccionar una Direccion");
      return 0;
	}
   document.form.hd_variable.value="ingresar";
Example #6
0
 public function departamento($id)
 {
     $datos = departamento::find($id);
     return $datos->nombre;
 }
 function view()
 {
     //Edificios
     if (!VAR3) {
         die("Error del sistema 404");
     }
     $this->ubicacion = new tab_ubicacion();
     $tab_provincia = new tab_provincia();
     $tab_localidad = new tab_localidad();
     $this->ubicacion->setRequest2Object($_REQUEST);
     $ubi = new ubicacion();
     $row = $this->ubicacion->dbselectByField("ubi_id", VAR3);
     if (!$row) {
         die("Error del sistema 404");
     }
     $row = $row[0];
     $row_loc = $tab_localidad->dbselectByField("loc_id", $row->loc_id);
     $row_pro = $tab_provincia->dbselectByField("pro_id", $row_loc[0]->pro_id);
     $departamento = new departamento();
     $provincia = new provincia();
     $localidad = new localidad();
     $this->registry->template->dep_id = $departamento->obtenerSelect($row_pro[0]->dep_id);
     $this->registry->template->pro_id = $provincia->obtenerSelect($row_loc[0]->pro_id, $row_pro[0]->dep_id);
     $this->registry->template->loc_id = $localidad->obtenerSelect($row->loc_id, $row_loc[0]->pro_id);
     $this->registry->template->ubi_id = $row->ubi_id;
     $this->registry->template->ubi_par = $row->ubi_par;
     $this->registry->template->ubi_codigo = $row->ubi_codigo;
     $this->registry->template->ubi_descripcion = $row->ubi_descripcion;
     $this->registry->template->ubi_direccion = $row->ubi_direccion;
     $this->registry->template->titulo_ubi = "EDITAR EDIFICIO";
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "update";
     $this->registry->template->GRID_SW = "true";
     $this->registry->template->PATH_J = "jquery-1.4.1";
     $this->menu = new menu();
     $this->liMenu = $this->menu->imprimirMenu(VAR1, $_SESSION['USU_ID']);
     $this->registry->template->men_titulo = $this->liMenu;
     $this->registry->template->show('headerG');
     $this->registry->template->show('ubicacion/tab_ubicacion.tpl');
     $this->registry->template->show('footer');
 }
 function clonar_view()
 {
     if (!VAR3) {
         die("Error del sistema 404");
     }
     // Clonar serie del sistema de informaci&oacute;n
     $this->usuario = new usuario();
     $adm = $this->usuario->esAdm();
     $departamento = new departamento();
     $this->registry->template->dep_id = $departamento->obtenerSelect();
     $unidad = new unidad();
     //$this->registry->template->uni_id = $unidad->obtenerSelect();
     $this->registry->template->uni_id = "";
     $serie = new series();
     $tipo_corr = new tipocorr();
     $retensiondoc = new retensiondoc();
     $fondo = new fondo();
     $this->registry->template->adm = $adm;
     $this->registry->template->delimiter = DELIMITER;
     // Clonacion de serie
     $this->registry->template->serclon_id = VAR3;
     $this->registry->template->ser_id = "";
     $this->registry->template->fon_id = $fondo->obtenerSelectFondos();
     //$this->registry->template->ser_par = $serie->obtenerSelectTodas();
     $this->registry->template->ser_par = "";
     $this->registry->template->ser_categoria = "";
     $this->registry->template->ser_tipo = "N";
     $this->registry->template->ser_codigop = "";
     $this->registry->template->ser_codigo = "";
     $this->registry->template->titulo = "Nueva ";
     $this->registry->template->tco_id = $tipo_corr->obtenerSelect();
     $this->registry->template->red_id = $retensiondoc->obtenerSelect();
     $this->registry->template->fon_cod = "";
     $this->registry->template->uni_cod = "";
     $this->registry->template->tco_codigo = "";
     $this->registry->template->ser_contador = "0";
     $this->registry->template->ser_corr = "<OPTION>AUTO</OPTION><OPTION>MANUAL</OPTION>";
     $this->registry->template->ser_exp = "0";
     $tramiteSerie = new tab_tramite();
     $tramites = $tramiteSerie->dbSelectBySQL("SELECT * FROM tab_tramite\r\n        WHERE tra_estado = '1' ORDER BY tra_descripcion ASC ");
     $tramiteTr = "";
     $i = 0;
     if (count($tramites)) {
         foreach ($tramites as $tramite) {
             $tramiteTr .= "<tr><td><input type='checkbox' class='' name='tramite[{$i}]' value='" . $tramite->tra_id . "' /></td><td>" . $tramite->tra_descripcion . "</td></tr>\n";
             $i++;
         }
     } else {
         $tramiteTr = "<tr><td colspan='2'>No existen tramites</td></tr>";
     }
     $this->registry->template->LISTA_TRAMITES = $tramiteTr;
     $this->registry->template->LISTA_TRAMITES_SELECT = "";
     $this->menu = new menu();
     $this->liMenu = $this->menu->imprimirMenu(VAR1, $_SESSION['USU_ID']);
     $this->registry->template->men_titulo = $this->liMenu;
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "save_clon";
     $this->registry->template->GRID_SW = "false";
     $this->registry->template->PATH_J = "jquery-1.4.1";
     $this->registry->template->show('headerG');
     $this->registry->template->show('tab_series.tpl');
     $this->registry->template->show('footer');
 }
 function listado()
 {
     $tseries = new series();
     $series = "";
     if ($_SESSION["ROL_COD"] == "SUBF" || $_SESSION["ROL_COD"] == "ACEN" || $_SESSION["ROL_COD"] == "ADM") {
         $series = $tseries->obtenerSelectTodas();
     } else {
         $series = $tseries->obtenerSelectSeries();
     }
     $departamento = new departamento();
     $this->registry->template->dep_id = $departamento->obtenerSelect();
     $this->registry->template->uni_id = "";
     $this->registry->template->ser_id = "";
     //$this->registry->template->exp_id = "";
     $this->registry->template->tra_id = "";
     $this->registry->template->cue_id = "";
     $tmenu = new menu();
     $liMenu = $tmenu->imprimirMenu("prestamos", $_SESSION['USU_ID']);
     $this->registry->template->men_titulo = $liMenu;
     $this->registry->template->UNI_ID = $_SESSION['UNI_ID'];
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "search";
     $this->registry->template->PATH_EVENT2 = "verifpass";
     $this->registry->template->PATH_EVENT_VERIF_PASS = "******";
     $this->registry->template->PATH_EVENT3 = "download";
     $this->registry->template->PATH_EVENT4 = "getConfidencialidad";
     $this->registry->template->PATH_EVENT_EXPORT = "exportar";
     $this->registry->template->GRID_SW = "false";
     $this->registry->template->PATH_J = "jquery-1.4.1";
     //session
     //ajax
     $this->registry->template->PATH_EVENT_LISTA = "guardarLista";
     //$this->registry->template->cantidad= $tseries->countBySQL();
     $this->registry->template->show('prestamos/headerBuscador');
     $this->registry->template->show('prestamos/listadocumentos.tpl');
     $this->registry->template->show('footer');
 }
 function add()
 {
     $departamento = new departamento();
     $this->registry->template->dep_id = $departamento->obtenerSelect();
     $fondo = new fondo();
     $this->registry->template->fon_id = $fondo->obtenerSelectFondos();
     $this->registry->template->uni_id = "";
     $this->registry->template->ser_id = "";
     //$this->registry->template->exp_id = "";
     $this->registry->template->tra_id = "";
     $this->registry->template->cue_id = "";
     $tmenu = new menu();
     $liMenu = $tmenu->imprimirMenu("solprestamo", $_SESSION['USU_ID']);
     $this->registry->template->men_titulo = $liMenu;
     $this->registry->template->UNI_ID = $_SESSION['UNI_ID'];
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "search";
     $this->registry->template->PATH_EVENT2 = "verifpass";
     $this->registry->template->PATH_EVENT_VERIF_PASS = "******";
     $this->registry->template->PATH_EVENT3 = "download";
     $this->registry->template->PATH_EVENT4 = "getConfidencialidad";
     $this->registry->template->PATH_EVENT_EXPORT = "exportar";
     $this->registry->template->GRID_SW = "false";
     $this->registry->template->PATH_J = "jquery-1.4.1";
     //session
     //ajax
     $this->registry->template->PATH_EVENT_LISTA = "guardarLista";
     //$this->registry->template->cantidad= $tseries->countBySQL();
     $this->registry->template->show('headerBuscador');
     $this->registry->template->show('prestamos/tab_solprestamo.tpl');
     //        $this->registry->template->show('prestamos/tab_solprestamog.tpl');
     $this->registry->template->show('footer');
 }