this php n html code is supposeed to allow editting of property info/details
parse error on last line (line 802)
1.
<?php
2.
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
3.
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
4.
header("Cache-Control: no-store, no-cache, must-revalidate");
5.
header("Cache-Control: post-check=0, pre-check=0", false);
6.
header("Pragma: no-cache");
7.
8.
require ( "../includes/config.php" );
9.
require ( "../includes/CGI.php" );
10.
require ( "../includes/SQL.php" );
11.
12.
$cgi = new CGI ();
13.
$sql = new SQL ( $DBusername, $DBpassword, $server, $database );
14.
15.
if ( ! $sql->isConnected () )
16.
{
17.
die ( $DatabaseError );
18.
}
19.
20.
require ( "includes/Auth.php" );
21.
$auth = new Auth ( $cgi, $sql, $admin_table );
22.
$auth->checkAuth ( "index.php" );
23.
24.
require ( "../includes/CSQL.php" );
25.
?>
26.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
27.
<html xmlns="http://www.w3.org/1999/xhtml">
28.
<HEAD>
29.
<TITLE>Property Management Admin</TITLE>
30.
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
31.
<LINK HREF="style.css" REL="stylesheet" TYPE="text/css">
32.
</HEAD>
33.
<script language="javascript" type="text/javascript"><!--
34.
function popupWindow(url, width, height) {
35.
if(width == null){ width =100; }
36.
if(height == null){height =100;}
37.
38.
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',screenX=150,screenY=150,top=150,left=100')
39.
}
40.
//--></script>
41.
<Body>
42.
<TABLE ALIGN="center" BORDER="0" CELLPADDING="1" CELLSPACING="0" WIDTH="100%">
43.
<TBODY>
44.
<TR>
45.
<TD BGCOLOR="#333333"> <?PHP include "header.php"; ?>
46.
<TABLE BGCOLOR="#ffffff" BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%">
47.
<TBODY>
48.
<TR>
49.
<TD COLSPAN="4">
50.
<TABLE WIDTH="100%" border="0" CELLPADDING="0" CELLSPACING="0">
51.
<TR>
52.
<TD ALIGN="LEFT" VALIGN="TOP" class="leftbg"><?PHP include "leftmenu.php"; ?></TD>
53.
<TD VALIGN="TOP" WIDTH="100%">
54.
<H2 ALIGN="LEFT"><IMG SRC="images/spacer.gif" HEIGHT="10" WIDTH="15">Edit Property</H2>
55.
<BR>
56.
<?php
57.
58.
if ( $cgi->getValue ( "op" ) == "editestablishment" )
59.
{
60.
$rows = $sql->execute ( "SELECT * from " . $property_table .
61.
" WHERE id=" . $sql->quote ( $cgi->getValue ( "id" ) ) . " LIMIT 1",
62.
SQL_RETURN_ASSOC );
63.
64.
$row = $rows [ 0 ];
65.
?><TABLE WIDTH="95%" CELLPADDING="0" CELLSPACING="1" ALIGN="CENTER">
66.
<TR>
67.
<TD>
68.
<b>You have selected to edit the following property</b><br>
69.
Please enter the new details for this property in the correct spaces below. To complete the property edit process, please click on the 'Update Property' button. Please note that for images changes, you may need to press your refresh button on your browser.</TD>
70.
</TR>
71.
</TABLE>
72.
73.
<form method="post">
74.
<input name="id" type="hidden" value="<?php echo $row [ "id" ]; ?>">
75.
<input name="op" type="hidden" value="UpdateProperty">
76.
<br>
77.
<TABLE WIDTH="95%" border="0" ALIGN="CENTER" CELLPADDING="5" CELLSPACING="1" CLASS="forumline">
78.
<tr><td height="23" colspan="2" ALIGN="LEFT" VALIGN="middle" background="images/top-menubg.gif" class="leftbg"> <b>Property Owner Information</b></td>
79.
</tr>
80.
<tr>
81.
<td width="165" valign="top" bgcolor="#F3F3F3"><b>Property Owner Details</b><br><i>(Not displayed on website.<br>
82.
Your information only)</i></td>
83.
<td bgcolor="#FFFFFF"><textarea name="propertyowner" rows="6" cols="35"><?php echo $row [ "propertyowner" ]; ?></textarea></td>
84.
</tr><tr><td height="23" colspan="2" ALIGN="LEFT" VALIGN="middle" background="images/top-menubg.gif" class="leftbg"> <b>Property Option - Sale or Rent</b></td>
85.
</tr>
86.
<tr>
87.
<td bgcolor="#F3F3F3"><strong>Sale or Rent:</strong></td>
88.
<td bgcolor="#FFFFFF"><select name="propertyoption">
89.
<option value="S"<?php if ( $row [ "propertyoption" ] == "S" ) { echo " selected"; } ?>>Sale</option>
90.
<option value="R"<?php if ( $row [ "propertyoption" ] == "R" ) { echo " selected"; } ?>>Rent</option>
91.
</select> <i class="row1">(Select if the property is to be Sale or Rent)</i></td>
92.
</tr>
93.
<tr><td height="23" colspan="2" ALIGN="LEFT" VALIGN="middle" background="images/top-menubg.gif" class="leftbg"> <b>Property Information</b></td>
94.
</tr>
95.
<TD width="165" BGCOLOR="#F3F3F3">
96.
<b>Date Added:</b></TD>
97.
<TD BGCOLOR="#FFFFFF">
98.
<?php echo $row [ "dateadded" ]; ?></TD>
99.
</TR>
100.
<TR>
101.
<TD width="165" BGCOLOR="#F3F3F3">
102.
<b>Featured Property:</b></TD>
103.
<TD BGCOLOR="#FFFFFF">
104.
105.
<SELECT NAME="featuredproperty">
106.
<OPTION VALUE="N" <?php if ( $row [ 'featuredproperty' ] == "N" ) { ?> selected<?php } ?>>No</OPTION>
107.
<OPTION VALUE="Y" <?php if ( $row [ 'featuredproperty' ] == "Y" ) { ?> selected<?php } ?>>Yes</OPTION>
108.
</SELECT>
109.
<i>(Make the property a featured listing)</i></TD>
110.
</TR>
111.
<TR>
112.
<TD width="165" BGCOLOR="#F3F3F3">
113.
<b>Property Ref Number:</b></TD>
114.
<TD BGCOLOR="#FFFFFF">
115.
<strong><?php echo $row [ "propertyref" ]; ?></strong></TD>
116.
</TR>
117.
<TR>
118.
<TD width="165" BGCOLOR="#F3F3F3">
119.
<b>Select Property Type:</b></TD>
120.
<TD BGCOLOR="#FFFFFF">
121.
122.
<SELECT NAME="propertytype" SIZE="1">
123.
<?php
124.
125.
$rows = $sql->execute ( "SELECT * FROM " . $propertytypes_table .
126.
" ORDER BY propertytype ASC", SQL_RETURN_ASSOC );
127.
128.
for ( $i = 0; $i < sizeof ( $rows ); ++$i )
129.
{
130.
$qry = $rows [ $i ];
131.
132.
?>
133.
<OPTION VALUE="<?php
134.
echo $cgi->htmlEncode ( $qry [ "id" ] ); ?>"<?php
135.
136.
if ( $row [ 'propertytype' ] == $qry [ "id" ] )
137.
{
138.
?> selected<?php
139.
}
140.
141.
?>><?php echo $cgi->htmlEncode ( $qry [ "propertytype" ] );
142.
143.
?></OPTION>
144.
<?php
145.
}
146.
147.
?>
148.
</SELECT>
149.
</TD>
150.
</TR>
151.
<TR>
152.
<TD width="165" BGCOLOR="#F3F3F3">
153.
<b>Enter Property Price:</b></TD>
154.
<TD BGCOLOR="#FFFFFF">
155.
<?php echo $CurrencyUnit; ?>
156.
<INPUT TYPE="TEXT" NAME="propertyprice" SIZE="10" MAXLENGTH="20" VALUE="<?php
157.
echo $row [ "propertyprice" ]; ?>">
158.
<i>(Enter Numbers Only. Do not use commas, spaces or punctuations)</i></TD>
159.
</TR>
160.
<TR>
161.
<TD width="165" BGCOLOR="#F3F3F3">
162.
<b>Number of Bedrooms:</b></TD>
163.
<TD BGCOLOR="#FFFFFF">
164.
165.
<SELECT NAME="propertybedrooms">
166.
<OPTION VALUE="0" <?php if ( $row [ "propertybedrooms" ] == "1" ) { echo " selected"; } ?>>0</OPTION>
167.
<OPTION VALUE="1" <?php if ( $row [ "propertybedrooms" ] == "1" ) { echo " selected"; } ?>>1</OPTION>
168.
<OPTION VALUE="2" <?php if ( $row [ "propertybedrooms" ] == "2" ) { echo " selected"; } ?>>2</OPTION>
169.
<OPTION VALUE="3" <?php if ( $row [ "propertybedrooms" ] == "3" ) { echo " selected"; } ?>>3</OPTION>
170.
<OPTION VALUE="4" <?php if ( $row [ "propertybedrooms" ] == "4" ) { echo " selected"; } ?>>4</OPTION>
171.
<OPTION VALUE="5" <?php if ( $row [ "propertybedrooms" ] == "5" ) { echo " selected"; } ?>>5</OPTION>
172.
<OPTION VALUE="6" <?php if ( $row [ "propertybedrooms" ] == "6" ) { echo " selected"; } ?>>6</OPTION>
173.
<OPTION VALUE="7" <?php if ( $row [ "propertybedrooms" ] == "7" ) { echo " selected"; } ?>>7</OPTION>
174.
<OPTION VALUE="8" <?php if ( $row [ "propertybedrooms" ] == "8" ) { echo " selected"; } ?>>8</OPTION>
175.
<OPTION VALUE="9" <?php if ( $row [ "propertybedrooms" ] == "9" ) { echo " selected"; } ?>>8</OPTION>
176.
<OPTION VALUE="10" <?php if ( $row [ "propertybedrooms" ] == "10" ) { echo " selected"; } ?>>10 +</OPTION>
177.
</SELECT>
178.
</TD>
179.
</TR><tr>
180.
<td bgcolor="#F3F3F3"><b>Number of Bathrooms:</b></td>
181.
<td bgcolor="#FFFFFF">
182.
<select name="propertybathrooms">
183.
<option value="0" <?php if ( $row [ "propertybathrooms" ] == "1" ) { echo " selected"; } ?>>0</option>
184.
<option value="1" <?php if ( $row [ "propertybathrooms" ] == "1" ) { echo " selected"; } ?>>1</option>
185.
<option value="2" <?php if ( $row [ "propertybathrooms" ] == "2" ) { echo " selected"; } ?>>2</option>
186.
<option value="3" <?php if ( $row [ "propertybathrooms" ] == "3" ) { echo " selected"; } ?>>3</option>
187.
<option value="4" <?php if ( $row [ "propertybathrooms" ] == "4" ) { echo " selected"; } ?>>4</option>
188.
<option value="5" <?php if ( $row [ "propertybathrooms" ] == "5" ) { echo " selected"; } ?>>5</option>
189.
</select>
190.
</td>
191.
</tr>
192.
<tr>
193.
<td bgcolor="#F3F3F3"><b>Year Built:</b></td>
194.
<td bgcolor="#FFFFFF"><input type="TEXT" name="propertyyearbuilt" size="25" maxlength="100" VALUE="<?php echo $cgi->htmlEncode ( $row [ "propertyyearbuilt" ] ); ?>"></td>
195.
</tr>
196.
<tr>
197.
<td bgcolor="#F3F3F3"><b>Living Area:</b></td>
198.
<td bgcolor="#FFFFFF"><input type="TEXT" name="propertylivingarea" size="50" maxlength="100" VALUE="<?php echo $cgi->htmlEncode ( $row [ "propertylivingarea" ] ); ?>"></td>
199.
</tr>
200.
<tr>
201.
<td bgcolor="#F3F3F3"><b>Plot Size:</b></td>
202.
<td bgcolor="#FFFFFF"><input type="TEXT" name="propertyplotsize" size="50" maxlength="100" VALUE="<?php echo $cgi->htmlEncode ( $row [ "propertyplotsize" ] ); ?>"></td>
203.
</tr>
204.
<tr>
205.
<td bgcolor="#F3F3F3"><b>Features:</b></td>
206.
<td bgcolor="#FFFFFF">
207.
<?php
208.
209.
$_propertyFeatures = $sql->execute (
210.
"SELECT feature_id FROM " . $propertyfeatures_table .
211.
" WHERE property_id=" . $sql->quote ( $cgi->getValue ( "id" ) ),
212.
SQL_RETURN_ASSOC );
213.
214.
// remap $propertyFeatures into an associated array, for easier lookup
215.
$propertyFeatures = array ();
216.
for ( $i = 0; $i < sizeof ( $_propertyFeatures ); ++$i )
217.
{
218.
$propertyFeatures [ $_propertyFeatures [ $i ] [ "feature_id" ] ] = 1;
219.
}
220.
221.
$features = $sql->execute ( "SELECT id, description from " . $features_table,
222.
SQL_RETURN_ASSOC );
223.
224.
for ( $i = 0; $i < sizeof ( $features ); ++$i )
225.
{
226.
?>
227.
<input type="checkbox" name="_feature_<?php echo $i; ?>"<?php
228.
if ( $propertyFeatures [ $features [ $i ] [ "id" ] ] == 1 )
229.
{
230.
?> checked="checked"<?php
231.
}
232.
?> value="<?php echo $features [ $i ] [ "id" ]; ?>"/><?php
233.
echo $cgi->htmlEncode ( $features [ $i ] [ "description" ] );
234.
?><br><?php
235.
}
236.
?>
237.
</td>
238.
</tr>
239.
<TR>
240.
<TD width="165" BGCOLOR="#F3F3F3">
241.
<b>Address of Property:</b></TD>
242.
<TD BGCOLOR="#FFFFFF">
243.
244.
<INPUT TYPE="TEXT" NAME="propertyaddress" SIZE="50" MAXLENGTH="100" VALUE="<?php echo $cgi->htmlEncode ( $row [ "propertyaddress" ] ); ?>">
245.
</TD>
246.
</TR>
247.
<TR>
248.
<TD width="165" BGCOLOR="#F3F3F3">
249.
<b>Location of Property:</b></TD>
250.
<TD BGCOLOR="#FFFFFF">
251.
252.
<SELECT NAME="propertylocation">
253.
<?PHP
254.
255.
$rows = $sql->execute ( "SELECT * FROM " .
256.
$propertylocations_table . " ORDER BY propertylocation ASC",
257.
SQL_RETURN_ASSOC );
258.
259.
for ( $i = 0; $i < sizeof ( $rows ); ++$i )
260.
{
261.
$qry = $rows [ $i ];
262.
263.
?>
264.
<OPTION VALUE="<?php
265.
266.
echo $cgi->htmlEncode ( $qry [ "id" ] );
267.
268.
?>"<?php
269.
270.
if ( $row [ 'propertylocation' ] == $qry [ "id" ] )
271.
{
272.
?> selected<?php
273.
}
274.
275.
?>>
276.
<?php
277.
278.
echo $cgi->htmlEncode ( $qry [ "propertylocation" ] );
279.
280.
?>
281.
</OPTION>
282.
<?php
283.
}
284.
285.
?>
286.
</SELECT>
287.
</TD>
288.
</TR>
289.
<tr>
290.
<td width="165" bgcolor="#F3F3F3">
291.
<b>Postcode:</b></td>
292.
<td bgcolor="#FFFFFF">
293.
<input type="TEXT" name="propertypostcode" size="15" maxlength="20" VALUE="<?php echo $cgi->htmlEncode ( $row [ "propertypostcode" ] ); ?>"></td>
294.
</tr>
295.
296.
<TR>
297.
<TD width="165" VALIGN="TOP" BGCOLOR="#F3F3F3">
298.
<b>Short Property Description:</b><BR>
299.
<I>(Maximum of 255 Characters)</I></TD>
300.
<TD BGCOLOR="#FFFFFF">
301.
302.
<TEXTAREA NAME="shortdescription" ROWS="6" COLS="45"><?php
303.
echo $cgi->htmlEncode ( $row [ "shortdescription" ] ); ?>
304.
</TEXTAREA>
305.
</TD>
306.
</TR>
307.
<TR>
308.
<TD width="165" VALIGN="TOP" BGCOLOR="#F3F3F3">
309.
<b>Long Property Description:</b><BR>
310.
<I>(HTML Permitted)</I></TD>
311.
<TD BGCOLOR="#FFFFFF">
312.
313.
<TEXTAREA NAME="longdescription" ROWS="15" COLS="45"><?php
314.
echo $cgi->htmlEncode ( $row [ "longdescription" ] ); ?>
315.
</TEXTAREA>
316.
</TD>
317.
</TR>
318.
<TR>
319.
<TD width="165" BGCOLOR="#F3F3F3">
320.
<b>Status:</b></TD>
321.
<TD BGCOLOR="#FFFFFF">
322.
323.
<SELECT NAME="propertystatus">
324.
<?PHP
325.
326.
$rows = $sql->execute ( "SELECT * FROM " .
327.
$propertystatus_table . " ORDER BY propertystatus ASC",
328.
SQL_RETURN_ASSOC );
329.
330.
for ( $i = 0; $i < sizeof ( $rows ); ++$i )
331.
{
332.
$qry = $rows [ $i ];
333.
334.
?>
335.
<OPTION VALUE="<?php
336.
337.
echo $cgi->htmlEncode ( $qry [ "id" ] );
338.
339.
?>"<?php
340.
341.
if ( $row [ 'propertystatus' ] == $qry [ "id" ] )
342.
{
343.
?> selected<?php
344.
}
345.
346.
?>>
347.
<?php
348.
349.
echo $cgi->htmlEncode ( $qry [ "propertystatus" ] );
350.
351.
?>
352.
</OPTION>
353.
<?php
354.
}
355.
356.
?>
357.
</SELECT>
358.
<i>(The property will be marked as this on the search results)</i></TD>
359.
</TR>
360.
<TR>
361.
<TD width="165" BGCOLOR="#F3F3F3">
362.
<b>Listing Option:</b></TD>
363.
<TD BGCOLOR="#FFFFFF">
364.
365.
<SELECT NAME="propertyshow">
366.
<OPTION VALUE="1" <?php
367.
if ( $row [ 'propertyshow' ] == "1" ) { ?> selected<?php } ?>>Yes</OPTION>
368.
<OPTION VALUE="0" <?php
369.
if ( $row [ 'propertyshow' ] == "0" ) { ?> selected<?php } ?>>No</OPTION>
370.
</SELECT>
371.
<i>(Make the property listing available to view on website)</i></TD>
372.
</TR>
373.
<tr><td height="23" colspan="2" align="left" valign="middle" background="images/top-menubg.gif"> <b>Virtual Tour</b></td>
374.
</tr>
375.
<tr>
376.
<td bgcolor="#F3F3F3"><strong>Virtual Tour Link:</strong></td>
377.
<td bgcolor="#FFFFFF"><input type="text" name="virtualtour" size="50" maxlength="200" value="<?php echo $cgi->htmlEncode ( $row [ "virtualtour" ] ); ?>" /> </td>
378.
</tr>
379.
</table>
380.
<p align="center">
381.
<input value="Update This Property" type="submit" class="submit" ONCLICK="return confirm('Are you sure you want to Update this Property?');">
382.
383.
</form><br><?php if($row ["propertyphoto1"]) {?>
384.
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
385.
<tr><td height="23" colspan="2" ALIGN="LEFT" VALIGN="middle" background="images/top-menubg.gif" class="leftbg"> <b>Edit this properties Photographs</b> Only JPG photographs can be uploaded.</td>
386.
</tr>
387.
</table>
388.
389.
<?php } ?>
390.
<br>
391.
392.
<TABLE WIDTH="90%" border="0" ALIGN="CENTER" CELLPADDING="0" CELLSPACING="1">
393.
394.
<TR>
395.
<TD BGCOLOR="#FFFFFF">
396.
397.
<table width="100%" border="1" cellspacing="1" cellpadding="1" align="center">
398.
<tr>
399.
<td align="center"><?php if($row ["propertyphoto1"]) {?>Picture 1<br><img src="<?php echo $ImageURL.$cgi->htmlEncode ( $row [ "propertyphoto1" ] ); ?>" width="125" height="100">
400.
<TABLE CELLPADDING="1" CELLSPACING="1">
401.
<TR>
402.
<TD ALIGN="CENTER">
403.
<form action="property_edit_image.php" method="post">
404.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
405.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto1" ]; ?>">
406.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
407.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-edit.gif"></FORM></TD>
408.
<TD ALIGN="CENTER">
409.
<form action="property_delete_image.php" method="post">
410.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
411.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto1" ]; ?>">
412.
<input type="hidden" name="imageno" value="propertyphoto1" />
413.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
414.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-delete.gif" ONCLICK="return confirm('Are you sure you want to Delete this Photo?');"></FORM></TD>
415.
</TR>
416.
</TABLE>
417.
<?php }else{ ?>
418.
<table Cellpadding="1" cellspacing="1">
419.
<TR>
420.
<TD ALIGN="CENTER"><a href="Javascript:popupWindow('pop_add_img.php?img=1&id=<?=$row[ "id" ];?>&ref=<?php echo $row [ "propertyref" ]; ?>',300,200);"><img src="images/camicon.gif" border="0"><br>
421.
Add image 1</a></TD></TR></table>
422.
<?
423.
}
424.
?>
425.
</td>
426.
<td align="center"><?php if($row ["propertyphoto2"]) {?>Picture 2<br><img src="<?php echo $ImageURL.$cgi->htmlEncode ( $row [ "propertyphoto2" ] ); ?>" width="125" height="100">
427.
<TABLE CELLPADDING="1" CELLSPACING="1">
428.
<TR>
429.
<TD ALIGN="CENTER">
430.
<form action="property_edit_image.php" method="post">
431.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
432.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto2" ]; ?>">
433.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
434.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-edit.gif"></FORM></TD>
435.
<TD ALIGN="CENTER">
436.
<form action="property_delete_image.php" method="post">
437.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
438.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto2" ]; ?>">
439.
<input type="hidden" name="imageno" value="propertyphoto2" />
440.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
441.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-delete.gif" ONCLICK="return confirm('Are you sure you want to Delete this Photo?');"></FORM></TD>
442.
</TR>
443.
</TABLE>
444.
<?php }else{ ?>
445.
<table Cellpadding="1" cellspacing="1">
446.
<TR>
447.
<TD ALIGN="CENTER"><a href="Javascript:popupWindow('pop_add_img.php?img=2&id=<?=$row[ "id" ];?>&ref=<?php echo $row [ "propertyref" ]; ?>',300,200);"><img src="images/camicon.gif" border="0"><br>
448.
Add image 2</a></TD></TR></table>
449.
<?
450.
}
451.
?>
452.
</td>
453.
</tr>
454.
<tr>
455.
<td align="center"><?php if($row ["propertyphoto3"]) {?>Picture 3<br><img src="<?php echo $ImageURL.$cgi->htmlEncode ( $row [ "propertyphoto3" ] ); ?>" width="125" height="100"><TABLE CELLPADDING="1" CELLSPACING="1">
456.
<TR>
457.
<TD ALIGN="CENTER">
458.
<form action="property_edit_image.php" method="post">
459.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
460.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto3" ]; ?>">
461.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
462.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-edit.gif"></FORM></TD>
463.
<TD ALIGN="CENTER">
464.
<form action="property_delete_image.php" method="post">
465.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
466.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto3" ]; ?>">
467.
<input type="hidden" name="imageno" value="propertyphoto3" />
468.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
469.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-delete.gif" ONCLICK="return confirm('Are you sure you want to Delete this Photo?');"></FORM></TD>
470.
</TR>
471.
</TABLE>
472.
<?php }else{ ?>
473.
<table Cellpadding="1" cellspacing="1">
474.
<TR>
475.
<TD ALIGN="CENTER"><a href="Javascript:popupWindow('pop_add_img.php?img=3&id=<?=$row[ "id" ];?>&ref=<?php echo $row [ "propertyref" ]; ?>',300,200);"><img src="images/camicon.gif" border="0"><br>
476.
Add image 3</a></TD></TR></table>
477.
<?
478.
}
479.
?>
480.
</td>
481.
482.
<td align="center"><?php if($row ["propertyphoto4"]) {?>Picture 4<br><img src="<?php echo $ImageURL.$cgi->htmlEncode ( $row [ "propertyphoto4" ] ); ?>" width="125" height="100">
483.
<TABLE CELLPADDING="1" CELLSPACING="1">
484.
<TR>
485.
<TD ALIGN="CENTER">
486.
<form action="property_edit_image.php" method="post">
487.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
488.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto4" ]; ?>">
489.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
490.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-edit.gif"></FORM></TD>
491.
<TD ALIGN="CENTER">
492.
<form action="property_delete_image.php" method="post">
493.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
494.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto4" ]; ?>">
495.
<input type="hidden" name="imageno" value="propertyphoto4" />
496.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
497.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-delete.gif" ONCLICK="return confirm('Are you sure you want to Delete this Photo?');"></FORM></TD>
498.
</TR>
499.
</TABLE>
500.
<?php }else{ ?>
501.
<table Cellpadding="1" cellspacing="1">
502.
<TR>
503.
<TD ALIGN="CENTER"><a href="Javascript:popupWindow('pop_add_img.php?img=4&id=<?=$row[ "id" ];?>&ref=<?php echo $row [ "propertyref" ]; ?>',300,200);"><img src="images/camicon.gif" border="0"><br>
504.
Add image 4</a></TD></TR></table>
505.
<?
506.
}
507.
?>
508.
</td>
509.
</tr>
510.
<tr>
511.
<td align="center"><?php if($row ["propertyphoto5"]) {?>
512.
Picture 5 <br>
513.
<img src="<?php echo $ImageURL.$cgi->htmlEncode ( $row [ "propertyphoto5" ] ); ?>" width="125" height="100">
514.
<TABLE CELLPADDING="1" CELLSPACING="1">
515.
<TR>
516.
<TD ALIGN="CENTER"><form action="property_edit_image.php" method="post">
517.
518.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
519.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto5" ]; ?>">
520.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
521.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-edit.gif">
522.
523.
</FORM></TD>
524.
<TD ALIGN="CENTER"><form action="property_delete_image.php" method="post">
525.
526.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
527.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto5" ]; ?>">
528.
<input type="hidden" name="imageno" value="propertyphoto5" />
529.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
530.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-delete.gif" ONCLICK="return confirm('Are you sure you want to Delete this Photo?');">
531.
532.
</FORM></TD>
533.
</TR>
534.
</TABLE>
535.
<?php }else{ ?>
536.
<table Cellpadding="1" cellspacing="1">
537.
<TR>
538.
<TD ALIGN="CENTER"><a href="Javascript:popupWindow('pop_add_img.php?img=5&id=<?=$row[ "id" ];?>&ref=<?php echo $row [ "propertyref" ]; ?>',300,200);"><img src="images/camicon.gif" border="0"><br>
539.
Add image 5 </a></TD>
540.
</TR>
541.
</table>
542.
<?
543.
}
544.
?></td>
545.
<td align="center"><?php if($row ["propertyphoto6"]) {?>
546.
Picture 6 <br>
547.
<img src="<?php echo $ImageURL.$cgi->htmlEncode ( $row [ "propertyphoto6" ] ); ?>" width="125" height="100">
548.
<TABLE CELLPADDING="1" CELLSPACING="1">
549.
<TR>
550.
<TD ALIGN="CENTER"><form action="property_edit_image.php" method="post">
551.
552.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
553.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto6" ]; ?>">
554.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
555.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-edit.gif">
556.
557.
</FORM></TD>
558.
<TD ALIGN="CENTER"><form action="property_delete_image.php" method="post">
559.
560.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
561.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto1" ]; ?>">
562.
<input type="hidden" name="imageno" value="propertyphoto6" />
563.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
564.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-delete.gif" ONCLICK="return confirm('Are you sure you want to Delete this Photo?');">
565.
566.
</FORM></TD>
567.
</TR>
568.
</TABLE>
569.
<?php }else{ ?>
570.
<table Cellpadding="1" cellspacing="1">
571.
<TR>
572.
<TD ALIGN="CENTER"><a href="Javascript:popupWindow('pop_add_img.php?img=6&id=<?=$row[ "id" ];?>&ref=<?php echo $row [ "propertyref" ]; ?>',300,200);"><img src="images/camicon.gif" border="0"><br>
573.
Add image 6 </a></TD>
574.
</TR>
575.
</table>
576.
<?
577.
}
578.
?></td>
579.
</tr>
580.
<tr>
581.
<td align="center"><?php if($row ["propertyphoto7"]) {?>
582.
Picture 7 <br>
583.
<img src="<?php echo $ImageURL.$cgi->htmlEncode ( $row [ "propertyphoto7" ] ); ?>" width="125" height="100">
584.
<TABLE CELLPADDING="1" CELLSPACING="1">
585.
<TR>
586.
<TD ALIGN="CENTER"><form action="property_edit_image.php" method="post">
587.
588.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
589.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto7" ]; ?>">
590.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
591.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-edit.gif">
592.
593.
</FORM></TD>
594.
<TD ALIGN="CENTER"><form action="property_delete_image.php" method="post">
595.
596.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
597.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto7" ]; ?>">
598.
<input type="hidden" name="imageno" value="propertyphoto7" />
599.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
600.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-delete.gif" ONCLICK="return confirm('Are you sure you want to Delete this Photo?');">
601.
602.
</FORM></TD>
603.
</TR>
604.
</TABLE>
605.
<?php }else{ ?>
606.
<table Cellpadding="1" cellspacing="1">
607.
<TR>
608.
<TD ALIGN="CENTER"><a href="Javascript:popupWindow('pop_add_img.php?img=7&id=<?=$row[ "id" ];?>&ref=<?php echo $row [ "propertyref" ]; ?>',300,200);"><img src="images/camicon.gif" border="0"><br>
609.
Add image 7 </a></TD>
610.
</TR>
611.
</table>
612.
<?
613.
}
614.
?></td>
615.
<td align="center"><?php if($row ["propertyphoto8"]) {?>
616.
Picture 8 <br>
617.
<img src="<?php echo $ImageURL.$cgi->htmlEncode ( $row [ "propertyphoto8" ] ); ?>" width="125" height="100">
618.
<TABLE CELLPADDING="1" CELLSPACING="1">
619.
<TR>
620.
<TD ALIGN="CENTER"><form action="property_edit_image.php" method="post">
621.
622.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
623.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto8" ]; ?>">
624.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
625.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-edit.gif">
626.
627.
</FORM></TD>
628.
<TD ALIGN="CENTER"><form action="property_delete_image.php" method="post">
629.
630.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
631.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto8" ]; ?>">
632.
<input type="hidden" name="imageno" value="propertyphoto8" />
633.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
634.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-delete.gif" ONCLICK="return confirm('Are you sure you want to Delete this Photo?');">
635.
636.
</FORM></TD>
637.
</TR>
638.
</TABLE>
639.
<?php }else{ ?>
640.
<table Cellpadding="1" cellspacing="1">
641.
<TR>
642.
<TD ALIGN="CENTER"><a href="Javascript:popupWindow('pop_add_img.php?img=8&id=<?=$row[ "id" ];?>&ref=<?php echo $row [ "propertyref" ]; ?>',300,300);"><img src="images/camicon.gif" border="0"><br>
643.
Add image 8 </a></TD>
644.
</TR>
645.
</table>
646.
<?
647.
}
648.
?></td>
649.
</tr>
650.
<tr>
651.
<td align="center"><?php if($row ["propertyphoto9"]) {?>
652.
Picture 9 <br>
653.
<img src="<?php echo $ImageURL.$cgi->htmlEncode ( $row [ "propertyphoto9" ] ); ?>" width="125" height="100">
654.
<TABLE CELLPADDING="1" CELLSPACING="1">
655.
<TR>
656.
<TD ALIGN="CENTER"><form action="property_edit_image.php" method="post">
657.
658.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
659.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto9" ]; ?>">
660.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
661.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-edit.gif">
662.
663.
</FORM></TD>
664.
<TD ALIGN="CENTER"><form action="property_delete_image.php" method="post">
665.
666.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
667.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto9" ]; ?>">
668.
<input type="hidden" name="imageno" value="propertyphoto9" />
669.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
670.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-delete.gif" ONCLICK="return confirm('Are you sure you want to Delete this Photo?');">
671.
672.
</FORM></TD>
673.
</TR>
674.
</TABLE>
675.
<?php }else{ ?>
676.
<table Cellpadding="1" cellspacing="1">
677.
<TR>
678.
<TD ALIGN="CENTER"><a href="Javascript:popupWindow('pop_add_img.php?img=9&id=<?=$row[ "id" ];?>&ref=<?php echo $row [ "propertyref" ]; ?>',300,200);"><img src="images/camicon.gif" border="0"><br>
679.
Add image 9 </a></TD>
680.
</TR>
681.
</table>
682.
<?
683.
}
684.
?></td>
685.
<td align="center"><?php if($row ["propertyphoto10"]) {?>
686.
Picture 10 <br>
687.
<img src="<?php echo $ImageURL.$cgi->htmlEncode ( $row [ "propertyphoto10" ] ); ?>" width="125" height="100">
688.
<TABLE CELLPADDING="1" CELLSPACING="1">
689.
<TR>
690.
<TD ALIGN="CENTER"><form action="property_edit_image.php" method="post">
691.
692.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
693.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto10" ]; ?>">
694.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
695.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-edit.gif">
696.
697.
</FORM></TD>
698.
<TD ALIGN="CENTER"><form action="property_delete_image.php" method="post">
699.
700.
<input name="propertyref" type="hidden" value="<?php echo $row [ "propertyref" ]; ?>">
701.
<input name="propertyphoto" type="hidden" value="<?php echo $row [ "propertyphoto10" ]; ?>">
702.
<input type="hidden" name="imageno" value="propertyphoto10" />
703.
<input type="hidden" name="propid" value="<?=$row[ "id" ];?>" />
704.
<INPUT TYPE="IMAGE" NAME="Image1" SRC="images/button-delete.gif" ONCLICK="return confirm('Are you sure you want to Delete this Photo?');">
705.
706.
</FORM></TD>
707.
</TR>
708.
</TABLE>
709.
<?php }else{ ?>
710.
<table Cellpadding="1" cellspacing="1">
711.
<TR>
712.
<TD ALIGN="CENTER"><a href="Javascript:popupWindow('pop_add_img.php?img=10&id=<?=$row[ "id" ];?>&ref=<?php echo $row [ "propertyref" ]; ?>',300,200);"><img src="images/camicon.gif" border="0"><br>
713.
Add image 10 </a></TD>
714.
</TR>
715.
</table>
716.
<?
717.
}
718.
?></td>
719.
</tr>
720.
</table>
721.
</TD>
722.
</TR>
723.
</TABLE>
724.
<br>
725.
726.
<br>
727.
<?php
728.
}
729.
730.
#### Update the requested Establishment ####
731.
if ( $cgi->getValue ( "op" ) == "UpdateProperty" )
732.
{
733.
mysql_query("UPDATE $property_table SET
734.
propertyoption = " . $sql->quote ( $cgi->getValue ( "propertyoption" ) ) . ",
735.
propertytype = " . $sql->quote ( $cgi->getValue ( "propertytype" ) ) . ",
736.
propertyprice = " . $sql->quote ( $cgi->getValue ( "propertyprice" ) ) . ",
737.
propertybedrooms = " . $sql->quote ( $cgi->getValue ( "propertybedrooms" ) ) . ",
738.
propertybathrooms = " . $sql->quote ( $cgi->getValue ( "propertybathrooms" ) ) . ",
739.
propertyyearbuilt = " . $sql->quote ( $cgi->getValue ( "propertyyearbuilt" ) ) . ",
740.
propertylivingarea = " . $sql->quote ( $cgi->getValue ( "propertylivingarea" ) ) . ",
741.
propertyplotsize = " . $sql->quote ( $cgi->getValue ( "propertyplotsize" ) ) . ",
742.
propertyaddress = " . $sql->quote ( $cgi->getValue ( "propertyaddress" ) ) . ",
743.
propertylocation = " . $sql->quote ( $cgi->getValue ( "propertylocation" ) ) . ",
744.
propertypostcode = " . $sql->quote ( $cgi->getValue ( "propertypostcode" ) ) . ",
745.
shortdescription = " . $sql->quote ( $cgi->getValue ( "shortdescription" ) ) . ",
746.
longdescription = " . $sql->quote ( $cgi->getValue ( "longdescription" ) ) . ",
747.
propertystatus = " . $sql->quote ( $cgi->getValue ( "propertystatus" ) ) . ",
748.
propertyshow = " . $sql->quote ( $cgi->getValue ( "propertyshow" ) ) . ",
749.
featuredproperty = " . $sql->quote ( $cgi->getValue ( "featuredproperty" ) ) . ",
750.
virtualtour = " . $sql->quote ( $cgi->getValue ( "virtualtour" ) ) . ",
751.
propertyowner = " . $sql->quote ( $cgi->getValue ( "propertyowner" ) ) . "
752.
WHERE id = " . $sql->quote ( $cgi->getValue ( "id" ) ) . "") or die ("$DatabaseError");
753.
754.
// we need to handle features, too
755.
// start by removing all currently assigned features
756.
$sql->execute ( "DELETE FROM " . $propertyfeatures_table .
757.
" WHERE property_id=" . $sql->quote ( $cgi->getValue ( "id" ) ) );
758.
759.
$params = $cgi->getValues ();
760.
761.
while ( list ( $param, $value ) = each ( $params ) )
762.
{
763.
$matches = array ();
764.
765.
if ( preg_match ( '/^_feature_(\d+)$/', $param, $matches ) )
766.
{
767.
// it matched, which means that it's a feature
768.
if ( $value > 0 )
769.
{
770.
$sql->execute ( "INSERT INTO " . $propertyfeatures_table .
771.
" (property_id, feature_id) VALUES (" .
772.
$sql->quote ( $cgi->getValue ( "id" ) ). ", " .
773.
$sql->quote ( $value ) . ")" );
774.
}
775.
}
776.
}
777.
778.
?>
779.
<p align="center"><font color="#CC0000">Property details have been updated</font>
780.
<br>
781.
<form method="post">
782.
<input name="op" type="hidden" value="editestablishment">
783.
<input name="id" type="hidden" value="<?php
784.
echo $cgi->htmlEncode ( $cgi->getValue ( "id" ) ); ?>">
785.
<p align="center">
786.
<input value="View New Details" type="submit" class="textinput">
787.
788.
</form>
789.
<?php
790.
}
791.
?>
792.
</TD>
793.
</TR>
794.
</TABLE> </TD>
795.
</TR>
796.
</TBODY>
797.
</TABLE> </TD>
798.
</TR>
799.
</TBODY>
800.
</TABLE> <?Php include "footer.php"; ?>
801.
</BODY>
802.
</HTML>
somedude3488 228 Nearly a Posting Virtuoso
dokinah1 -5 Newbie Poster
somedude3488 228 Nearly a Posting Virtuoso
diafol
poojamakhija 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.