1 <?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 foldmethod=marker:
2 -------------------------------------------------------------------------------
5 -------------------------------------------------------------------------------
6 This file is part of agenda.
8 agenda is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2 of the License, or (at your option)
13 agenda is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License; if not,
18 write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19 Boston, MA 02111-1307 USA
20 -------------------------------------------------------------------------------
21 Creado: lun ago 11 14:10:35 ART 2003
22 Autor: Martin Marrese <mmarre@mecon.gov.ar>
23 -------------------------------------------------------------------------------
24 $Id: agenda1.php 64 2003-08-21 18:48:28Z mmarre $
25 -----------------------------------------------------------------------------*/
28 require_once 'HTML/Table.php';
29 require_once 'MECON/HTML/Tabla.php';
30 require_once '../../../local_lib/HTML_DietMarco.php';
31 require_once 'BandasNovedades/Buscador.php';
32 require_once 'MECON/HTML/QuickForm.php';
33 require_once 'MECON/HTML/Image.php';
34 require_once 'DB.php';
37 //CHEQUEO QUE EL USUARIO YA ESTÉ LOGUEADO {{{
38 if(!isset($_SESSION['documento']))
40 header('Location: ../../servicios.php');
44 //CREO LA CONEXION A LA BASE DE DATOS {{{
45 $DB = DB::connect("mysql://intranet:intranet@bal747f/bandas",true);
46 if (DB::isError($DB)) {
47 die ($DB->getMessage());
51 //CREO LOS OBJETOS NECESARIOS {{{
52 $TABLAFORM = new MECON_HTML_Tabla ('width="500"', 'medio');
53 $MARCO = new HTML_DietMarco('servicios','Bandas Horarias');
54 $FORM = new MECON_HTML_QuickForm('bandas', 'post', 'banda_agente', '', array ('onSubmit' => "return validar(this)", 'action' => ''));
55 $FORM->renderer->setTable($TABLAFORM);
56 $TABLA = new HTML_Table('width="760" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"');
57 $IMG = new MECON_HTML_Image('../../images/servicios_flecha_naranja.gif');
59 //OBTENGO LOS DATOS DE LAS BASES {{{
60 setlocale (LC_ALL, 'es_AR');
61 $RESULT_MESES = BandasNovedades_Buscador::getMeses($DB);
63 foreach ($RESULT_MESES as $m)
65 $mes = strftime("%B", mktime(0,0,0,$m[0],1,$m[1]));
66 ($m[0]<10)?$m[0]='0'.$m[0]:0;
67 $MESES[$m[1].'-'.$m[0].'-01'] = $m[1].'-'.$mes;
71 //AGREGO LOS ELEMENTOS AL FORM {{{
72 $header =& $FORM->addElement('header', 'cabecera' , $IMG->toHtml().'Ingreso de fecha');
73 $edificio =& $FORM->addElement('select', 'fecha' , 'Meses Disponibles' , $MESES, array('size' => '1'));
74 //Agrego el botón del formulario
76 $grupo[] =& HTML_QuickForm::createElement('submit', 'aceptar' , 'Buscar');
77 $botones =& $FORM->addGroup($grupo, 'botones');
82 $MARCO->addStyleSheet($TABLAFORM->getCSS()); //EL PROBLEMA QUE ESTO LO NECESITO PARA QUE FUNCIONE EL RENDERER NUEVO
87 $TABLA->addRow(array($FORM));
91 $MARCO->addTitle('Bandas Horarias');
92 $MARCO->addBodyContent('<BR>');
93 $MARCO->addBodyContent($TABLA);