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 '../../../local_lib/Servicios/Bandas/Buscador.php';
32 require_once 'MECON/HTML/QuickForm.php';
33 require_once 'MECON/HTML/Image.php';
34 require_once 'DB.php';
37 //CREO LA CONEXION A LA BASE DE DATOS {{{
38 $DB = DB::connect("mysql://intranet:intranet@bal747f/bandas",true);
39 if (DB::isError($DB)) {
40 die ($DB->getMessage());
44 //CREO LOS OBJETOS NECESARIOS {{{
45 $TABLAFORM = new MECON_HTML_Tabla ('width="500"', 'medio');
46 $MARCO = new HTML_DietMarco('servicios','Bandas Horarias');
47 $FORM = new MECON_HTML_QuickForm('bandas', 'post', 'banda_agente', '', array ('onSubmit' => "return validar(this)", 'action' => ''));
48 $FORM->renderer->setTable($TABLAFORM);
49 $TABLA = new HTML_Table('width="760" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"');
50 $IMG = new MECON_HTML_Image('../../images/servicios_flecha_naranja.gif');
52 //OBTENGO LOS DATOS DE LAS BASES {{{
53 setlocale (LC_ALL, 'es_AR');
54 $RESULT_MESES = Servicios_Bandas_Buscador::getMeses($DB);
56 foreach ($RESULT_MESES as $m)
58 $mes = strftime("%B", mktime(0,0,0,$m[0],1,$m[1]));
59 ($m[0]<10)?$m[0]='0'.$m[0]:0;
60 $MESES[$m[1].'-'.$m[0].'-01'] = $m[1].'-'.$mes;
64 //AGREGO LOS ELEMENTOS AL FORM {{{
65 $header =& $FORM->addElement('header', 'cabecera' , $IMG->toHtml().'Ingreso de fecha');
66 $edificio =& $FORM->addElement('select', 'fecha' , 'Meses Disponibles' , $MESES, array('size' => '1'));
67 //Agrego el botón del formulario
69 $grupo[] =& HTML_QuickForm::createElement('submit', 'aceptar' , 'Buscar');
70 $botones =& $FORM->addGroup($grupo, 'botones');
75 $MARCO->addStyleSheet($TABLAFORM->getCSS()); //EL PROBLEMA QUE ESTO LO NECESITO PARA QUE FUNCIONE EL RENDERER NUEVO
80 $TABLA->addRow(array($FORM));
84 $MARCO->addTitle('Bandas Horarias');
85 $MARCO->addBodyContent('<BR>');
86 $MARCO->addBodyContent($TABLA);