Buenas a todos
me estoy volviendo loco aiudarme por favor
Tengo echo esto formulario y me funciona, pero.......,
quiero que en los campos Zona - Calle
el usuario pueda añadir en los apartados mencionados tramite una nueva ventana ( que se sierre automaticamente al selecionar insertar),y actualize
el dato en la respectiva casilla, dejandola relazionada a las casillas anteriores
<?php require_once('Connections/citta.php'); ?>
<?php
//NeXTenesio Special List Recordset
mysql_select_db($database_citta, $citta);
$query_Paises = "SELECT * FROM paises ORDER BY pais ASC";
$Paises = mysql_query($query_Paises, $citta) or die(mysql_error());
$row_Paises = mysql_fetch_assoc($Paises);
$totalRows_Paises = mysql_num_rows($Paises);
//End NeXTenesio Special List Recordset
//NeXTenesio Special List Recordset
$colname_Provincias = "-1";
if (isset($_POST['id_pais'])) {
$colname_Provincias = $_POST['id_pais'];
}
mysql_select_db($database_citta, $citta);
$query_Provincias = sprintf("SELECT id_provincia, provincia FROM provincias WHERE id_pais = '%s' ORDER BY provincia ASC", $colname_Provincias);
$Provincias = mysql_query($query_Provincias, $citta) or die(mysql_error());
$row_Provincias = mysql_fetch_assoc($Provincias);
$totalRows_Provincias = mysql_num_rows($Provincias);
//End NeXTenesio Special List Recordset
//NeXTenesio Special List Recordset
$colname_Ciudades = "-1";
if (isset($_POST['id_provincia'])) {
$colname_Ciudades = $_POST['id_provincia'];
}
mysql_select_db($database_citta, $citta);
$query_Ciudades = sprintf("SELECT id_ciudad, ciudad FROM ciudades WHERE id_provincia = '%s' ORDER BY ciudad ASC", $colname_Ciudades);
$Ciudades = mysql_query($query_Ciudades, $citta) or die(mysql_error());
$row_Ciudades = mysql_fetch_assoc($Ciudades);
$totalRows_Ciudades = mysql_num_rows($Ciudades);
//End NeXTenesio Special List Recordset
//NeXTenesio Special List Recordset
$colname_Zonas = "-1";
if (isset($_POST['id_ciudad'])) {
$colname_Zonas = $_POST['id_ciudad'];
}
mysql_select_db($database_citta, $citta);
$query_Zonas = sprintf("SELECT id_zona, zona FROM zonas WHERE id_ciudad = '%s' ORDER BY zona ASC", $colname_Zonas);
$Zonas = mysql_query($query_Zonas, $citta) or die(mysql_error());
$row_Zonas = mysql_fetch_assoc($Zonas);
$totalRows_Zonas = mysql_num_rows($Zonas);
//End NeXTenesio Special List Recordset
//NeXTenesio Special List Recordset
$colname_Calles = "-1";
if (isset($_POST['id_zona'])) {
$colname_Calles = $_POST['id_zona'];
}
mysql_select_db($database_citta, $citta);
$query_Calles = sprintf("SELECT id_calle, calle FROM calles WHERE id_zona = '%s' ORDER BY calle ASC", $colname_Calles);
$Calles = mysql_query($query_Calles, $citta) or die(mysql_error());
$row_Calles = mysql_fetch_assoc($Calles);
$totalRows_Calles = mysql_num_rows($Calles);
//End NeXTenesio Special List Recordset
?>
<style type="text/css">
<!--
.Estilo1 {
font-size: 20px;
font-weight: bold;
}
.Estilo2 {
font-size: 14px;
font-weight: bold;
}
-->
</style>
<form name="form1" method="post" action="">
<table width="83%" border="0" align="center">
<tr align="center" valign="middle">
<td height="21"> </td>
<td> </td>
<td colspan="2"> </td>
<td colspan="2"> </td>
<td colspan="7"> </td>
<td> </td>
</tr>
<tr align="center" valign="middle">
<td height="48"> </td>
<td> </td>
<td width="4%"><div align="center" class="Estilo1"></div></td>
<td colspan="8"><span class="Estilo1">Ubicacion Inmueble </span></td>
<td width="7%"> </td>
<td width="1%"> </td>
<td> </td>
</tr>
<tr align="center" valign="middle">
<td height="21"> </td>
<td> </td>
<td colspan="2"> </td>
<td colspan="2"> </td>
<td colspan="7"> </td>
<td> </td>
</tr>
<tr align="center" valign="middle">
<td width="10%" height="48"><strong>Pais:</strong></td>
<td width="17%"><select name="id_pais" id="id_pais" onChange="submit()">
<option value="" <?php if (!(strcmp("", $_POST['id_pais']))) {echo "SELECTED";} ?>>Seleccionar</option>
<?php
do {
?>
<option value="<?php echo $row_Paises['id_pais']?>"<?php if (!(strcmp($row_Paises['id_pais'], $_POST['id_pais']))) {echo "SELECTED";} ?>><?php echo $row_Paises['pais']?></option>
<?php
} while ($row_Paises = mysql_fetch_assoc($Paises));
$rows = mysql_num_rows($Paises);
if($rows > 0) {
mysql_data_seek($Paises, 0);
$row_Paises = mysql_fetch_assoc($Paises);
}
?>
</select></td>
<td colspan="7"><strong>Provincia:</strong></td>
<td width="17%"><select name="id_provincia" id="id_provincia" onChange="submit()">
<option value="" <?php if (!(strcmp("", $_POST['id_provincia']))) {echo "SELECTED";} ?>>Seleccionar</option>
<?php
do {
?>
<option value="<?php echo $row_Provincias['id_provincia']?>"<?php if (!(strcmp($row_Provincias['id_provincia'], $_POST['id_provincia']))) {echo "SELECTED";} ?>><?php echo $row_Provincias['provincia']?></option>
<?php
} while ($row_Provincias = mysql_fetch_assoc($Provincias));
$rows = mysql_num_rows($Provincias);
if($rows > 0) {
mysql_data_seek($Provincias, 0);
$row_Provincias = mysql_fetch_assoc($Provincias);
}
?>
</select></td>
</tr>
<tr align="center" valign="middle">
<td height="40"><strong>Ciudad:</strong></td>
<td colspan="5">
<select name="id_ciudad" id="id_ciudad" onChange="submit()">
<option value="" <?php if (!(strcmp("", $_POST['id_ciudad']))) {echo "SELECTED";} ?>>Seleccionar</option>
<?php
do {
?>
<option value="<?php echo $row_Ciudades['id_ciudad']?>"<?php if (!(strcmp($row_Ciudades['id_ciudad'], $_POST['id_ciudad']))) {echo "SELECTED";} ?>><?php echo $row_Ciudades['ciudad']?></option>
<?php
} while ($row_Ciudades = mysql_fetch_assoc($Ciudades));
$rows = mysql_num_rows($Ciudades);
if($rows > 0) {
mysql_data_seek($Ciudades, 0);
$row_Ciudades = mysql_fetch_assoc($Ciudades);
}
?>
</select>
</div></td>
<td colspan="7"><strong>Zona:</strong> </td>
<td><select name="id_zona" id="id_zona" onChange="submit()">
<option value="" <?php if (!(strcmp("", $_POST['id_zona']))) {echo "SELECTED";} ?>>Seleccionar</option>
<?php
do {
?>
<option value="<?php echo $row_Zonas['id_zona']?>"<?php if (!(strcmp($row_Zonas['id_zona'], $_POST['id_zona']))) {echo "SELECTED";} ?>><?php echo $row_Zonas['zona']?></option>
<?php
} while ($row_Zonas = mysql_fetch_assoc($Zonas));
$rows = mysql_num_rows($Zonas);
if($rows > 0) {
mysql_data_seek($Zonas, 0);
$row_Zonas = mysql_fetch_assoc($Zonas);
}
?>
</select></td>
</tr>
<tr align="center" valign="middle">
<td height="40"><strong>Calle:</strong> </td>
<td><select name="id_calle" id="id_calle" onChange="submit()">
<option value="" <?php if (!(strcmp("", $_POST['id_calle']))) {echo "SELECTED";} ?>>Seleccionar</option>
<?php
do {
?>
<option value="<?php echo $row_Calles['id_calle']?>"<?php if (!(strcmp($row_Calles['id_calle'], $_POST['id_calle']))) {echo "SELECTED";} ?>><?php echo $row_Calles['calle']?></option>
<?php
} while ($row_Calles = mysql_fetch_assoc($Calles));
$rows = mysql_num_rows($Calles);
if($rows > 0) {
mysql_data_seek($Calles, 0);
$row_Calles = mysql_fetch_assoc($Calles);
}
?>
</select>
?>
</select></td>
<td> </td>
</tr>
</table>
<hr width="83%" size="7" noshade>
</form>
<form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="form2" id="form2">
<p> </p>
<table width="83%" border="0" align="center" id="dettaglio">
<tr align="center" valign="middle">
<td width="13%" height="49"> </td>
<td width="20%"> </td>
<td width="21%"> </td>
<td width="2%"> </td>
<td width="16%"> </td>
<td width="7%"> </td>
</tr>
</table>
<hr width="83%" size="7" noshade>
<p>
<input name="pais" type="hidden" id="pais" value="<?php echo $_POST['id_pais'];?>">
<input name="provincia" type="hidden" id="provincia" value="<?php echo $_POST['id_provincia'];?>">
<input name="ciudad" type="hidden" id="ciudad" value="<?php echo $_POST['id_ciudad'];?>">
<input name="zona" type="hidden" id="zona" value="<?php echo $_POST['id_zona'];?>">
<input name="calle" type="hidden" id="calle" value="<?php echo $_POST['id_calle'];?>">
</p>
<label><input name="Submit" type="submit" id="Submit" accesskey="E" value="Enviar" />
</label>
<input type="hidden" name="MM_insert" value="form2">
</form>
<p>
<p>
<?php
mysql_free_result($Paises);
mysql_free_result($Provincias);
mysql_free_result($Ciudades);
mysql_free_result($Zonas);
mysql_free_result($Calles);
?>
Muchas gracias