| Server IP : 104.21.17.213 / Your IP : 216.73.217.141 Web Server : Apache System : Linux hosting01.arsenalhost.com 4.18.0-425.13.1.lve.el8.x86_64 #1 SMP Mon Feb 27 15:23:24 EST 2023 x86_64 User : corbizre ( 1013) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/corbizre/nextgreathome.com/ |
Upload File : |
<?php
include_once "config.php";
include_once "lib/common.lib.php";
require_once "lib/main.php";
require_once "lib/dbmysql.class.php";
error_reporting(0);
$db2 = new DbMySQL(DB_HOST2, DB_NAME2, DB_USER2, DB_PWD2);
if(!$db2->connect()){
header('HTTP/1.0 500 Internal Server Error');
exit;
}
$sql = "SELECT count(*) as houses_count FROM houses WHERE ID not in (select house_id from houses_spintext) and true_state is not null and true_state!=''";
$houses_count = $db2->select_row($sql);
echo "HOUSES for UPDATE:".$houses_count['houses_count']."\n";
$processing = 100;
echo $iterations_number = ceil($houses_count['houses_count'] / $processing);
$i=0;
for ($iteration = 0; $iteration < $iterations_number; $iteration++) {
$sql = "SELECT * FROM houses WHERE ID not in (select house_id from houses_spintext) and true_state is not null and true_state!='' LIMIT ".($iteration * $processing).",".$processing;
$houses = $db2->select($sql);
foreach($houses as $key=>$house){
$sql = "select * from images where house_id='".$house['ID']."' and state = 4";
$images = $db2->select_row($sql);
$base_text = "<h2>{Common|General} {Property|Home|House|Listing} {Info|Information|Description|Facts}</h2>
<p>{House|Home|Property|Listing} was {recorded|added|listed|placed|proposed} {".$house['status']."|} on www.nextgreathome.com from ".date_format(date_create($house['created_date']), 'm/d/Y H:i:s').".</p>";
if($house['market_type']=='Listed'){
$base_text .= "<p>{Owner|Landlord} appointed \"Listed\� status for this {property|listing|row|asset}, it {means|denotes|indicates} that property {became|can be|already} opened for {offers|proposes|reviews|propositions} coming from {potential|possibile|possible} {home|house|property} {buyers| customers|consumers|clients|purchasers}.</p>";
}
if($house['market_type']=='Coming Soon'){
$base_text .= "<p>The {property|listing|row|asset} you reviewing has \"COMING SOON\" status, so at the {moment|consequenc} the {owner|proprietor|landlord} isn't accepting the {offers|proposes|submits|bids|proposals|propositions}.</p>";
}
if($house['market_type']=='Sale Pending'){
$base_text .= "<p>Sale Pending status means that a {home|house|property|listing} is {under|subordinate} contract, depending from the {local|regional} MLS {rules|regulations|standards}. Backup contract can be submitted in most cases, {but|however} it {usually|normally|typically} {means|intends} that the {home|house|listing} is about to {change|replace|switch} {hands|owner|landlord}.</p>";
}
if($house['price']){
$house['price'] = str_replace("$","",$house['price']);
$base_text .="<p>According to our {information|info|info from MLS database} the {property|listing|home|item} price is $".$house['price'].", {but| however|but sure} you {can ask|can check|can request|can get} more exact {info|information|details} from your {agent|realtor} or from {listing|property|house|home} owner.</p>";
}else{
$house['price'] = "NA";
$base_text .="<p>We don't have {information|info} about {price|rate|cost} for this {property|listing|home|item}, {but| however|but sure} you {can ask|can check|can request|need to check|} more {info|information|details} from your {agent|realtor} or directly contact with {listing|property|house|home} owner.</p>";
}
$base_text .= "
<h3>{Property|Home|House|Listing} {Geographic Location|Geo Location|Placement|Location}</h3>";
if($house['address']!=''){
$base_text .= "<p>This {house|home|listing|property|building} is {positioned|located|placed} in ".$house['city']." city, ".$house['state'].". {Address in US Format|Address|Addr.}: <strong>".$house['address'].", ".$house['city'].", ".$house['state']." ".$house['zip']."</strong><br/>";
}
$base_text .= "{More|Full|All|Complete} {info|information|details} about {property|home|house|estate|asset|realty|listing} {location|geographic location|geo location|placement} you can {get|see} on Google Map and Street view {below|on the bottom of this page}.<br/> ";
if(count($images)==0){
$base_text .="We have no {pictures|images|pics|photos} assigned to this {listing|property|house|home}. To get {additional|extra|fresh|more|new} {pictures|images|pics|photos} you can {call to|telephone to} listing {agent|owner}.";
}
if(count($images)==1){
$base_text .="This {listing|property|house|home} {contains|haves|includes} a one {picture|image|pic|photo} assigned to it {and} for {additional|extra|fresh|more|new|other} {pictures|images|pics|photos} you can email or {call|telephone} listing {agent|owner}.";
}
if(count($images)>1){
$base_text .="This {listing|property|house|home} {contains|haves|includes} {".convertNumber(count($images))."|".count($images)."} {pictures|images|pics|photos} assigned to it {and} for {additional|extra|fresh|more|new|other} {pictures|images|pics|photos} you can {call|contact with|ask} listing {agent|owner}.";
}
$base_text .="</p>";
$base_text .="<h3>{Property|Home|House|Estate|Asset|Realty|Listing} {History|Historical} {Records|Report|Logs|Facts}</h3>";
$base_text .="<p>";
if($house['construction_year']){
$base_text .="The ".$house['status_type']." {residence|home|house|listing|property|realty} was built in ".$house['construction_year'].". ";
}
$base_text .="The ".$house['type']." {listing|property|realty} was updated in ".date_format(date_create($house['last_update']), 'm/d/Y').". ";
$base_text .="</p>";
if($house['rooms']||$house['area']||($house['bedrooms']&&$house['bathrooms'])){
$base_text .="<h3>{Property|Listing|Rooms} capacity</h3>";
$base_text .="<p>";
if($house['rooms']){
$base_text .="{When|During|Whereas} you {purchase|buy} this {property|estate|assets|house|listing} you {get|receive} ".convertNumber((int)$house['rooms'])." {good|nice|excellent} looking {rooms|spaces}.";
}else{
$base_text .="{When|During|Whereas} you {purchase|obtain|buy} this {property|estate|assets|house|listing} you {get|receive} ".$house['rooms']." {good|nice|excellent} looking {rooms|spaces}."; }
if($house['area']){
$base_text .="This {home|house|listing|property} includes ".$house['area']." of {total|sum|general} area.";
}
if($house['bedrooms']&&$house['bathrooms']){
$base_text .="This {home|house|property|listing} {comes with|includes|contains} {".$house['bedrooms']."|".convertNumber($house['bedrooms'])."} {bedrooms|beds} {and|plus} {".convertNumber($house['bathrooms'])."|".$house['bathrooms']."} {bathrooms|baths|toilets}. ";
}
$base_text .="</p>";
}
if($house['agent']){
$base_text .="<h4>{Do you want|If you want|If you need} to {contact|connect|ask} listing {agent|owner} for details?</h4>";
$base_text .="<p>If you are {ready|want} to go {ahead|forward} with this {property|estate|assets|listing} {please|try|feel free} {connect|ask|connect} with ".trim($house['agent']).".";
if($house['brokerage_email']!=''){
$base_ctext ="{Just|Please|Try to} {send|send mail} {message|note|question} to this {email address|mailbox}: ".$house['brokerage_email'].".";
}
if($house['brokerage_phone']!=''){
$base_ctext ="{Just|Please|Try to} call to this {number|phone|phone num|tel}: ".$house['brokerage_phone'].".";
}
if($house['brokerage_phone']!=''&&$house['brokerage_email']!=''){
$base_ctext ="{Just|Please|Try to} {send|forward|send mail} {message|note|question} to this {email address|box}: ".$house['brokerage_email']." or phone to this {number|phone|phone num|tel}: ".$house['brokerage_phone'].".";
}
$base_text = $base_text." ".$base_ctext."</p>";
}else{
$base_text .="<h4>{Do you want|If you want|If you need} to {contact with|connect with|ask} listing {agent|owner} for details?</h4>";
$base_text .="<p>If you are {ready|want} to go {ahead|forward} with this {property|estate|assets|listing} {please|try|feel free} {connect|ask|connect} with any {".$house['city']." realtor|agent in ".$house['city']."|local real estate agent|".$house['city']." licensed agent}.";
}
//echo $house['agent'];
$spin_text = spin($base_text);
$sql = "insert ignore into houses_spintext set house_id='".$house['ID']."', spin_text='".mysqli_real_escape_string($db2->getLink(), $spin_text)."'";
echo "insert spin for house:".$house['ID']."\n";
$db2->query($sql);
//exit;
}
}
?>