-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
86 lines (79 loc) · 2.57 KB
/
index.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php set_time_limit(30000); ?>
<?php
session_start();
if(isset($_SESSION['tipo_usu']))
{
header('Location: system.php');
}?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="img/icon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="dist/sweetalert.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/font.css">
<link rel="stylesheet" type="text/css" href="css/index.css">
</head>
<body>
<div class="contenedor2 text-center" id="contenedor" style="background-color:white;">
</br></br></br>
<img src="img/logo_halcon.png" style="width:25%;height:25%;">
<img src="img/falconright.png" style="width:20%;height:25%;">
</br></br>
<img src="img/enfemeria_login.png" style="width:75%;height:25%;">
</br>
<div class="login">
<form id="form_login" class="form-group" method="POST">
<div class="form-group">
<div class="col-md-offset-4 col-md-4">
<input type="text" name="usuario" class="form-control " placeholder="Ingrese su Usuario" required>
</div>
<br><br>
</div>
<div class="form-group">
<div class="col-md-offset-4 col-md-4">
<input type="password" name="contrasena" class="form-control " placeholder="Ingrese su Contraseña" required>
</div>
<br><br>
</div>
<div class="form-group">
<div class=" col-md-offset-4 col-md-4">
<input type="submit" class="btn btn-primary btn-block" value="Iniciar sesión">
</div>
<div class="col-md-5"></div>
</div>
</form>
</div>
</div>
</body>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="dist/sweetalert.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$.post('control/conexion.php?e=existeBD',{},function(data){
if(data > 0)
{
//console.log("La base de datos ya existe!");
}else{
$.post('includes/instalacion.php',{},function(data){ $("#contenedor").html(data); });
}
});
$("#form_login").submit(function(e){
e.preventDefault();
$.post('control/ctrl_usuario.php?e=iniciarSesion',$("#form_login").serialize(),function(data){
var json = JSON.parse(data);
if(json.error>0)
{
swal('Aviso',json.mensaje);
}else{
window.location='system.php';
}
});
});
});
</script>
</html>