
No puedo hacer que el programa se redireccione a la funcion guardar()
Publicado por ruben (3 intervenciones) el 06/05/2015 21:52:44
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<?
session_start();
?>
<?
include "conectar.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<script language="JavaScript">
function tabular(e,obj) {
tecla=(document.all) ? e.keyCode : e.which;
if(tecla!=13) return;
frm=obj.form;
for(i=0;i<frm.elements.length;i++)
if(frm.elements[i]==obj) {
if (i==frm.elements.length-1) i=-1;
break }
frm.elements[i+1].focus();
return false;
}
function tabular2(e,obj) {
tecla=(document.all) ? e.keyCode : e.which;
if (tecla>13 && tecla < 48){return false;}
if (tecla>57){return false;}
if(tecla!=13) return;
frm=obj.form;
for(i=0;i<frm.elements.length;i++)
if(frm.elements[i]==obj) {
if (i==frm.elements.length-1) i=-1;
break }
frm.elements[i+1].focus();
return false;
}
function guardar(){
var envio="";
envio=envio +"numero_unico=" + datos_ingreso.numero_unico.value +"&"
envio=envio +"nombre_usuario=" + datos_ingreso.nombre_usuario.value +"&"
envio=envio +"contrasena=" + datos_ingreso.contrasena.value +"&"
envio=envio +"tipo_equipo=" + datos_ingreso.tipo_equipo.value +"&"
envio=envio +"ip_equipo=" + datos_ingreso.ip_equipo.value +"&"
envio=envio +"propietario=" + datos_ingreso.propietario.value +"&"
envio=envio +"email=" + datos_ingreso.email.value +"&"
envio=envio +"clave_correo=" + datos_ingreso.clave_correo.value +"&"
envio=envio +"detalle=" + datos_ingreso.detalle.value +"&"
window.location.href="guarda_equipos.php?"+envio;
}
</script>
<head>
<title>Ingreso de Equipos</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!--
.Estilo1 {
font-size: 18px;
color: #FFFFFF;
}
.Estilo3 {color: #FFFFFF}
.Estilo4 {
font-size: 16px;
color: #FFFFFF;
}
-->
</style>
<style type="text/css">
<!--
.Estilo4 {font-size: 36px}
.Estilo5 {font-size: 18px}
.Estilo6 {font-size: 24px}
-->
</style>
</head>
<body>
<p>
<?
/* include "encabezado.php"; */
?>
</p>
<table border="0">
<tr>
<th scope="col"><img src="imagenes/logoinformatica.jpg" width="182" height="53" /></th>
<th scope="col"><span class="Estilo3 Estilo4">"Ingreso de Equipos"</span></th>
</tr>
</table>
<p><br>
<br>
</p>
<div class="content">
<form method="POST" name="form1" action="ingreso_stock.php">
<table border="1" width="100%">
<tr>
<td colspan="2" bgcolor="#00FFFF"><span class="Estilo1 Estilo6">Usuario</span></td>
</tr>
<tr>
<td bgcolor="#00FFFF"><span class="Estilo5">Seleccione el usuario
</span></td>
<td bgcolor="#00FFFF">
<select name="usuario" onkeypress="return tabular(event,this)">
<? //por área
$result = mysql_query("SELECT * FROM usuarios WHERE vigente ='S' order by nombre_largo");
if (mysql_num_rows($result)>0){
$i=0;
$rows=mysql_num_rows($result);
while($i < $rows) {
if ($_POST["usuario"]==mysql_result($result, $i, "num_unico")){
echo("<option selected value=".mysql_result($result, $i, "num_unico").">".mysql_result($result, $i, "nombre_largo")."</option>");
}else{
echo("<option value=".mysql_result($result, $i, "num_unico").">".mysql_result($result, $i, "nombre_largo")."</option>");
}
$i++;
}
}
?>
</select></td>
</tr>
</table>
<input type="submit" value="Mostrar">
</form>
<?
if ($_POST["usuario"]!=""){
//selecciona usuario a modificar
$result = mysql_query("SELECT * FROM usuarios WHERE num_unico=".$_POST["usuario"]);
if (mysql_num_rows($result)>0){
$nombre_largo=mysql_result($result,0, "Nombre_largo");
$sucursal=mysql_result($result,0, "Sucursal");
$c_usados=mysql_result($result,0,"c_usados");
$c_ford_nuevos=mysql_result($result,0,"c_ford_nuevos");
$hyundai=mysql_result($result,0,"Hyundai");
$global=mysql_result($result,0,"Global");
$u_livianos=mysql_result($result,0,"u_livianos");
$ford_livianos=mysql_result($result,0,"ford_livianos");
$fortaleza=mysql_result($result,0,"fortaleza");
$fortaleza_camiones=mysql_result($result,0,"fortaleza_camiones");
$motos=mysql_result($result,0,"Motos");
$rentacar=mysql_result($result,0,"rentacar");
$agricola=mysql_result($result,0,"agricola");
$sin_area=mysql_result($result,0,"sin_area");
$nombre_user=mysql_result($result,0, "Nombre_Usuario");
$pass=mysql_result($result,0, "Clave_ing");
$nivel=mysql_result($result,0, "Nivel");
$cargo=mysql_result($result,0, "cargo_coti");
$celular=mysql_result($result,0, "celular_coti");
$email=mysql_result($result,0, "email");
$num_unico=mysql_result($result,0, "num_unico");
$fono_fijo=mysql_result($result,0, "Fono_Fijo");
}
echo("<br>");
echo("<form method=POST name=datos_ingreso>");
echo("<input type=hidden value=".$_POST["usuario"]." name=num_actual>");
echo("<table border=1 width=100%>");
echo("<tr>");
echo("</tr>");
echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Datos de Usuario</span></td>");
echo("</tr>");
echo("<table border=1 width=100%>");
echo("<tr>");
echo("</tr>");
echo(" <td>Nombre Completo</td>");
echo(" <td><input type=text value=".chr(34).$nombre_largo.chr(34)." name=nombre_largo size=20 maxlength=20 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
echo("</tr>");
echo("<tr>");
echo(" <td>Sucursal</td>");
echo(" <td>");
echo(" <select name=sucursal onkeypress=".chr(34)."return tabular(event,this)".chr(34).">");
$result = mysql_query("SELECT * FROM mae_ubicaciones WHERE sucursal ='S' order by Ubicacion");
if (mysql_num_rows($result)>0){
$i=0;
$rows=mysql_num_rows($result);
while($i < $rows) {
if ($sucursal==mysql_result($result, $i, "Ubicacion")){
echo("<option selected value=".chr(34).mysql_result($result, $i, "Ubicacion").chr(34).">".mysql_result($result, $i, "Ubicacion")."</option>");
}else{
echo("<option value=".chr(34).mysql_result($result, $i, "Ubicacion").chr(34).">".mysql_result($result, $i, "Ubicacion")."</option>");
}
$i++;
}
}
echo("</select>");
echo(" </td>");
echo("</tr>");
echo("<tr>");
echo(" <td>Contraseña</td>");
echo(" <td><input type=text value=".chr(34).$pass.chr(34)." name=clave size=10 maxlength=10 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
echo("</tr>");
echo("<tr>");
echo(" <td>Area de trabajo (Marcada con ''X'')</td>");
echo(" <td>Camiones Usados <input type=text value=".chr(3).$c_usados.chr(3)." name=c_usados size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
echo("</tr>");
echo("<tr>");
echo(" <td></td>");
echo(" <td>Camiones Ford Nuevos <input type=text value=".chr(3).$c_ford_nuevos.chr(3)." name=c_ford_nuevos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
echo("</tr>");
echo(" <td></td>");
echo(" <td>Hyundai <input type=text value=".chr(3).$Hyundai.chr(3)." name=Hyundai size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
echo("</tr>");
echo(" <td></td>");
echo(" <td>Global <input type=text value=".chr(3).$global.chr(3)." name=global size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
echo("</tr>");
echo(" <td></td>");
echo(" <td>Utilitarios Livianos <input type=text value=".chr(3).$u_livianos.chr(3)." name=u_livianos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
echo("</tr>");
echo(" <td></td>");
echo(" <td>Ford Livianos <input type=text value=".chr(3).$ford_livianos.chr(3)." name=ford_livianos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
echo("</tr>");
echo(" <td></td>");
echo(" <td>Fortaleza <input type=text value=".chr(3).$fortaleza.chr(3)." name=Fortaleza size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
echo("</tr>");
echo(" <td></td>");
echo(" <td>Fortaleza Camiones <input type=text value=".chr(3).$fortaleza_camiones.chr(3)." name=fortaleza_camiones size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
echo("</tr>");
echo(" <td></td>");
echo(" <td>Motos <input type=text value=".chr(3).$motos.chr(3)." name=motos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
echo("</tr>");
echo(" <td></td>");
echo(" <td>Rentacar <input type=text value=".chr(3).$rentacar.chr(3)." name=Rentacar size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
echo("</tr>");
echo(" <td></td>");
echo(" <td>Agricola <input type=text value=".chr(3).$agricola.chr(3)." name=agricola size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
echo("</tr>");
echo(" <td></td>");
echo(" <td>Sin Area <input type=text value=".chr(3).$sin_area.chr(3)." name=sin_area size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
echo("</tr>");
echo("<tr>");
echo(" <td>Fono</td>");
echo(" <td><input type=text value=".chr(34).$fono_fijo.chr(34)." name=fono_fijo size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
echo("</tr>");
echo("<tr>");
echo(" <td>Nivel</td>");
echo(" <td>");
echo(" <select name=nivel onkeypress=".chr(34)."return tabular(event,this)".chr(34).">");
if ($nivel==3){echo("<option selected value=3>Vendedor</option>");}else{echo("<option value=3>Vendedor</option>");}
if ($nivel==2){echo("<option selected value=2>Asistente</option>");}else{echo("<option value=2>Asistente</option>");}
if ($nivel==1){echo("<option selected value=1>Administrador</option>");}else{echo("<option value=1>Administrador</option>");}
echo("</select>");
echo(" </td>");
echo("</tr>");
echo("<tr>");
echo(" <td>Cargo</td>");
echo(" <td><input type=text value=".chr(34).$cargo.chr(34)." name=cargo size=30 maxlength=40 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
echo("</tr>");
echo("<tr>");
echo(" <td>Celular</td>");
echo(" <td><input type=text value=".chr(34).$celular.chr(34)." name=celular size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
echo("</tr>");
$busqueda = 0;
$cont=1;
$busqueda = mysql_query("SELECT * FROM equipos_computacionales WHERE numero_unico=".$_POST["usuario"]);
$Total=mysql_num_rows($busqueda);
if (($busqueda)>0 and ($Total == 1)){
$ini=mysql_result($busqueda,0, "ini")+1;
$email=mysql_result($busqueda,0, "email");
$clave_correo=mysql_result($busqueda,0, "clave_correo");
$contrasena=mysql_result($busqueda,0,"contrasena");
$tipo_equipo=mysql_result($busqueda,0,"tipo_equipo");
$propietario=mysql_result($busqueda,0,"propietario");
$ip_equipo=mysql_result($busqueda,0,"ip_equipo");
$detalle=mysql_result($busqueda,0,"detalle");
$busqueda = 0;
$cont=$cont+1;
}
if ($Total==0){
$ini="1";
$email="";
$clave_correo="";
$contrasena="";
$tipo_equipo="";
$propietario="";
$detalle="";
$ip_equipo="";
$detalle="";
}
echo("<table border=1 width=100%>");
echo("<br>");
echo("<tr>");
echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Claves del Sistema</span></td>");
echo("</tr>");
echo("<table border=1 width=100%>");
echo("<tr>");
echo("</tr>");
echo(" <td>e-Mail</td>");
echo(" <td><input type=text value=".chr(34).$email.chr(34)." name=email size=20 maxlength=20 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
echo("</tr>");
echo(" <td>Clave Correo</td>");
echo(" <td><input type=text value=".chr(34).$clave_correo.chr(34)." name=clave_correo size=30 maxlength=40 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
echo("</tr>");
echo("</table>");
echo("</tr>");
echo("<table border=1 width=100%>");
echo("<br>");
echo("<tr>");
echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Plataforma</span></td>");
echo("</tr>");
echo("<table border=1 width=100%>");
echo("<tr>");
echo("</tr>");
echo("<tr>");
echo("<td>Nombre de Usuario</td>");
echo(" <td><input type=text value=".chr(34).$nombre_user.chr(34)." name=nombre size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
echo("</tr>");
echo("<tr>");
echo(" <td>Contraseña</td>");
echo(" <td><input type=text value=".chr(34).$contrasena.chr(34)." name=contrasena size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
echo("</tr>");
echo("<tr>");
echo(" <td>Numero Unico</td>");
echo(" <td><input type=text value=".chr(10).$num_unico.chr(10)." name=num_unico size=30 maxlength=40 onkeypress=".chr(10)."return tabular(event,this)".chr(10)."></td>");
echo("</tr>");
echo("</table>");
echo("</tr>");
echo("<table border=1 width=100%>");
echo("<br>");
echo("<tr>");
echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Equipos</span></td>");
echo("</tr>");
echo("<table border=1 width=100%>");
echo("<tr>");
echo("</tr>");
echo("<tr>");
echo("<td>Seleccione el Tipo de Equipo</td>");
echo("<td>");
?> <select name="$tipo_equipo" size="1">
<option value="PC" selected>PC</option>
<option value="NOTEBOOK">Notebook</option>
<option value="PANTALLA">Pantalla</option>
</select>
<?
echo("</td>");
echo("<tr>");
echo("<tr>");
echo(" <td>IP</td>");
echo(" <td><input type=text value=".chr(34).$ip_equipo.chr(34)." name=ip_equipo size=15 maxlength=15 onkeypress=".chr(15)."return tabular(event,this)".chr(15)."></td>");
echo("</tr>");
echo("<tr>");
echo("<tr>");
echo(" <td>Propiedad de:</td>");
echo("<td>");
?> <select name="$propiedad" size="1">
<option value="Curifor" selected>Curifor</option>
<option value="Personal">Personal</option>
</select>
<?
echo("</td>");
echo("<tr>");
echo(" <td valign='top'>Detalles</td>");
echo(" <td> "); ?>
<textarea name="$detalle" rows="100" cols="100" enabled><? echo $detalle; ?>
</textarea>
<? echo "</td>";
echo "</tr>";
echo("</table>");
echo("<tr>");
echo("<br>");
echo("<table border=1 width=100%>");
echo("<tr>");
echo("<table border=1 width=100%>");
?>
<input type="button" value="Guardar" onclick="guardar()">
</form>
<?
}
?>
</div>
</body>
</html>
Valora esta pregunta


0