X-Git-Url: https://git.llucax.com/mecon/samurai.git/blobdiff_plain/94983fa84d06dc5e6f99f6b570245bcf08b96a75..50d164c278afef190726d33beee8ce2e1b333fe3:/sistema/www/sel-sistema.php?ds=sidebyside diff --git a/sistema/www/sel-sistema.php b/sistema/www/sel-sistema.php index fff2afe..0aa27ef 100644 --- a/sistema/www/sel-sistema.php +++ b/sistema/www/sel-sistema.php @@ -1,5 +1,5 @@ 'HTML 4.01 Transitional', + 'charset' => 'iso-8859-1', + 'lineend' => 'unix', + 'language' => 'es', + 'cache' => 'false', + 'simple' => 'true')); + $PAGE->addStyleSheet('/MECON/css/marco.css'); $FORM = new MECON_HTML_QuickForm ('sel_sistema','post','sel-sistema'); - $SAMURAI = new Samurai($DB); - $SISTEMAS = $SAMURAI->getSelectSistemas(); + $TABLAFORM =& new MECON_HTML_Tabla ('width="400"', 'comun'); + $FORM->renderer->setTable($TABLAFORM); + $SISTEMAS = SAMURAI_Sistema::getArraySistemasSeleccionar($DB); // }}} //AGREGO LOS ELEMENTOS DEL FORM {{{ $FORM->addElement ('header', 'cabecera', 'Seleccione el sistema con el cual quiere trabajar'); $FORM->addElement ('select', 'sistemas', 'Sistemas', $SISTEMAS, array('size' => '1')); - - //SI ESTA EL LOGIN NO LO PIDO {{{ - if (!@$_SESSION['samurai']['login']) { - $FORM->addElement ('text', 'responsable', 'Responsable', array('size' => '30')); - $FORM->addRule ('responsable', 'El campo responsable es obligatorio', 'required'); + if (@$_GET['redirect']) { + $redirect = $_GET['redirect']; + } + elseif (@$_POST['redirect']) { + $redirect = $_POST['redirect']; + } + else { + $redirect = 'index'; } - // }}} + $FORM->addElement ('hidden', 'redirect', $redirect); $group[] = HTML_QuickForm::createElement('submit', 'aceptar' , 'Seleccionar'); $FORM->addGroup($group,'botones', '', ', '); // }}} - //VALIDO EL FORMULARIO {{{ if ($FORM->validate()) { $sistema =& $FORM->getElement ('sistemas'); - $tmp = $sistema->getSelected(); + $tmp = $sistema->getSelected(); $_SESSION['samurai']['id_sistema'] = $tmp['0']; if ($FORM->elementExists('responsable')) { $responsable =& $FORM->getElement ('responsable'); - $_SESSION['samurai']['login'] = $responsable->getValue(); + $_SESSION['usuario'] = $responsable->getValue(); } - header('Location: index'); + header('Location: '.$_POST['redirect']); } // }}} // DIBUJO LA PAGINA {{{ - $_SESSION['deshabilitar_links'] = true; //MODIFICAR ESTO CUANDO SE HAGA LA FUNCION DESHABILITAR LINKS - $MARCO = new Marco ('../conf/confSecciones.php'); - $MARCO->addBody($FORM); - $MARCO->display(); + require_once 'MECON/HTML/Image.php'; + $im =& new MECON_HTML_Image('images/copete.jpg'); + $PAGE->addBodyContent($im); + $PAGE->addBodyContent($FORM); + $PAGE->addStyleSheet($FORM->getCSS()); + $PAGE->setTitle('Seleccionar Sistema'); + $PAGE->display(); // }}} ?>