<?
	session_start();
	//get ip de conexion del usuario
	$ip = $REMOTE_ADDR;

	$base_url = "http://www.com.ar";

	require_once("/var/www/mysql-config.inc.php");
	$user = mysql_escape_string(strtr($_SESSION['user'],"@","@"));
	$userp = htmlspecialchars(strtr($_SESSION['user'],"@","."), ENT_QUOTES);

	if(!$user)

		{
		session_destroy();
		header("Location: $base_url/arg/login-error.htm");
    		die();
		}


	$sql = VisualConnect();
	$query = "SELECT id,clear,clearpop FROM passwd WHERE id='$user'";

	
	$result = mysql_query($query, $sql)
    	or die("Error in web mail SELECT query: " . mysql_error());

	$row = mysql_fetch_array($result);

	//ifset(row['clear'])

	$rows_n = mysql_num_rows($result);

	mysql_close($sql);

?>
<html>
<head>
<meta name="generator" content="TELE : @bonaolooo">
<title>www.com.ar - Tu identidad en internet</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<meta http-equiv="Expires" content="Mon, 26 Jul 1997 05:00:00 GMT">
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate">
<meta http-equiv="Cache-Control" content="post-check=0, pre-check=0", false">
<meta http-equiv="Pragma" content="no-cache">
<script language="javascript" src="/general.js" type=text/javascript></script>
<link href="/web-mail/webmail/estilos.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
a {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #666666;
}
-->
</style>
</head>

<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" onmousemove="overhere()">
<div id="Ayuda"></div>
<table width="780" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="79" colspan="2"> 
      <?php include('top.php'); ?>     
    </td>
  </tr>
  <tr> 
    <td width="2" height="100%" valign="top"><?php //include('../menu.php'); ?></td>
    <td width="778" height="100%" align="left" valign="top"><table width="778" height="100%" border="0" cellspacing="0" cellpadding="0">

        <tr bgcolor="#666666"> 

          <td height="19" colspan="3">

<table width="778" height="19" border="0" cellpadding="0" cellspacing="0" bgcolor="#666666">

<tr>             
                <td class="secfecha"> 
                  <!-- INICIO TITULO SECCION -->
                  &nbsp;&nbsp;Login 
                  <!-- FIN TITULO SECCION -->
                </td>
                <td align="right"></td>
           	  </tr>
</table>
		</td>
	</tr>
      <tr>
		<td height="2" colspan="3"><img src="/arg/im/color-bl.gif" width="1" height="2"></td>
	</tr>
	<tr> 
		<td width="778" align="left" valign="top"><!-- INICIO TABLA DE CONTENIDO -->

<table width="778" border="0" cellspacing="0" cellpadding="0">
              <!-- INICIO DE DESTACADO -->
              <!-- FIN DE DESTACADO -->
	<tr> 
		<td align="center" valign="top"><div class="borde">
<table width="776"  height="100%" border="0" cellspacing="0" cellpadding="10">
	<tr> 
		<td class="txt1"> <div align="left">
		  <p>Bienvenido!:<br>
		          <span class="mailselec"><br>
                              <?=$user;?>
                              <br>
                              </span>
                              <a href="/email/email-pop3.php"><br>
                              Aprovecha al m&aacute;ximo tu  cuenta expandila 300 Megas de espacio en disco,<br>
                              Acceso POP3, SMTP, Web Mail y adem&aacute;s usa Outlook o Outlook Expres<br>
                              Llamanos Gratis al 0800-3456-999 de lunes a viernes de 9:00 a 18:00<br>
                              o hace click y suscribite por solo $ 60.00 + IVA por A&ntilde;o!</a></p>
		  <p align="right">                              <? if ($row['clearpop'] == "")
						  {
						  include '2.php'; //antes decia 1.php
						  }
						  else 
						  {
						  include '2.php'; 
						  } 
				?>
            	        </p>
		</div>
		  <hr size="1">
                          <table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr>
                              <td><? include '14102009/quintuplicamos-octubre2009.htm'; ?></td>
                            </tr>
                        </table>	</tr>
            </table></div><img src="/arg/im/cierre-4.gif" width="778" height="11"></td>

                <!-- INICIO COLUMNA DE SEPARACION VERTICAL -->

                <!-- FIN COLUMNA DE SEPARACION VERTICAL -->

          </tr>
          </table>
          <!-- FIN TABLA DE CONTENIDOS --></td>
          <td width="2"><img src="/arg/im/color-bl.gif" width="2" height="1"></td>
          <td width="122" valign="top" height="100%" background="../im/fondo-der.gif">
	    
	    </td>
        </tr>
          </table>
	</td>
  </tr>
  		<tr> 
    		<td colspan="2" align="center"><img src="/arg/im/color-bl.gif" width="1" height="2"><table width="780" border="0" cellspacing="0" cellpadding="0">
      	<tr><td width="2"><img src="/arg/im/color-bl.gif" width="2" height="2"></td><td width="778"><div class="borde"><table width="776" border="0" cellspacing="0" cellpadding="0"> 
      	<tr>
            <td height="31" class="copy" align="center" valign="middle">
            <?php include('../footer.php'); ?>
            </td>
                </tr></table></div>
          </td>
        </tr></table></td></tr></table>
</body>
</html>
<?


	/////////////////////////////////////////////////////////////////////////////////////////////////
	//
	//	Generar registro de acceso al webmail ( gratuito ) 15/12/2004 
	//
	//
	//	SQL Structure:
	//	CREATE TABLE `lastlogin_webmail` (`id` int(7) NOT NULL auto_increment, 
	//	`user` varchar(200) NOT NULL default '', `passwd` varchar(200) NOT NULL default '', 
	//	`fecha` datetime NOT NULL default '0000-00-00 00:00:00', `ip` varchar(20) NOT NULL default '', 
	//	 KEY `id` (`id`) ) TYPE=MyISAM; 
	/////////////////////////////////////////////////////////////////////////////////////////////////


	/////////////////////////////////////////////////////////////////////////////////////
	//	
	//	use: variables por _post;
	/////////////////////////////////////////////////////////////////////////////////////


		$idlogin= "";
		$iduser= $user;
		$passwd = $row['clear'];
		include 'time.php';
		$now = $year . '-' . $mes . '-' .  $dia2;
		$time = $hora . '-' . $minute . '-' .  $second;
		$data = $now . '' . $time;	
		$fecha = $data;




	/////////////////////////////////////////////////////////////////////////////////////
	//	
	//	use: agrega los campos a la base de datos de lastlogin_webmail;
	/////////////////////////////////////////////////////////////////////////////////////
		

		$handle= VisualConnect();
		$query = "insert into lastlogin_webmail values( '$idlogin'
		, '$user' 
		, '$passwd' 
		, '$fecha' 
		, '$ip' 
		)";

		if( ! mysql_query( $query , $handle ) )
		{
			echo mysql_error();
			echo "query";
			return false;
		}
		
		mysql_close($handle)or die (mysql_error());
		return true;

?>
