Advertisement
Guest User

sys_login.php

a guest
Sep 25th, 2014
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.49 KB | None | 0 0
  1. <?php
  2. header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
  3. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Fecha en el pasado
  4. require("config_claro.php");
  5.  
  6.  
  7. $ip = $_SERVER["REMOTE_ADDR"];
  8. $int=0;
  9.       $consul="select ipnro,count(*) from ip group by ipnro having ipnro = '$ip'";
  10.       $resul=mysql_query($consul, $con);
  11.       $f=mysql_fetch_array($resul);
  12.       $int=$f[1];
  13.             if($int>2)
  14.             {
  15.             $err=4;
  16.             }
  17.  
  18. ?>
  19. <html>
  20.  
  21. <head>
  22. <meta http-equiv="Content-Language" content="es">
  23. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  24. <title>SGA-DAC : Inicio de Sesión</title>
  25.  
  26. <link rel="stylesheet" href="css/aqua.css" type="text/css" media="screen">
  27. <script type="text/javascript" src="js/estilo.js"></script>
  28.  
  29.  
  30. <script type="text/javascript">
  31. function Validar(frm)
  32.  {
  33.    if(frm.codigo.value=="")
  34.     {
  35.      alert("Ingrese su código de usuario");
  36.      frm.codigo.focus();
  37.      return false;
  38.     }
  39.    if(frm.clave.value=="")
  40.     {
  41.      alert("Ingrese su contraseña");
  42.      frm.clave.focus();
  43.      return false;
  44.     }
  45.    return true;
  46.  }
  47.  
  48. function Enviar(frm)
  49.  {
  50.    if(Validar(frm))
  51.     {
  52.      frm.submit();
  53.     }
  54.  }
  55. </script>
  56.  
  57. </head>
  58.  
  59. <body onload="javascript:frmLogin.codigo.focus();" onmousemove="javascript:BotonEncima();" onmouseout="javascript:BotonFuera();" topmargin='10px' leftmargin='10px'>
  60.  
  61. <br>
  62. <br>
  63. <?php
  64. if($err>3)
  65. {
  66. $abc="disabled";
  67. }
  68. else
  69. {
  70. $abc="";
  71. }
  72. ?>
  73. <br>
  74.  
  75. <form name="frmLogin" method="POST" action="sys_validar_usuario.php" enctype="multipart/form-data">
  76.    
  77.     <input type='hidden' name='uid' value=''>
  78.     <input type='hidden' name='sid' value=''>
  79.     <input type='hidden' name='idt' value=''>
  80.     <input type='hidden' name='listo' value='no'>
  81.  
  82.     <?php
  83.     /*
  84.     <p align='center' style='margin:5px'>
  85.     <img src='images/logo002.jpg' border='0'>
  86.     </p>
  87.   */
  88.     ?> 
  89.      
  90.     <div align="center">
  91.         <table border="0" cellpadding="2" cellspacing="0" width="400" style="border: 1 inset">
  92.             <tr>
  93.                 <td colspan="3" align="center" class='tthb' style='font-weight:bold'>
  94.                 Inicio de Sesión:
  95.                 </td>
  96.             </tr>
  97.  
  98.  
  99.     <?php
  100.     if($err>0)
  101.      {
  102.        switch($err)
  103.           {
  104.               case 1:
  105.                   $mensaje= "Datos incorrectos: Nombre de usuario ó contraseña no existe.";
  106.                     break;
  107.                 case 2:
  108.                     $mensaje= "No se ha asignado ningún punto de venta al usuario, requiere por lo menos uno.";
  109.                     break;
  110.                 case 3:
  111.                     $mensaje= "Los datos ingresados son correctos pero el usuario se encuentra temporalmente inactivo en el sistema.";
  112.                     break;
  113.                 case 4:
  114.                     $mensaje= "Se ha bloqueado su conexion y se ha enviado un reporte del suceso a info@sistemaclaro.com .Si quiere activar nuevamente su usuario escriba al administrador del sistema.";
  115.                     break;          }
  116.          
  117.          echo "<tr>
  118.                    <td colspan='3' height='80' bgcolor='#FFFFFF'>
  119.                          <h4 align='center'><font color='#CC0000'>Acceso denegado!</font></h4>
  120.                      <p align='justify' style='padding:1;margin:1'>
  121.                          <img src='images/msg_adv.gif' border='0' align='left' style='margin-right:10px;margin-left:5px'>
  122.                          $mensaje<br>
  123.                          Para mayor información consulte al administrador del sistema. gracias.
  124.                          </p>
  125.                          </td>
  126.                          </tr>";
  127.      }
  128.     ?>             
  129.            
  130.            
  131.             <tr>
  132.                 <td colspan="3">&nbsp;</td>
  133.             </tr>
  134.                        
  135.             <tr>
  136.                 <td width="40">&nbsp;&nbsp; </td>
  137.                 <td width="156">Código de usuario:</td>
  138.                 <td width="188"><input type="text" name="codigo" size="26" style="width: 150px" <?php echo "$abc"?>></td>
  139.             </tr>
  140.             <tr>
  141.                 <td width="40">&nbsp;&nbsp; </td>
  142.                 <td width="156">Contraseña:</td>
  143.                 <td width="188"><input type="password" name="clave" size="26" style="width: 150px" <?php echo "$abc"?>></td>
  144.             </tr>
  145.             <tr>
  146.                 <td colspan="3">&nbsp; </td>
  147.             </tr>
  148.         </table>
  149.        
  150.        
  151.     </div>
  152.     <p align="center">
  153.    
  154.     <?php
  155.     //<input type="button" class="boton" value="Iniciar Sesión" onclick="javascript:Enviar(frmLogin);">&nbsp;
  156.     ?>
  157.     <input type="submit" class="boton" value="Iniciar Sesión" <?php echo "$abc"?>>&nbsp;
  158.     <input type="reset" class="boton" value="Restablecer" <?php echo "$abc"?>>
  159.    
  160.     <br>
  161.     <br>
  162.     <br>
  163.     <br>
  164.  
  165.     <font color='#999999'>NUEVO SISTEMA DAC MELQUI 2013 - VERSION PRUEBA</font>
  166.     <br>
  167.     <font color='#CC0000'><b>Importaciones y Comunicaciones MELQUI EIRL</b></font>
  168.     <br>
  169.     </p>
  170. </form>
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181. <form><input type="hidden" name="marca" value="WebSolutionsPeru"></form>
  182.  
  183. </body>
  184.  
  185. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement