<?php
	$conexion = mysql_connect('localhost','psycom_admin','psycom1021');
	mysql_select_db('psycom_users', $conexion);
	
	$nombre = $_POST['nombre'];
	$password = $_POST['password'];
	$apellidos = $_POST['apellidos'];
	$usuario = $_POST['usuario'];
	$acceso = $_POST['acceso'];
	
	if($_POST['usuario'] == 'admin' && $_POST['password'] == 'admin')
		echo "<script> window.location='http://www.psycom.com.mx/login/registro.php?x=1';</script>";
	
	if($_POST['opcion'] == 'registro'){
		$date = date('Y-m-d');
		mysql_query("insert into usuarios VALUES('','{$_POST['nombre']}','{$_POST['apellidos']}','{$_POST['usuario']}','{$_POST['password']}','{$date}','0000-00-00','')");
		echo "<script> window.location='http://www.psycom.com.mx/login/registro.php?x=1';</script>";
	}

		$qry = mysql_query("SELECT usuario, password FROM usuarios where usuario = '$usuario' and password = '$password'");
		
		$x = mysql_fetch_array($qry);
		if($x['usuario'] != $usuario || $x['password'] != $password)
			echo "<script>alert('El usuario o contraseņa no coninciden');
			window.location='http://www.psycom.com.mx/login/';</script>";
		else{
		$date = date('Y-m-d');
		mysql_query("UPDATE usuarios SET fecha_ingreso = '{$date}', acceso = '{$acceso}' where usuario = '$usuario' and password = '$password'");
?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>..::::..Psycom..::::..</title>
<script type="text/JavaScript">
<!--
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_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_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>
<style type="text/css">
<!--
.titulo_bco {color: #FFFFFF; font-family: Verdana; font-size:14px;}
.titulo {color: #125DA5; font-family: Verdana; font-size:15px; font-weight:bold;} 
.Estilo2 {color: #FFFFFF; font-family: Verdana; font-size: 14px; font-weight: bold; }
.text {color: #333347; font-family: Verdana; font-size:12px;}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" onload="MM_preloadImages('../img/enlinea2.jpg','../img/psyenlinea2.jpg','../img/web2.jpg','../img/tress2.jpg','../img/klyma2.jpg','../img/placevalue2.jpg','../img/owl2.jpg','../img/quie1.jpg','../img/mis1.jpg','../img/vis1.jpg','../img/val1.jpg','../img/aquie2.jpg','../img/ventajas2.jpg')">
<center>
	<table width="195" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td bgcolor="#135da6" align="center" height="30"><span class="Estilo2">EVALUACIONES</span></td>
		</tr>
		<tr>
			<td><a href="http://189.163.78.198:8082/portaliswinteractive<?php if (isset($_GET['proxy'])) { echo '&proxy'; } ?>" target="_blank" onmouseover="MM_swapImage('Image8','','../img/enlinea2.jpg',1)" onmouseout="MM_swapImgRestore()"><img src="../img/enlinea1.jpg" name="Image8" width="195" height="57" border="0" id="Image8" /></a></td>
		</tr>
		<tr>
			<td><a href="http://evaluaciones.psycom.mx/?psycomweb<?php if (isset($_GET['proxy'])) { echo '&proxy'; } ?>" target="_blank" onmouseover="MM_swapImage('Image10','','../img/web2.jpg',1)" onmouseout="MM_swapImgRestore()"><img src="../img/web.jpg" name="Image10" width="195" height="56" border="0" id="Image10" /></a></td>
		</tr>
		<tr>
			<td><a href="http://evaluaciones.psycom.mx/?psycom360<?php if (isset($_GET['proxy'])) { echo '&proxy'; } ?>" target="_blank" onmouseover="MM_swapImage('Image11','','../img/tress2.jpg',1)" onmouseout="MM_swapImgRestore()"><img src="../img/tress.jpg" name="Image11" width="195" height="57" border="0" id="Image11" /></a></td>
		</tr>
		<tr>
			<td><a href="http://evaluaciones.psycom.mx/?psycomclima<?php if (isset($_GET['proxy'])) { echo '&proxy'; } ?>" target="_blank" onmouseover="MM_swapImage('Image12','','../img/klyma2.jpg',1)" onmouseout="MM_swapImgRestore()"><img src="../img/klyma.jpg" name="Image12" width="195" height="57" border="0" id="Image12" /></a></td>
		</tr>
		<tr>
			<td><a href="http://evaluaciones.psycom.mx/?psycomclima<?php if (isset($_GET['proxy'])) { echo '&proxy'; } ?>" target="_blank" onmouseover="MM_swapImage('Image12','','../img/klyma2.jpg',1)" onmouseout="MM_swapImgRestore()"><img src="../img/klyma.jpg" name="Image12" width="195" height="57" border="0" id="Image12" /></a></td>
		</tr>
		<tr>
			<td><script src="../place.js"></script></td>
		</tr>
	</table>
	</center>
</body>
</html>
<?php } ?>