<?
ob_start();session_start();
		include("include/db.inc.php");
		include("include/bit_functions.inc.php");
	   
 		$db1=new db;
   $db1->open();
    mysql_query("SET NAMES 'utf8'");
		check_login();
 		if($_GET[uid]){
		$uid=$_GET[uid];
		}
		else{
    	$uid=$_SESSION['uid'];
		}
	
	
		/*if(isset($_POST['delete']) && is_array($_POST['chkbx']))
		{
		foreach($_POST['chkbx'] as $delid)
			{
			$upd="delete from t123go_product_sold where pid='$delid' and uid='$uid'";
			$sql=mysql_query($upd);
			
			}
		
		}
		*/
   
?>
 <!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" />

<meta name="author" content="Info-Tech Ltd. | We simplify web 2.0"/>
<title>MY<?=_TITLE1_?>|Won-auctions</title> 

<link href="<?=_BASEURLCSSNEW_?>/main.css" rel="stylesheet" type="text/css" />
<link href="<?=_BASEURLCSSNEW_?>/div.css" rel="stylesheet" type="text/css" />
<link href="<?=_BASEURLCSSNEW_?>/fonts.css" rel="stylesheet" type="text/css" />
<link href="<?=_BASEURLCSSNEW_?>/links.css" rel="stylesheet" type="text/css" />
<!--[if lte IE 6]><style type="text/css" media="screen">/* <![CDATA[ */ @import url(css/ie6.css?0:102290); /* ]]> */</style><![endif]-->
<!--[if gte IE 7]><style type="text/css" media="screen">/* <![CDATA[ */ @import url(css/ie7.css?0:99961); /* ]]> */</style><![endif]-->
  
  </head>
<body>  
<center>
<div id="mainwrap">
<? include("header.php");?>

<div id="centerwrap" >
<div  align="left" class="cl">
<div ><h3 style="padding-left:8px; padding-top:3px;color:#5C5C5C">My <?=_TITLE1_?></h3> </div>
    <br />
    <table border="0" cellpadding="0" cellspacing="0" >
    <tr>
      <td valign="top" width="170" style="padding-left:10px"><? include("view.php");?></td>
      
      <td style="padding-left:20px; color:#5C5C5C" valign="top">
	  <?
		        $sql="select * from t123go_product_sold where uid=".$uid;
				$rwd=mysql_query($sql);
				if(mysql_num_rows($rwd)){
		   ?>
	
	   <div style="font-weight:bold;height:22px;padding-left:10px;padding-top:4px">Your won auctions</div> <br />
	   
	   <div id="titlebarn">
                                <div class="imagetitlen">IMAGE</div>
                                <div class="desctitlen">DESCRIPTION</div>
                                <div class="priceetitlen"><span class="fl">PRICE</span></div>
                                <div class="bidtitle"><span class="fl">BIDDER</span><span class="arrow"></span></div>
                                <div class="counttitlen"><span class="fl">Time of Bid</span></div>
                                <div class="imagetitleclearedup"></div> 
                            </div>
	
            
              <?
                while($myuser=mysql_fetch_array($rwd)){
				$myprod=mysql_fetch_array(mysql_query("SELECT * FROM t123go_product where pid='".$myuser['pid']."' "));
				
			  ?>
			   <div id="detailsw"  >
                           <div class="imagetitlew" >
						   <a href="product_details.php?prodid=<?=$myprod['pid']?>"><?=get_product_image_new($myprod['thumbnail'],90,70); ?></a> </div>
                           <div class="desctitlew">
						   <a href="product_details.php?prodid=<?=$myprod['pid']?>"><strong><?=$myprod['pname'];?></strong></a>
						   <br /><br />
									<?
									if($myprod['type1']=='1'){ echo'<a href="#" title="Fixed Price Auction"><img src="template/fixed.gif" alt="Fixed Price Auction" /></a>&nbsp;&nbsp;&nbsp;'; }
									else if($myprod['type1']=='2'){ echo'<a href="#" title="Penny Auction"><img src="template/penny.gif" alt="Penny Auction" /></a>&nbsp;&nbsp;&nbsp;&nbsp;'; }
         							else if($myprod['type1']=='3'){ echo'<a href="#" title="100% off auction"><img src="template/100.gif" alt="100% off auction" /></a>&nbsp;&nbsp;&nbsp;&nbsp;'; }
									//if($myprod['type4']=='1'){ echo'<a href="#" title="Night Auction"><img src="template/night.gif" alt="Night Auction" /></a>'; } 
									?></div>
							   <div  class="priceetitlew"> <?=$myuser['sold_price']?> &pound;</div>
							   <div class="bidtitlew"> <?=get_fieldval(id,uname,user,$myprod['bider_id'])?> </div>
							   <div class="counttitlew"><?=$myuser['sold_date']?><!--&nbsp;<input type="checkbox" name="chkbx[]" value="<?=$myprod[pid]?>"/>--></div>
							<div style="clear:both"></div>
                      	 </div>
	 
	   
	  <? }?>
	<!--  <div style="float:right; padding:10px"> Delete selected auctions from list &raquo; 
	  <input type="submit" name="delete" value="Delete Selected" class="inputsubmit" onClick="return confirm('Are you sure to delete this Product ?');"/></div>
        </form>-->
		<?	} else{
			 echo "<strong>Sorry, you haven't won your first auction yet</strong>";
			}
			 ?>
         </td>
      </tr>
   </table>
 </div>
 </div>
<div>

</html></div></div>
</center>
</body>
</html>
