COMBOS TERRIBLES
Publicado por zendi (1058 intervenciones) el 05/07/2015 23:17:06
Bueno anteriormente habia avisado que solucioné el problema de los combos dependientes, pero ahora los he colocado en otro formulario y no funcionan, esto es la locura mas absurda que he visto jamás.
Si pueden ayudarme por favor, tal vez hay algo inexacto que no he visto, cuando hago la seleccion del ESTADO trae los registros; pero no cambia a MUNICIPIOS Y mucho menos a PARROQUIA.
No se si el problema radica en los dos <Form> aunque ya lo he probado y modificado muchas veces.
Nombres:
Apellidos:
Estado:
Municipio:
Parroquia:
Direccion:
Telefono:
Cuenta de correos:
Fecha de la Cita:
este es el codigo:
Si pueden ayudarme por favor, tal vez hay algo inexacto que no he visto, cuando hago la seleccion del ESTADO trae los registros; pero no cambia a MUNICIPIOS Y mucho menos a PARROQUIA.
No se si el problema radica en los dos <Form> aunque ya lo he probado y modificado muchas veces.
Apellidos:
Estado:
Municipio:
Parroquia:
Direccion:
Telefono:
Cuenta de correos:
Fecha de la Cita:
este es el codigo:
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
<html>
<head>
<title>Combos Dinámicos</title>
<script type="text/javascript" language="javascript" src="js/funciones.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="estilo.css" type="text/css">
<style type="text/css">
span{
color: #F60;
font-size: 1.5 em;
}
.sr {
background-color: #FFFFCF;
color: #000000;
font-family: Arial;
font-size: 12px;
}
.color{color:#FF0000;}
</style>
</head>
<!--/////////Codigo para enviar correos a un solo destinatario, con enviar1.php.-->
<body onload="limpiar()">
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<form method="POST" name="form1">
<?php
$connect = pg_connect("host=localhost port=5432 dbname=pediatria user=postgres password=movilnet");
?>
<h1>
<table align="center"><tr><td class="sr" style="text-decoration:none">Sistema de Registro en Línea para PEDIATRIA</td></tr>
<table align="center"><tr><td class="sr" style="text-decoration:none">Módulo para Solicitar una Cita en Línea</td></tr>
</table>
</table></h1>
<table width="200" align="center" class="bordetbl1">
<tr>
<td class="tit1">Escriba la Cédula:</td>
<td><input type="text" name="cedula" size="15" maxlength="15" align="right" class="color1"/></td>
<td><input type="submit" name="buscar" value="Buscar"></td>
</tr>
</table>
<?php
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
////////////////////// valida cedula en blanco
$cedula = $_POST['cedula'];
if(empty($cedula) && $_POST['buscar'])
{
echo "<script type='text/javascript'>
alert('Debe escribir su Cédula antes de Seguir');
window.location='';
</script>";
}
$cedula = $_POST['cedula'];
$apellido = $_POST['apellido'];
if($cedula && $_POST['buscar'])
{
$query="SELECT cedula FROM public.pacientes WHERE cedula=$cedula";
$res=@pg_query($connect,$query);
if(@pg_num_rows($res)==0)
{
?>
<script type='text/javascript'>
var agree=confirm("La Cedula aún no esta Registrada.\nDebe registrarse con la Cedula del Representante\npara optar por una Cita\n¿Desea Registrarse Ahora mísmo?");
if (agree)
window.location='crearhistoria.php?nro=<?php echo $cedula?>';
else
window.location='citas.php';
</script>
<?php
}
else
{
if ($_POST['cedula'])
{
$consulta2 = "SELECT pacientes.nrohistoria,
pacientes.nombres,
pacientes.apellidos,
pacientes.direccion,
pacientes.cta_correo,
pacientes.telefono,
pacientes.fecha_nac,
pacientes.id_paciente
FROM pacientes
WHERE public.pacientes.cedula = {$_POST['cedula']}";
$consulta3 = @pg_query($connect,$consulta2);
$consulta3 = @pg_fetch_array($consulta3);
}
?>
</form>
<form name="form2" action="cargacita.php" method="get">
<table>
<td>
<tr>
<!-- <input type="hidden" name="cedula" value="<?php echo $cedula; ?>"/>
--> <td>Nombres:
<input type="text" name="nombres" size="50" maxlength="50" align="right" value="<?php echo $consulta3['nombres']?>" readonly="t" />
</td>
</tr>
<tr>
<td>Apellidos:
<input type="text" name="apellidos" size="50" maxlength="50" align="right" value="<?php echo $consulta3['apellidos']?>" readonly="t"/></td>
</tr>
<?php
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
$connect = pg_connect("host=localhost port=5432 dbname=pediatria user=postgres password=movilnet");
$sql="select * from estado order by nombre asc";
$res=@pg_query($connect,$sql);
?>
<TR>
<td><div>
<?php echo "Estado:"." "." "." "." "." " ." " ." "." "." " ." "." "." "." "." "." "." "." "." "?>
<select name="estado" onchange="from(document.form.estado.value,'mun','municipios.php')">
<option value="0">Seleccione el Estado</option>
<?php
while ($reg=pg_fetch_array($res))
{
?>
<option value="<?php echo $reg["id"];?>"><?php echo $reg["nombre"];?></option>
<?php
}
?>
</select>
</div>
</td>
</TR>
<tr>
<td><div id="mun">
<?php echo "Municipio:"." "." "." "." " ." "." "." "." "." "." "." "." "." " ?>
<select name="mun">
<option value="0">Seleccione el municipio</option></select>
</div>
</td>
</tr>
<tr>
<td><div id="parr">
<?php echo "Parroquia:"." " ." " ." "." "." "." "." "." "." "." "." "." "." "." " ?>
<select name="parr">
<option value="0">Seleccione la parroquia</option></select>
</div>
</td>
</tr>
<tr>
<td><?php echo "Direccion:" ." "." "." "." "." "." "." "." "." "." "." "." "." "." "?>
<input type="text" name="direccion" size="50" maxlength="50" value="<?php echo $consulta3['direccion']?>" readonly="t"/>
</td>
</tr>
<tr>
<td><?php echo "Telefono:"." "." "." "." "." "." "." "." "." "." "." "." "." "." "." "?>
<input type="text" name="telefono" size="10" maxlength="10" value="<?php echo $consulta3['telefono']?>" readonly="t"/>
</td>
</tr>
<tr>
<td><?php echo "Cuenta de correos:"." "?>
<input type="text" name="correo" size="50" maxlength="50" value="<?php echo $consulta3['cta_correo']?>" readonly="t"/>
</td>
</tr>
<tr>
<td><?php echo "Fecha de la Cita:"." "." "." "?>
<input type="text" name="correo" size="10" maxlength="10" value="" readonly="t"/>
</td>
</tr>
</tr>
</table></fieldset>
</form>
<?php
}
}
?>
</body>
</html>
Valora esta pregunta


0