<?
		ob_start();session_start();

		if($_SESSION['lang']=='')
		{
			$_SESSION['lang'] = "en";
		}
		include 'languages/lang_common_'.$_SESSION['lang'].'.php';
        include 'languages/lang_watchlist_'.$_SESSION['lang'].'.php';

		include("include/db.inc.php");
		include("include/bit_functions.inc.php");
		include("include/functions.php");
		include("include/pager.php");
		include("include/banner_inc.php");
 		$db1=new db;
   $db1->open();
    mysql_query("SET NAMES 'utf8'"); $currency_symbol_new=symbol_currency();
  
		check_login();
    	if($_GET[uid]){
		$uid=$_GET[uid];
		}
		else{
    	$uid=$_SESSION['uid'];
		}
		$myres=remainbid1();

		if(isset($_POST['delete']) && is_array($_POST['chkbx']))
		{
		foreach($_POST['chkbx'] as $delid)
			{
			$upd="delete from watchlist where pid='$delid' and uid='$uid'";
			$sql=mysql_query($upd);

			}

		}


	 $jsres=mysql_query(dopaging("SELECT p.pid,bid_price FROM t123go_product p,watchlist w where w.pid=p.pid and w.uid='$uid' and p.status='1' ",4));
	$pids="";
	while($jsrec=mysql_fetch_array($jsres))
	{
	$pids.=$jsrec['pid'].",";
	$_SESSION['new'][$jsrec['pid']]=$jsrec['bid_price'];
	}

?>
<!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>
<base href="<?=_BASEURL_?>/" />
<meta content="<?=_TITLE1_?> offers bargain auctions of new brand products. Save up to 70% for every product almost. Bid and Win high quality products.<?=_TITLE1_?> offers amazing bargains." />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="Info-Tech Ltd. | We simplify web 2.0"/>
<title>
<?=_PAGE_TITLE_;?>
</title>
<link href="<?=_BASEURLCSSNEW_?>/index.css" rel="stylesheet" type="text/css" />
<link href="<?=_BASEURLCSSNEW_?>/index_sec.css" rel="stylesheet" type="text/css" />
<link href="<?=_BASEURLCSSNEW_?>/personal_acc.css" rel="stylesheet" type="text/css" />
<link href="<?=_BASEURLCSSNEW_?>/watch_bo.css" rel="stylesheet" type="text/css" />
<!--[if lte IE 6]><style type="text/css" media="screen">/* <![CDATA[ */ @import url(<?=_BASEURLCSSNEW_?>/ie6.css?0:102290); /* ]]> */</style><![endif]-->
<!--[if gte IE 7]><style type="text/css" media="screen">/* <![CDATA[ */ @import url(<?=_BASEURLCSSNEW_?>/ie7.css?0:99961); /* ]]> */</style><![endif]-->
<script src="<?=_BASEURL_?>/js/home_counter.js" type="text/javascript"></script>
<? include("timer.js.php");?>
</head>
<body onload="home_detail();">
<div id="container">
  <? include("header.php");?>
  <div id="accountleft_bar">
    <? include("view.php");?>
  </div>
  <div id="product_detail">
    <?
	//echo $pids;
  $parr=explode(",",$pids);
  echo "<form name='frm'>";
      for($y=0; $y < count($parr)-1; $y++)
   {

      $pid=$parr[$y];
	  $diff=mysql_fetch_array(mysql_query("SELECT TIME_TO_SEC( TIMEDIFF( end_time, now( ))),
	  bid_price,bider_id FROM t123go_product where pid='$pid'")) ;

	  ?>
    <input type="hidden" name="price_<?=$pid?>" value="<?=$diff[bid_price]?>" />
    <input type="hidden" name="bider_<?=$pid?>" value="<?=get_uname($diff[bider_id])?>" />
    <input type="hidden" name="diff_<?=$pid?>" value="<?=$diff[0]?>" />
    <input type="hidden" name="new_<?=$pid?>" value="0" />
    <?
   }
	echo "</form>";
 ?>
  </div>
  <div id="accountright_bar">
   <div id="green_bo">
      <div class="buygreen1" >
        <div class="buygreen2"><div>watched auctions</div></div>
        <div class="buygreen3"></div>
      </div>
      <div class="allm100px">
    <?
						
		$sql="SELECT * FROM t123go_product p,watchlist w where w.pid=p.pid and w.uid='$uid' and p.status='1' ";
				$rwd=mysql_query(dopaging($sql,4));
				if(mysql_num_rows($rwd)){

?>

        <form action="" method="post" name="my_auction">
          <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" width="100%" class="tm10px" align="center">
            <tr>
              <?  

	   $i=0;							
	while($mywatch=mysql_fetch_array($rwd)){
	$myprod=mysql_fetch_array(mysql_query("SELECT * FROM t123go_product where pid='".$mywatch['pid']."' and status='1' "));
	
	if($i%4==0 && $i!=0)
	echo"</tr><tr>";
		  ?>
              <td valign="top"><div id="top_n_auction">
                  <div class="normaltextorangebold19ca tm10px"><a href="<?=get_cat_name($myprod['cid']);?>/<?=str_replace(" ","-",$myprod['pname']);?>/auction/<?=$myprod['pid']?>/" class="product_title" title="<?=$myprod['pname'];?>">
                    <?=substr($myprod['pname'],0,20);?>
                    </a></div>
                  <div class="imagex"><a href="<?=get_cat_name($myprod['cid']);?>/<?=str_replace(" ","-",$myprod['pname']);?>/auction/<?=$myprod['pid']?>/"  target="_parent">
                    <?=image_130($myprod['pid']); ?>
                    </a></div>
                  <div class="normaltextorangebold13 tac" id="winner_index_page_<?=$myprod['pid']?>">
                    <?=get_fieldval(id,uname,user,$myprod['bider_id'])?>
                  </div>
                  <div class="pricex">
                    <div id="maximumbid_<?=$myprod['pid']?>" class="highestbid" style="display:none; "></div>
                    <div  id="productprice_<?=$myprod[pid]?>" class="normaltextorangebold24">
                      <?=$currency_symbol_new?>
                      <span  id="price_index_page_<?=$myprod['pid']?>">
                      <?
		  echo $myrow['bid_price'];
		?>
                      </span> </div>
                    <div id="productcounter_<?=$myprod[pid]?>" class="normaltextblackbold20">
                      <div id="counter_index_page_<?=$myprod['pid']?>"></div>
                    </div>
                  </div>
                  <div class="button_bd">
                    <div id="button_finished_index_page_<?=$myprod['pid']?>" style="display:none" >
                      <? if($myres<=0){ ?>
                      <input type="button" name="bid" value=" " onclick="alert('<?=_NOT_ABLE_TO_BID_;?>')" class="inputsubmitbid" />
                      <? } else	{ ?>
                      <input type="button" name="bid" value=" " onclick="product_bid('<?=$myprod['pid']?>'); return false;" class="inputsubmitbid" />
                      <? }?>
                    </div>
                  </div>
                  <div class="clb normaltextsmall tal lm5px rml5px tm10px">
                    <div class="sfl w10">
                      <input type="checkbox" name="chkbx[]" value="<?=$myprod[pid]?>"/>
                    </div>
                    <div class="sfl lm5px w85">Check this product to remove your Bid.</div>
                  </div>
                </div></td>
              <?
				$i++;
			}	// end of while loop
		?>
            </tr>
            <tr>
              <td colspan="4"><div id="if_s"><div class="tac sfl lm40px">
                  <? if(rightpaging()){

 echo rightpaging(); 
			}
			?>
                </div></div>
                <div  class="normaltextblackbold11 sfr"><?=_DELETE_SELECTED_AUCTION_;?> &raquo;
	   <input type="submit" name="delete" value=" " class="inputsubmit_delete" onClick="return confirm('<?=_SURE_TO_DELETE_PRODUCT_;?>');"/></div></td>
            </tr>
          </table>
        </form>

    <?
	} else {
			echo "<div class='no_message_show'><h3>"._NO_AUCTIONS_.".</h3></div>";

	}
  ?>
  </div> <div class="tft1">
              <div class="tft2"></div>
              <div class="tft3"></div>
            </div> </div> 
             <div  class="w99">
             <h3 class="tac tm40px"><div class="tm40px tac"><br /><br /><br /><br /><br />Advertisment Sponsors</div></h3>

             
  <? 
  $page='innerpage';
  $query_num=mysql_query("select bid from zb_banners where `status`='1' and pagename='$page' order by rand() limit 0,4");
 while($brow=mysql_fetch_array($query_num))
  {
  ?>
<?=banner_home("innerpage","bottom",158,103,$brow['bid']);?>
<? }?>
</div>

</div>
  <div style="clear:both">
    <? include("footer.php");?>

