-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecover_pass.php
142 lines (135 loc) · 5.02 KB
/
recover_pass.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php include_once "config/app.php"; ?>
<!doctype html>
<html lang="es">
<head>
<title>Login - CETI Intranet</title>
<?php require_once "shared/meta.php"; ?>
</head>
<body class="bg-login-section">
<div class="container">
<div class="row mt-5">
<div class="col-xs col-md-4 offset-md-4">
<div class="text-center" style="margin-bottom: 40px;">
<img src="public/images/logo-ceti-color.png" class="img-responsive"
style="display: inline-block; max-width: 280px;" alt="Logo">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4 offset-md-4">
<form id="formLogin" method="post">
<div class="form-group">
<div>
<p class="text-center loginTxtBienvenido">BIENVENIDO</p>
<p class="text-center loginTxtIngrese">Ingrese su credenciales para acceder al
sistema</p>
</div>
</div>
<div class="form-group text-white">
<label for="txtUsuario">Usuario:</label>
<input type="text" class="form-control" id="txtUsuario"
name="txtUsuario">
</div>
<!-- <div class="form-group text-white">
<label for="txtPassword">Contraseña:</label>
<input type="password" class="form-control" id="txtPassword" name="txtPassword">
</div> -->
<br>
<div class="form-group text-center">
<input type="submit" id="btnLogin" value="RECUPERAR" class="btn btn-success">
</div>
<div class="form-group">
<div class="text-center">
<a href="index.php" class="btn-link">Volver</a>
</div>
</div>
</form>
</div>
</div>
<br>
<footer>
<div class="text-center text-secondary"><p class="no-margin">OTEC Online - Gestión web para Organismos Técnicos de Capacitación</p>
<p class="no-margin"> © 2018 CETI.CL Todos los derechos reservados. </p>
</div>
</footer>
</div>
<?php require_once "shared/js.php"; ?>
<script>
$(document).ready(function () {
$("#formLogin").validate({
rules: {
txtUsuario: {
required: true,
email: true
}
},
messages: {
txtUsuario: {
required: "Debe ingresar su usuario (e-mail)",
email: "Debe ingresar un correo válido"
}
},
errorElement: 'span',
errorClass: 'is-invalid invalid-feedback',
highlight: function (element) {
$(element).addClass('has_error is-invalid');
},
submitHandler: function (form) {
var usuario = $("#txtUsuario").val();
var password = $("#txtPassword").val();
$.ajax({
url: "controller/login.php",
type: "POST",
data: {
acc: 4,
txtEmail: usuario
},
error: function (e) {
alert("En desarrollo... " + e.responseText);
},
beforeSend: function () {
//$("#btnGuardar").prop("disabled", true);
},
success: function (data) {
eval(data);
console.info(data);
if (r.resultado == "OK") {
alertOk(r.titulo, r.mensaje);
/*setTimeout(function () {
location.href = r.irURL;
}, 4000);*/
} else {
alertFail(r.titulo, r.mensaje);
}
}
});
}
});
});
function cerrarSesion() {
$.ajax({
url: "login_ajax.php",
type: "POST",
data: {
acc: 2
},
error: function (e) {
alert("error " + e.responseText);
},
beforeSend: function () {
//$("#btnGuardar").prop("disabled", true);
},
success: function (data) {
$.globalEval(data);
if (r.resultado == "OK") {
Messenger().post({message: r.mensaje, type: "info"});
setTimeout(function () {
location.href = r.irURL;
}, 1000);
}
}
});
}
</script>
</body>
</html>