-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlista_usuario.php
120 lines (78 loc) · 2.33 KB
/
lista_usuario.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
<?php
include 'seguro.php';
include 'conectadb.php';
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link href="css2/jquery.autocomplete.css" rel="stylesheet">
<script src="js2/jquery.varios.js"></script>
<script src="js2/jquery.autocomplete.js"></script>
</head>
<body onLoad="document.datos4.nombre.focus()">
<div class="container">
<center>
<div class="panel panel-default">
<div class="panel-heading" align="center">
<strong>Usuarios Registrados</strong></div>
<div class="panel-body" align="center">
<form class="form-inline" role="form" name="datos4">
<div class="form-group">
<label for="buscar">Ingrese Nombre:</label>
</div>
<div class="form-group">
<input type="text" name="nombre" id="nombre" class="form-control" value="" size="50"></input>
<!-- <input type="button" id="buscar" value="Buscar" class="btn btn-primary"/>-->
<input type="button" id="nuevo" value="Nuevo Usuario" class="btn btn-success"/>
<input type="hidden" name="f_codigo_usu" id="f_codigo_usu" value="" />
</div>
</form>
<div id="cargando" style="display:none; color: red; text-align:center">
<img src="images/loading.gif" width="16" height="16" />
</div>
<div id="listado">
</div>
</div>
</div>
</center>
<script type="text/javascript">
$(document).ready(inicializarEvento);
function inicializarEvento(){
visualizar(0);
$("#buscar").click(function(){visualizar(2)});
$("#nombre").autocomplete('get_usuarios.php')
.result(function(event,data,formated){
$("#f_codigo_usu").val(data[1]);
visualizar(1)
});
$('#nuevo').click(function(event) {
cargar('nuevo_usuario.php');
});
}
function visualizar(tipo){
//alert(tipo);
var param='';
if(tipo=='0' || tipo=='1'){
$('#cargando').show();
if(tipo==1) param='f_codigo_usu=' + $('#f_codigo_usu').val();
$('#listado').empty().load('usuarios.php?'+param,function(){
$("#cargando").hide();
});
}
if(tipo='2'){
$('#cargando').show();
if(tipo==2) param='f_texto=' + $('#nombre').val();
$('#listado').empty().load('usuarios.php?'+param,function(){
$("#cargando").hide();
});
}
}
function nombre(){
if(event.keyCode==13){
visualizar(1);
}
}
</script>
</script>
</body>
</html>