-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathanuncio.php
214 lines (165 loc) · 6.25 KB
/
anuncio.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<?
#########################################################
#Copyright © e-Mobiliária. Todos os direitos reservados.#
#########################################################
# #
# Programa : e-Mobiliária PHP #
# Autor : Moisés Bach B. #
# E-mail : [email protected] #
# Versão : 2.5 #
# Modificado em : 09/12/2005 #
# Copyright © : e-Mobiliária #
# WWW.ANIMABUSCA.COM/IMOBILIARIA #
#########################################################
#ESTE SCRIPT NÃO PODE SER COPIADO SEM AUTORIZAÇÃO PRÉVIA#
#########################################################
require_once("configuracao_mysql.php");
require_once("includes.php");
if(empty($_GET[id]))
{
header("location:index.php");
exit();
}
$q1 = "select * from re2_agents, re2_listings where re2_listings.ListingID = '$_GET[id]' and re2_listings.AgentID = re2_agents.AgentID ";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);
if(empty($i) || $i == '1')
{
$Image1 = "ver_anuncio2.gif";
$desc = nl2br($a1[DetailedDesc]);
$MyPrice = number_format($a1[Price], 2, ",", ".");
$ShowInfo = "<table border=0 align=center width=\"100%\">\n\t<tr>\n\t<td width=\"60%\" valign=top><font size=3 face=verdana color=black><b>$a1[city], $a1[state], $a1[country]</b></font><br><font size=2 face=verdana color=black>$a1[address]</font></td>\n\t<td width=\"40%\" valign=top align=center><font size=2 face=verdana><B>Preço: R$ $MyPrice</td>\n</tr>\n\n<tr>\n\t<td valign=top><br><b>Imóvel ID: $a1[ListingID]</b><br><br>$desc<br><br><font size=2 face=verdana color=black><b>$a1[rooms] quarto(s), $a1[bathrooms] banheiro(s), $a1[garage] garagem(ns)</font><br><br>Vizinhança:</b> $a1[neighbourhood]<br><br><b>Tamanho da residência: $a1[SquareMeters] m2<br>Tamanho do lote: $a1[LotSize] m2<br>Idade: $a1[HomeAge] anos<br>";
if($a1[fireplace] == 'y')
{
$ShowInfo .= ">>Tem lareira ou churrasqueira<br>\n";
}
if($a1[NearSchool] == 'y')
{
$ShowInfo .= ">>Próximo a escola<br>\n";
}
if($a1[NearTransit] == 'y')
{
$ShowInfo .= ">>Próximo do trânsito<br>\n";
}
if($a1[NearPark] == 'y')
{
$ShowInfo .= ">>Próximo a parque ou praça<br>\n";
}
if($a1[OceanView] == 'y')
{
$ShowInfo .= ">>Vista para o mar<br>\n";
}
if($a1[LakeView] == 'y')
{
$ShowInfo .= ">>Vista para um lago<br>\n";
}
if($a1[MountainView] == 'y')
{
$ShowInfo .= ">>Vista para uma montanha<br>\n";
}
if($a1[OceanWaterfront] == 'y')
{
$ShowInfo .= ">>De frente para o mar<br>\n";
}
if($a1[LakeWaterfront] == 'y')
{
$ShowInfo .= ">>De frente para um lago<br>\n";
}
if($a1[RiverWaterfront] == 'y')
{
$ShowInfo .= ">>De frente para um rio<br>\n";
}
if(!empty($a1[image]))
{
$im_array = explode("|", $a1[image]);
$FirstImage = "<img src=\"fotos_anuncios/$im_array[0]\" width=100 height=100>";
}
if($a1[TipodeConta] == '2')
{
if(!empty($a1[cellular]))
{
$int[] = "Celular: $a1[cellular]";
}
if(!empty($a1[pager]))
{
$int[] = "Pager: $a1[pager]";
}
if(!empty($int))
{
$int2 = implode("<br>", $int);
$int2 = "<br>".$int2;
}
}
$ShowInfo .= "</td>\n\t<td align=center valign=top>$FirstImage<br><br>Para Maiores informações ligue para<br><b> $a1[FirstName] $a1[LastName]<br>Telefone: $a1[phone]$int2</b><br>ou clique <a class=RedLink target=_blank href=\"contato.php?AgentID=$a1[AgentID]&ListingID=$a1[ListingID]\">AQUI</a> para enviar-lhe um e-mail.<br><br>";
if($a1[TipodeConta] == '1')
{
$ShowInfo .= "<a class=BlueLink href=\"buscador.php?AgentID=$a1[AgentID]\" title=\"Mais propriedades deste agente\">Mais propriedades deste agente</a><br><br><center>";
}
else
{
$ShowInfo .= "<a class=BlueLink href=\"buscador.php?AgentID=$a1[AgentID]\" title=\"Mais propriedades de $a1[FirstName] $a1[LastName]\">Mais propriedades de $a1[FirstName] $a1[LastName]</a><br><br><center>";
}
if($a1[TipodeConta] == '1')
{
if(!empty($a1[logo]))
{
$ShowInfo .= "<a href=\"sobre_mim.php?id=$a1[AgentID]\" title=\"Ver informações deste agente!\"><img src=\"fotos_anuncios/$a1[logo]\" border=0></a>";
}
else
{
$ShowInfo .= "<a class=BlackLink href=\"sobre_mim.php?id=$a1[AgentID]\" title=\"Ver informações deste agente!\">$a1[FirstName] $a1[LastName]: Ver perfil</a>";
}
}
$ShowInfo .= "</center></td>\n</tr>";
if($a1[AgentID] == $_SESSION[AgentID])
{
$ShowInfo .= "<tr>\n\t<td colspan=3 align=center><a class=RedLink href=\"editar.php?id=$a1[ListingID]\">EDITAR</a> | <a class=RedLink href=\"deletar.php?id=$a1[ListingID]\">DELETAR</a></td>\n</tr>\n\n";
}
$ShowInfo .= "\n</table>";
}
else
{
$Image1 = "ver_anuncio.gif";
}
if($i == '2')
{
$Image2 = "ver_fotos2.gif";
if(!empty($a1[image]))
{
$MyImages = explode("|", $a1[image]);
$ShowInfo .= "<table valign=top align=center width=\"500\" height=50>\n<tr>\n\t<td align=center valign=top width=\"500\" height=50>";
while(list(,$v) = each($MyImages))
{
$ShowInfo .= "<a href=\"anuncio.php?id=$_GET[id]&i=$_GET[i]&f=$v\"><img src=\"fotos_anuncios/$v\" width=50 height=50 border=0></a> \n\n\t";
}
$ShowInfo .= "</table><hr size=1 width=\"95%\" color=#336699><br>";
if(!empty($f))
{
$ShowInfo .= "<center><img src=\"fotos_anuncios/$f\"></center><br>";
}
else
{
$ShowInfo .= "<center><img src=\"fotos_anuncios/$MyImages[0]\"></center><br>";
}
}
else
{
$ShowInfo .= "<br><center><img src=\"sem_foto.gif\"></center>";
}
}
else
{
$Image2 = "ver_fotos.gif";
}
$MyAddress = str_replace(" ", "+", $a1[address]);
$MyAddress = str_replace(",", "", $MyAddress);
$Image3 = "<a target=_blank href=\"http://www.mapquest.com/maps/map.adp?city=$a1[city]&state=$a1[state]&address=$MyAddress&country=$a1[country]&zoom=5\"><img src=\"minhas_imagens/mapa.gif\" border=0></a>";
//$Image3 = "<img src=\"minhas_imagens/sem_foto.gif\">";
$ListingID = $a1[ListingID];
require_once("templates/HeaderTemplate.php");
require_once("templates/InfoTemplate.php");
require_once("templates/FooterTemplate.php");
//update the stats
$q1 = "update re2_listings set visits = visits + '1' where ListingID = '$_GET[id]' ";
mysql_query($q1) or die(mysql_error());
?>