<?

$datecheck=date("Y-m-d H:i:s");
$user_id=$_SESSION[user_id];

$expiry_date = $row['expire_date'];
$selling_method = $row['selling_method'];
$bid_starting_date = $row['bid_starting_date'];

$time_end=24*60*60;

$end_auction = AddDays2($bid_starting_date,$time_end); 

if(($bid_starting_date <= $datecheck)&&($expiry_date >= $datecheck)){
$aucstatus="yes";
}
if(($bid_starting_date > $datecheck)&&($expiry_date >= $datecheck)){
$aucstatus="future";
}
if(($bid_starting_date <= $datecheck)&&($expiry_date < $datecheck)){
$aucstatus="no";
}
$min_bid_amount=$row['min_bid_amount'];
$bidincrement=$row['bidincrement'];

$bid_sql2="select * from site_bids where productid=".$row['productid']." order by bidding_amount desc";
$bid_res2=mysql_query($bid_sql2);
$bid_row2=mysql_fetch_array($bid_res2);
$user_bid_amt=$bid_row2[bidding_amount];
$user_bid_id=$bid_row2['user_id'];
$user_bid_sold="$user_bid_amt";
$user_bid_amt = $user_bid_amt+$bidincrement;

if($user_bid_amt==$bidincrement)
{
$user_bid_amt = $min_bid_amount;
}

$highest_bidder_sql="select user_name un from member_details where user_id=".$user_bid_id;
$highest_bidder_res=mysql_query($highest_bidder_sql);
$highest_bidder_res=mysql_fetch_array($highest_bidder_res);
$user_bid_name=$highest_bidder_res[un];

if($user_bid_name=="")
{
$user_bid_name = "None";
}

?>
<?
	 $title="Details of item";
	 require 'templates/'.$tfold.'/header.php';
	 ?>
<script language="javascript">
      function _flip_image(url) {
        if (url == null || url == undefined || url == "") {
          return;
        }
        else {
        document.getElementById("immg").innerHTML = "<img src=\"uploads/<? echo $row['picture1']; ?>\" width=<?= $w; ?> height=<?=$h?> border=\"0\">"
        }
      }
    </script>
<table cellpadding="0" cellspacing="0" width=100%  style="padding-bottom:0px;padding-top:0px;padding-left:0px;padding-right:0px;">
<tr><td style="padding-bottom:0px;padding-top:0px;padding-left:0px;padding-right:0px;" valign="top">
<table width="980" height="47" align="center" cellpadding="0" cellspacing="0" style="background:url(templates/<?=$tfold?>/img_files/auction_details.jpg) bottom no-repeat;">
<tr><td width="85" height="24" valign="top">&nbsp;</td>
<td width="422" height="24" valign="middle" align="left" style="padding-bottom:5px;color:white;"><B><?=$lang_716?><?= $row['productid']; ?></b></td>
<td width="458" height="24" align="right" valign="middle"><a href="itechd.php?productid=<?= $row['productid'] ?>&mode=watch"><B><? echo "$lang_106" ?></b></a></td>
<td width="3" height="24" valign="top">&nbsp;</td></tr>
	</table>

<table width="980" align="center" cellpadding="0" cellspacing="0" border=0 class="ft_right_br" style="padding-left:2px;padding-right:2px;">
<tr><td colspan="5" height=30>
<table cellpadding="0" cellspacing="0" width="100%"><tr><td align="left"><font size="3">
<b><div align="left">
&nbsp;&nbsp; <? echo ucwords($row['producttitle']); ?> </div> </b></font></td>
<td align="right"><b><?=$lang_459?>(<?= $row['productid']; ?>)</b></td></tr></table>
 </td></tr>
<tr><td width= align="center"><BR></td></tr>
<tr><td width= align="center">
<table width=100% align="center" cellpadding="0" cellspacing="0" style="padding-right:0px;padding-left:0px;">
<tr>
<td valign="top" align="center">

<table width="406" cellpadding="0" cellspacing="0" >
<tr><td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/box_head_l.gif border="0"></td>
<td class="boxhead_main" width="99%" height="5" valign="middle"></td>
<td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/box_head_r.gif border="0"></td></tr>
	</table>

<TABLE cellSpacing=0 align="center" cellPadding=0 width=406 style="padding-right:0px;padding-left:0px;"
                  border=0 class="ft_box"> 
				  <tr><td align="center" style="padding-right:0px;padding-left:0px;">
<div id="immg">
				   <?
				   if(!empty($row['picture1']))
	               {
				   $img=$row['picture1'];
				   list($width, $height, $type, $attr) = getimagesize("uploads/$img");
				   $h=$height;
				   $w=$width;
				   if($h>300)	
				   {
				   $nh=300;
				   $nw=($w/$h)*$nh;
				   $h=$nh;
				   $w=$nw;
				   }
				  if($w>400)
				  {
				  $nw=400;
				  $nh=($h/$w)*$nw;
				  $h=$nh;
				  $w=$nw;
				  }
	              ?>
                  <img src="uploads/<? echo $row['picture1']; ?>" width=<?= $w; ?> height=<?=$h?> border="0">
	               <? 
	               }
	               else
	               {
				   $img="no_image.gif";
				   list($width, $height, $type, $attr) = getimagesize("uploads/$img");
	               ?>
		          <img src="templates/<? echo "$tfold" ?>/img_files/no_image.gif"  name="runimg" >
	               <?
	               }
				   ?>
	</div>			  
               </td></tr>
</TABLE>
<script language="javascript">
      function flip_image(url) {
        if (url == null || url == undefined || url == "") {
          return;
        }
        else {
        document.getElementById("immg").innerHTML = "<img src=\"uploads/"+url+"\" width=<?= $w; ?> height=<?=$h?> border=\"0\">"
        }
      }
</script>
<?
if($row['picture2']=="")
{
$row['picture2']=$row['picture1'];
}
if($row['picture4']=="")
{
$row['picture4']=$row['picture3'];
}
if($row['picture6']=="")
{
$row['picture6']=$row['picture5'];
}
?>
<table width="406" height="125" style="background:url(templates/<? echo "$tfold" ?>/img_files/pic_bottom.gif) no-repeat center;">
<TR>
<TD height="100" align="center" width="25%" style="background:url(templates/<? echo "$tfold" ?>/img_files/no_image.gif) no-repeat center;">
<? if($row['picture2']!=""){ ?><a href=javascript:flip_image("<? echo $row['picture1']; ?>") style="text-decoration: none;
">
<img name="runimg" src="uploads/<? echo $row['picture2']; ?>" width="100" height="60" border="0"></a>
<? } ?>
</TD><TD align="center" width="25%" style="background:url(templates/<? echo "$tfold" ?>/img_files/no_image.gif) no-repeat center;">
<? if($row['picture4']!=""){ ?><a href=javascript:flip_image("<? echo $row['picture3']; ?>") style="text-decoration: none;
">
<img name="runimg" src="uploads/<? echo $row['picture4']; ?>" width="100" height="60" border="0"></a>
<? } ?>
</TD><TD align="center" width="25%" style="background:url(templates/<? echo "$tfold" ?>/img_files/no_image.gif) no-repeat center;">
<? if($row['picture6']!=""){ ?><a href=javascript:flip_image("<? echo $row['picture5']; ?>") style="text-decoration: none;
">
<img name="runimg" src="uploads/<? echo $row['picture6']; ?>" width="100" height="60" border="0" ></a>
<? } ?>
</TD>
</TR>
<TR><TD valign="top" colspan="3" align="center"><font size="1"><?=$lang_771?></font></TD></TR>
</TABLE>




</td>
<td width=1>&nbsp;</td>
<td  valign="top" style="padding-top:0px; padding-bottom:0px;">

<table width="300" cellpadding="0" cellspacing="0" >
	<tr>
<tr><td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/box_head_l.gif border="0"></td>
<td class="boxhead_main" width="99%" height="5" valign="middle"></td>
<td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/box_head_r.gif border="0"></td></tr>
	</table>


<table cellpadding="0" cellspacing="0"  width=300  class="ft_box">
<tr>
<td width="100" style="font-size: 10px;" width="80" height="20"><?=$lang_163?> :</td>
<?
$expire_date = $row['expire_date']; 
$date2=strtotime($expire_date);
$date2 = date("d-m-Y H:i:s",$date2); 
$dateTo = $date2;
$date1 = mktime(date("H"),date("i"),date("s"),date("n"),date("j"),date("Y"));
$dateToElements = split(' ', $dateTo);
$dateToDateElements = split('-', $dateToElements[0]);
$dateToTimeElements = split(':', $dateToElements[1]); 
$date2 = mktime($dateToTimeElements[0], $dateToTimeElements[1], $dateToTimeElements[2], $dateToDateElements[1], $dateToDateElements[0], $dateToDateElements[2]); 
$difference = $date2 - $date1;
?>
<div id="futu<?=$row['productid'];?>" style="display:none;"><?=$difference?></div>
<div id="totb<?=$row['productid'];?>" style="display:none;"><?=$row['totbid'];?></div>	   
<div id="timadd<?=$row['productid'];?>" style="display:none;"><?=$row['timetoadd'];?></div>	    
<div id="pause<?=$row['productid'];?>" style="display:none;">no</div>
<td align="right" ><div style="border:0px; padding-top:0px; padding-bottom:0px; font-weight:bold; color:teal; font-size:12px;">
<? if(($aucstatus=="yes")||($aucstatus=="future")){
?>
<span style="border:0px; padding-top:0px; padding-bottom:0px; font-weight:bold; color:teal; font-size:24px;" id="Amt<?=$row['productid'];?>">
<? echo $row['currency']."".$user_bid_amt; ?></span>
<? } ?>
<? if($aucstatus=="no"){
?>
<span style="border:0px; padding-top:0px; padding-bottom:0px; font-weight:bold; color:teal; font-size:24px;">
<? echo $row['currency']."".$user_bid_sold; ?></span>
<? } ?>
</div></td>
</tr><? if(($aucstatus=="yes")||($aucstatus=="future")){
?>
<tr><td style="font-size: 10px;" width="80" height="20"><?=$lang_735?> : </td>
          <td align="right">
<div style="font-weight:bold;" id="Usr<?=$row['productid'];?>"><? echo $user_bid_name;?>
</div>
</td>
</tr>
<? } ?>
<? if($aucstatus=="no"){
?>
<tr><td style="font-size: 10px;" width="80" height="20"><?=$lang_735?> : </td>
          <td align="right">
<div style="font-weight:bold;"><? echo $user_bid_name;?>
</div>
</td>
</tr>
<? } ?>
<? if($aucstatus=="yes"){
?>
<tr><td colspan="2" align="center"><div id="Bid<?=$row['productid'];?>" style="font-size:32px; font-weight:bold;">
<B>--|--|--</b>
</div>
</td></tr>	

<? } ?>
<? if($aucstatus=="future"){
?>
<tr><td colspan="2" align="center"><div style="font-size:16px;">
<B><?=$lang_774?></b><BR>
<?
echo "$bid_starting_date";
?>
</div>
</td></tr>	

<? } ?>
<? if(($aucstatus=="yes")||($aucstatus=="future")){
?>

	    <tr><td colspan="2" align="center" style="padding-top:0px; padding-bottom:0px;">
<?
$bidnow = $_SESSION[userid];
?>
<?if(empty($_SESSION[userid])) { ?>
<a name= "link1" href="signin.php" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('IMG<?=$i?>','','templates/<?=$tfold?>/img_files/login_big.png',1);" style="text-decoration:none;">
<img NAME = "IMG<?=$i?>" src=templates/<?=$tfold?>/img_files/bidnow_big.png border="0"></a>
<? } ?>
<?if(!empty($_SESSION[userid])) { ?>
<a name= "link1" href="javascript:bidnow(<?=$row['productid']?>,<?=$bidnow?>)" style="text-decoration:none;">
<img NAME = "IMG<?=$i?>" src=templates/<?=$tfold?>/img_files/bidnow_big.png border="0"></a>
<? } ?>
</td></tr>
<? } ?>
<? if($aucstatus=="yes"){
?>
<tr><td align="center" colspan="2" style="font-size: 10px;" height="20"><?=$lang_717?> <? echo $row['currency']."".$bidincrement; ?></td></tr>	
	    <tr><td align="center" colspan="2" style="font-size: 10px;" height="20"><?=$lang_718?><BR><? echo $row['expire_date']; ?></td></tr>			
<? } ?>
<? if($aucstatus=="no"){
?>
	    <tr><td align="center" colspan="2" style="font-size: 16px;font-weight:bold" height="20"><?=$lang_718?><BR><? echo $row['expire_date']; ?></td></tr>			
<? } ?>
</table>
<table width="300" cellpadding="0" cellspacing="0" >
	<tr>
<tr><td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/box_foot_l.gif border="0"></td>
<td class="boxfoot_main" width="99%" height="5" valign="middle"></td>
<td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/box_foot_r.gif border="0"></td></tr>
	</table>

<BR>


<table width="300" cellpadding="0" cellspacing="0" >
	<tr>
<tr><td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/box_head_l.gif border="0"></td>
<td class="boxhead_main" width="99%" height="5" valign="middle"></td>
<td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/box_head_r.gif border="0"></td></tr>
</table>

<table cellpadding="0" cellspacing="0"  width=300  class="ft_box" style="padding-top:0px; padding-bottom:0px;">
<tr>
<td width="100" style="font-size: 10px;" width="80" height="10"><?=$lang_720?> :</td>
<td align="right" ><? echo "".$row['currency']."".$row['or_price']; ?>
</td>
</tr>
<?
$or_price=$row['or_price'];
$admin="select * from genaralsettings where set_id=58"; //sitename -> id=1
$admin_res=mysql_query($admin);
$admin_rec=mysql_fetch_array($admin_res);
$bid_cost=$admin_rec[set_value];

if($user_id!=""){
$bid_sql2="select productid from site_bids where productid=".$row['productid']." and user_id=".$user_id;
$bid_res2=mysql_query($bid_sql2);
$bid_row2=mysql_num_rows($bid_res2);
$bid_rebate=$bid_row2*$bid_cost;
}
if($user_id==""){
$bid_rebate="0.00";
}

$buy_cost=$or_price-$bid_rebate;
$buy_cost = number_format($buy_cost, 2, ".", "");
$bid_rebate = number_format($bid_rebate, 2, ".", "");
?>
<tr><td style="font-size: 10px;" width="80" height="10">Bid Rebate : </td>
          <td align="right">

<span style="border:0px; padding-top:0px; padding-bottom:0px; font-weight:bold; font-size:12px;" id="SAmt<?=$row['productid'];?>">
<? echo $row['currency']."".$bid_rebate; ?></span>
</td>
</tr>

<tr><td style="font-size: 10px;" width="80" height="10">Purchase Cost : </td>
          <td align="right">
<span style="border:0px; padding-top:0px; padding-bottom:0px; font-weight:bold; font-size:12px;" id="Sav<?=$row['productid'];?>">
<? echo $row['currency']."".$buy_cost; ?></span>
</td>
</tr>
<tr><td align="center" colspan="2" style="font-size: 10px;" height="20">
<? if($aucstatus!="future"){ ?>
<form action="reviewitechds.php" method="post" style="MARGIN: 0px" target="_blank">
<input type="hidden" name="productid" value="<? echo $row['productid'];?>">
<input type="hidden" name="recycle" value="yes">
<?if(empty($_SESSION[userid])) { ?>
<a name= "link1" href="signin.php" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('IMG<?=$i?>','','templates/<?=$tfold?>/img_files/buy_now_log.png',1);" style="text-decoration:none;">
<img NAME = "IMG<?=$i?>" src=templates/<?=$tfold?>/img_files/buy_now_big.png border="0"></a>
<? } ?>

<?if(!empty($_SESSION[userid])) { ?>
<input type="image" src="templates/<?=$tfold?>/img_files/buy_now_big.png">
<?}?>
</form>
<? } ?>
<?if($aucstatus=="future") { ?>
<img src="templates/<?=$tfold?>/img_files/buy_now_big.png">
<?}?>
</td></tr>			
</table>

<table width="300" cellpadding="0" cellspacing="0" >
	<tr>
<tr><td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/box_foot_l.gif border="0"></td>
<td class="boxfoot_main" width="99%" height="5" valign="middle"></td>
<td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/box_foot_r.gif border="0"></td></tr>
	</table>




</td>
<td width=1>&nbsp;</td>
<td valign="top">

<? if(($user_id!="")&&($selling_method!=4)&&($aucstatus=="yes")){ ?>
<table width="235" cellpadding="0" cellspacing="0" >
	<tr>
<tr><td width="1%" height="22" valign="top"><img src=templates/<?=$tfold?>/img_files/his_l.gif border="0"></td>
<td style="font-weight:bold;color:#4a4a4a;" class="hishead_main" width="99%" height="22" valign="middle"><?=$lang_728?></td>
<td width="1%" height="22" valign="top"><img src=templates/<?=$tfold?>/img_files/his_r.gif border="0"></td></tr>
	</table>        
<div id=Auto<?=$row['productid']?>>
<?
$productid = $row['productid'];
$sqlsus="select * from autobids where user_id=$user_id and productid=$productid";
$resultsus=mysql_query($sqlsus);
$totsus=mysql_num_rows($resultsus);
if($totsus<=0)
{
?>
<form name="autobid" style="MARGIN: 0px">
<table cellpadding="0" cellspacing="0" width=235 class="ft_right_br_his">
<TR><TD style="background-color:#dadada;" align="center" width="33%"><?=$lang_729?></TD>
<TD style="background-color:#dadada;" align="center" width="33%"><?=$lang_730?></TD>
<TD style="background-color:#dadada;" align="center" width="33%"><?=$lang_731?></TD></TR>
<TR><TD align="center" width="33%">&nbsp;</TD>
<TD align="center" width="33%"></TD>
<TD align="center" width="33%"></TD></TR>
<TR><TD align="center" width="33%"><div class="h_text_cell_mic"><input type="text" class="h_text_mic" name="minbid" style="font-size:12px;font-family:arial;width:40;height:20" value="" maxlength="7" ></div></TD>
<TD align="center" width="33%"><div class="h_text_cell_mic"><input type="text" class="h_text_mic" name="maxbid" style="font-size:12px;font-family:arial;width:40;height:20" value="" maxlength="7" ></div></TD>
<TD align="center" width="33%"><div class="h_text_cell_mic"><input type="text" class="h_text_mic" name="bidno" style="font-size:12px;font-family:arial;width:40;height:20" value="" maxlength="7" ></div></TD></TR>
<TR><TD align="center" colspan="3" align="center"><BR>
<a name= "link1" href="javascript:setauto(<? echo $row['productid']; ?>)" style="text-decoration:none;">
<img src=templates/<?=$tfold?>/img_files/set.png border="0">
</a>
</TD></TR>
</table></form>	  


<? } ?>
<?
	if($totsus>0)
{
$bid_row2=mysql_fetch_array($resultsus);
?>
<form name="autobid" style="MARGIN: 0px">
<table cellpadding="0" cellspacing="0" width=235 class="ft_right_br_his">
<TR><TD style="background-color:#dadada;" align="center" width="33%"><?=$lang_729?></TD>
<TD style="background-color:#dadada;" align="center" width="33%"><?=$lang_730?></TD>
<TD style="background-color:#dadada;" align="center" width="33%"><?=$lang_731?></TD></TR>
<TR><TD align="center" width="33%">&nbsp;</TD>
<TD align="center" width="33%"></TD>
<TD align="center" width="33%"></TD></TR>
<TR><TD align="center" width="33%"><? echo $bid_row2['minbid']; ?></TD>
<TD align="center" width="33%"><? echo $bid_row2['maxbid']; ?></TD>
<TD align="center" width="33%"><? echo $bid_row2['bidnum']; ?></TD></TR>
<TR><TD align="center" colspan="3" align="center"><BR>
<a name= "link1" href="javascript:unsetauto(<?=$productid?>,<? echo $bid_row2['auto']; ?>,0)" style="text-decoration:none;">
<img src=templates/<?=$tfold?>/img_files/unset.png border="0">
</a>
</TD></TR>
</table></form> 


<? } ?>
	
</div>
<table width="235" cellpadding="0" cellspacing="0" >
	<tr>
<tr><td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/his_f_l.gif border="0"></td>
<td class="hisfoot_main" width="99%" height="5" valign="middle"></td>
<td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/his_f_r.gif border="0"></td></tr>
	</table>
<BR>
<? } ?>
<? if($user_id==""){ ?>
<a href="user_reg.php" border="0">
<img src=templates/<?=$tfold?>/img_files/register.gif border="0">
</a><BR>
<? } ?>

               
<table width="236" cellpadding="0" cellspacing="0" >
	<tr>
<tr><td width="1%" height="22" valign="top"><img src=templates/<?=$tfold?>/img_files/his_l.gif border="0"></td>
<td style="font-weight:bold;color:#4a4a4a;" class="hishead_main" width="99%" height="22" valign="middle"><?=$lang_732?></td>
<td width="1%" height="22" valign="top"><img src=templates/<?=$tfold?>/img_files/his_r.gif border="0"></td></tr>
	</table>        

<table cellpadding="0" cellspacing="0" width=236 height="143" class="ft_right_br_his"><tr><td valign="top">
<div id=His<?=$row['productid']?>>
<table cellpadding="0" cellspacing="0" width=100%>
<TR><TD style="background-color:#dadada;" align="center" width="30%"><?=$lang_733?></TD><TD style="background-color:#dadada;" align="center" width="35%"><?=$lang_705?></TD><TD style="background-color:#dadada;" align="center" width="35%">BID TYPE</TD></TR>

<?
$bid_sql2="select * from site_bids where productid=".$row['productid']." order by bidding_amount desc limit 10";
$bid_res2=mysql_query($bid_sql2);
while($bid_row2=mysql_fetch_array($bid_res2))
{
$user_bid_amt=$bid_row2[bidding_amount];
$bid_type = $bid_row2[bid_type];

$highest_bidder_sql="select * from member_details where user_id=".$bid_row2['user_id'];
   $highest_bidder_res=mysql_query($highest_bidder_sql);
   $highest_bidder_res=mysql_fetch_array($highest_bidder_res);
  $user_bid_name=$highest_bidder_res[user_name];

$query="select * from auction_details where productid=".$row['productid'];
$table=mysql_query($query);
$row3=mysql_fetch_array($table);
$sale_price=$row3['currency'];
$min_bid_amount=$row3['min_bid_amount'];
$bidincrement=$row3['bidincrement'];
?>
<TR><TD align="center" width="30%"><?=$sale_price?><?=$user_bid_amt?></TD><TD align="center" width="35%"><?=$user_bid_name?></TD><TD align="center" width="35%"><?=$bid_type?></TD></TR>
<?
}
?>	</table></div>		  
</td></tr>
			  </table>
<table width="236" cellpadding="0" cellspacing="0" >
	<tr>
<tr><td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/his_f_l.gif border="0"></td>
<td class="hisfoot_main" width="99%" height="5" valign="middle"></td>
<td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/his_f_r.gif border="0"></td></tr>
	</table> <BR>
<img src=templates/<?=$tfold?>/img_files/slogan.gif border="0">
			  </td></tr>
			  </table>
























</td>
  </tr>
</table>

</td></tr>
</td></tr>

</table>
<table width="100%" cellpadding="0" cellspacing="0" >
<tr>
<td width="98%" height="5" valign="middle"><img src=templates/<?=$tfold?>/img_files/t_bot_br.gif border="0"></b></td>
</tr>
	</table>
<?
$query="select * from home_announcements where id=1";
$tab=mysql_query($query);
if($rowa=mysql_fetch_array($tab))
{
$registration=$rowa['home_announcements'];
}
if($registration!=""){
?>
<BR>

<table width="980" align="center" cellpadding="0" cellspacing="0" >
	<tr>
<tr><td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/box_head_l_br.gif border="0"></td>
<td class="boxhead_main_br" width="99%" height="5" valign="middle"></td>
<td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/box_head_r_br.gif border="0"></td></tr>
	</table>

<table align="center" cellpadding="0" cellspacing="0" class="ft_right_br" width=980>
  <tr>
          <td align="center">




<?=$registration?></td>
        </tr>

</table>
<? } ?>

<table width="980" align="center" cellpadding="0" cellspacing="0" >
	<tr>
<tr><td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/box_foot_l_br.gif border="0"></td>
<td class="boxfoot_main_br" width="99%" height="5" valign="middle"></td>
<td width="1%" height="5" align="right" valign="top"><img src=templates/<?=$tfold?>/img_files/box_foot_r_br.gif border="0"></td></tr>
	</table>

<BR>


<table width="980" height="47" align="center" cellpadding="0" cellspacing="0" style="background:url(templates/<?=$tfold?>/img_files/product_details.jpg) bottom no-repeat;">
<tr><td width="980" height="24" valign="top">&nbsp;</td>
</tr>
	</table>

<table align="center" cellpadding="0" cellspacing="0" class="ft_right_br" width=980>
  <tr>
          <td align="left" style="padding-left:5px;padding-top:5px;padding-bottom:5px;"><?=$description;?>

</td>
</tr>

</table>

<table width="980" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td width="98%" height="5" valign="middle"><img src=templates/<?=$tfold?>/img_files/t_bot_br.gif border="0"></b></td>
</tr>
	</table>


<BR>
<table width="980" height="47" align="center" cellpadding="0" cellspacing="0" style="background:url(templates/<?=$tfold?>/img_files/payment_details.jpg) bottom no-repeat;">
<tr><td width="980" height="24" valign="top">&nbsp;</td>
</tr>
	</table>
<?
		$gate_select_query="select * from payment_gateway where status='yes'";
		$gate_select_result=mysql_query($gate_select_query);
		while($gate_select_row=mysql_fetch_array($gate_select_result)) {
		$gateway_id=$gate_select_row['gateway_id'];
        $payment_gateway=$gate_select_row['payment_gateway'];
        if($gateways!=''){
        $gateways="$gateways, $payment_gateway";
        }
        if($gateways==''){
        $gateways="$payment_gateway";
        }
        }
?>

<table align="center" cellpadding="0" cellspacing="0" class="ft_right_br" width=980>

<tr align="left" valign="top">

<TD width="30%" style="padding-left:10px; padding-top:10px; padding-bottom:10px;">
<B>
Payment methods:
</B><BR>
<BR>
&raquo; <?=$gateways;?>


</td>

<TD width="20%" style="padding-left:10px; padding-top:10px; padding-bottom:10px;">
<B>
Delivery Cost:
</B><BR>
<BR>
&raquo; <?=$row['currency'];?><?=$row['shipping_cost'];?>


</td><TD width="30%" style="padding-left:10px; padding-top:10px; padding-bottom:10px;">

<B>Return:</B> <BR><BR>&raquo; <?=$row['return_pol'];?>

</td><TD width="20%" style="padding-left:10px; padding-top:10px; padding-bottom:10px;">

<B>Any questions left?</B><BR><BR>&raquo; <a href="contact.php"><font color="#000000"><B>Contact</B></font></a>
</td>
</tr>
</table>
<table width="980" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td width="98%" height="5" valign="middle"><img src=templates/<?=$tfold?>/img_files/t_bot_br.gif border="0"></b></td>
</tr>
	</table>

<BR>








<BR>



<?
$datecheck=date("Y-m-d H:i:s");
$date1 = strtotime(now);
$date1 = date("M j, Y G:i:s",$date1);
$feature_sql="select * from auction_details where status='Active' and selling_method!=10 and selling_method!='want_it_now' and picture1!='' and (expire_date > '$datecheck') and productid!='$productid' order by expire_date limit 0,4 ";
	$feature_res=mysql_query($feature_sql);
	$tot_count=mysql_num_rows($feature_res);
	$count=0;
	if($tot_count > 0)
	{
$nu=1;
	 ?>
	<table width="980" align="center" cellpadding="0" cellspacing="0" >
	<tr>
<tr><td width="1%" height="24" valign="top"><img src=templates/<?=$tfold?>/img_files/t_header_l_br.gif></td>
<td class="tdhead_main_br" width="98%" height="24" valign="middle">&nbsp;<B>OTHER AUCTIONS</b></td>
<td width="1%" height="24" valign="top"><img src=templates/<?=$tfold?>/img_files/t_header_r_br.gif></td></tr>
	</table>
<table align="center" border="0" cellpadding="0" cellspacing="0" style="padding-left:0px;padding-right:0px;" width=980 class="ft_right_br"><tr><td align="center" valign="top">
<TR>
<?
while($feature_row=mysql_fetch_array($feature_res))
{
	$selling_method=$feature_row[selling_method];
	$autobidder=$feature_row[autobidder];
?><TD valign="top">
<table align="center" valign="middle" cellpadding=5 cellspacing=2>
<tr><td colspan="2" class="style3" valign="top" width="180" height="30" align="center" valign="middle">
<B><? echo $feature_row['producttitle'];?></b>
</tr><TR>
<td valign="top" align="center">
	<?
$imgsize = $feature_row['picture1'];
list($widths, $heights, $types, $attrs) = getimagesize("uploads/$imgsize");
if($feature_row['picture2']==""){
$feature_row['picture2']=$feature_row['picture1'];
}
	               $img=$feature_row['picture2'];
				   list($width, $height, $type, $attr) = getimagesize("uploads/$img");
				   $h=$height;
				   $w=$width;
				   if($h>40)	
				   {
				   $nh=40;
				   $nw=($w/$h)*$nh;
				   $h=$nh;
				   $w=$nw;
				   }
				  if($w>50)
				  {
				  $nw=50;
				  $nh=($h/$w)*$nw;
				  $h=$nh;
				  $w=$nw;
				  }
$w=round($w);	
	?>
	<a href="itechd.php?productid=<? echo $feature_row['productid']; ?>">
	 <img src="uploads/<? echo $feature_row['picture2']; ?>" width=<?= $w; ?> height=<?=$h?> border=0>
	</a>
<?
$min_bid_amount3=$feature_row['min_bid_amount'];
$bidincrement3=$feature_row['bidincrement'];
$bid_sql23="select * from site_bids where productid=".$feature_row['productid']." order by bidding_amount desc";
$bid_res23=mysql_query($bid_sql23);
$bid_row23=mysql_fetch_array($bid_res23);
$user_bid_amt3=$bid_row23[bidding_amount];

$user_bid_id3=$bid_row23['user_id'];
if($user_bid_amt3=="")
{
$user_bid_amt3 = "0.00";
}
$user_bid_amt3 = number_format($user_bid_amt3, 2, ".", "");
$sale_price3=$feature_row['currency'];
$highest_bidder_sql3="select * from member_details where user_id=".$user_bid_id3;
$highest_bidder_res3=mysql_query($highest_bidder_sql3);
$highest_bidder_res3=mysql_fetch_array($highest_bidder_res3);
$user_bid_name3=$highest_bidder_res3[user_name];
if($user_bid_name3=="")
{
$user_bid_name3 = "None";
}
?>
<?
$bidnow3=$_SESSION[userid];
?>
<?
$expire_date = $feature_row['expire_date']; 
$date2=strtotime($expire_date);
$date2 = date("d-m-Y H:i:s",$date2); 
$dateTo = $date2;
$date1 = mktime(date("H"),date("i"),date("s"),date("n"),date("j"),date("Y"));
$dateToElements = split(' ', $dateTo);
$dateToDateElements = split('-', $dateToElements[0]);
$dateToTimeElements = split(':', $dateToElements[1]); 
$date2 = mktime($dateToTimeElements[0], $dateToTimeElements[1], $dateToTimeElements[2], $dateToDateElements[1], $dateToDateElements[0], $dateToDateElements[2]); 
$difference = $date2 - $date1;
?>
<BR>
<div id="pause<?=$feature_row['productid'];?>" style="display:none;"><?=$feature_row['stopped'];?></div>
<div id="futu<?=$feature_row['productid'];?>" style="display:none;"><?=$difference?></div>
<div id="totb<?=$feature_row['productid'];?>" style="display:none;"><?=$feature_row['totbid'];?></div>
<div id="timadd<?=$feature_row['productid'];?>" style="display:none;"><?=$feature_row['timetoadd'];?></div>	  
<div id="Bid<?=$feature_row['productid'];?>" style="font-size:16px; font-weight:bold;">
<b>--|--|--|--</b>
</div>
</td><td align="center">
<span style="border:0px; padding:0px; font-weight:bold; color:#0075b2; font-size:13px;" id="Amt<?=$feature_row['productid'];?>">
<? echo Trim($sale_price3); ?><? echo Trim($user_bid_amt3); ?></span>
<div style="font-weight:normal; font-size:13px;" id="Usr<?=$feature_row['productid'];?>"><?=$user_bid_name3?>
</div><BR>
<?if(empty($_SESSION[userid])) { ?>
<a name= "link1" href="signin.php" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('IMG<?=$feature_row['productid'];?>','','templates/<?=$tfold?>/img_files/login_sm.png',1);" style="text-decoration:none;">
<img NAME = "IMG<?=$feature_row['productid'];?>" src=templates/<?=$tfold?>/img_files/bid_now_sm.png border="0"></a>
<? } ?>
<?if(!empty($_SESSION[userid])) { ?>
<a name= "link1" href="javascript:bidnow(<?=$feature_row['productid']?>,<?=$bidnow?>)" style="text-decoration:none;">
<img NAME = "IMG<?=$feature_row['productid'];?>" src=templates/<?=$tfold?>/img_files/bid_now_sm.png border="0"></a>
<? } ?>

</td>
		</tr>
		</table>
<?
$allpro2 = $feature_row['productid'];
$allpro1 = "$allpro2";
if($allpro!=""){
$allpro = "$allpro1|$allpro";
}
if($allpro==""){
$allpro = "$allpro1";
}
$nu=$nu+1;
?>
</td><td><?if($nu<5){?><img src=templates/<?=$tfold?>/img_files/devider.gif><?}?></TD>
<?}?>
</tr>
		</table>
	<table width="980" align="center" cellpadding="0" cellspacing="0" >
	<tr>
<tr><td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/t_bot_l_br.gif></td>
<td class="tdbot_main_br" width="98%" height="5" valign="middle"></td>
<td width="1%" height="5" valign="top"><img src=templates/<?=$tfold?>/img_files/t_bot_r_br.gif></td></tr>
	</table>
<? } ?>
<BR>
<?
$productid=$row['productid'];
$allpro_u = "$allpro|$productid";
?>

<SCRIPT LANGUAGE='javascript'>countdown('<?=$allpro_u?>')</SCRIPT>
<SCRIPT LANGUAGE='javascript'>setTimeout("GetUpdate('<?=$allpro_u?>','<?=$user_id?>')",2000);</SCRIPT>









