<?
		ob_start();session_start();

		if($_SESSION['lang']=='')
		{
		$_SESSION['lang'] = "en";
		}
		include 'languages/lang_common_'.$_SESSION['lang'].'.php';
		include 'languages/lang_my_bidbutlers_'.$_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 t123go_butler where pid='$delid' and uid='$uid'";
			$sql=mysql_query($upd);

			}

		}
	 $jsres=mysql_query(dopaging("SELECT p.pid,bid_price FROM t123go_product p,t123go_butler b where b.pid=p.pid and b.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>
<?=_TITLE_;?>
Greenbot | An automatic bidder for you</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_?>/green_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">
    <?
		  $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>MY ACTIVE GREENBOTS</div></div>
        <div class="buygreen3"></div>
      </div>
      <div class="allm100px">
    <?
						$sql="SELECT * FROM t123go_product p,t123go_butler b where b.pid=p.pid and b.uid='$uid' and p.status='1' ";
						$rwd=mysql_query(dopaging($sql,4));
						if(mysql_num_rows($rwd)){
				   ?>

      <form action="" method="post" name="my_butler">
        <?
						while($myuser=mysql_fetch_array($rwd)){

						$bid_butlr=mysql_fetch_array(mysql_query("select * from t123go_product where status='1' and pid=".$myuser['pid']));

					  ?>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="clshow">
          <tr height="90px">
            <td align="left" valign="top" width="100"><? if($bid_butlr['type1']=='1'){?>
              <div class="fixed_price1"></div>
              <? }else if($bid_butlr['type1']=='2'){?>
              <div class="penny_prd1"></div>
              <? }else if($bid_butlr['type1']=='3'){?>
              <div class="s100_off1"></div>
              <? }?>
             <div class="simg"> <a href="<?=get_cat_name($bid_butlr['cid']);?>/<?=str_replace(" ","-",$bid_butlr['pname']);?>/auction/<?=$bid_butlr['pid']?>/"  >
              <?=image_90($bid_butlr['pid'])?>
              </a></div> </td>
            <td align="left" valign="middle" width="102"><div  class="sfl">
                <div class="normaltextorangebold19c" id="productprice_<?=$bid_butlr[pid]?>">
                  <?=$currency_symbol_new?>
                  <span id="price_index_page_<?=$bid_butlr['pid']?>">
                  <?
									  echo $bid_butlr['bid_price'];
									?>
                  </span> </div>
              </div></td>
            <td align="left" valign="middle" width="105"><div class="sfl normaltextorangebold13">
                <div id="winner_index_page_<?=$bid_butlr['pid']?>" >
                  <?=get_fieldval(id,uname,user,$bid_butlr['bider_id'])?>
                </div>
              </div></td>
            <td align="left" valign="middle" width="98"><div class="sfl">
                <div class="normaltextblackbold19c" id="productcounter_<?=$bid_butlr[pid]?>"> <span id="counter_index_page_<?=$bid_butlr['pid']?>"></span></div>
              </div></td>
            <td width="176" align="left" valign="middle"><div class="tal"><span class="normaltextgreybold">
                <?
						echo "Starting Price:&nbsp;&nbsp;";
						?>
                </span><span class="normaltextgreenbold11">
                <?
                          echo $currency_symbol_new."&nbsp;".$myuser['min_price'];
						  ?>
                </span> <br />
                <br/>
                <span class="normaltextgreybold">
                <?
						  echo "Ending Price:&nbsp;&nbsp;";?>
                </span><span class="normaltextgreenbold11">
                <?
						  echo  $currency_symbol_new."&nbsp;".$myuser['max_price'];
						  ?>
                </span></div>
              <div style="display:none" id="maximumbid_<?=$bid_butlr['pid']?>" class="highestbid" ></div></td>
            <td align="left" valign="middle" width="117"><div class="sfl" id="button_finished_index_page_<?=$bid_butlr['pid']?>" style="cursor:pointer; 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('<?=$bid_butlr['pid']?>');"  class="inputsubmitbid" />
                <? }?>
              </div></td>
            <td align="left" valign="middle" width="30"><div>
                <input type="checkbox" name="chkbx[]" value="<?=$bid_butlr[pid]?>"/>
              </div></td>
          </tr>
        </table>
        <?

			}	// end of while loop
		
				?>
  <div id="if_s"><div class="tac sfl lm40px">
          <? if(rightpaging()){

 echo rightpaging(); 
			}
			?>
        </div>
        <div  class="sfr normaltextblackbold11_s">
          <?=_DELETE_SELECTED_AUCTION_;?>
          &raquo;
          <input type="submit" name="delete" value=" " class="inputsubmit_delete" onClick="return confirm('<?=_SURE_TO_DELETE_PRODUCT_;?>');"/>
        </div>
       </div>
      </form>
    <?
					} else{
					echo "<div class='no_message_show'><h3>"._NO_CURRENTLY_HAVE_ANY_DOOBIEBIDS_ACTIVE_."</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");?>

