$mes[1] = "enero"; $mes[2] = "febrero"; $mes[3] = "marzo"; $mes[4] = "abril"; $mes[5] = "mayo"; $mes[6] = "junio"; $mes[7] = "julio"; $mes[8] = "agosto"; $mes[9] = "septiembre"; $mes[10] = "octubre"; $mes[11] = "noviembre"; $mes[12] = "diciembre"; $_SESSION['id'] = $_GET['id']; $id = $_SESSION['id']; if ($id != null) { conectarGuest(); $strsql = "SELECT a.id, e.nombre, e.logo, a.titulo, ti.tipo, te.tema, pu.publico, lu.lugar, a.descripcion, a.visitante, a.horario, e.nombre_resp, e.apellido1_resp, e.apellido2_resp, e.tlf_resp, e.fax, e.email_resp FROM lugar_act lu, publico_act pu, tema_act te, tipo_act ti, actividad a, entidad e WHERE a.id_entidad = e.id AND a.id_tema = te.id AND a.id_tipo = ti.id AND a.id_publico = pu.id AND a.id_lugar = lu.id AND a.id = $id"; $resultado = consulta($strsql); if (!$resultado) { tratarError("Ha habido un error en la consulta: ", $strsql); } else { $registro = extraer_registro($resultado); $aux_IdListado = $registro[0]; $aux_entidad = $registro[1]; $aux_logo = $registro[2]; $aux_titulo = $registro[3]; $aux_tipo = $registro[4]; $aux_tema = $registro[5]; $aux_publico = $registro[6]; $aux_sala = $registro[7]; $aux_descripcion = $registro[8]; $aux_visitante = $registro[9]; $aux_fecha = $registro[10]; $aux_resp_nombre = $registro[11]; $aux_resp_ap1 = $registro[12]; $aux_resp_ap2 = $registro[13]; $aux_resp_telefono1 = $registro[14]; $aux_resp_fax = $registro[15]; $aux_resp_mail = $registro[16]; /* a.id, e.nombre, e.logo, a.titulo, ti.tipo, te.tema, pu.publico, lu.lugar, a.descripcion, a.visitante, a.horario, e.nombre_resp, e.apellido1_resp, e.apellido2_resp, e.tlf_resp, e.fax, e.email_resp */ } } $meses = array('Diciembre','Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'); $strsql2 = "select distinct dia, date_format(dia,'%e') as dia, date_format(dia,'%m') as mes from fecha_act where id_actividad = $id"; $fechas = consulta($strsql2); $num_fechas = mysql_num_rows($fechas); $str_fecha = ""; if ($num_fechas > 0){ $fech = extraer_registro($fechas); $d = $fech[1]; $m = $fech[2]; $last_mes = $m; $str_fecha = $d; for($f = 1; $f < $num_fechas; $f++){ $fech = extraer_registro($fechas); $d = $fech[1]; $m = $fech[2]; if ($last_mes != $m){ $str_fecha .= " de ".$meses[$last_mes]."; $d"; $last_mes = $m; }else{ $str_fecha .= ", $d"; } } $str_fecha .= " de ".$meses[$last_mes]; } ?>