From: Martín Marrese Date: Fri, 19 Mar 2004 17:47:23 +0000 (+0000) Subject: Se utiliza el nuevo objeto MECON_HTML_Page. X-Git-Tag: svn_import~11 X-Git-Url: https://git.llucax.com/mecon/samurai.git/commitdiff_plain/3f6877e42e9c7d6940e2d7e73c29e7f457e2c536 Se utiliza el nuevo objeto MECON_HTML_Page. --- diff --git a/sistema/www/sel-sistema.php b/sistema/www/sel-sistema.php index 0aa27ef..da938f2 100644 --- a/sistema/www/sel-sistema.php +++ b/sistema/www/sel-sistema.php @@ -21,61 +21,60 @@ // //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'); +$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'); +$PAGE->addBodyContent('
'); +$PAGE->addBodyContent($im); +$PAGE->addBodyContent($FORM); +$PAGE->addBodyContent('
'); +$PAGE->setTitle('Seleccionar Sistema'); +$PAGE->display(); // }}} ?>