<?php
session_start();
//if(strlen($_SESSION['adminuser'])==0) {
	//echo '<meta http-equiv="refresh" content="0;url=index.php">';
	//exit();
//}
require 'include/configurations.php'; // ITECHBIDS Configuration File
require 'include/header.php';
$item_name=$_GET['item_name'];
//$pib_row['selling_method']=$_GET['val'];
$id=$_GET['id'];
$photo=array();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
>
<style type="text/css">
<!--
.style1 {
	color: #666666;
	font-weight: bold;
}
.style3 {color: #666666; font-size: 11px; font-family:Arial, Helvetica, sans-serif}
-->
</style>
<?php
 $pib_sql="select * from auction_details where productid='$id'";
 $pib_res=mysql_query($pib_sql);
 $pib_row=mysql_fetch_array($pib_res);
?>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="2">
  <tr>
    <td>
	<table width="391" style="border:1px solid color=#DBFEDF" cellpadding="5" cellspacing="2"><br>
	<tr><td width="15">&nbsp;</td>
   <td width="191"  class="tddis">Item Name</td>
    <td width="169">
     <?php echo $pib_row['producttitle']; ?>
    </td>
  </tr>
  
  <tr><td width="15">&nbsp;</td>
   <td width="191"  class="tddis">Detailed Description</td>
    <td width="169">
	<textarea rows="5"><?php echo $pib_row['detailed_descrip'];
	 ?>
      </textarea>
    </td>
  </tr>
   <?php 
  if($pib_row['selling_method']=='auction' or $pib_row['selling_method']=='dutch_auction')
  { 
  ?>

  <tr><td width="15">&nbsp;</td><td class="ft" heught=25"><b>Bid </b></td></tr>
  <tr><td width="15">&nbsp;</td>
   <td width="191"  class="tddis">Minimum Amount</td>
    <td width="169">
     <?php echo $pib_row['currency']." "; echo $pib_row['min_bid_amount']; ?>
    </td>
  </tr>
  
  <tr><td width="15">&nbsp;</td>
   <td width="191"  class="tddis">Increment</td>
    <td width="169">
    <?php echo $pib_row['bidincrement']; ?>
    </td>
  </tr>
  <?php 
  	}
	else if($pib_row['selling_method']=='fix' or $pib_row['selling_method']=='ads') {
	?>
  <tr><td width="15">&nbsp;</td><td class="ft" heught=25"><b>Fixed Price Sale</b></td></tr>
  <tr><td width="15">&nbsp;</td><td >Fixed Amount</td><td><?php echo $pib_row['currency']; echo $pib_row['quick_buy_price']; ?></td></tr>
	<?
	} 
  ?>
  
   <tr><td width="15">&nbsp;</td><td class="ft" heught=25"><b>Other Pay( Shippping )</b></td></tr>
  <tr><td width="15">&nbsp;</td>
   <td width="191">Shipping Amount</td>
    <td width="169">
     <?php echo $pib_row['currency']." ";  echo $pib_row['shipping_cost']; ?>
    </td>
  </tr>
   <?php if($pib_row['selling_method']=='auction' or $pib_row['selling_method']=='dutch_auction')
  { ?>
  <tr><td width="15">&nbsp;</td>
   <td width="191"  class="tddis">Reserve Price</td>
    <td width="169">
      <?php echo $pib_row['currency']." ".$pib_row['reserve_price'];  ?>
    </td>
  </tr>
   <?php
   }  if($pib_row['selling_method']=='fix' or $pib_row['selling_method']=='ads')
  { ?>
  <tr><td width="15">&nbsp;</td>
   <td width="191"  class="tddis">Quick Buy Price</td>
    <td width="169">
   <?php  echo $pib_row['currency']." ".$pib_row['quick_buy_price'];?>
    </td>
  </tr><?php }?>
	</table>
	</td>
    <td valign="top"><br><table width="391"  style="border:1px solid color=#DBFEDF" cellpadding="5" cellspacing="2">
	 <tr valign="top"><td width="5%">&nbsp;</td>
    <td width="51%"  class="ft" heught=25"  class="tddis"><b>Number of Visitor's</b></td>
	</tr>
  <tr><td width="5%">&nbsp;</td>
    <td  class="tddis"  >Number of Visitor's</td>
    <td width="44%">
     <?php echo $pib_row['clicks']; ?>
   </td>
  </tr>
 <?php $photo[1]=$pib_row['picture1'];
$photo[2]=$pib_row['picture2'];
$photo[3]=$pib_row['picture3'];
$photo[4]=$pib_row['picture4'];
$photo[5]=$pib_row['picture5']; ?>
  <tr><td width="5%">&nbsp;</td>
    <td  class="tddis" class="ft" heught=25"><b>Images</b></td>
  </tr>
  <?php
  for($i=1;$i<=5;$i++)
  { 
    if($photo[$i] !='')
	{  
	$picture_found=1;  ?> 
	 <tr><td width="5%">&nbsp;</td>
	 <td>picture <?php echo $i; ?></td><td>
	 
	 <a href="#" id="dislink" onClick="window.open('full_size_image.php?img=<?= $photo[$i]; ?>','pop_up','toolbar=no, top=0,location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=400')">
	 <img src="../uploads/<?php echo $photo[$i]; ?>" width="40" height="40"></a></td></tr>
	<?php 
	}
	else if($picture_found!=1)
	{
		$no_photo=1;
	}
	}
 	if($no_photo==1) {
	echo "<tr><td colspan=2 align=center>No Pictures Found</td></tr>";
	}
  ?>
	</table></td>
  </tr>
  <tr>
    <td><table width="391" style="border:1px solid color="#DBFEDF" """"""""""""""""""""""""""" >
	  <tr> <td width="5%">&nbsp;</td> <td class="ft" heught=25"><b>Auction's action</b></td></tr>
  <tr><td width="5%">&nbsp;</td>
    <td width="231"  class="tddis">Started </td>
    <td width="261">
     <?php echo $pib_row['bid_starting_date']; ?>
    </td>
  </tr>
  <tr><td width="5%">&nbsp;</td>
    <td  class="tddis">Closed </td>
    <td>
      <?php echo $pib_row['expire_date'];?>
</td>
  </tr>
  <tr><td width="1%">&nbsp;</td>
   <td width="231"  class="tddis">Duration</td>
          <td width="261"> <?php echo $pib_row['duration']; ?> Days </td>
  </tr>
  <tr><td width="5%">&nbsp;</td>
    <td  class="tddis">Status</td>
    <td>
  <?php echo $pib_row['status'];?>
   </td>
  </tr>
  <tr><td width="5%">&nbsp;</td>
  <td class="ft" heught=25"><b>Sold Details</b></td></tr>
  <tr><td width="1%">&nbsp;</td>
    <td  class="tddis">Total # Quantity</td>
    <td>
     <?php echo $pib_row['Quantity']; ?>
   </td>
  </tr>
  <? $bid="select * from site_bids where productid=$id";
     $bid_res=mysql_query($bid);
	 $bid_row=mysql_fetch_array($bid_res);
  ?>
   <tr><td width="1%">&nbsp;</td>
    <td  class="tddis">Quantity Sold </td>
    <td>
     <?php if(!empty($bid_row['quantity_sold']))
	 {
	 echo $bid_row['quantity_sold'];
	 }
	 else 
	 echo "-" ?>
   </td>
  </tr>
<!--   <tr><td width="5%">&nbsp;</td>
    <td  class="tddis">Payment Gateway </td>
    <td>
    <?php  /* $pay="select * from payment_gateway where gateway_id=".$pib_row['payment_gateway']; 
	$pay_res=mysql_query($pay);
	$pay_row=mysql_fetch_array($pay_res);
	if(!empty($pay_row['payment_gateway']))
	{
	echo $pay_row['payment_gateway'];
	}
	else
	{
	echo "-"; }
	 ?>
   </td>
   </tr>  
   <?php
     if($pay_row['payment_gateway']!='')
	 {  ?>
	 
	 <tr><td width="5%">&nbsp;</td><td>Payment Id</td><td><?php  echo $pib_row['payment_id']; ?></td></tr>
	 <tr><td width="5%">&nbsp;</td><td>Payment Name</td><td><?php  echo $pib_row['payment_name']; ?></td></tr>
	  <?php } */
   ?>  
   <tr><td width="5%">&nbsp;</td>
   <td width="231"  class="tddis"> Method</td>
    <td width="261">
     <?php echo $pib_row['selling_method']; ?>
    </td>
  </tr> -->
  <tr><td width="5%">&nbsp;</td>
   <td width="231"  class="tddis">Shipping Location</td>
    <td width="261">
    <?php 
	  if(!empty($pib_row['shipping_route']))
	  {
     	echo $pib_row['shipping_route']; 
		} else
		{
		echo "-";
		}
		?>
    </td>
  </tr>
	</table></td>
    <td valign="top">
</td>
  </tr>
</table><?php
require 'include/footer.php';
?>
</body>
</html>
