<table width="750" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td valign="top">
	<? $title="$lang_221";
	   $click="help";
	require 'templates/'.$tfold.'/header.php';?>
	</td>
  </tr>


<? 
 require 'include/configurations.php'; // ITECHBIDS Configuration File
//require'include/datemanu.php'; 
 $user_id=$_SESSION[userid];
 $mode=$_GET[mode];
 $productid=$_GET['productid'];
 $currec=$_GET['currec'];
 if($mode=="del")
 {
 $del="delete from watch_list where productid=".$productid;
 mysql_query($del); 
 }
 $ver="select * from watch_list where user_id=".$user_id;
 $page1=mysql_query($ver);
 $chk=mysql_num_rows($page1);
 if($chk==0)
 {
 ?>
 <tr ><td class="tr_border"><font size=+1>Watch <? echo "$lang_45" ?></font></td>
</tr>
 <table align="left" width="60%" cellspacing="0" cellpadding="0" class="ft2">
 
<tr><td><table align="center"><tr><td>
<font class="head_font" ><b><? echo "$lang_535" ?></b></font>
</td></tr>
<tr><td>&nbsp;&nbsp;
<font class="head_font" >-<a href="watchlist.php"><? echo "$lang_536" ?></a> </font></td></tr>
<tr><td>&nbsp;&nbsp;
<font class="head_font" >-<a href="myauction.php"><? echo "$lang_146" ?></a> </font>
<br>
<br>
<br></td></tr> </table></td></tr>
</table>
</table>
<tr><td><? require'templates/'.$tfold.'/footer.php';?></td></tr>
</table>
 <?
 exit();
 }
 ?>
 
 <?
 
  if($chk>0)
 {
 ?>
 <table align="center" width="980" cellspacing="0" cellpadding="0" class="ft2">
 <tr ><td class="tr_border"><font size=+1>fdfdsdsfWatch <? echo "$lang_45" ?></font></td></tr>
<tr><td align="right" colspan=2 class="tr_border"> 
 <a href="watchall.php?mode=feweritems">Show Fewer Items</a> &nbsp;&nbsp;
 <a href="watchlist.php">Back to Watchlist</a></td></tr>
  <tr><td>
<table border="1" cellpadding="0" cellspacing="0" align=center width="100%">
<tr><td valign="top">
<table width="100%" align="center" cellpadding="0" cellspacing="1" class="header_table">
<tr>
    <td colspan="2" align="justify"><br><br><br><br>
	 Item<br><br><br><br><br></td></tr>
     <tr>
     <td><? echo "$lang_163" ?></td>
     </tr>
     <tr>
     <td><? echo "$lang_164" ?></td>
     </tr>
     <tr>
    <td><? echo "$lang_165" ?></td>
    </tr>
    <tr>
   <td><? echo "$lang_166" ?></td>
        </tr>
        <tr>
          <td>Ends</td>
        </tr>
        <tr>
          <td>bid_starting_date</td>
        </tr>
        <tr>
          <td><? echo "$lang_167" ?></td>
        </tr>
		 <tr>
          <td><? echo "$lang_168" ?></td>
        </tr>
		<!--  <tr>
          <td><? echo "$lang_169" ?></td>
         </tr> -->
		<tr>
		<td>&nbsp;
        </td></tr>
    </table></td>
<?
}
$wat="select * from watch_list where user_id=".$user_id;
$page=mysql_query($wat);
//$wat_rec=mysql_query($wat);
if($mode=="feweritems")
{
$limitsize=2;//pagelimit
$page_res=mysql_query($wat);
$total_records = mysql_num_rows($page_res);
if($total_records>0)
{ 
//get the total records
if(strlen($currec)==0) //check firstpage 
$currec = 1;  
$start = ($currec - 1) *$limitsize;
$end = $limitsize;
$wat .=" limit $start,$end";
$page=mysql_query($wat);
}
}
while($wat_res=mysql_fetch_array($page))
{
$sql="select * from auction_details where productid=".$wat_res[productid];
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
$cat="select category_name from site_categories where category_id=".$row['category_id'];
$cat_res=mysql_query($cat);
$cat_row=mysql_fetch_array($cat_res);
 $user_sql="select * from member_details where user_id=".$row['user_id'];
$user_res=mysql_query($user_sql);
$user=mysql_fetch_array($user_res);
/*  $country_sql="select * from site_countries where country_id=".$user['country'];
$country_res=mysql_query($country_sql);
$country=mysql_fetch_array($country_res); */
 $bid_sql="select * from site_bids where productid=".$row['productid'];
$bid_res=mysql_query($bid_sql);
$bid=mysql_fetch_array($bid_res);
$current_price=$bid['bidding_amount'];
if(!isset($bid[0]))
{
$bid_sql="select * from auction_details where productid=".$row['productid'];
$bid_res=mysql_query($bid_sql);
$bid=mysql_fetch_array($bid_res);
$current_price=$bid['min_bid_amount'];
}

 $tot_sql="select count(*) from site_bids where productid=".$row['productid'];
  $tot_res=mysql_query($tot_sql);
  $tot=mysql_fetch_array($tot_res);
 $expire_date=$bid['expire_date'];
  require 'ends.php';
   ?>
<td>
<table align="center" bgcolor="#F8F8FA" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td colspan="2" align="justify">
	<a href="watchall.php?productid=<?= $row['productid']; ?>&mode=del"><? echo "$lang_170" ?></a><br>
	<br>
	<a href="itechd.php?productid=<? echo $row['productid']; ?>">
	<? if(!empty($row['picture1']))
	{
	?>
	<img src="uploads/<? echo $row['picture1']; ?>" height="80" width="80" border=0>
	<? 
	}
	else
	{
	?>
		<img src="templates/<? echo "$tfold" ?>/img_files/no_image.gif" height="80" width="80" border=0>
	<?
	 }
	?>
	</a>
	 <br>
	 <br>
	 <a href="itechd.php?productid=<? echo $row['productid']; ?>">
	 <? echo $row['producttitle']; ?></a></td></tr>
      <tr>
     <td><? echo $current_price; ?></td>
     </tr>
     <tr>
     <td><? echo $row['min_bid_amount'];?></td>
     </tr>
     <tr>
     <td><? echo $row['Quantity'];?></td>
     </tr>
     <tr>
     <? if($tot[0]==0)
	 {
     ?>
          <td><? echo $tot[0];?></td>
		  <?
		  }
		  else
		  {
		   ?>
		   <td><? echo "-"; ?></td>
		   <?
		    }
		    ?>
        </tr>
        <tr>

          <td><? echo "$string_difference" ;?></td>
        </tr>
        <tr>

          <td><? echo $row['bid_starting_date'];?></td>
        </tr>
        <tr>
                   <td><? echo $user['user_name'];?></td>
        </tr>
		 <tr>
         		  <? if(isset($user['shipping_cost']))
		  {
          ?>
          <td><? echo $user['shipping_cost'];?></td>
		  <? 
		  }
		  else
		  {
		  ?>
		            <td><? echo "-" ;?></td>
		  <? }
		  		  ?>
        </tr>
	<!--	 <tr>
         		  <? if(isset($user['who_pay_shipping']))
		  {
		  ?>
          <td><? echo $user['who_pay_shipping'];?></td>
		  <? 
		  }
		  else
		  {
		  ?>
		           <td><? echo "-" ;?></td>
		  <? }
		  		  ?>
        
        </tr> -->
		<tr>
		<td>
        <?
		echo $user['selling_method'];
		if($user['selling_method']=="Fixed Price Sale")
		{ ?>
		<a href=# ><img src="templates/<? echo "$tfold" ?>/img_files/classi.gif" border="0"></a>
		<? 
		}
		else 
		{
		?>
		<a href="bidding.php?productid=<?= ?>"><img src="templates/<? echo "$tfold" ?>/img_files/auction_b.gif" border="0"></a>
		<? 
		}
		?>
		</td>
		</tr>
   </table>
</td>
<?
 }
 ?>
 </tr>
<? 
if(isset($mode))
{
$net=($currec-1*$limitsize+$end)-$total_records;
$dis=$limitsize+$start;
if($net <= 0) $net=$end;
if($dis<=$total_records)
{
?>
Currently Showing <? echo $start+1; ?> <? echo "-". $dis; ?> <? echo "$lang_186" ?><? echo $total_records; ?> Records
<?
}
else
{
?>
Currently Showing <? echo $start+1;?>  <? echo "$lang_186" ?><? echo $total_records; ?> Record
<?
}
if($currec != 1)
{
echo "<a href=watchall.php?currec=".($currec - 1)."&mode=feweritems style=text-decoration:none><font size=-3 color=green>Prev </font></a>";
}
$net=$total_records - ($currec*$limitsize+$end) + $end;
if($net >$limitsize) $net=$limitsize;
if($net <= 0) $net=$end;
if($total_records > ($start + $end)) 
{
echo "<a href=watchall.php?currec=".($currec + 1)."&mode=feweritems style=text-decoration:none><font size=-3 color=green> <? echo "$lang_546" ?> </font></a>";
}
}
?>

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