<?php 
    
// 1. Acceso por usuario
    
$usuario = isset($user);
    if (
$usuario == false) {
        
$user "guest";
        
    }

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>mi Ambiente</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
#portada{
    padding:10px; 
    color:#333333;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    text-transform: none;
    font-size: 12px;
    font-style: normal;
    line-height: normal;
    font-weight: bold;
    font-variant: normal;
    color: #000004;
    
    text-align: justify;
    border-left:1px solid #FFCC00;
    border-right:1px solid #274770;
    border-top:5px solid #FFCC00;
    border-bottom:1px solid #274770;}

body,td,th {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    color: #000000;
}
body {
    background-color: #333333;
}
.Estilo5 {
    color: #FFFFFF;
    font-weight: bold;
}
a:link {
    color: #333333;
    text-decoration: none;
}
a:visited {
    color: #333333;
    text-decoration: none;
}
a:active {
    color: #FF3300;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
.Highlight {background-color:#999999}
.Normal{background-color:#666666}
.Estilo48 {font-size: 18}
.Estilo49 {font-size: 12px}
.Estilo54 {font-family: Verdana, Arial, Helvetica, sans-serif}
.Estilo55 {font-size: 12}
.style1 {color: #999999}
input {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    color: #666666;
    background-color: #F3F3F3;
    border: 1px solid #33CCFF;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--

function NewWindowfull(mypage,myname,settings){
w = screen.width-5;
h = screen.height-55;
settings ='height='+h+',width='+w+',top=0,left=0,scrollbars=yes,resizable=yes'
win = window.open(mypage,myname,settings)
}

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];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<style type="text/css">
<!--
.tabla1 {
    border: 1px none #CCCCCC;
}
.style3 {
    font-size: 14px;
    font-weight: bold;
}
.style4 {color: #333333}
.style8 {font-size: 10px}
-->
</style>
</head>
<body onLoad="MM_preloadImages('imadam/inicio7.jpg')">
<div align="center"> </div>

<p align="center"><a href="reqintranet.php"><img src="images/top2008.jpg" alt="el ambiente no es un contenedor es un proceso" name="Image3" width="760" height="100" border="0"></a> 
<div align="center">
  <table width="760" border="0" cellpadding="1" cellspacing="0">
    <tr bgcolor="#666666"> 
      <td width="65" bgcolor="#FFCC00"><div align="center" class="Estilo56">INICIO</div></td>
      <td width="75" bgcolor="#666666" class="Normal" onmouseover="this.className='Highlight'" onmouseout="this.className='Normal'"> 
        <div align="center"><a href="reqnoticias2.php?user=<?php echo $user?>"><span class="Estilo56"><font color="#FFFFFF">NOTICIAS</font></span></a></div></td>
      <td width="78" bgcolor="#666666" class="Normal" onmouseover="this.className='Highlight'" onmouseout="this.className='Normal'"><div align="center"><a href="reqsistemasform2.php?user=<?php echo $user?>"><span class="Estilo56"><font color="#FFFFFF">SOPORTE</font></span></a></div></td>
      <td width="102" bgcolor="#666666" class="Normal" onmouseover="this.className='Highlight'" onmouseout="this.className='Normal'"><div align="center"><a href="reqlegis.php?user=<?php echo $user?>"><span class="Estilo56"><font color="#FFFFFF">LEGISLACI&Oacute;N</font></span></a></div></td>
      <td width="90" bgcolor="#666666" class="Normal" onmouseover="this.className='Highlight'" onmouseout="this.className='Normal'"><div align="center"><a href="reqdamaweb.php?user=<?php echo $user?>"><span class="Estilo56"><font color="#FFFFFF">WEB 
          SDA</font> </span></a></div></td>
      <td width="81" bgcolor="#666666" class="Normal" onmouseover="this.className='Highlight'" onmouseout="this.className='Normal'"><div align="center"><a href="reqlinks.php?user=<?php echo $user?>"><span class="Estilo56"><font color="#FFFFFF">LINKS</font> 
          </span></a></div></td>
      <td width="78" bgcolor="#666666" class="Normal" onmouseover="this.className='Highlight'" onmouseout="this.className='Normal'"><div align="center"><a href="reqindice.php?user=<?php echo $user?>"><span class="Estilo56"><font color="#FFFFFF">INDICE</font></span></a></div></td>
    </tr>
  </table>
</div>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="760">
  <tbody>
    <tr bgcolor="#FFFFFF"> 
      <td bgcolor="#FFCC00" height="8"></td>
    </tr>
  </tbody>
</table>
<table width="760" height="276" border="0" align="center" cellpadding="0" cellspacing="20" bgcolor="#990000">
  <tr> 
    <td width="511" valign="top" bordercolor="#FFCC00" bgcolor="#FFFFFF">
<div align="center"> 
        <table border="0" cellpadding="0" cellspacing="0" width="511">
          <tbody>
            <tr>
              <td height="10" valign="bottom"><a href="/sig/"><img src="banner_meci.jpg" alt="Sistema Integrado de Gesti&oacute;n - Click para ver mas informaci&oacute;n" width="510" height="120" border="0"></a></td>
            </tr>
            <tr> 
              <td height="10" valign="bottom" width="511">&nbsp;</td>
            </tr>
          </tbody>
        </table>
        <table border="0" cellpadding="8" cellspacing="0" width="100%">
          <tbody>
            <?php
            
require('conexion3.php');
            
$hora getdate();
            
$yr $hora["year"];
            
$mo $hora["mon"];
            
$dy $hora["mday"];
            
            
$mo $mo 100;
            
$yr $yr 2000;
            
$yr $yr 10000;
            
$fc $mo $yr;
            
$fc1 $fc 100;
            
//$fc = $mo + $yr + $dy;
            
$consul "SELECT *
            FROM news where cat=9"
            
" order by fecha DESC, id DESC limit 0,2";
            
$result mysql_query($consul,$db);
            
$num_filas mysql_num_rows($result);
            while (
$myrow mysql_fetch_array($result))
            {
            
$idacc1 $myrow["id"];
            
$descriacc1 $myrow["descri"];
            
$descriacc1 str_replace("\n""<br>"$descriacc1);
            
$catacc1 $myrow["cat"];
            
$files $myrow["fichero"];
            
$titularacc1 $myrow["titular"];
            
$foro $myrow["comments"];
            
$veri1 substr_count($titularacc1"(f)");
            if (
$veri1 == 1) {
            
// Función de Compresión de la Imagen
            
$opend 'c:\maps\tumbs';
            @
$opend_result mkdir ($opend 0777);
            
$v1 $files;
            
// Extrae el verdadero nombre del archivo
            
$pos strrpos($v1"/");
            
$rest substr($v1$pos+1);
            
$sz 100;
            
            
$size GetImageSize("c:/maps/tumbs/".$rest); 
            
$an $size[0];
            
$la $size[1];
            
$ty $size[2];
            
$an1 round($an);
            
$la1 round($la);
            
            if (
$an $la) {
            
$la $la $sz;
            
$la $la $an;
            
$an $sz;
            }
            if (
$la $an) {
            
$fc $an $sz;
            
$an $sz;
            
$la $la $fc;
            }
            if (
$la == $an) {
            
$an $sz;
            
$la $sz;
            }
            
            
$pos strpos($v1"/");
            
$n_file substr($v1$pos);    
            
            
$copyfile "c:/maps/tumbs/images/".$rest;
            
$original_file ="c:/maps/tumbs/".$rest;
            
copy($original_file $copyfile);
            
$dest "c:\maps\\recipiente.jpg";
            
            if (
$ty == 1) {
                
$img_src=imagecreatefromgif("c:/maps/tumbs/".$rest);
            }
            if (
$ty == 2) {
                
$img_src=imagecreatefromjpeg("c:/maps/tumbs/".$rest);
            }
            
            
$img_dst=imagecreatetruecolor($an,$la);
            
imagecopyresampled($img_dst$img_src0000$an$la$an1$la1);
            
$dest "c:/maps/tumbs/images/".$rest.".jpg";
            
imagejpeg($img_dst$dest100);
            
// Fin de la Función de Compresión de la Imagen
            
?>
            <tr> 
              <td width="22%" valign="top" bgcolor="#FFFFFF"> <div align="center"><img src="images2/<?php echo $rest?>.jpg"></div></td>
              <td width="78%" valign="top" bgcolor="#ffffff"> <p align="justify"><a href="requirenew3.php?id=<?php echo $idacc1?>&user=<?php echo $user?>" style="color:#006699"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#003399"><strong><?php echo $titularacc1?></strong></font></a><strong> 
                  </strong></p>
                <p align="left"><?php echo $descriacc1?></p>
                <?php if ($foro == 1) { ?>
                <p align="left"><font color="#006699"><a href="requirenew3.php?id=<?php echo $idacc1?>&user=<?php echo $user?>#uno">Comentar 
                  este tema...</a></font> <font face="Arial, Helvetica, sans-serif">I</font> 
                  <font color="#006699"><a href="requirenew3.php?id=<?php echo $idacc1?>&user=<?php echo $user?>#dos">Comentarios 
                  sobre este tema...</a></font></p>
                <?php ?>
              </td>
            </tr>
            <?php }else{ ?>
            <tr> 
              <td colspan="2" valign="top" bgcolor="#FFFFFF"> <div align="left"><a href="requirenew3.php?id=<?php echo $idacc1?>&user=<?php echo $user?>" style="color:#006699"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong><?php echo $titularacc1?></strong></font></a><strong> 
                  </strong></div>
                <p align="left"><?php echo $descriacc1?></p>
                <?php if ($foro == 1) { ?>
                <p align="left"><font color="#006699"><a href="requirenew3.php?id=<?php echo $idacc1?>&user=<?php echo $user?>#uno">Comentar 
                  este tema...</a></font> <font face="Arial, Helvetica, sans-serif">I</font> 
                  <font color="#666666"><a href="requirenew3.php?id=<?php echo $idacc1?>&user=<?php echo $user?>#dos">Comentarios 
                  sobre este tema...</a></font></p>
                <?php ?>
                <p>-</p></td>
            </tr>
            <?php }} ?>
            <tr bgcolor="#CCCCCC"> 
              <td height="90" colspan="2" valign="top" bgcolor="#FFFFFF" align="left"> 
                <a href="#" onClick="NewWindowfull('http://192.168.10.3/manual_funciones/','','');"><img src="/dama/libreria/gif/manualfunciones.gif" width="470" height="83" hspace="4" vspace="6" border="0" align="left"></a></td>
            </tr>
            <tr bgcolor="#FFFFFF"> 
              <td height="90" colspan="2" valign="top" align="left">
<p><img src="bullet.gif" alt="" width="8" height="8" hspace="2"><span class="style3">Manual 
                  de Procesos y Procedimientos</span> (Documentos obsoletos)<br>
                  <img src="/dama/libreria/gif/winzip1.gif" width="39" height="39" hspace="4" vspace="6" align="left"> 
                  <span class="style4">Archivo en formato ZIP<br>
                  Tama&ntilde;o aproximado : 81.3 MB</span> (Actualizaci&oacute;n 
                  septiembre 17 de 2008)<br>
                  <a href="/sig/documentos/OBSOLETOS_MARZO_9-09.zip" style="color:#0066CC"><strong>( 
                  Click para descargar )</strong></a></p></td>
            </tr>
            <tr> 
              <td colspan="2" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
            </tr>
          </tbody>
        </table>
      </div></td>
    <td width="180" valign="top" bordercolor="#FFCC00" bgcolor="#CCCC99"> 
      <div align="center"> 
        <form name="form1" method="post" action="requireval1.php">
          <table width="100%" border="0" cellspacing="0" cellpadding="6">
            <tr bgcolor="#99CCCC"> 
              <td> <div align="left"><font color="#000000"><span class="Estilo48">APLICACIONES</span></font><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><span class="Estilo48"> 
                  <strong> 
                  <?php if ($user != "guest") { echo $user; } ?>
                  </strong></span></font></div></td>
            </tr>
            <tr align="left"> 
              <td>
              <?php if ($user == "guest") { ?>
              <div id="Layer2" style="position:absolute; width:170px; height:99px; z-index:2">
                  <form name="form1" method="post" action="requireval1.php"> 
                    
                <table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#C0C081">
                  <tr> 
                    <td><font color="#333333">Usuario:</font></td>
                    <td><input name="user" type="text" id="user" size="15"></td>
                  </tr>
                  <tr> 
                    <td><font color="#333333">Clave:</font></td>
                    <td><input name="pass" type="password" id="pass2" size="10">
                    </td>
                  </tr>
                  <tr align="center"> 
                    <td colspan="2"> 
                      <input type="submit" name="Submit" value="Ingresar">
                    </td>
                  </tr>
                </table>
                    </form>
                </div>
                    <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p></p><?php ?>
                <?php
              
// 1. Si el usuario no es validado no muestre la capa
              
$user strtolower($user);
              if (
$user != "guest") { 
              
?>
              <div id="Layer1" style="position:absolute; width:170px; height:55px; z-index:1; overflow: auto; background-color: #CCCC99; layer-background-color: #CCCC99; border: 1px none #000000; visibility: visible;"> 
                <strong> 
                <?php
                
require('conexion.php');
                    
$consul "SELECT *
                    FROM usrs where user='
$user'"
                    
" order by aplyid";
                    
$result mysql_query($consul,$db);
                    
$num_filas mysql_num_rows($result);
                    while (
$myrow mysql_fetch_array($result))
                    {
                    
$aaply $myrow["aplyid"];
                    
$consula "SELECT *
                    FROM aplica where id='
$aaply'";
                    
$resulta mysql_query($consula,$db);
                    
$num_filasa mysql_num_rows($resulta);
                    while (
$myrowa mysql_fetch_array($resulta))
                    {
                    
$one $myrowa["nombre"];
                    
$dos $myrowa["label"];
                    
$tre $myrowa["link"];
                    }
                    
$xsi $one "/" $dos;
                    
$user strtoupper($user);
                    
?>
                </strong> 
                <strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><a href="<?php echo $tre?>?user=<?php echo $user?>"><font color="#666666">> 
                    <?php echo $dos?></font></a></font><br>
                    <?php
                
}
                
?>
                </strong></div>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p></p>
                <?php ?>
              </td>
            </tr>
          </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="6">
          <tr> 
            <td bgcolor="#CCCC99" height="10"></td>
          </tr>
          <tr> 
            <td align="center" bgcolor="#CCCC99"><a href="/php/reqapp.php?user=guest" title='Aplicaciones administrativas y financieras'><img src="apps.gif" alt='Aplicaciones administrativas y financieras' width="157" height="57" border="0"></a></td>
          </tr>
          <tr>
            <td align="center" bgcolor="#CCCC99"><p><strong><font color="#00CC66" size="2"><a href="http://192.168.168.23:81/Default.htm">Red 
                de Monitoreo de Calidad del Aire de Bogot&agrave; </a></font></strong></p>
              <p><a href="http://192.168.168.23:81/Default.htm"><strong><font color="#00CC66" size="2">IBOCA</font></strong></a></p></td>
          </tr>
          <tr> 
            <td align="center" bgcolor="#CCCC99"><a href="/concurso_calidad/" title='Concurso de Calidad - MECI'><img src="imadam/certificacion.gif" alt='Concurso de Calidad - MECI' width="157" height="57" border="0"></a></td>
          </tr>
          <?php
                
require('conexion3.php');
                
$consul "SELECT *
                FROM clasificados order by fecha DESC limit 0,2"
;
                
$result mysql_query($consul,$db);
                
$num_filas mysql_num_rows($result);
                  while (
$myrow mysql_fetch_array($result))
                {
                
$tid $myrow["id"];
                
$tit $myrow["titulo"];
                
$tex $myrow["texto"];
                
$fec $myrow["fecha"];
                
?>
          <?php ?>
          <tr> 
            <td align="center"><a href="/biblioteca" title='Noticiero Virtual de la Red de Comunicación Interna del Distrito' target="_blank"><img src="/images/boton.jpg" alt='Biblioteca Virtual del recurso h&iacute;drico' width="157" height="57" border="0"></a></td>
          </tr>
          <tr> 
            <td align="center"><a href="/php/reqcapacitacion.php" title='Noticiero Virtual de la Red de Comunicación Interna del Distrito'><img src="images/2.gif" alt='Registro' width="157" height="57" border="0"></a></td>
          </tr>
          <tr> 
            <td align="center"> <a href="http://www.bogota.gov.co/amarillorojo/" target='_blank' title='Noticiero Virtual de la Red de Comunicación Interna del Distrito'><img src="images/amarillo.jpg" alt='Noticiero Virtual de la Red de Comunicación Interna del Distrito' width="157" height="57" border="0"></a></td>
          </tr>
          <tr> 
            <td align="center"><a href="/php/reqpot.php"><img src="images/pot.jpg" alt='Plan de Ordenamiento Territorial' width="157" height="57" border="0"></a></td>
          </tr>
          <tr> 
            <td align="center"><a href="http://www.secretariadeambiente.gov.co">P&aacute;gina 
              web Secretar&iacute;a Distrital de Ambiente<br>
              <br>
              <img src="webdama.jpg" alt="Visite www.secretariadeambiente.gov.co" width="150" height="121" border="0"> 
              </a></td>
          </tr>
          <tr> 
            <td align="center"><a href="/resoluciones/" target="_blank"><img src="imadam/resol.jpg" alt="Resoluciones SDA" width="161" height="50" border="0"></a></td>
          </tr>
        </table>
      </div></td>
  </tr>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="760">
  <tbody>
    <tr bgcolor="#003399"> 
      <td width="544" bgcolor="#FFCC00"><div class="Estilo14 style1" align="center"></div></td>
      <td bgcolor="#FFCC00" width="216"><div align="center"> 
          <p><img src="midama3_files/bogsin1yellow_sml.jpg" width="120" height="44"></p>
        </div></td>
    </tr>
  </tbody>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="760">
  <tbody>
    <tr bgcolor="#003399"> 
      <td bgcolor="#ffcc00" width="545"><div align="center"></div></td>
      <td bgcolor="#FFCC00" width="215">&nbsp;</td>
    </tr>
  </tbody>
</table>
<table width="760" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#666666">
  <tr bgcolor="#2656A2"> 
    <td width="65" bgcolor="#FFCC00"><div align="center" class="Estilo56"><a href="#">INICIO</a></div></td>
    <td width="75" bgcolor="#2656A2" class="Estilo56" onmouseover="this.className='Highlight'" onmouseout="this.className='Estilo56'"><div align="center"><a href="reqnoticias2.php?user=<?php echo $user?>"><span class="Estilo56"><font color="#FFFFFF">NOTICIAS</font></span></a></div></td>
    <td width="78" bgcolor="#2656A2" class="Estilo56" onmouseover="this.className='Highlight'" onmouseout="this.className='Estilo56'"><div align="center"><a href="reqsistemasform2.php?user=<?php echo $user?>"><span class="Estilo56"><font color="#FFFFFF">SOPORTE</font></span></a></div></td>
    <td width="102" bgcolor="#2656A2" class="Estilo56" onmouseover="this.className='Highlight'" onmouseout="this.className='Estilo56'"><div align="center"><a href="reqlegis.php?user=<?php echo $user?>"><span class="Estilo56"><font color="#FFFFFF">LEGISLACI&Oacute;N</font></span></a></div></td>
    <td width="90" bgcolor="#2656A2" class="Estilo56" onmouseover="this.className='Highlight'" onmouseout="this.className='Estilo56'"><div align="center"><a href="reqdamaweb.php?user=<?php echo $user?>"><span class="Estilo56"><font color="#FFFFFF">WEB 
        SDA </font> </span></a></div></td>
    <td width="81" bgcolor="#2656A2" class="Estilo56" onmouseover="this.className='Highlight'" onmouseout="this.className='Estilo56'"><div align="center"><a href="reqlinks.php?user=<?php echo $user?>"><span class="Estilo56"><font color="#FFFFFF">LINKS</font> 
        </span></a></div></td>
    <td width="78" bgcolor="#2656A2" class="Estilo56" onmouseover="this.className='Highlight'" onmouseout="this.className='Estilo56'"><div align="center"><a href="reqindice.php?user=<?php echo $user?>"><span class="Estilo56"><font color="#FFFFFF">INDICE</font></span></a></div></td>
  </tr>
</table>
<p>&nbsp;</p>
</body></html>