-
Notifications
You must be signed in to change notification settings - Fork 0
/
buscar_chofer.php
87 lines (83 loc) · 3 KB
/
buscar_chofer.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
<html>
<head>
<title> Buscar Chofer </title>
<link rel="stylesheet" type="text/css" href="estilos\ver_lista_empleado.css">
</head>
<body Background="imagenes\fondo.jpg">
<div id="contenedor">
<div id="cabecera">
<a href="menu_supervisor.php"><img src="imagenes\cerrar.png" class="imagen_atras_buscar"/></a>
<div class="titulo_buscar">
Chofer
</div>
</div>
<div id="cuerpo">
<?php
if ($_POST['buscador'])
{
// Tomamos el valor ingresado
$buscar = $_POST['palabra'];
// Si está vacío, lo informamos, sino realizamos la búsqueda
if(empty($buscar))
{
echo "<p><font color='red'> NO SE HA INGRESADO UNA CADENA A BUSCAR </font></p>";
}else{
// Conexión a la base de datos y seleccion de registros
include('conexion_bd.php');
$sql = "SELECT * FROM empleado WHERE apellido LIKE '%$buscar%' AND id_cargo = 1 ORDER BY id ASC";
mysql_select_db($bd, $conexion);
$result = mysql_query($sql, $conexion);
// Tomamos el total de los resultados
$total = mysql_num_rows($result);
// Imprimimos los resultados
if ($row = mysql_fetch_array($result)){
echo "Resultados para: <font color='red'><b>$buscar</b></font>";
echo ' <table border="1" cellpadding="0" align="center" cellspacing="0" width="100%" bgcolor="#F6F6F6" bordercolor="#FFFFFF">
<tr align="center">
<td width="50" style="font-weight: bold">ID </td>
<td width="80" style="font-weight: bold">Dni </td>
<td width="85" style="font-weight: bold">Fec. Nac. </td>
<td width="140" style="font-weight: bold">Nombre </td>
<td width="100" style="font-weight: bold">Apellido </td>
<td width="150" style="font-weight: bold">Domicilio </td>
<td width="110" style="font-weight: bold">Localidad </td>
<td width="130" style="font-weight: bold">Provincia </td>
<td width="40" style="font-weight: bold">Lic </td>
<td width="100" style="font-weight: bold">Teléfono </td>
<td width="50" style="font-weight: bold">Id_Rol </td>
<td width="140" style="font-weight: bold">usuario </td>
</tr>
</table>';
do {
?>
<?.$row['id'];?><?=
"<table border='1' cellpadding='0' align='center' cellspacing='0' width='100%' bgcolor='#F6F6F6' bordercolor='#FFFFFF'>
<tr align='center'>
<td width='50'>".$row['id']. "</td>
<td width='80'>".$row['dni']. "</td>
<td width='85'>".$row['fecha_nac']. "</td>
<td width='140'>".$row['nombre']. "</td>
<td width='100'>".$row['apellido']. "</td>
<td width='150'>".$row['domicilio']. "</td>
<td width='110'>".$row['localidad']. "</td>
<td width='130'>".$row['provincia']. "</td>
<td width='40'>".$row['lic']. "</td>
<td width='100'>".$row['telefono']. "</td>
<td width='50'>".$row['id_rol']. "</td>
<td width='140'>".$row['usuario']. "</td>
</tr>
</table>
";?>
<?php
} while ($row = mysql_fetch_array($result));
echo "<p>Resultados Encontrados: $total</p>";
} else {
// En caso de no encontrar resultados
echo "<p><font color='red'>NO SE ENCONTRARON RESULTADOS PARA: <b>$buscar</b></font></p>";
}
}
}?>
</div>
</div>
</body>
</html>