<?
	include("config/connect.php");
	include("session.php");
	include("functions.php");
	$uid = $_SESSION["userid"];
	if(!$_GET['pgno'])
	{
		$PageNo = 1;
	}
	else
	{
		$PageNo = $_GET['pgno'];
	}

	
	$qryselauc = "select * from auc_show aus left join auction a on aus.bid_id=a.auctionID left join  products p on a.productID=p.productID where aus.member_id=$uid  order by id desc";

	$resselauc = mysql_query($qryselauc);
	$totalauc = mysql_num_rows($resselauc);
	$totalpage=ceil($totalauc/$PRODUCTSPERPAGE_MYACCOUNT);

	if($totalpage>=1)
	{
	$startrow=$PRODUCTSPERPAGE_MYACCOUNT*($PageNo-1);
	$qryselauc.=" LIMIT $startrow,$PRODUCTSPERPAGE_MYACCOUNT";
	//echo $sql;
	$resselauc=mysql_query($qryselauc);
	$totalauc=mysql_num_rows($resselauc);
	}
?>
<!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=<?=$lng_characset;?>" />
<title>我的晒单</title>
<link href="css/style_youbid.css" rel="stylesheet" type="text/css" />

</head>


<body >
<div id="main_div">
<?
	include("d1.php");
?>
		<div id="middle_div">
			<? include("leftside.php"); ?>
			<div class="inner-container">
				<div class="titlebar">
					<div class="leftbar"></div>
					<div class="middlebar"><div class="page_title_font">我的晒单</div></div>
					<div class="rightbar"></div>
				</div>
				<div class="bodypart">	
					<div style="height: 15px;">&nbsp;</div>
					<?
					if($totalauc>0)
					{
					?>
					<?
						$counter = 1;
						while($obj = mysql_fetch_array($resselauc))
						{
							
					 ?>	
					 <? if($counter==1){ ?>
						<div class="strip">
							<div class="imagetext">项目</div>
							<div class="descriptiontext">描述</div>
							<div class="pricetext">获得奖励</div>
							<div class="pricetext" align="center" style="padding:0px; width:132px;">申请时间</div>
							<div class="pricetext" align="right" style="padding:0px; width: 60px;">状态</div>
							
						</div>
					<? } ?>
						<div class="even-row">
							<div class="evenproductimage"><a href="auction_<?=str_replace(" ","_",strtolower(stripslashes($obj["name"])));?>_<?=$obj["auctionID"];?>.html"><?=stripslashes($obj["name"]);?></a>
							</a>
							


							</div>
							<div class="evenproductdesc"><div class="auction_decription"><?=stripslashes(choose_short_desc($obj["short_desc"],160));?><a href="auction_<?=str_replace(" ","_",strtolower(stripslashes($obj["name"])));?>_<?=$obj["auctionID"];?>.html" class="black_link"><?=$lng_linkmore;?></a></div></div>
							<div class="evenproductprice">
								<?=$obj["money"];?>
							</div>		
							<div class="wonprice">
								<?=date('Y-m-d H:i:s',$obj["addtime"]);?>
							</div>			
							<div class="wonbidder">
								<?if($obj["is_audit"]==1){?>
							   <a href="show_<?=$obj["id"];?>.html">详情</a>
							<? } 
						     elseif($obj["is_audit"]==2){
							 echo "没有通过审核";
							 }
							 else{
							 echo "申请中";
							 }
							 
							 ?>

							</div>			
						</div>
					
					<?
							$counter++;	
						}
					?>
					<div style="height: 10px;"></div>
					<div class="strip">
						<div style="padding-top: 2px;">
					<?
					if($PageNo>1)
					{
					  $PrevPageNo = $PageNo-1;
					?>
						  <A class="alink" href="myauctions_<?=$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="myauctions_<?=$NextPageNo;?>.html"><?=$lng_nextpage;?> &gt;</A>
					  <?
					   }
					  ?>
					     </div>
					</div>	
					<?
					}
					else
					{
					?>		
					<div>&nbsp;</div>
					<div class="noauction_message" align="center">您现在没有晒单</div>
					<div>&nbsp;</div>
					<?
					}
					?>
				</div>
				<div class="bottomline">
					<div class="leftsidecorner"></div>
					<div class="middlecorner"></div>
					<div class="rightsidecorner"></div>
				</div>
			</div>
		</div>
<?
	include("footer2.php");
?>		
</div>

</body>
</html>
