Ver Mensaje Individual
  #7 (permalink)  
Antiguo 10/06/2007, 10:09
primerdan
 
Fecha de Ingreso: mayo-2007
Mensajes: 18
Antigüedad: 17 años, 8 meses
Puntos: 0
Re: Intercambiar dos valores (un precio)

Te pongo el código . Esta un poco liado
Código:
<?php require_once('../Connections/ruralspainproperties.php'); ?>
<?php
if (!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;
}
}
mysql_select_db($database_ruralspainproperties, $ruralspainproperties);
$query_rsResultados = "SELECT propiedad_id, nombre_propiedad, comunidad_autonoma, provincia, poblacion, referencia, precio_eur, precio_gbp, sup_construida_m2, sup_construida_ft2, habitaciones, miniatura_url, mapa_url FROM propiedades ORDER BY propiedad_id DESC";
$rsResultados = mysql_query($query_rsResultados, $ruralspainproperties) or die(mysql_error());
$row_rsResultados = mysql_fetch_assoc($rsResultados);
$totalRows_rsResultados = mysql_num_rows($rsResultados);

if(isset($_GET['tipo_precio']) && $_GET['tipo_precio']=="precio_gbp"){
     $precio = $row_rsResultados['precio_eur'];
}else{
     $precio = $row_rsResultados['precio_gbp'];
}
?>


<body>

<!-- INICIO ANCHO PAGINA -->

<div id="container">

	<!-- INICIO CABECERA -->
<?php require_once('includes/header.php'); ?>
	<!-- FIN CABECERA -->
	
	<!-- INICIO NAVEGACION -->
	
	<div id="navegacion">
	
		<!-- INICIO MENU IZDA -->
<?php require_once('includes/menu.php'); ?>
		<!-- FIN MENU IZDA -->
		
		<!-- INICIO QUICK PROPERTY SEARCH -->
		<?php include('search.php'); ?>
		<!-- FIN QUICK PROPERTY SEARCH -->	
	
		<!-- INICIO LEGAL -->
		
		<?php require_once('includes/legal.php'); ?>
		
		<!-- FIN LEGAL -->
	</div>
	
<!-- FIN NAVEGACION -->
	
	<!-- INICIO CUERPO CENTRAL -->
	
  <div id="contenido">
	
		<div id="search_results_titular"><h3>SEARCH RESULTS</h3></div>
		
        <?php do { ?>
        <?php if ($totalRows_rsResultados > 0) { // Show if recordset not empty ?>
    <div id="search_results_fondo">
            
            <!-- INICIO CONTENEDOR FOTO -->
            
            <div id="search_results_foto"><a href="13_a_property_information.php?propiedad_id=<?php echo $row_rsResultados['propiedad_id']; ?>&amp;referencia=<?php echo $row_rsResultados['referencia']; ?>&amp;provincia=<?php echo $row_rsResultados['provincia']; ?>"><img src="<?php echo $row_rsResultados['miniatura_url']; ?>" alt="photo" title="photo" /></a></div>
			  
<!-- FIN CONTENEDOR FOTO -->
            
            <!-- INICIO CONTENDEDOR TEXTO -->
            
            <div id="search_results_texto">			
              <ul>
                <li><span class="destacado_negrita"><a href="13_a_property_information.php?propiedad_id=<?php echo $row_rsResultados['propiedad_id']; ?>&amp;referencia=<?php echo $row_rsResultados['referencia']; ?>&amp;provincia=<?php echo $row_rsResultados['provincia']; ?>" class="general_enlace"><?php echo $row_rsResultados['nombre_propiedad']; ?></a></span></li>
				  <li>Village/Town: <?php echo $row_rsResultados['poblacion']; ?></li>
				  <li>Province: <?php echo $row_rsResultados['provincia']; ?></li>
				  <li>Ref. <?php echo strtoupper($row_rsResultados['referencia']); ?></li>
				  <li>Bedrooms <span class="destacado_negrita"><?php echo $row_rsResultados['habitaciones']; ?></span></li>
				  <li>Build Size: <?php echo number_format($row_rsResultados['sup_construida_ft2'],0,'.',','); ?> aprox. | <a href="javascript:;" class="general_boton_flecha">SQUARE METERS</a></li>
			      <li><?php echo $precio; ?>|<a href="<?php echo $_SERVER['PHP_SELF'];?>?tipo_precio=precio_eur"> EUROS</a></li>
		      </ul>
		      <div class="clear"></div>			
	  </div>
	    <div class="clear"></div>
			  
			<!-- FIN CONTENEDOR TEXTO -->
    </div>
          
    <?php } // Show if recordset not empty ?>
<p>
            <?php } while ($row_rsResultados = mysql_fetch_assoc($rsResultados)); ?>
    </p>
          
          <?php if ($totalRows_rsResultados == 0) { // Show if recordset empty ?>
<div id="search_results_fondo2">
            <!-- INICIO CONTENEDOR FOTO -->
            <!-- FIN CONTENEDOR FOTO -->
            <!-- INICIO CONTENDEDOR TEXTO -->
<div id="search_results_texto2">
      </div>
            <div class="clear">
              <div id="titol">
                <div> 
                  <p align="center"><strong>Search results:</strong>There are no results for your search</p>
                </div>
              </div>
            </div>
            <!-- FIN CONTENEDOR TEXTO -->
    </div>
          
<?php } // Show if recordset empty ?>
<p>&nbsp; </p>
  </div>
	<div class="clear"></div>
    
	
	<!-- FIN CUERPO CENTRAL -->

</div>

<!-- FIN ANCHO PAGINA -->

</body>
</html>
<?php
mysql_free_result($rsResultados);
?>