Location: PHPKode > scripts > PHP Classified script made easy > php-classified-script-made-easy/openclassifiedsdownload24124/Files/details.php
<?PHP
            $id = $_GET['id'];
			$admin = $_GET['adminpreview'];
			if(isset($admin)){
			$preview = true;
			}
if(!isset($id)) {
echo "<meta http-equiv='refresh' content='0;url=index.php'>";
}
        include("inc/header.php");
		$id = strtoupper($id);
		$id = strip_tags($id);
		$id = trim ($id); 
		// Checking for classified ad that the user is trying to view, and making sure it's a validated ad, not awaiting approval.
		if($preview == true){
        $query  = "SELECT * FROM classifieds WHERE adid = '".$id."'";
		} else {
        $query  = "SELECT * FROM classifieds WHERE adid = '".$id."' AND authorized = '1'";		
		}
        $result3 = mysql_query($query) or die(mysql_query());
        $rows3 = mysql_num_rows($result3);
		// If it can't find the given ad in the Database
if($rows3 < 1) {
echo "<meta http-equiv='refresh' content='0;url=index.php'>";
} else {
if(isset($_GET['remove'])){
echo "<meta http-equiv='refresh' content='0;url=remove.php?id=".$id."'>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<?PHP include("inc/meta.php"); ?>
<title><?PHP include("inc/title.php"); ?></title>

<link href="inc/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function goto(url)
{
document.location.href=(url);
}
</script>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<style type="text/css">
<!--
.style52 {font-size: 12px}
.style54 {
	font-size: 35px;
	color: #FFFFFF;
}
.style55 {font-family: Geneva, Arial, Helvetica, sans-serif}
.style2 {	font-size: 18px;
	font-weight: bold;
}
-->
</style>
</head>

<body>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="70" valign="bottom"><a href="index.php"><img src="images/logo.gif" alt="Petoskey Classifieds - Northern Michigan Classifieds" width="450" height="62" border="0" /></a></td>
    <td class="head"><div align="right" class="style1"><a href="index.php" class="style10">Home</a> <span class="style4">|</span> <a href="buy.php" class="style46">Buy</a> <span class="style4">|</span><a href="sell.php" class="style46"> Sell </a><span class="style4">| </span><span class="style9"><a href="search.php" class="style46">Search</a> <span class="style44">|</span> <a href="help.php" class="style46">Help</a> </span></div></td>
  </tr>
  <tr>
    <td height="226" bgcolor="#F1F5FA" class="top left" onClick="goto('buy.php');"><div align="center"><img src="images/buy.gif" alt="Petoskey Classifieds Listings" width="272" height="178" /></div></td>
    <td bgcolor="#E2ECF5" class="top right" onClick="goto('sell.php');"><div align="center"><img src="images/sell.gif" alt="Petoskey Classifieds Sell Items" width="265" height="180" /></div></td>
  </tr>
  <tr>
    <td height="34" colspan="2" valign="top" class="main-content"><br />
    <table width="100%" height="75" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="71%" valign="top" class="left-content"><table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tbody>
              <tr>
                <td valign="bottom"><span class="style34">Classified Details<?PHP if($preview == true){ echo " (PREVIEW MODE)"; } ?></span> - <a href="#options" style="text-decoration:none;color:#000000;font-size:14px;">View Options</a></td>
              <td width="180" valign="bottom" style="padding-right:5px;"><div align="right"></div></td>
              </tr>
            </tbody>
            </table>
			
            
            
            <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border:1px solid #D8D8D8;" class="listings">
              <tr>
                <td height="30" colspan="1" valign="middle" bgcolor="#E2ECF5" style="padding-left:10px;" class="pages">
              
			  <?PHP
echo "<div align='left'></div>";

echo "</tr><tr><td>";

while($row = mysql_fetch_array($result3, MYSQL_ASSOC))
{
$id = $row['adid'];
    echo "
	 <table width='100%' border='0' cellspacing='0' cellpadding='0' style='background-color:#f1f5fa;'>
                    <tr>
				<td colspan='2'>"; echo $block6; echo"</td>
					</tr>
					<tr>
                      <td width='65%' valign='top' style='padding-top:5px;padding:10px;'><table width='100%' border='0' cellspacing='4' cellpadding='0'>
                        <tr>
                          <td width='75%'><span class='style1'>".$row['title']."</span><br /></td>  <td rowspan='4' background='images/pricebg.gif' style='height:83;width:85;background-position:center;background-repeat:no-repeat;'><div align='center' class='style26 style54' style='color:#000000;'>$".$row['price']."</div></td></tr><tr>
 <td><span  class='style55'>Listed: ".$row['date']."</span></td></tr><tr/>
 <td><span  class='style55'>Contact Number: ".$row['number']."</span></td></tr><tr>
 <td><span  class='style55'>Email Address: <a href='contact.php?id=".$row['adid']."' class='style55' style='text-decoration:none;'>Contact This Seller</a></span></td></tr>
                      </table>
                        <div class='style55' style='border-bottom:1px solid #000;font-size:20px;'><br />
                          Description:</div>
                        <div style='padding-top:5px;'><span class='style55'>".$row['description']."</span></div>
                        <p class='style55'>
                        <div class='style55' style='border-bottom:1px solid #000;font-size:20px;'>Listing Details :</div>
                       <table width='100%' border='0' cellspacing='4' cellpadding='0' style='padding-top:5px;'>
  <tr>
    <td width='40%' style='padding-right:15px;'><div align='left'><span class='style55'>Title:</span></div></td>
    <td width='60%'><span class='style55'>".$row['title']."</span></td>
  </tr>
  <tr>
    <td style='padding-right:15px;'><div align='left'><span class='style55'>Price:</span></div></td>
    <td><span class='style55'>$".$row['price']."</span></td>
  </tr>
  <tr>
    <td style='padding-right:15px;'><div align='left'></div></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td style='padding-right:15px;'><div align='left'><span class='style55'>Seller Name:</span></div></td>
    <td><span class='style55'>".$row['name']."</span></td>
  </tr>
  <tr>
    <td style='padding-right:15px;'><div align='left'><span class='style55'>Contact Number:</span></div></td>
    <td><span class='style55'>".$row['number']."</span></td>
  </tr>
  <tr>
    <td style='padding-right:15px;'><div align='left'><span class='style55'>Email Address:</span></div></td>
    <td><span class='style55'><a href='contact.php?id=".$row['adid']."' class='style55' style='text-decoration:none;'>Contact This Seller</a></span></td>
  </tr>
  <tr>
    <td style='padding-right:15px;'><div align='left'></div></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td style='padding-right:15px;'><div align='left'><span class='style55'>Date Added:</span></div></td>
    <td><span class='style55'>".$row['date']." </span></td>
  </tr>
  <tr>
    <td style='padding-right:15px;'><div align='left'><span class='style55'>Ad Views:</span></div></td>
    <td><span class='style55'>".$row['views']."</span></td>
  </tr>
  
</table>
                      </td>
                      <td width='31%' valign='top' style='padding-top:15px;'><div align='center'><a href='".$row['picture']."' rel='lightbox' title='".$row['title']."' style='text-decoration:none;'>
                        <img src='".$row['picture']."' width='150' border='0' /><br />
                        <span class='style52'>Click To See Larger Image</span> </a><br/>
"; echo $block5; echo "				
						</div></td>
                    </tr>
					<tr>
					<td colspan='2'>"; echo $block7; echo "</td>
					</tr>
                  </table>
	
	";
		$views = $row['views']+1;
	    $query2  = "UPDATE classifieds SET views = '$views' WHERE adid = '".$row['adid']."'";
        $result2 = mysql_query($query2);
		$contactlink = "contact.php?id=".$row['adid'];
		$printlink = "print.php?id=".$row['adid'];
		$telllink = "tellafriend.php?id=".$row['adid'];
	}

echo "<div align='left'>";
			  ?>
              <tr>
                <td height="30" colspan="1" valign="middle" bgcolor="#E2ECF5" style="padding-left:10px;" class="pages"><a href='details.php?id=<?PHP echo $id;?>&remove=true'><img src="images/remove-icon.png" width="20" height="20" border="0" align="left" />Buyer Remove Ad</a></td>
              </tr>
            </table>
            <br />
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="26" colspan="3" bgcolor="#E2ECF5"><span class="style2">Classified Ad Options<a name="options"></a></span> </td>
              </tr>
              <tr>
                <td height="48" bgcolor="#F1F5FA"><div align="center"><strong><a href="<?PHP echo $contactlink; ?>" style="color:#000000;text-decoration:none;">Contact This Seller <br />
                          <img src="/images/contact-icon.png" width="79" height="77" border="0" /></a></strong></div></td>
                <td bgcolor="#F1F5FA"><div align="center"><strong><a href="<?PHP echo $printlink; ?>" target="_blank" style="color:#000000;text-decoration:none;">Print This Ad <br />
                          <img src="/images/print-icon.png" width="67" height="77" border="0" /></a></strong></div></td>
                <td bgcolor="#F1F5FA"><div align="center"><strong><a href="<?PHP echo $telllink; ?>" style="color:#000000;text-decoration:none;">Tell A Friend <br />
                          <img src="/images/tell-icon.png" width="68" height="86" border="0" /></a><br />
                </strong></div></td>
              </tr>
            </table>
            <br />
          <br /></td>
          <td width="29%" valign="top" class="right-content"><?PHP include("inc/right.php"); ?></td>
        </tr>
    </table>    </td></tr>
  <tr>
    <td height="93" colspan="2" valign="top" class="footer">
    <div style="float:right;"><a href="#"><img src="images/backtotop.png" width="59" height="18" border="0" /></a></div>
    <div align="left" class="style23">
      <p><a href="index.php" class="style49">Home</a> <span class="style44">|</span> <a href="buy.php" class="style49">Buy</a> <span class="style44">|</span><a href="sell.php" class="style49"> Sell </a><span class="style44">| </span><span class="style49"><a href="search.php" class="style49">Search</a> <span class="style44">|</span> <a href="help.php" class="style49">Help</a></span></p>
      <p class="style24"> All Rights Reserved
        <?PHP include("inc/title.php"); ?>
          <br />
        PHP Classifieds App - <a href="http://www.rcoders.com/" style="text-decoration:none;color:#000000;">RCoders</a> Dev </p>
    </div></td>
  </tr>
</table>
</body>
</html>
<?PHP
}
?>
Return current item: PHP Classified script made easy