<?php require_once('Connections/conn.php'); ?><?phpif (!function_exists("GetSQLValueString")) {function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue;}}$editFormAction = $_SERVER['PHP_SELF'];if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);}if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) { $insertSQL = sprintf("INSERT INTO anuncios (gestione, tipo, m_int, m_parcela, salon, cocina, baño, terraza, planta, ascensor, foto1, foto2, foto3, foto4, region, provincia, ciudad, zona, calle, ) VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['gestione'], "text"), GetSQLValueString($_POST['tipo'], "text"), GetSQLValueString($_POST['m_int'], "text"), GetSQLValueString($_POST['m_parcela'], "text"), GetSQLValueString($_POST['salon'], "text"), GetSQLValueString($_POST['cocina'], "text"), GetSQLValueString($_POST['baño'], "text"), GetSQLValueString($_POST['terraza'], "text"), GetSQLValueString($_POST['planta'], "text"), GetSQLValueString($_POST['ascensor'], "text"), GetSQLValueString($_POST['foto1'], "text"), GetSQLValueString($_POST['foto2'], "text"), GetSQLValueString($_POST['foto3'], "text"), GetSQLValueString($_POST['foto4'], "text"), GetSQLValueString($_POST['region'], "text"), GetSQLValueString($_POST['provincia'], "text"), GetSQLValueString($_POST['ciudad'], "text"), GetSQLValueString($_POST['zona'], "text"), GetSQLValueString($_POST['calle'], "text")); mysql_select_db($database_conn, $conn); $Result1 = mysql_query($insertSQL, $conn) or die(mysql_error()); $insertGoTo = "ver_form.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo));}?><?php//NeXTenesio Special List Recordsetmysql_select_db($database_conn, $conn);$query_Regiones = "SELECT * FROM regiones ORDER BY region ASC";$Regiones = mysql_query($query_Regiones, $conn) or die(mysql_error());$row_Regiones = mysql_fetch_assoc($Regiones);$totalRows_Regiones = mysql_num_rows($Regiones);//End NeXTenesio Special List Recordset//NeXTenesio Special List Recordset$colname_Provincias = "-1";if (isset($_POST['id_region'])) { $colname_Provincias = $_POST['id_region'];}mysql_select_db($database_conn, $conn);$query_Provincias = sprintf("SELECT id_provincia, provincia FROM provincias WHERE id_region = '%s' ORDER BY provincia ASC", $colname_Provincias);$Provincias = mysql_query($query_Provincias, $conn) 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_conn, $conn);$query_Ciudades = sprintf("SELECT id_ciudad, ciudad FROM ciudades WHERE id_provincia = '%s' ORDER BY ciudad ASC", $colname_Ciudades);$Ciudades = mysql_query($query_Ciudades, $conn) 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_conn, $conn);$query_Zonas = sprintf("SELECT id_zona, zona FROM zonas WHERE id_ciudad = '%s' ORDER BY zona ASC", $colname_Zonas);$Zonas = mysql_query($query_Zonas, $conn) 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_conn, $conn);$query_Calles = sprintf("SELECT id_calle, calle FROM calles WHERE id_zona = '%s' ORDER BY calle ASC", $colname_Calles);$Calles = mysql_query($query_Calles, $conn) 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: 9px}.Estilo2 {font-size: 10px}.Estilo3 {font-size: 12px}--></style><style type="text/css"><!--.Estilo5 {font-size: 24px}--></style><form name="form1" method="post" action=""> <table width="83%" border="0" align="center"> <tr align="center" valign="middle"> <td height="21"> </td> <td width="16%"> </td> <td colspan="2"> </td> <td colspan="2"> </td> <td colspan="3"> </td> <td width="16%" colspan="-3"> </td> </tr> <tr align="center" valign="middle"> <td height="48"> </td> <td> </td> <td colspan="5"><div align="center" class="Estilo1"></div> <span class="Estilo5">Ubicacion Inmueble </span></td> <td width="6%" colspan="-3"> </td> <td width="1%" colspan="-3"> </td> <td colspan="-3"> </td> </tr> <tr align="center" valign="middle"> <td height="21"> </td> <td> </td> <td colspan="2"> </td> <td colspan="2"> </td> <td colspan="3"> </td> <td colspan="-3"> </td> </tr> <tr align="center" valign="middle"> <td width="10%" height="48"><strong>Region:</strong></td> <td colspan="2"><select name="id_region" id="id_region" onChange="submit()"> <option value="" <?php if (!(strcmp("", $_POST['id_region']))) {echo "SELECTED";} ?>>Seleccionar</option> <?phpdo { ?> <option value="<?php echo $row_Regiones['id_region']?>"<?php if (!(strcmp($row_Regiones['id_region'], $_POST['id_region']))) {echo "SELECTED";} ?>><?php echo $row_Regiones['region']?></option> <?php} while ($row_Regiones = mysql_fetch_assoc($Regiones)); $rows = mysql_num_rows($Regiones); if($rows > 0) { mysql_data_seek($Regiones, 0); $row_Regiones = mysql_fetch_assoc($Regiones); }?> </select></td> <td width="19%"> </td> <td colspan="2"><strong>Provincia:</strong></td> <td colspan="4"><select name="id_provincia" id="select2" onChange="submit()"> <option value="" <?php if (!(strcmp("", $_POST['id_provincia']))) {echo "SELECTED";} ?>>Seleccionar</option> <?phpdo { ?> <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="64"><strong>Ciudad:</strong></td> <td colspan="2"> <p> <select name="id_ciudad" id="id_ciudad" onChange="submit()"> <option value="" <?php if (!(strcmp("", $_POST['id_ciudad']))) {echo "SELECTED";} ?>>Seleccionar</option> <?phpdo { ?> <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> </p> </td> <td colspan="3"><a href="#" target="reminder" onClick='window.open("ins_ciudad.php","reminder","width=250,height=160,scrollbars=0,resizable=0"); return false;'>Insertar Ciudad </a></td> <td colspan="3"> </td> <td colspan="-3"><p> </p> <p> </p></td> </tr> <tr align="center" valign="middle"> <td height="42"><strong>Zona:</strong> </td> <td height="42" colspan="2"><select name="id_zona" id="select4" onChange="submit()" > <option value="" <?php if (!(strcmp("", $_POST['id_zona']))) {echo "SELECTED";} ?>>Seleccionar</option> <?phpdo { ?> <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> <td height="42" colspan="3"><a href="#" target="reminder" onClick='window.open("ins_zona.php","reminder","width=250,height=160,scrollbars=0,resizable=0"); return false;'>Insertar Zona</a> </td> <td height="42" colspan="3"> </td> <td height="42"> </td> </tr> <tr align="center" valign="middle"> <td height="40"><strong>Calle:</strong> </td> <td height="40" colspan="2"><select name="id_calle" id="select5" onChange="submit()"> <option value="" <?php if (!(strcmp("", $_POST['id_calle']))) {echo "SELECTED";} ?>>Seleccionar</option> <?phpdo { ?> <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></td> <td height="40" colspan="3"><a href="#" target="reminder" onClick='window.open("ins_calle.php","reminder","width=250,height=160,scrollbars=0,resizable=0"); return false;'>Insertar Calle </a> </td> <td height="40" colspan="3"> </td> <td height="40"> </td> </tr> <tr align="center" valign="middle"> <td height="40" colspan="10"> </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 height="25"> </td> <td colspan="3"> </td> <td width="21%"> </td> <td colspan="3"> </td> <td> </td> <td> </td> </tr> <tr align="center" valign="middle"> <td height="48"> </td> <td width="1%"> </td> <td width="1%"> </td> <td width="18%"> </td> <td colspan="2"><span class="Estilo5">Descricion Inmueble</span></td> <td width="1%"> </td> <td width="1%"> </td> <td> </td> <td> </td> </tr> <tr align="center" valign="middle"> <td height="21"> </td> <td colspan="3"> </td> <td> </td> <td colspan="3"> </td> <td> </td> <td> </td> </tr> <tr align="center" valign="middle"> <td width="13%" height="48"><span class="Estilo2">Gestion : </span></td> <td colspan="3"><strong> <select name="gestione"> <option>Vendo</option> <option>Alquilo</option> <option>Traspaso</option> </select> </strong></td> <td><div align="right"><span class="Estilo2">Tipo Vivienda : </span></div></td> <td colspan="3"><strong> <select name="tipo"> <option>Apartamento</option> <option>Casa</option> <option>Chalet</option> <option>Piso</option> <option>Atico</option> <option>Sobre Atico</option> <option>Local</option> </select> </strong></td> <td width="16%"><span class="Estilo2">M² Interno : </span></td> <td width="7%"><input name="m_int" type="text" id="m_int" size="6" maxlength="6" /></td> </tr> <tr align="center" valign="middle"> <td height="49"><span class="Estilo2">Cocina :</span> </td> <td colspan="3"><strong> <select name="cocina"> <option>Independiente</option> <option>Americana</option> <option>Francesa</option> </select> </strong></td> <td><div align="right"><span class="Estilo2">Salon : </span></div></td> <td colspan="3"><strong> <select name="salon"> <option>Independiente</option> <option>Junto Cocina</option> </select> </strong></td> <td><span class="Estilo2">M² Parcela :</span> </td> <td><input name="m_parcela" type="text" id="m_parcela" size="6" maxlength="6" /></td> </tr> <tr align="center" valign="middle"> <td height="49"><span class="Estilo2">Baño:</span> </td> <td colspan="3"><strong> <select name="baño"> <option>1</option> <option>1+ Aseo</option> <option>2</option> <option>2+ Aseo</option> <option>3</option> </select> </strong></td> <td><div align="right"><span class="Estilo2">Terraza:<strong> <select name="terraza"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> </strong></span> </div></td> <td colspan="3"><strong><span class="Estilo2">Planta:<strong> <select name="planta"> <option>1º</option> <option>2º</option> <option>3º</option> <option>4º</option> <option>5º</option> <option>6º</option> <option>7º</option> <option>8º</option> <option>9º</option> <option>10º</option> <option>11º</option> <option>12º</option> <option>13º</option> <option>14º</option> <option>15º</option> <option>16º</option> <option>17º</option> <option>18º</option> <option>19º</option> <option>20º</option> <option>21º</option> <option>22º</option> <option>23º</option> <option>24º</option> <option>25º</option> <option>26º</option> <option>27º</option> <option>28º</option> <option>29º</option> <option>30º</option> </select> </strong></span> </strong></td> <td><span class="Estilo2">Ascensor:<strong> </strong></span></td> <td><div align="center"><span class="Estilo2"><strong> <select name="ascensor"> <option>Si</option> <option>No</option> </select> </strong></span></div></td> </tr> <tr align="center" valign="middle"> <td height="49"> </td> <td colspan="3"> </td> <td> </td> <td colspan="3"> </td> <td> </td> <td> </td> </tr> <tr align="center" valign="middle"> <td height="49"> </td> <td colspan="3"> </td> <td> </td> <td colspan="3"> </td> <td> </td> <td> </td> </tr> <tr align="center" valign="middle"> <td height="49" colspan="10"><input name="foto1" type="text" id="foto1"></td> </tr> <tr align="center" valign="middle"> <td height="44" colspan="10"><input name="foto2" type="text" id="foto2"></td> </tr> <tr align="center" valign="middle"> <td height="44" colspan="10"><input name="foto3" type="text" id="foto3"></td> </tr> <tr align="center" valign="middle"> <td height="44" colspan="10"><input name="foto4" type="text" id="foto4"></td> </tr> </table> <hr width="83%" size="7" noshade> <p> <input name="region" type="hidden" id="region" value="<?php echo $_POST['id_region'];?>"> <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'];?>"> <label><input name="Submit" type="submit" id="Submit" accesskey="E" value="Enviar" /></label><input type="hidden" name="MM_insert" value="form2"></form><p><p> <?phpmysql_free_result($Regiones);mysql_free_result($Provincias);mysql_free_result($Ciudades);mysql_free_result($Zonas);mysql_free_result($Calles);?>
<?php require_once('Connections/conn.php'); ?><title>Insertar Ciudad</title><table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#33CCFF" width="100%" height="76" bordercolorlight="#33CCFF" bordercolordark="#33CCFF"> <tr> <td width="100%" height="76"> <p align="center"><span lang="es"><font color="#FF0000"> Introduzca la Ciudad.</font></span></p> <form method="post" action="" > <p align="center"> <font color="#0000FF">Calle :</font> <input type=text name=ciudad size=26 maxlength=50> <input name="Submit" type="submit" id="Submit" accesskey="E" value="Aceptar" onClick="window.close()"> </p> </form></td> </tr></table>