<?error_reporting(0);
	include("config/connect.php");
	include("functions.php");

	$showid = $_REQUEST["sid"];
	//$prid = $_REQUEST["pid"];
	//$uid = $_SESSION["userid"];
	if($showid=="")
	{
		header("location: index.php");
	}

	$now=time();
	$qrysel = "select *,s.id as sid from products p left join auction a on p.productID=a.productID  left join auc_show s on a.auctionID=s.bid_id left join registration r on a.buy_user=r.id  where s.id='$showid'";
	$ressel = mysql_query($qrysel);
	$total2 = mysql_num_rows($ressel);
	if($total2<1){
	 header("location: index.php");
	}
	$obj = mysql_fetch_object($ressel);
?>
<!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=utf-8" />
<title>拍客网</title>
<link href="style/css/index.css" rel="stylesheet" type="text/css" />
</head>
<body onload="OnloadPage();">
<?
	include("d1.php");
?>

<div id="wrap">
	<div class="wrap-row">
    	<div class="wrap-row-title">商品信息</div>
        <div class="wrap-row-info">
        	<div class="col1"><img src="uploads/products/<?=$obj->picture1;?>"  width="135" height="120"/></div>
            <div class="info-wrap">
            	<div class="title">商品名称：<a href="auction_<?=str_replace(" ","_",strtolower(stripslashes($obj->name)));?>_<?=$obj->auctionID;?>.html" target="_blank"><?=stripslashes($obj->name);?>
</a></div>
                <div class="price">市场价： ￥<?=$obj->price ;?> </div>
				<div class="price">成交价格:￥<?=$obj->spread_price;?> </div>
                <div class="intro">
            <?=stripslashes($obj->long_desc);?>            
                </div>
            </div>
            <div class="clear"></div>
        </div>        
    </div>

	<div class="wrap-position">首页 >> 晒单列表页面  >><?=stripslashes($obj->name);?>  </div>
   
 <?


	if(!$_GET['pgno'])
	{
		$PageNo = 1;
	}
	else
	{
		$PageNo = $_GET['pgno'];
	}
	$qry = "select * from show_reply s left join registration r on s.member_id=r.id where show_id=".$obj->sid;
	$res = mysql_query($qry);
	$total3= mysql_num_rows($res);
	$totalpage=ceil($total3/$PRODUCTSPERPAGE_MYACCOUNT);

	if($totalpage>=1)
	{
	$startrow=$PRODUCTSPERPAGE_MYACCOUNT*($PageNo-1);
	$qry .= " LIMIT $startrow,$PRODUCTSPERPAGE_MYACCOUNT";
	//echo $sql;
	$res=mysql_query($qry);
	$total_p=mysql_num_rows($res);
	}
				
	?>
    <div class="wrap-title">
    	<div class="col1">网友晒单  （共<?=$total3;?>条回复）</div>
        <div class="col2"><a href="show_index.html">返回晒单列表页面</a></div>
        <div class="clear"></div>
    </div>
    
    <div class="post-row1">
    	<div class="col1">
        	<div class="headering"><img src="<?=$obj->headering;?>"  width='55' height='55'/></div>
            <div class="username">会员名：<?=$obj->username;?></div>
            <div class="time">注册日期：<?=$obj->register_date;?></div>
        </div>
        <div class="col2">
        	<div class="info-wrap">
            	<div class="info-title"><?=$obj->title;?></div>
                <div class="info"><?=$obj->detail;?>
                            
                </div>
            </div>
            <div class="picture-list">
            	<ul>
				<?
	
	
	$qrypho = "select * from show_photo where show_id=".$obj->sid;
	$respho = mysql_query($qrypho);
	$total_ph = mysql_num_rows($respho);
	
	if($total_ph>0)
	{
						
	while($obj_ph = mysql_fetch_array($respho))
		{
?>
                            <div class="picture-li"><a href="show_<?=$obj->sid;?>.html"><img src="<?=$obj_ph["detail_img"];?>" /></a></div>
                            <? 
	}
	}

?>

                </ul>
            </div>
        </div>
        <div class="clear"></div>
    </div>
    

	 <?
	
	
	
	if($total_p>0)
	{
						
	while($obj2 = mysql_fetch_array($res))
		{
?>
    <div class="post-row2">
    	<div class="col1">
        	<div class="headering"><img src="<?=$obj2["header"];?>"  width='55' height='55'/></div>
            <div class="username">会员名：<?=$obj2["username"];?></div>
            <div class="time">注册日期：<?=$obj2["register_date"];?></div>
        </div>
        <div class="col2">
        	<div class="info-wrap">
            	<div class="info-title"><?=$obj2["title"];?></div>
                <div class="info"> <?=$obj2["detail"];?>   
                </div>
            </div>
        </div>
        <div class="clear"></div>
    </div>

 <? 
	}
	}

?>
<div class="inside3-pagination"><?
					if($PageNo>1)
					{
					  $PrevPageNo = $PageNo-1;
					?>
						  <A class="alink" href="show_index_<?=$PrevPageNo; ?>.html">&lt; <?=$lng_previouspage;?></A>
					<?
						if($totalpage>2 && $totalpage!=$PageNo)
						{
					 ?>
						<span class="paging">&nbsp;|</span>
					 <?
						}
					  }
				     ?>&nbsp;
				     <?php
			 		  if($PageNo<$totalpage)
					  {
						 $NextPageNo = 	$PageNo + 1;
					  ?>
						  <A class="alink" id="next" href="show_index_<?=$NextPageNo;?>.html"><?=$lng_nextpage;?> &gt;</A>
					  <?
					   }
					  ?></div>
	    
   
            
</div>
							
<?
	include("footer2.php");
?>		

</body>
</html>
