-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
83 lines (74 loc) · 1.95 KB
/
Copy pathindex.php
File metadata and controls
83 lines (74 loc) · 1.95 KB
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
<?php
require_once "clases/Conexion.php";
$obj= new conectar();
$conexion=$obj->conexion();
$sql="SELECT * from usuarios where email='admin'";
$result=mysqli_query($conexion,$sql);
$validar=0;
if(mysqli_num_rows($result) > 0){
$validar=1;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Login de usuario</title>
<link rel="stylesheet" type="text/css" href="librerias/bootstrap/css/bootstrap.css">
<script src="librerias/jquery-3.2.1.min.js"></script>
<script src="js/funciones.js"></script>
</head>
<body style="background-color: gray">
<br><br><br>
<div class="container">
<div class="row">
<div class="col-sm-4"></div>
<div class="col-sm-4">
<div class="panel panel-primary">
<div class="panel panel-heading">Sistema de ventas y almacen</div>
<div class="panel panel-body">
<p>
<img src="img/ventas.jpg" height="190">
</p>
<form id="frmLogin">
<label>Usuario</label>
<input type="text" class="form-control input-sm" name="usuario" id="usuario">
<label>Password</label>
<input type="password" name="password" id="password" class="form-control input-sm">
<p></p>
<span class="btn btn-primary btn-sm" id="entrarSistema">Entrar</span>
<?php if(!$validar): ?>
<a href="registro.php" class="btn btn-danger btn-sm">Registrar</a>
<?php endif; ?>
</form>
</div>
</div>
</div>
<div class="col-sm-4"></div>
</div>
</div>
</body>
</html>
<script type="text/javascript">
$(document).ready(function(){
$('#entrarSistema').click(function(){
vacios=validarFormVacio('frmLogin');
if(vacios > 0){
alert("Debes llenar todos los campos!!");
return false;
}
datos=$('#frmLogin').serialize();
$.ajax({
type:"POST",
data:datos,
url:"procesos/regLogin/login.php",
success:function(r){
if(r==1){
window.location="vistas/inicio.php";
}else{
alert("No se pudo acceder :(");
}
}
});
});
});
</script>