<?php
   session_start();
?>
<html>
<head>
  <title>BIENVENID@ A SIGEDU v1.1</title>
<style type="text/css">
<!--
#apDiv1 {
	position:absolute;
	left:26px;
	top:13px;
	width:653px;
	height:59px;
	z-index:1;
}
#apDiv2 {
	position:absolute;
	left:828px;
	top:14px;
	width:287px;
	height:27px;
	z-index:2;
}
#apDiv3 {
	position:absolute;
	left:201px;
	top:82px;
	width:750px;
	height:365px;
	z-index:2;
}
#apDiv4 {
	position:absolute;
	left:209px;
	top:88px;
	width:746px;
	height:469px;
	z-index:2;
}
-->
</style>
</head>
<body>
<p><br>
  <br>
  <?php   
	// Fecha y hora
	$hoy=date("d-m-Y H:i:s");
	echo "Hora de acceso: ".$hoy."<br>";
  
   //Recupero la variable a través de la session
   //$basededatos = $_SESSION["bdd"];
  
   
    
   $ip = $_SERVER['REMOTE_ADDR']."<br>";
   echo "Su direcci&oacute;n IP es: $ip";
   
   //Archivo de conexión
   include("data/conecta.php");
   //echo "Se ingresa a conexion <br>";   
   mysql_select_db($basededatos,$conexion) or die("Error al conectar a la base de datos: ".mysql_error());  
   
   $sql = mysql_query("select nombre1,nombre2,apellido1,apellido2 from usuarios",$conexion);
   $fila = mysql_num_rows($sql);
   
   if (!empty($fila)){
	   while ($row = mysql_fetch_array($sql)){
			$nom1 = $row["nombre1"];
			$nom2 = $row["nombre2"];
			$ape1 = $row["apellido1"];
            $ape2 = $row["apellido2"];   
		   }
	   }
   
   
   echo "<div id='apDiv2'>";
    echo "En sesi&oacute;n: ".$nom1." ".$nom2." ".$ape1." ".$ape2;
   echo "</div>";
   
   $_SESSION['nom1'] = $nom1;
   $_SESSION['nom2'] = $nom2;
   $_SESSION['ape1'] = $ape1;
   $_SESSION['ape2'] = $ape2;

    // Bloque para auditoria
	$sql2 = mysql_query("insert into auditoria values('NULL','$usuario','Panel Principal','Ingresa a Panel Principal','$hoy','$ip') from usuarios",$conexion);
	$fila2 = mysql_fetch_array($sql);

   
   // cierre de conexión
   mysql_close($conexion);
?>

<a href="instituciones.html" target="_self">Instituci&oacute;n</a>


</body>
</html>
