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
|
<?
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Autores: Pedro Obregón Mejías
Rubén D. Mancera Morán
Versión: 1.0
Fecha Liberación del código: 13/07/2004
Galopín para gnuLinEx 2004 -- Extremadura
*/
?>
<html>
<head>
<title>Buscador de artículos</title>
<script>
function ponPrefijo(pref,aux) {
opener.document.formul.codigo.value=pref
opener.document.formul.pvp.value=aux
window.close()
}
</script>
<link href="estilo.css" rel="stylesheet" type="text/css">
</head>
<? include ("conectar.php"); ?>
<body onLoad="Javascript: document.buscar.descripcion.focus();">
<img src="images/nuevas/listadodearticulos.jpg" alt="Listado de Artículos"><br>
<br>
<form action="buscar_articulo.php" name="buscar">
<table border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#0066FF">
<tr>
<td colspan="2" class="primeralineaizquierda">
Buscador de Artículos
</td>
</tr>
<tr>
<td width="30%" class="primeralineaizquierda">
Código (6 Digitos):
</td>
<td width="70%">
<input type="text" name="codigo" maxlength="6" size="6">
</td>
</tr>
<tr>
<td width="30%" class="primeralineaizquierda">
Descripción:
</td>
<td width="70%">
<input type="text" name="descripcion" maxlength="40" size="40">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<center><input type="submit" value="Buscar artículo">
</center>
</td>
</tr>
</table>
</form>
<?
$consulta0 = "select * from familia order by codigo";
$resultado0 = mysql_query($consulta0, $conexion);
$filas=mysql_num_rows($resultado0);
if (empty($numi)) { $numi=0; }
$consulta0=$consulta0." limit $numi,7";
$resultado0 = mysql_query($consulta0, $conexion);
$enlaces=$filas;
while ($lafila0=mysql_fetch_array($resultado0)) {
$codf=$lafila0["codigo"]; ?>
<br><font color="#FF0000"><strong>
<? print "Familia de: ".$lafila0["familia"]."<br>"; ?>
</strong> </font>
<? $consulta1="select * from subfamilia where idfamilia='$codf'";
$resultado1= mysql_query($consulta1, $conexion);
while ($lafila1=mysql_fetch_array($resultado1)) {
$codsf=$lafila1["codigo"]; ?>
<blockquote><font color="#33CC33">
<? print "Subfamilia de: ".$lafila1["subfamilia"]."<br>"; ?>
</blockquote></font>
<? $consulta = "select * from articulos where codfamilia='$codf' and codsubfamilia='$codsf' order by codigo";
$resultado = mysql_query($consulta, $conexion);
$filas=mysql_num_rows($resultado);
if (empty($filas)) { print "No hay artículos de esta familia.<br>"; } else { ?>
<table align="center">
<tr>
<td width="12%" class="primeralinea">Código</td>
<td width="32%" class="primeralinea">Descripción</td>
<td width="12%" class="primeralinea">PVP</td>
</tr>
<? while ($lafila=mysql_fetch_array($resultado)) { ?>
<tr bgcolor="#7CCEED">
<? $lafila["pvp"]=sprintf("%01.2f", $lafila["pvp"]);?>
<td class="segundalinea"><a href="#" class="sinsubraya" onclick="ponPrefijo('<? echo $lafila["codfamilia"]; ?><? echo $lafila["codsubfamilia"]; ?><? echo $lafila["codigo"]; ?>' , '<? echo $lafila["pvp"]; ?>' )"><? print($lafila["codfamilia"] . $lafila["codsubfamilia"] . $lafila["codigo"]); ?></a></td>
<td class="segundalineaizquierda"><? echo $lafila["descripcion"]; ?></td>
<td class="segundalineaderecha"><? $total2= number_format($lafila["pvp"],2,",",".");echo $total2; ?></td>
</tr>
<? } ?>
</table>
<? } } }
if ($enlaces>7) {
$i=0;
$j=1;
print "<center><font size=2 face='Verdana, Arial, Helvetica, sans-serif'>Páginas: ";
while ($i<$enlaces) { ?>
<a href="listado_articulos.php?codigo=<? echo $codigo; ?>&descripcion=<? echo $descripcion; ?>&numi=<? echo $i; ?>"><? echo $j; ?></a>
<? $j++;
$i=$i+7; }
}
@mysql_free_result($resultado);
@mysql_free_result($resultado0);
@mysql_free_result($resultado1);
?>
<form>
<div align="center">
<label>
<input type="submit" name="Submit" value="Cerrar ventana" onclick="JavaScript: window.close();">
</label>
</div>
</form>
<p align="center"> </p>
</body>
</html>
|