<?php
use_helper('UrlFunctions');
$sErrorNickname = "";
$sErrorPasswor  = "";
//temporal
$sMessgaeError  = "";

if(isset($_POST['commit']))
{
   $o_MyLoginValidator = new myLoginValidator();
   $preLogin = $o_MyLoginValidator->execute( $_POST['nickname'], $_POST['password'] );
 	if($preLogin === true){
  	
	}elseif($preLogin == "2"){
  	  $sMessgaeError = "<font color=red><b>Error con el c&oacute;digo ingresado</b></font>";	
  }elseif(!$preLogin){
  	$sMessgaeError = "<font color=red><b>Error al iniciar sesi&oacute;n</b></font>";
  }
  
}
?>
<table class="cuerpo" width="100%" border="0" cellpadding="0" cellspacing="0">
  
  <tr>
    <td valign="top">
      <table style=" border: 1px solid #e1e1e1" cellpadding="0" cellspacing="0" align="center" width="25%" >
	    <tr>
		   <td  height="35"  align="center" colspan="3" style="color: #005EA8;font-size: 12px;padding:10px 150px;text-transform: uppercase;font-weight: bold;">INGRESO AL SISTEMA</td>
		</tr>
	    <tr>
		   <td valign="top">
		      <table cellpadding="0" cellspacing="0" align="center">
			  	<tr>
				  <td>&nbsp;</td>
				</tr>
			    <tr>
				  <td><img src="<?=Constantes::ROOT_DIR_IMG?>common/sesion.png"/></td>
				</tr>
			  </table>
		   </td>
		   <td>
		     <table cellpadding="0" cellspacing="0" width="100%">
			    <tr>
				  <td valign="top">		
				  <div id="login" >
					<div style="padding:10px;"><?=$sMessgaeError?></div>
					<form id="myFormLogin" name="myFormLogin" method="post">
					  
					  <div>
						  <h5>Usuario:</h5>
						  <p><input type="text" name="nickname" id="nickname" value="" maxlength="30" class="required texto"/> </p>
					  </div>
					  <div>
						  <h5>Contrase&ntilde;a:</h5>
						  <p><input type="password" name="password" id="password" value="" maxlength="30" class="required texto" /> </p>
					  </div>
					  
					  <div align="right" style="padding:20px 0px 0px 0px"><span><input type="submit" name="commit" value="Ingresar" class="button"/></span></div>
					  
					</form>
				  </div>
		      </td>
				</tr>
			  </table>
		   </td>
		</tr>
	</table>
    </td>
  </tr>
  <tr>
  	<td valign="top">
	 <table cellpadding="0" cellspacing="0" width="97%" border="0" height="450">
	   <tr>  
		   <td  style="vertical-align:bottom; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; color:#ff0000; text-align:right;">Copyright &copy; 2014. Todos los derechos reservados del Autor.
		 </td>
	   <tr>
	 </table>		
  <tr>
</table>