include("include/escape.php");?>
include("include/all.php");?>
include("include/lang.php");?>
$k = GetKey();
$ID = toGet($_GET['ID'], $_POST['ID']);
$miSend = toGet($_GET['miSend'], $_POST['miSend']);
$AddList = toGet($_GET['AddList'], $_POST['AddList']);
$Action = toGet($_GET['Action'], $_POST['Action']);
$ip = getenv(REMOTE_ADDR);
mysql_query("insert into t_visitors (PageType, IP, EstateID) values('Estate', '".$ip."', '".$ID."')");
if ($miSend != '') {
switch($Action) {
case 'AddList' :
if (!isset($_COOKIE['AddList'])) {
if (IsHave("Select * from t_add_list where EstateID='".$ID."' and CookieID='".session_id()."'") == 0) {
$sql = "insert into t_add_list (EstateID, CookieID, ADate) values ('".$ID."', '".session_id()."', '".date("Y-m-d H:i:s")."')";
mysql_query($sql);
setcookie("AddList", session_id(), time()+360000000);
header("Location: advert_detail.php?ID=".$ID."");
}
} else {
if (IsHave("Select * from t_add_list where EstateID='".$ID."' and CookieID='".$_COOKIE['AddList']."'") == 0) {
$sql = "insert into t_add_list (EstateID, CookieID, ADate) values ('".$ID."', '".$_COOKIE['AddList']."', '".date("Y-m-d H:i:s")."')";
mysql_query($sql);
}
}
break;
}
}
?>
$x=1;
$t = 1;
$z = 1;
$sql = "select count(*) as count_row from t_advert where Visible='1' and DisplayAdvert='1'";
$record_count = CountRow($sql);
if ($record_count > 0) {
$record_per_page = GetName("select * from t_count_page","DisplayCount");
$page_count = ceil($record_count/$record_per_page);
}
$sql = "select
t1.*, ".GetCurrency($_SESSION['LangCurrency'])."
t2.Name as estate_type,
t3.Name as estate_status,
t4.Name as estate_township,
t6.Currency as estate_rent_currency,
t7.Images as estate_images,
t8.Name as estate_city
from t_advert t1
inner join t_properties t2 on t2.PageType='EstateType'
inner join t_properties t3 on t3.PageType='EstateStatus'
inner join t_properties t4 on t4.PageType='TownShip'
inner join t_exchange t6 on t6.Currency=t1.RentCurrency
inner join t_advert_images t7 on t7.ParentID=t1.ID
inner join t_properties t8 on t8.PageType='City'
where
t2.ItemID = t1.EstateType and t2.PageLang='".$_SESSION['Lang']."' and
t3.ItemID = t1.EstateStatus and t3.PageLang='".$_SESSION['Lang']."' and
t4.ID = t1.TownShipID and
t6.Currency = t1.RentCurrency and
t7.ParentID = t1.ID and t7.Seq = (select min(Seq) from t_advert_images where Visible='1' and ParentID=t1.ID group by Seq LIMIT 0,1) and
t8.ID = t1.CityID and
t1.Visible='1' and t1.DisplayAdvert='1' order by ListPrice limit ".($_GET['page_no']*$record_per_page).",".$record_per_page;
$qrDisplay = mysql_query($sql);
while($rsDisplay = mysql_fetch_array($qrDisplay)) {
?>