X-Git-Url: https://git.llucax.com/mecon/samurai.git/blobdiff_plain/5b15a6f7796a86dfeaf9f41911e7cb112f2c6a97..9002d01b94477c868b4b6b84eb496262ea30fadf:/sistema/www/sel-sistema.php diff --git a/sistema/www/sel-sistema.php b/sistema/www/sel-sistema.php index 0aa27ef..7f1f5e7 100644 --- a/sistema/www/sel-sistema.php +++ b/sistema/www/sel-sistema.php @@ -21,61 +21,65 @@ // //REQUIRE ONCE {{{ - require_once 'HTML/Page.php'; - require_once 'MECON/HTML/QuickForm.php'; - require_once 'MECON/HTML/Tabla.php'; - require_once 'SAMURAI/Sistema.php'; +require_once 'MECON/HTML/Page.php'; +require_once 'MECON/HTML/QuickForm.php'; +require_once 'MECON/HTML/Tabla.php'; +require_once 'SAMURAI/Sistema.php'; +require_once 'MECON/HTML/Image.php'; //}}} //CREO LOS OBJETOS NECESARIOS {{{ - $PAGE = new HTML_Page(array ('doctype'=>'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'); - $TABLAFORM =& new MECON_HTML_Tabla ('width="400"', 'comun'); - $FORM->renderer->setTable($TABLAFORM); - $SISTEMAS = SAMURAI_Sistema::getArraySistemasSeleccionar($DB); -// }}} +$PAGE =& new MECON_HTML_Page(); +$FORM =& new MECON_HTML_QuickForm ('sel_sistema','post','sel-sistema'); +$TABLA =& new HTML_Table('width="760"'); +$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')); - 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', '', ', '); -// }}} +$FORM->addElement ('header', 'cabecera', 'Seleccione el sistema con el cual quiere trabajar'); +$FORM->addElement ('select', 'sistemas', 'Sistemas', $SISTEMAS, array('size' => '1')); +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(); - $_SESSION['samurai']['id_sistema'] = $tmp['0']; - - if ($FORM->elementExists('responsable')) { - $responsable =& $FORM->getElement ('responsable'); - $_SESSION['usuario'] = $responsable->getValue(); - } - header('Location: '.$_POST['redirect']); +if ($FORM->validate()) { + $sistema =& $FORM->getElement ('sistemas'); + $tmp = $sistema->getSelected(); + $_SESSION['samurai']['id_sistema'] = $tmp['0']; + + if ($FORM->elementExists('responsable')) { + $responsable =& $FORM->getElement ('responsable'); + $_SESSION['usuario'] = $responsable->getValue(); } -// }}} -// DIBUJO LA PAGINA {{{ - 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(); + header('Location: '.$_POST['redirect']); +} +//}}} + +//DIBUJO LA PAGINA {{{ +$im =& new MECON_HTML_Image('images/copete.jpg', + 'Intranet - MEcon - SAMURAI'); + +$TABLA->addRow(array($im), 'align="center"'); +$TABLA->addRow(array($FORM), 'align="center"'); + +$PAGE->addStyleSheet($FORM->getCss()); +$PAGE->addBodyContent('