Viewing file: index.php (16.12 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? //SI NO SE HA SELECCIONADO NADA, LA SECCIÓN PRINCIPAL ACTIVA ES LA 1
if (!isset($n1)) {
$n1=1;
}else{
$n1==$n1;
}
?>
<? //DETERMINO LA ÚLTIMA VARIABLE DECLARADA EN EL URL//
if (!isset($n4)&& !isset($n3) && !isset($n2)){
$cm=$n1;
$numm=1;
$ruta="n1=$n1";
}else if (!isset($n4)&& isset($n3)){
$cm = $n3;
$numm=3;
$ruta="n1=$n1&n2=$n2&n3=$n3";
}else if (!isset($n4)&& !isset($n3) && isset($n2)){
$cm = $n2;
$numm=2;
$ruta="n1=$n1&n2=$n2";
}else{
$cm = $n4;
$numm=4;
$ruta="n1=$n1&n2=$n2&n3=$n3&n4=$n4";
}
$var_tabla="nivel".strlen($cm);
$var_campo="idnivel".strlen($cm);
?>
<?php require_once('../Connections/oa.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_oa, $oa);
$query_rsnivel1 = "SELECT idnivel1, nombre, tooltip, estilo, colorbase, colordos FROM nivel1 ORDER BY orden";
$rsnivel1 = mysql_query($query_rsnivel1, $oa) or die(mysql_error());
$row_rsnivel1 = mysql_fetch_assoc($rsnivel1);
$totalRows_rsnivel1 = mysql_num_rows($rsnivel1);
$n1_rsnivel2 = "0";
if (isset($n1)) {
$n1_rsnivel2 = (get_magic_quotes_gpc()) ? $n1 : addslashes($n1);
}
mysql_select_db($database_oa, $oa);
$query_rsnivel2 = sprintf("SELECT idnivel2, nombre FROM nivel2 WHERE idnivel1=%s ORDER BY orden", $n1_rsnivel2);
$rsnivel2 = mysql_query($query_rsnivel2, $oa) or die(mysql_error());
$row_rsnivel2 = mysql_fetch_assoc($rsnivel2);
$totalRows_rsnivel2 = mysql_num_rows($rsnivel2);
$n2_rsnivel3 = "0";
if (isset($n2)) {
$n2_rsnivel3 = (get_magic_quotes_gpc()) ? $n2 : addslashes($n2);
}
mysql_select_db($database_oa, $oa);
$query_rsnivel3 = sprintf("SELECT idnivel3, nombre FROM nivel3 WHERE idnivel2=%s ORDER BY orden", $n2_rsnivel3);
$rsnivel3 = mysql_query($query_rsnivel3, $oa) or die(mysql_error());
$row_rsnivel3 = mysql_fetch_assoc($rsnivel3);
$totalRows_rsnivel3 = mysql_num_rows($rsnivel3);
$n3_rsnivel4 = "0";
if (isset($n3)) {
$n3_rsnivel4 = (get_magic_quotes_gpc()) ? $n3 : addslashes($n3);
}
mysql_select_db($database_oa, $oa);
$query_rsnivel4 = sprintf("SELECT idnivel4, nombre FROM nivel4 WHERE idnivel3=%s ORDER BY orden", $n3_rsnivel4);
$rsnivel4 = mysql_query($query_rsnivel4, $oa) or die(mysql_error());
$row_rsnivel4 = mysql_fetch_assoc($rsnivel4);
$totalRows_rsnivel4 = mysql_num_rows($rsnivel4);
$n1_rsn1 = "0";
if (isset($n1)) {
$n1_rsn1 = (get_magic_quotes_gpc()) ? $n1 : addslashes($n1);
}
mysql_select_db($database_oa, $oa);
$query_rsn1 = sprintf("SELECT nombre, tooltip, estilo, colorbase FROM nivel1 WHERE idnivel1=%s", $n1_rsn1);
$rsn1 = mysql_query($query_rsn1, $oa) or die(mysql_error());
$row_rsn1 = mysql_fetch_assoc($rsn1);
$totalRows_rsn1 = mysql_num_rows($rsn1);
$n2_rsn2 = "0";
if (isset($n2)) {
$n2_rsn2 = (get_magic_quotes_gpc()) ? $n2 : addslashes($n2);
}
mysql_select_db($database_oa, $oa);
$query_rsn2 = sprintf("SELECT nombre, tooltip FROM nivel2 WHERE idnivel2=%s", $n2_rsn2);
$rsn2 = mysql_query($query_rsn2, $oa) or die(mysql_error());
$row_rsn2 = mysql_fetch_assoc($rsn2);
$totalRows_rsn2 = mysql_num_rows($rsn2);
$n3_rsn3 = "0";
if (isset($n3)) {
$n3_rsn3 = (get_magic_quotes_gpc()) ? $n3 : addslashes($n3);
}
mysql_select_db($database_oa, $oa);
$query_rsn3 = sprintf("SELECT nombre, tooltip FROM nivel3 WHERE idnivel3=%s", $n3_rsn3);
$rsn3 = mysql_query($query_rsn3, $oa) or die(mysql_error());
$row_rsn3 = mysql_fetch_assoc($rsn3);
$totalRows_rsn3 = mysql_num_rows($rsn3);
$n4_rsn4 = "0";
if (isset($n4)) {
$n4_rsn4 = (get_magic_quotes_gpc()) ? $n4 : addslashes($n4);
}
mysql_select_db($database_oa, $oa);
$query_rsn4 = sprintf("SELECT nombre, tooltip FROM nivel4 WHERE idnivel4=%s", $n4_rsn4);
$rsn4 = mysql_query($query_rsn4, $oa) or die(mysql_error());
$row_rsn4 = mysql_fetch_assoc($rsn4);
$totalRows_rsn4 = mysql_num_rows($rsn4);
$cm_sabiasque = "0";
if (isset($cm)) {
$cm_sabiasque = (get_magic_quotes_gpc()) ? $cm : addslashes($cm);
}
mysql_select_db($database_oa, $oa);
$query_sabiasque = sprintf("select texto from sabias where idtema=%s ORDER BY rand() LIMIT 1 ", $cm_sabiasque);
$sabiasque = mysql_query($query_sabiasque, $oa) or die(mysql_error());
$row_sabiasque = mysql_fetch_assoc($sabiasque);
$totalRows_sabiasque = mysql_num_rows($sabiasque);
?>
<?
mysql_select_db($database_oa, $oa);
$query_rsContenido = ("SELECT nombre, tipo, enlace FROM $var_tabla, tipos WHERE idtipo = tipo and $var_campo=$cm");
$rsContenido = mysql_query($query_rsContenido, $oa) or die(mysql_error());
$row_rsContenido = mysql_fetch_assoc($rsContenido);
$totalRows_rsContenido = mysql_num_rows($rsContenido);
?>
<html>
<head>
<script type="text/javascript"
src="contador/tools/count.js">
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function mypopup()
{
window.open ('../libroverde.php','null', "height=800,width=600,status=yes,toolbar=no,menubar=no,location=no");
}
//-->
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function atlasa()
{
window.open ('../atlas.php','null', "height=600,width=600,status=yes,toolbar=no,menubar=no,location=no");
}
//-->
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<title>Observatorio Ambiental de Bogotá</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" rev="stylesheet" href="../css/enlaces.css" type="text/css" media="screen" charset="utf-8" />
<style type="text/css">
<!--
body {
background-image: url(imagenes/inicio/patron_fondo.gif);
margin-left: 0px;
margin-top: 10px;
margin-right: 0px;
margin-bottom: 10px;
}
-->
</style>
<?php
// PARA QUE INCLUYA ESTE ARCHIVO SOLO CUANDO EXISTA ELEMENTO DE NIVEL TRES (03)
// PARA PREVENIR ERROR JAVASCRIPT
if ($totalRows_rsnivel3 > 0) { // Show if recordset not empty ?>
<? include('efecto.php');?>
<?php } // Show if recordset not empty ?>
</head>
<body>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F7F7F7">
<tr>
<td height="20" colspan="2" background="imagenes/inicio/sup_01.jpg" bgcolor="#ECE9D8" class="blanco"><div align="right">| <a href="#">Mapa del Sitio</a> | <a href="#">Contáctenos</a> | </div></td>
</tr>
<tr>
<td height="100" colspan="2"><table width="100%" height="100" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="160"><img src="imagenes/inicio/sup_02.jpg" width="160" height="100"></td>
<td><img src="imagenes/inicio/00<?php echo $n1;?>.jpg" width="600" height="100"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30" colspan="2" bgcolor="#50A1C4"> <?php do { ?>
<style type="text/css">
<!--
.x<?php echo $row_rsnivel1['idnivel1']; ?> ul li a{
padding: 2px 0.5em;
text-decoration: none;
float: left;
color: #000000;
background-color: <?php echo $row_rsnivel1['colorbase']; ?>;
border: 2px solid <?php echo $row_rsnivel1['colorbase']; ?>;
}
.x<?php echo $row_rsnivel1['idnivel1']; ?> ul li a:hover{
background-color: <?php echo $row_rsnivel1['colordos']; ?>;
border-style: outset;
color: #000000;
}
-->
</style>
<div class="<?php echo $row_rsnivel1['estilo']; ?>">
<ul>
<li><a href="index.php?n1=<?php echo $row_rsnivel1['idnivel1']; ?>" title="<?php echo $row_rsnivel1['tooltip']; ?>"><?php echo $row_rsnivel1['nombre']; ?></a></li>
</ul>
</div>
<?php } while ($row_rsnivel1 = mysql_fetch_assoc($rsnivel1)); ?> <span class="blanco">
<?php require_once('../fechaesp.php'); ?>
<? echo " ".datacastella(time());?></span></td>
</tr>
<tr>
<td height="20" colspan="2" bgcolor="#E5E5E5"><?php do { ?>
<a href="index.php?n1=<? echo $n1?>&n2=<?php echo $row_rsnivel2['idnivel2']; ?>" class="donkey" ><?php echo $row_rsnivel2['nombre']; ?></a> <span class="titulo">|</span>
<?php } while ($row_rsnivel2 = mysql_fetch_assoc($rsnivel2)); ?></td>
</tr>
<tr>
<td height="35" colspan="2">
<? if ($numm==1){
$clase="final";
}else{
$clase="donkey";
}
?>
<a href="index.php?n1=<?php echo $n1; ?>" class="<? echo $clase?>" ><?php echo $row_rsn1['nombre']; ?></a> <?php if ($totalRows_rsn2 > 0) { // Show if recordset not empty ?>
<span class="titulo">|</span>
<? if ($numm==2){
$clase="final";
}else{
$clase="donkey";
}
?>
<a href="index.php?n1=<? echo $n1?>&n2=<? echo $n2?>" class="<? echo $clase?>"><?php echo $row_rsn2['nombre']; ?></a>
<?php } // Show if recordset not empty ?> <?php if ($totalRows_rsn3 > 0) { // Show if recordset not empty ?>
<span class="titulo">|</span>
<? if ($numm==3){
$clase="final";
}else{
$clase="donkey";
}
?>
<a href="index.php?n1=<? echo $n1?>&n2=<? echo $n2?>&n3=<? echo $n3?>" class="<? echo $clase?>"><?php echo $row_rsn3['nombre']; ?></a>
<?php } // Show if recordset not empty ?> <?php if ($totalRows_rsn4 > 0) { // Show if recordset not empty ?>
<span class="titulo">|</span>
<? if ($numm==4){
$clase="final";
}else{
$clase="donkey";
}
?>
<a href="index.php?n1=<? echo $n1?>&n2=<? echo $n2?>&n3=<? echo $n3?>&n4=<? echo $n4?>" class="<? echo $clase;?>"><?php echo $row_rsn4['nombre']; ?></a>
<?php } // Show if recordset not empty ?></td>
</tr>
<tr>
<td width="180" height="20" align="left" valign="top"><br/>
<br/> <?php if ($totalRows_rsnivel3 > 0) { // Show if recordset not empty ?>
<div class="suckerdiv">
<ul id="suckertree1">
<?php do { ?>
<li><a href="index.php?n1=<? echo $n1?>&n2=<? echo $n2?>&n3=<?php echo $row_rsnivel3['idnivel3']; ?>" >
<img src="imagenes/vin.gif" width="7" height="7" border="0"> <?php echo $row_rsnivel3['nombre']; ?></a>
<?php
$cual=$row_rsnivel3['idnivel3'];
$link = mysql_connect($hostname_oa, $username_oa, $password_oa);
mysql_select_db("oa", $link);
$result = mysql_query("select idnivel4, nombre from nivel4 where idnivel3=$cual order by orden", $link);
if ($row = mysql_fetch_array($result)){
echo "<ul>";
do {
echo "<li><a href='index.php?n1=$n1&n2=$n2&n3=".$cual."&n4=".$row["idnivel4"]."'><img src='imagenes/vin1.gif' width='7' height='7' border='0'> ".$row["nombre"]."</a></li>";
} while ($row = mysql_fetch_array($result));
echo "</ul>";
} else {
}
?>
<?php } while ($row_rsnivel3 = mysql_fetch_assoc($rsnivel3)); ?>
</li>
</ul>
</div>
<?php } // Show if recordset not empty ?></td>
<td width="580" rowspan="2" align="left" valign="top"><table width="95%" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td><?php if ($totalRows_rsnivel4 > 0) { // Show if recordset not empty ?>
<?php do { ?>
<a href="index.php?n1=<? echo $n1?>&n2=<? echo $n2?>&n3=<? echo $n3?>&n4=<?php echo $row_rsnivel4['idnivel4']; ?>" class="donkey"><?php echo $row_rsnivel4['nombre']; ?></a><span class="titulo">|</span>
<?php } while ($row_rsnivel4 = mysql_fetch_assoc($rsnivel4)); ?>
<?php } // Show if recordset not empty ?></tr>
<tr>
<td>
<table width="95%" border="0" align="left" cellpadding="0" cellspacing="0" bgcolor="#F7F7F7">
<tr>
<td><?
$destino =$row_rsContenido['enlace'];
include($destino);?> </td>
</tr>
</table> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="180" height="400" align="left" valign="top" class="titulo"><br/>
<?php if ($totalRows_sabiasque > 0) { // Show if recordset not empty ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="160" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#9999CC">
<tr>
<td><img src="imagenes/inicio/sabias.gif" alt="Sabías que..." width="160" height="30"></td>
</tr>
<tr>
<td class="sabias"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="sabias"><?php echo $row_sabiasque['texto']; ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<?php } // Show if recordset not empty ?>
<? if ($cm==1){ ?>
<br/>
<table width="180" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><a href="javascript: atlasa()"><img src="imagenes/inicio/atlas.gif" alt="Atlas ambiental de Bogotá" border="0"></a><br>
<br>
</td>
</tr>
<tr>
<td><a href="javascript: mypopup()"><img src="imagenes/inicio/libroverde.gif" alt="El libro verde de la oficina" border="0"></a></td>
</tr>
</table>
<? }
?>
<? if ($cm==2){ ?>
<br/><table width="180%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="textoNormal"><? //<p>Mapa interactivo<br/>descripción</p> ?></td>
</tr>
</table>
<? }
?> </td>
</tr>
<tr>
<td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="152" class="textoNormal"><div align="center"><a href="http://www.dama.gov.co" target="_blank"><img src="imagenes/inicio/damaweb.gif" alt="Departamento Técnico Administrativo del Medio Ambiente" width="150" height="40" border="0"></a></div></td>
<td width="152"><a href="http://horalegal.sic.gov.co/" target="_blank"><img src="imagenes/inicio/horalegal.jpg" alt="Hora Legal" width="150" height="41" border="0"></a></td>
<td width="152" class="textoNormal">
<div align="center"><a href="http://www.luchoinforma.gov.co/showalcaldenv.php" target="_blank"><img src="imagenes/inicio/luchoinforma.jpg" alt="Lucho Informa" width="150" height="34" border="0"></a></div></td>
<td width="152" class="textoNormal">
<div align="center"><a href="http://www.transitobogota.gov.co/" target="_blank"><img src="imagenes/inicio/sectransito.jpg" alt="Secretaría de Tránsito y Transporte Bogotá" width="150" height="38" border="0"></a></div></td>
<td width="152" class="textoNormal"><div align="center"><a href="http://www.saludcapital.gov.co/secsalud/" target="_blank"><img src="imagenes/inicio/secsalud.jpg" alt="Secretaría Distrital de Salud de Bogotá" width="150" height="39" border="0"></a></div></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2"><img src="imagenes/inicio/coda.jpg" alt="Pié de página" width="760" height="60"></td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($rsnivel1);
mysql_free_result($rsnivel2);
mysql_free_result($rsnivel3);
mysql_free_result($rsnivel4);
mysql_free_result($rsn1);
mysql_free_result($rsn2);
mysql_free_result($rsn3);
mysql_free_result($rsn4);
mysql_free_result($sabiasque);
?>
|