Code: Select all
require "config.php";
if(!isset($_GET['page'])) {
$page = 1;
} else {
$page = $_GET['page'];
}
// Define the number of results per page
$max_results = 1;
// Figure out the limit for the query based
// on the current page number
$from = (($page * $max_results) - $max_results);
// Perform MySQL query on only the current page number's results
$sql = mysql_query("SELECT * FROM clearingsales LEFT JOIN clearingsales_photos ON clearingsales.id = clearingsales_photos.parent_id LIMIT $from, $max_results") or die ("Could not query because: " . mysql_error());
while($row = mysql_fetch_array($sql)){
$propertyname = "";
if (isset($row['propertyname'])) {
$propertyname = stripslashes($row['propertyname']);
$propertyname = stripslashes($propertyname);
$propertyname = stripslashes($propertyname);
$propertyname = stripslashes($propertyname);
$propertyname = mysql_real_escape_string($row['propertyname']);
}
$txt1 = "";
if (isset($row['txt1'])) {
$txt1 = stripslashes($row['txt1']);
$txt1 = stripslashes($txt1);
$txt1 = stripslashes($txt1);
}
$txt2 = "";
if (isset($row['txt2'])) {
$txt2 = stripslashes($row['txt2']);
$txt2 = stripslashes($txt2);
$txt2 = stripslashes($txt2);
}
$txt3 = "";
if (isset($row['txt3'])) {
$txt3 = stripslashes($row['txt3']);
$txt3 = stripslashes($txt3);
$txt3 = stripslashes($txt3);
}
$txt4 = "";
if (isset($row['txt4'])) {
$txt4 = stripslashes($row['txt4']);
$txt4 = stripslashes($txt4);
$txt4 = stripslashes($txt4);
}
$txt5 = "";
if (isset($row['txt5'])) {
$txt5 = stripslashes($row['txt5']);
$txt5 = stripslashes($txt5);
$txt5 = stripslashes($txt5);
}
$txt6 = "";
if (isset($row['txt6'])) {
$txt6 = stripslashes($row['txt6']);
$txt6 = stripslashes($txt6);
$txt6 = stripslashes($txt6);
}
$txt7 = "";
if (isset($row['txt7'])) {
$txt7 = stripslashes($row['txt7']);
$txt7 = stripslashes($txt7);
$txt7 = stripslashes($txt7);
}
$txt8 = "";
if (isset($row['txt8'])) {
$txt8 = stripslashes($row['txt8']);
$txt8 = stripslashes($txt8);
$txt8 = stripslashes($txt8);
}
$txt9 = "";
if (isset($row['txt9'])) {
$txt9 = stripslashes($row['txt9']);
$txt9 = stripslashes($txt9);
$txt9 = stripslashes($txt9);
}
$txt10 = "";
if (isset($row['txt10'])) {
$txt10 = stripslashes($row['txt10']);
$txt10 = stripslashes($txt10);
$txt10 = stripslashes($txt10);
}
$txt11 = "";
if (isset($row['txt11'])) {
$txt11 = stripslashes($row['txt11']);
$txt11 = stripslashes($txt11);
$txt11 = stripslashes($txt11);
}
$select1 = "";
if (isset($row['select1'])) {
$select1 = mysql_real_escape_string($row['select1']);
}
$select2 = "";
if (isset($row['select2'])) {
$select2 = mysql_real_escape_string($row['select2']);
}
$select3 = "";
if (isset($row['select3'])) {
$select3 = mysql_real_escape_string($row['select3']);
}
$select4 = "";
if (isset($row['select4'])) {
$select4 = mysql_real_escape_string($row['select4']);
}
$select5 = "";
if (isset($row['select5'])) {
$select5 = mysql_real_escape_string($row['select5']);
}
$select6 = "";
if (isset($row['select6'])) {
$select6 = mysql_real_escape_string($row['select6']);
}
$select7 = "";
if (isset($row['select7'])) {
$select7 = mysql_real_escape_string($row['select7']);
}
$select8 = "";
if (isset($row['select8'])) {
$select8 = mysql_real_escape_string($row['select8']);
}
$select9 = "";
if (isset($row['select9'])) {
$select9 = mysql_real_escape_string($row['select9']);
}
$select10 = "";
if (isset($row['select10'])) {
$select10 = mysql_real_escape_string($row['select10']);
}
$select11 = "";
if (isset($row['select11'])) {
$select11 = mysql_real_escape_string($row['select11']);
}
$date = "";
if (isset($row['date'])) {
$date = mysql_real_escape_string($row['date']);
}
$time = "";
if (isset($row['time'])) {
$time = mysql_real_escape_string($row['time']);
}
$accountname = "";
if (isset($row['accountname'])) {
$accountname = mysql_real_escape_string($row['accountname']);
}
$photos = "";
if (isset($row['photos'])) {
$photos = mysql_real_escape_string($row['photos']);
}
$comments = "";
if (isset($row['comments'])) {
$comments = mysql_real_escape_string($row['comments']);
}
$filename = "";
if (isset($row['filename'])) {
$filename = mysql_real_escape_string($row['filename']);
}
$id = "";
if (isset($row['id'])) {
$id = mysql_real_escape_string($row['id']);
}
// Build your formatted results here
echo '<b><center>'.$propertyname.'</b><br />';
echo $date.' commencing '.$time.'<br />';
echo 'A/c '.$accountname.'</center><br />';
echo $comments.'<br />';
echo '<div class=title2>'.$select1.'</div> '.$txt1.'<br />';
echo '<div class=title2>'.$select2.'</div> '.$txt2.'<br />';
echo '<div class=title2>'.$select3.'</div> '.$txt3.'<br />';
echo '<div class=title2>'.$select4.'</div> '.$txt4.'<br />';
echo '<div class=title2>'.$select5.'</div> '.$txt5.'<br />';
echo '<div class=title2>'.$select6.'</div> '.$txt6.'<br />';
echo '<div class=title2>'.$select7.'</div> '.$txt7.'<br />';
echo '<div class=title2>'.$select8.'</div> '.$txt8.'<br />';
echo '<div class=title2>'.$select9.'</div> '.$txt9.'<br />';
echo '<div class=title2>'.$select10.'</div> '.$txt10.'<br />';
echo '<div class=title2>'.$select11.'</div> '.$txt11.'<br /><br />';
echo '<a href=# onClick="popWin('.$filename.'.htm\', \'\', \'640\', \'480\')"><img src=http://www.blueguminteractive.biz/hyc/admin/images/'.$photos.' border=0 /></a><br />';
echo '<a href="edit_clearing_sale.php?id='.$id.'">EDIT</a> ';
echo '<a href="delete_clearing_sale.php?id='.$id.'">DELETE</a><br /><br />';
}
mysql_close();