Viewing file: Copia de index.php (9.78 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;
}else if (!isset($n4)&& isset($n3)){
$cm = $n3;
}else if (!isset($n4)&& !isset($n3) && isset($n2)){
$cm = $n2;
}else{
$cm = $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, 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", GetSQLValueString($n1_rsnivel2, "-1"));
$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", GetSQLValueString($n2_rsnivel3, "-1"));
$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", GetSQLValueString($n1_rsn1, "-1"));
$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", GetSQLValueString($n2_rsn2, "int"));
$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", GetSQLValueString($n3_rsn3, "int"));
$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", GetSQLValueString($n4_rsn4, "int"));
$rsn4 = mysql_query($query_rsn4, $oa) or die(mysql_error());
$row_rsn4 = mysql_fetch_assoc($rsn4);
$totalRows_rsn4 = mysql_num_rows($rsn4);
?>
<?
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>
<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);
}
-->
</style></head>
<body leftmargin="0" topmargin="15" marginwidth="0" marginheight="15">
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F5F5F5">
<tr>
<td height="112"><img src="imagenes/inicio/cabezal.jpg" width="760" height="112"></td>
</tr>
<tr>
<td height="30" 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']; ?>"><?php echo $row_rsnivel1['nombre']; ?></a></li>
</ul>
</div>
<?php } while ($row_rsnivel1 = mysql_fetch_assoc($rsnivel1)); ?>
</td>
</tr>
<tr>
<td height="20" bgcolor="#D4D4D4">
<?php do { ?>
<a href="index.php?n1=<? echo $n1?>&n2=<?php echo $row_rsnivel2['idnivel2']; ?>" class="donkey" ><?php echo $row_rsnivel2['nombre']; ?></a> |
<?php } while ($row_rsnivel2 = mysql_fetch_assoc($rsnivel2)); ?></td>
</tr>
<tr>
<td height="35" align="left" valign="middle" class="titulo"><a href="index.php?n1=<?php echo $n1; ?>" class="donkey" ><?php echo $row_rsn1['nombre']; ?></a>
<?php if ($totalRows_rsn2 > 0) { // Show if recordset not empty ?>
| <a href="index.php?n1=<? echo $n1?>&n2=<? echo $n2?>" class="donkey" ><?php echo $row_rsn2['nombre']; ?></a>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_rsn3 > 0) { // Show if recordset not empty ?>
| <a href="index.php?n1=<? echo $n1?>&n2=<? echo $n2?>&n3=<? echo $n3?>" class="donkey"><?php echo $row_rsn3['nombre']; ?></a>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_rsn4 > 0) { // Show if recordset not empty ?>
| <a href="index.php?n1=<? echo $n1?>&n2=<? echo $n2?>&n3=<? echo $n3?>&n4=<? echo $n4?>" class="donkey"><?php echo $row_rsn4['nombre']; ?></a>
<?php } // Show if recordset not empty ?></td>
</tr>
<tr>
<td height="225" align="left" valign="top">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="180" align="left" valign="top">
<?php do { ?>
<?php if ($totalRows_rsnivel3 > 0) { // Show if recordset not empty ?>
<a href="index.php?n1=<? echo $n1?>&n2=<? echo $n2?>&n3=<?php echo $row_rsnivel3['idnivel3']; ?>" class="donkey"><?php echo $row_rsnivel3['nombre']; ?></a>
<?php } // Show if recordset not empty ?>
<br>
<?php } while ($row_rsnivel3 = mysql_fetch_assoc($rsnivel3)); ?>
</td>
<td align="left" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="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> |
<?php } while ($row_rsnivel4 = mysql_fetch_assoc($rsnivel4)); ?>
<?php } // Show if recordset not empty ?> </td>
</tr>
<tr>
<td><?
$destino =$row_rsContenido['enlace'];
include($destino);
?></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="imagenes/inicio/coda.jpg" width="760" height="60"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td></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);
?>
|