".number_format($price)." €"; echo "
PROPERTY REF".$ref."
"; $publish_up_new=$publish_up; $sqlpublish_up="select publish_up from sbp2.vfox_iproperty where mls_id = '$ID_LISTING'"; $resultpublish_up=mysqli_query($connection,$sqlpublish_up) or die("could not do sql on line 114"); while ($rowpublish_up=mysqli_fetch_array($resultpublish_up)) {extract($rowpublish_up);} if ($publish_up >= $publish_up_new) {$publish_up=$publish_up_new;} echo "
URL link to propertyhttp://www.villasfox.com/property?id=".$ID_LISTING."
"; if ($vtour <> '') {echo "
URL link to virtual tour http://www.villasfox.com/vtour?id=".$ID_LISTING."
";} echo "
Date property first listed".$publish_up."
"; $date1 = $publish_up; $date2 = date('m/d/Y h:i:s a', time()); //Convert them to timestamps. $date1Timestamp = strtotime($date1); $date2Timestamp = strtotime($date2); //Calculate the difference. $difference = intval(($date2Timestamp - $date1Timestamp)/(60*60*24)); echo "
Days advertised ".$difference." days
"; /*echo "
Views on www.villasfox.com".$hits."
"; echo "
Total constructed size (m2)$square_feet
";$sqft_saved=$square_feet; $ppm2=($price/($sqft+0.001)); echo "
Price per m2 constructed area".number_format($ppm2,0)."
"; //Lets calculate the benchmark // $cunter=0; $minagreed_price=9999999999; $sql3c="select agreed_price,square_feet from sbp2.smf_smds_cont_sales_progress join sbp2.vfox_osrs_properties on propref=ref where (agreed_price/'$price') >0.6 and (agreed_price/'$price')20 and idsscsp < 275000 order by idsscsp desc limit 100"; $result3c=mysqli_query($connection,$sql3c) or die("could not do sql on line 160"); while ($row3c=mysqli_fetch_array($result3c)) { extract ($row3c); $cunter=$cunter+1; $totppm2=$totppm2+($agreed_price/$sqft); if ($agreed_price>$maxagreed_price) {$maxagreed_price=$agreed_price;} if ($agreed_price<$minagreed_price) {$minagreed_price=$agreed_price;} } $benchmark=$totppm2/$cunter; echo "
Benchmark (the average price/m2 observed for previous ".$cunter." sales of properties in this price range)".(number_format($benchmark,0))."
"; echo "
Variation between advertised price/m2 and benchmark price/m2".number_format((($ppm2/$benchmark)*100)-100,1)." %"; echo "Benchmark price".number_format(($sqft_saved*$benchmark),0)." €"; echo "
"; echo "
Properties used in the benchmark comparison sold for final agreed prices between ".$minagreed_price." € and ".$maxagreed_price." €"; if ($propcode99=='') {echo "<align=center>Owners will see a button here which allows them to view lots of detailed information about similar properties to theirs which have already sold, including metres, number of bedrooms and bathrooms, plot size, location and final selling price.";} else {echo "