<?
ob_start();
session_start();
if($_SESSION['uname']=='' || $_SESSION['pwd']=='')
		{
			header("location:login.php");
		}
 include("../include/db.inc.php");
 include("../include/bit_functions.inc.php");
 include("../include/pager.php"); 
   $db1=new db;
   $db1->open();
    mysql_query("SET NAMES 'utf8'");
   if(isset($_GET['del'])){  
		
		 $query="delete from t123go_product_sold where id='".$_GET['del']."'";
		 mysql_query($query);
			?>
			<script language="javascript" >
				alert(" product has been deleted successfully");
				window.location="won_auctions.php";
				</script>
	<?	}
   
   ?>
<!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>
<title>NEWADMIN</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="../css/stylesheet.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
function views(pid){
			window.open('thumbnail.php?id='+pid,'','width=800,height=600,top=50,left=180');		
	}	
function veiwmem(id){
			window.open('view_user.php?id='+id,'','width=800,height=800,top=5,left=180');		
	}	
	function viewproduct(id){
		window.open('view_product.php?id='+id,'','scrollbars,width=920,height=700,top=5,left=180');		
	}
	</script>
<style type="text/css">
<!--
.style1 {color: #093A9C}
.style2 {color: #FE6905}
-->
</style>
</head>
<body bgcolor="#ffffff">
<div class="admin_wrapper">
<div class="logo_show"><? include("minorlogout.php");?></div>
<div style="float:left; width:200px">
<div class="topg_links_show"><? include("left.php");	?></div>
<div class="top_links_show"><? include("belowleft1.php");	?></div></div>
<div style="float:left; width:800px">
<div class="maximum"><br />
<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::header starts:::::::::::::::::::::::::::::::::::::::::::::::::::::-->

<table width="100%" border="1" cellspacing="0" cellpadding="0" style="border-collapse:collapse; border-color:#ffffff">
  <tr>
    <td><? //include("header.php");?></td>
  </tr>
</table>

<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::header ends:::::::::::::::::::::::::::::::::::::::::::::::::::::-->


<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::center starts:::::::::::::::::::::::::::::::::::::::::::::::::::::-->


<div style="margin-top:5px">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%" style="border-collapse:collapse; border-color:#404193">
  <tr height="417">
<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::left starts:::::::::::::::::::::::::::::::::::::::::::::::::::::-->   
    
	
<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::left ends:::::::::::::::::::::::::::::::::::::::::::::::::::::-->    
<td width="81%" bgcolor="#FFFFFF" valign="top">
		
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="text3">	
    <tr>
	  
    <td align="center" valign="top">     
      <table  width="100%" border="0" cellpadding="0" cellspacing="0" class="bodytxt">
  <tr> 
    <td width="15" valign="top">&nbsp;</td>
          <td valign="top"><br> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="bodytxt">
        <tr> 
          <td width="33" valign="top"><img src="img/03.gif" width="33" height="23"></td>
                  
                <td background="img/bg01.gif">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="20%"><strong>WON PRODUCT</strong> </td>
                      <td width="54%">&nbsp;</td>
                      <td width="26%" align="right">&nbsp;
					 
					  </td>
                    </tr>
                  </table></td>
          <td width="35"><img src="img/04.gif" width="35" height="23"></td>
        </tr>
      </table>
      <table  width="100%" border="0" cellpadding="0" cellspacing="0" class="bodytxt">
        <tr> 
          <td width="22" valign="top" background="img/tbl-left04.gif"><img src="img/tbl-left04.gif" width="22" height="13"></td>
                <td valign="top" align="center"> 
    <br> <?
		        $sql="select * from t123go_product_sold ";
				$rwd=mysql_query(dopaging($sql,20));
				if(mysql_num_rows($rwd)){
		   ?>
                    <form action="" method="post" enctype="multipart/form-data" name="form1">
                    <table width="100%" border="1" cellspacing="1" cellpadding="1" bgcolor="#FFFFFF" style="border-collapse:collapse; border-color:#FED267">
                            <tr bgcolor="#FED267"> 
							<td width="80"  ><strong><font color="#FFFFFF">Product ID</font></strong></td>
                              <td width="120" align="center" ><strong><font color="#FFFFFF">Thumbnail</font></strong></td>
                               <td width="137" ><strong><font color="#FFFFFF">Product Name</font></strong></td>
                              <td width="80"  ><strong><font color="#FFFFFF">PRICE</font></strong></td>
							   <td width="100" align="center"><strong><font color="#FFFFFF">Winner</font></strong></td>
                              <td width="74" height="20" align="center"><strong><font color="#FFFFFF">Delete</font></strong></td>
                            </tr>
							<?  
								$i=1;	
							
                         while($my_won=mysql_fetch_array($rwd)){ 
						 
						 $myrow=mysql_fetch_array(mysql_query("select * from t123go_product where pid='".$my_won['pid']."'"));
						 
						 
						  ?>
                            <tr <?php /*?><? if($i%2==0)echo 'bgcolor="#E6E4E3"';?> <?php */?>onMouseOver="this.style.backgroundColor='#FFECBF'" onMouseOut="this.style.backgroundColor='#ffffff'"> 
							 <td ><?=$myrow['pid'];?></td>
                              <td align="center" valign="top"><a href="javascript:views('<?=$myrow['pid']?>')"><?=image_90($myrow['pid'])?></a>
							
                              </td>
                             
                             
                              <td ><? echo '<a href="javascript:viewproduct('.$myrow['pid'].')" class="link11">'.$myrow['pname'].'</a>'?></td>
                              
                              <td ><?=$my_won['sold_price']?></td>
							 
							   <td align="center"> <a class="link5" style="font-size:12px;"  href="javascript:veiwmem(<?=$my_won['uid']?>)" title="Click To View User Information" ><?=get_fieldval(id,uname,user,$my_won['uid'])?></a> </td>
                              
                              
							   <td align="center">
                                <table>
                                  <tr>
                                    <td></td>   
                                    <td style="padding-left:30px;"><a href="won_auctions.php?del=<?=$my_won['id']?>" onClick="return confirm('Are you sure to delete this Product ?');"><img src="../images/category/imgdelete.gif" border="0"></a></td>
                                  </tr>
                                </table> </td>
                            </tr>
                                <?
				$i++;
			}	// end of while loop
		
			if(rightpaging()){	// if there are more than one pages then only display paging
		?>
				<tr>
					<td colspan="6" align="center"><br><? echo rightpaging(); ?></td>
				</tr>
		<?
			}	// end of paging display
		?>
                          </table>
					  
</form>
			<? }?>
</td>
          <td width="19" valign="top" background="img/tbl-right04.gif"><img src="img/tbl-right04.gif" width="19" height="9"></td>
        </tr>
      </table>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="bodytxt">
              <tr> 
                <td width="33"><img src="img/tbl-bot01.gif" width="33" height="12"></td>
                <td  width="709" align="right" background="img/tbl-bg.gif"></td>
                <td width="33"><img src="img/tbl-right05.gif" width="35" height="12"></td>
              </tr>
            </table>
      
    </td>
    <td width="15" valign="top">&nbsp;</td>
  </tr>
</table></td>
    </tr>
  </table>
        </td>
	</tr></table>	
</div>


<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::center ends:::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::footer starts:::::::::::::::::::::::::::::::::::::::::::::::::::::-->
</div></div>
<div class="bottom_links_show"><? include("footer.php");	?></div>
</div>
<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::footer ends:::::::::::::::::::::::::::::::::::::::::::::::::::::-->
</body>
</html>