<?php

session_start();
//include("DMMYSQLG.php");
//include("DSA3000.php");
include("DMMYSQLG.php");
include("DF80000.php");
include("varfun.php");
?>
<html>
<link rel="stylesheet" href="css/estilo1.csss" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>

<body>
<?php
 
$ayuda = 'valeryus1120A_AG.php';
include("DYAYUDA.php");

?>
  <?php

  if(isset($_POST['clave'])){
  	 $action=$_POST['+[a-z_]+'];
 	 	$usu=mysqli_real_escape_string($con,$_POST['clave']);
  		$dt_user=mysqli_fetch_array(mysqli_query($con ,"SELECT   count(*) as numRows, clave,oper,nombre FROM geoyos_jc.dxopemaex  WHERE clave='$usu' "));
  echo mysqli_error($con);
  
  		if($dt_user['numRows']==0){
		  		echo alert_JS("Usuario Invalido");
  			
  }
  			else {
				echo '<meta content="1; url='.$action.'" HTTP-EQUIV="REFRESH">';
				$_SESSION['num_usu']=$dt_user['oper'];
				$_SESSION['usuario']=$dt_user['nombre'];
				mysqli_query($con ,"insert into geoyos_jc.dxacceso SET ip='".$_SESSION['usuario']."',fecha=CURDATE(),rem_add='$_SESSION['+[a-z_]+']'");
				echo mysqli_error($con);
				exit();
  }
 
  }
  	else{
	$_SESSION['usuario']="";
	$_SESSION['num_usu']="";
	
  }
  ?>
<form  action="" method="post" name="frm1" target="_self" id="frm1">
<span class="Estilo20">
  <input type="hidden" name="actionOK" value="<?php
 echo $action;?>">
  <label>
  
  </label>
</span>
<!-- -->
  
  <label>
  <input name="fecha" type="text" class="hdos" id="fecha"  value="<?php

  echo whatDay(date('Y-m-d')).', '.chfecha(date('Y-m-d'),'Y-m-d','d de M de Y');
  ?>"size="35" >
  </label>
  <table width="400"  align="center">
    <tr class="form">
      <th colspan="2" class=\"titulo\"><div align="center" class="men Estilo18"> ACESSO</div></th>
    </tr>
	<tr>
      <td width="125"><span class="Estilo17">Clave:</span></td>
      <td width="259"><input name="clave" type="password" class="thimprime" id="clave"  maxlength="25"></td>
    </tr>
    

    <tr>
      <td colspan="2">
        <div align="center">
          <input type="button" name="button" value="Aceptar" onClick="cargapag('valeryus12001.php','_self')"/>
   </div></td>
    </tr>
  </table>
</form>
</body>
</html>
