PHP - ejecutar un boton en php

 
Vista:

ejecutar un boton en php

Publicado por escarger (1 intervención) el 13/02/2012 19:15:25
Que tal buen dia

Un favor, haber si me pueden ayudar estoy aprendiendo apena php y mysql.....

no logro ejecutar un boton para que me traiga informacion de una consulta, les dejo mi consulta haber si me pueden ayudar, gracias

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
<?php
include('bd.php');
if (!isset($accion)) {
 
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script language="javascript" type="text/javascript">
function actAgencia(val,forma) {
	forma.agencias.length=0; // ELIMINA LOS VALORES DEL COMBO AGENCIA
	document.forma.agencias.options[0]=new Option("TODAS","TODAS");
	document.forma.agencias.length = 1;
	/*document.forma.ruta.options[0]=new Option("TODAS","TODAS");
	document.forma.ruta.length = 1;*/
	<?php
	$rs_a = mysql_query("select id_age,agencia,id_zona from agencia order by id_age desc",$bd);
	while($reg_a = mysql_fetch_array($rs_a)) { ?>
	    if (val == '<?php echo $reg_a["id_zona"] ?>'){
  	   		clave='<?php echo $reg_a["id_age"] ?>';
  	   		nombre='<?php echo $reg_a["agencia"] ?>';
			forma.agencias.options[forma.agencias.length]=new Option(nombre,clave); //Agrega un nuevo item al combo  	   
		}
	<?php
	}
   	mysql_free_result($rs_a); ?>
}
 
/*function asigna_accion(forma){
	if (forma.accion.value=='buscar')
		forma.accion.value='muestra';
}*/
</script>
 
<body>
<form name="forma" id="forma">
<table width="400" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>Zona:</td>
    <td><label>
      <select name="zona" id="zona" onChange="javascript:actAgencia(this.value,this.form)">
        <option value="0" selected="selected" <?php if($zona=='0') echo "selected";?>>-Todas-</option>
		<?php $rs_zona = mysql_query("select id_zona as id,zona from zona order by id_zona",$bd);
		   while($reg_zona = mysql_fetch_array($rs_zona)){
		   	   if ($zona == $reg_zona["zona"]) $selected="selected";
			   else $selected="";
	      	   printf("<option value='%s' %s>%s</option>", $reg_zona["id"], $selected, $reg_zona["zona"]);
		   }
		   mysql_free_result($rs_zona);
	?>
      </select>
    </label></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Agencia:</td>
    <td><label>
      <select name="agencias" id="agencias">
        <option value="0" selected="selected"<?php if($agencias=='0') echo "selected";?>>-Todas-</option>
		<?php $rs_age = mysql_query("select id_age,agencia,id_zona from agencia where id_zona='".$zona."' order by id_age",$bd);
		   while($reg_age = mysql_fetch_array($rs_age)){
		   	   if ($agencias == $reg_age["agencia"]) $selected="selected";
			   else $selected="";
	      	   printf("<option value='%s' %s>%s</option>", $reg_age["id_age"], $selected, $reg_age["agencia"]);
		   }
		   mysql_free_result($rs_age);
	?>
    </select>
      </select>
    </label></td>
  </tr>
  <tr>
    <td colspan="2"><label>
      <input name="buscar" type="submit" id="buscar" value="Buscar" onclick="asigna_accion(this.form)">
	  <input name="accion" type="hidden" id="accion">
    </label></td>
    </tr>
</table>
</form>
<?php $rs_clie = mysql_query("select * from clientes where agencia='DL10A' and pob='01' and ciclo='78'",$bd);		  				     		   while($reg_clie= mysql_fetch_array($rs_clie))
  {
		$rpu= $reg_clie["rpu"];
 
  ?>
	  <tr>
		<td>&nbsp;<?php echo $rpu; ?></td>
 
	  </tr>
  <?php
  }
  ?>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder