-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
62 lines (48 loc) · 1.61 KB
/
login.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
session_start();
include_once("gestionas/gestionBD.php");
include_once("gestionas/gestionarEmpleado.php");
if (isset($_POST['submit'])){
$dni= $_POST['dni'];
if (isset($_SESSION['login']))
unset($_SESSION['login']);
if(isset($_SESSION['cargo']))
unset($_SESSION['cargo']);
$conexion = crearConexionBD();
$usuariop=consultaBaseDatosPass($conexion,$dni);
$usuario2=obtener_empleado_dni($conexion,$dni);
cerrarConexionBD($conexion);
if($usuario2['DNI']==null or $usuario2['OCULTO']==1){
$error=1;
}else{
if ($usuariop['pass'] == null){
$_SESSION['dni'] = $dni;
Header("Location: registro.php");
}
else {
$_SESSION['dni'] = $dni;
Header("Location: acceso.php");
}
}
}
?>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/formLogin.css" />
<link rel="icon" href="img/logo_coenca.png" />
<title>Coenca | Acceso </title>
</head>
<body>
<a href="index.php"><img src="img/back.png" width="50px" alt="Volver" height="30px" style="position: absolute"/></a>
<div align="center" class="login">
<img class="logoCoenca" src="img/logo_coenca.png">
<?php if(isset($error))echo "<div class=\"error\"><p align=\"center\">El DNI indicado no tiene acceso</p></div>"; ?>
<form action="login.php" method="post">
<div><input spellcheck="false" type="text" name="dni" id="dni" placeholder="Introduce tu DNI" pattern="^[0-9]{8}[A-Z]"/></div>
<input class="botonLogin" type="submit" name="submit" value="Acceder" style="width:150px; height:30px;"/>
</form>
</div>
</body>
</html>