<?
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'");  	
   if($_SESSION['uname']=='' || $_SESSION['pwd']=='')
		{
			header("location:login.php");
		}
$pid=$_GET['id'];
$sql_qry=mysql_query("select * from t123go_product where pid=".$pid);	
$mypro=mysql_fetch_array($sql_qry);
?> 
<!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>123gewon ADMINISTRATOR</title>  
<link href="../css/stylesheet.css" rel="stylesheet" type="text/css">
</head>
<style type="text/css">
<!--
.style1 {color: #093A9C}
.style2 {color: #FE6905}
-->
</style>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="98%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>    
    <td width="10" align="center" valign="top">&nbsp;</td>
    <td align="center" valign="top"><table  width="100%" border="0" cellpadding="0" cellspacing="0" class="bodytxt">
        <tr> 
          <td width="1" 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"><strong>&nbsp;VIEW PRODUCT</strong></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> 
                  <br> 
                    <table width="90%"  border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
                      <tr bgcolor="#FFFFFF" class="headingtxt"> 
                        <td height="25" style="padding-left:10px;"> Key</td>
                        <td height="25" style="padding-left:10px;">Value</td>
                      </tr>
                      <tr bgcolor="#FFFFFF"> 
                        <td width="15%" class="txt" style="padding-left:10px;">Main Category :</td>
                        <td width="54%" style="padding-left:10px;"> 
                            <? $sel_cat="select name from add_category where id='".$mypro[cid]."'";
							$cat_query=mysql_query($sel_cat);							
							$mymaincat=mysql_fetch_array($cat_query);				
												
									echo $mymaincat['name'];
								
							
							?>
                          </td>
                      </tr>
                      <tr bgcolor="#FFFFFF"> 
                        <td class="txt" style="padding-left:10px;">Product Name :</td>
                        <td style="padding-left:10px;"><?=$mypro['pname']?></td>
                      </tr>
                      <tr bgcolor="#FFFFFF"> 
                        <td height="28" class="txt" style="padding-left:10px;">Brand :</td>
                        <td style="padding-left:10px;"><?=$mypro['brand']?></td>
                      </tr>
                     
                      <tr bgcolor="#FFFFFF" id="priceid"> 
                        <td class="txt" style="padding-left:10px;">Price :</td>
                        <td style="padding-left:10px;"><?=$mypro['price']?></td>
                      </tr>
					   <tr bgcolor="#FFFFFF"> 
                        <td class="txt" style="padding-left:10px;">Fixed Price :</td>
                        <td style="padding-left:10px;"><?=$mypro['fixed_price'];?> </td>
                      </tr>
                      <tr bgcolor="#FFFFFF"> 
                        <td class="txt" style="padding-left:10px;">Break Even Price :</td>
                        <td style="padding-left:10px;"><?=$mypro['break_even_point']?></td>
                      </tr>   
					  <tr bgcolor="#FFFFFF"> 
                        <td class="txt" style="padding-left:10px;">Shipping Amount :</td>
                        <td style="padding-left:10px;"><?=$mypro['delivery_cost']?></td>
                      </tr>                      
                      <tr bgcolor="#FFFFFF"> 
                        <td class="txt" style="padding-left:10px;">Dummy Users :</td>
                        <td style="padding-left:10px;"><?=$mypro['dummy_user']?></td>
                      </tr>
                      <tr bgcolor="#FFFFFF"> 
                        <td class="txt" style="padding-left:10px;">Thumbnail :</td>
                        <td style="padding-left:10px;">
						 <?=image_150($mypro['pid'])?>
						<!--  <img src="../images/product/<? //=$mypro['thumbnail']?>" >-->
						</td>
                      </tr>
					  <tr bgcolor="#FFFFFF"> 
                        <td class="txt" style="padding-left:10px;">Image1 :</td>
                        <td style="padding-left:10px;">
						 <?=image_product_150($mypro['pid'],$mypro['image1'])?>
						<!--  <img src="../images/product/<? //=$mypro['thumbnail']?>" >-->
						</td>
                      </tr>
					   <tr bgcolor="#FFFFFF"> 
                        <td class="txt" style="padding-left:10px;">Image2 :</td>
                        <td style="padding-left:10px;">
						 <?=image_product_150($mypro['pid'],$mypro['image2'])?>
						<!--  <img src="../images/product/<? //=$mypro['thumbnail']?>" >-->
						</td>
                      </tr>
					   <tr bgcolor="#FFFFFF"> 
                        <td class="txt" style="padding-left:10px;">Image3 :</td>
                        <td style="padding-left:10px;">
						 <?=image_product_150($mypro['pid'],$mypro['image3'])?>
						<!--  <img src="../images/product/<? //=$mypro['thumbnail']?>" >-->
						</td>
                      </tr>
					   <tr bgcolor="#FFFFFF"> 
                        <td class="txt" style="padding-left:10px;">Auction Type :</td>
                        <td style="padding-left:10px;">
						<? 
							if($mypro[type1]=='1'){
							echo "Fixed Price";
							}
							else if($mypro[type1]=='2'){
							echo "Penny";
							
							}
							else if($mypro[type1]=='3'){
							
							echo "100% Off";
							}
						
						
						
						?></td>
                      </tr>
					  <tr bgcolor="#FFFFFF"> 
                        <td class="txt" style="padding-left:10px;">Community Offset :</td>
                        <td style="padding-left:10px;">
						<?=$mypro['community_offset']?></td>
                      </tr>
                    
                      <tr bgcolor="#FFFFFF"> 
                        <td class="txt" style="padding-left:10px;">Description 
                          :</td>
                        <td style="padding-left:10px;"><?=$mypro['description']?></td>
                      </tr>
					  <tr bgcolor="#FFFFFF"> 
                        <td class="txt" style="padding-left:10px;">Winner 
                          :</td>
                        <td style="padding-left:10px;"> 
						<? $sel_uname="select uid from t123go_product_sold where pid='".$mypro[pid]."'";
							$uname_query=mysql_query($sel_uname);	
							$num_user=mysql_num_rows($uname_query);
							if($num_user > 0){						
							$myuname=mysql_fetch_array($uname_query);				
												
									echo get_fieldval(id,uname,user,$myuname['uid']);
								}else{
								
								echo "There is no any Winner";
								
								}
							
							?></td>
                      </tr>
					  <tr bgcolor="#FFFFFF"> 
                        <td class="txt" style="padding-left:10px;">All Bidders 
                          :</td>
                        <td style="padding-left:10px;">
						<? $sel_bidder="select uid from t123go_bid where pid='".$mypro[pid]."' group by uid order by uid ";
							$bidder_query=mysql_query($sel_bidder);	
							$num_bidder=mysql_num_rows($bidder_query);
							if($num_bidder > 0){							
							while($mybidder=mysql_fetch_array($bidder_query)){				
												
									echo get_fieldval(id,uname,user,$mybidder['uid'])."<br />";
								
							}
							}else{
							echo "There is no any Bidders";
							
							}
							?></td>
                      </tr>
                    </table>
                    <br>
                 
                  <br> </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="20" valign="top">&nbsp;</td>
        </tr>
      </table>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
    </td>
  </tr>
</table>
</body>
</html>
