<?	ob_start();

	session_start();

		if($_SESSION['lang']=='')

{

	$_SESSION['lang'] = "en";

}

	include ('languages/lang_index_'.$_SESSION['lang'].'.php');

	include 'languages/lang_common_'.$_SESSION['lang'].'.php';



 include("include/pager.php");

	include("include/db.inc.php");

 	include("include/bit_functions.inc.php");

	include("include/functions.php");

	include("include/meta_functions.php");

	include("include/mail.php");

	include("include/banner_inc.php");



   $db1=new db;

   $db1->open();

    mysql_query("SET NAMES 'utf8'"); 

	$currency_symbol_new=symbol_currency();

  

   $uid=$_SESSION['uid'];



 if($_POST['refer_a_friend'])

 {

 $errmsg="";

   if($uid!='')

   {

 $refer_mail=$_POST['refer_mail'];

 $ccode=substr(md5(time()),0,10);

	 if(mysql_num_rows(mysql_query("select id from user where email='$refer_mail'"))==0)

	   {

	     if(mysql_num_rows(mysql_query("select id from invite_friend where email='$refer_mail'"))==0)

		 {

	   mysql_query("insert into invite_friend set uid='$uid',email='$refer_mail',refer_code='$ccode'");

	   

	    send_invitation($uid,$refer_mail,$ccode);

		admin_refer_friend($uid,$refer_mail,$ccode);	 

	    $errmsg="Your invitation has been sent.";

		 }

		 else

		 $errmsg="User already invited.";

	   

	   }

	   else

	   {

	   $errmsg="User already is a member.";

	   }

   }

   else

   $errmsg="You must be logged in to do that.";

    

 }



 //print_r($_SESSION);



   $myres=remainbid1();

  



  // Query start for Hot featured product //

	 $sql="select * from t123go_product where featured='1' and status='1' and start_time < now() 

	 and end_time >	 now() order by rand() limit 1";

 	 $rs=mysql_query($sql);

  	 $data=mysql_fetch_array($rs);

  // Query ended for Hot featured product //





   $jsres=mysql_query("SELECT pid,bid_price FROM t123go_product where start_time < now() and end_time >now()  and pid!='".$data[pid]."' and status='1' order by end_time  limit 4");

	$pids="";

	while($jsrec=mysql_fetch_array($jsres))

	{

	$pids.=$jsrec['pid'].",";

	$_SESSION['new'][$jsrec['pid']]=$jsrec['bid_price'];

	}



	//for featured product //

	if($data['pid']!='')

	{

	$pids.=$data['pid'].",";

	$_SESSION['new'][$data['pid']]=$data['bid_price'];

	}







	$sql_qry="SELECT pid,pname,price,bid_price,thumbnail,bider_id,description,type1,cid,brand FROM t123go_product where start_time <now() and end_time > now() and pid!='$data[pid]' and status='1' order by end_time limit 4";

	





$lat_auction=substr($pids,0,-1);

	//  top live auctions //

	

	if($lat_auction=='')

	$lat_auction="''";



 $jsquery1="SELECT * FROM t123go_product where start_time < now() and 

   end_time > now() and status='1' and pid!='".$data[pid]."' and pid not in(".$lat_auction.")";

   $jsres1=mysql_query($jsquery1) or( die(mysql_error));	

	

	while($jsrec1=mysql_fetch_array($jsres1))

	{

	$pids.=$jsrec1['pid'].",";

	$_SESSION['new'][$jsrec['pid']]=$jsrec['bid_price'];	

	}

	

	$homeres=mysql_query($sql_qry);



	$homeres1=mysql_query($jsquery1);

    $num_live=mysql_num_rows($homeres1);







?>

<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>

<?=_TITLE_?>

High Discount on

<?=meta_title($pids)?>

</title>

<meta name="description" content="<?=meta_description($pids)?>" />

<meta name="keywords" content="<?=meta_keyword($pids)?>" />

<META Http-Equiv="Cache-Control" Content="no-cache">

<META Http-Equiv="Pragma" Content="no-cache">

<META Http-Equiv="Expires" Content="0">

<meta name="author" content="Info-Tech Ltd.">

<meta name="publisher" content="Info-Tech Ltd.">

<meta name="copyright" content="Money Auctions | Powered by Money Auctions">

<meta name="page-topic" content="Service">

<meta name="audience" content="all">

<meta http-equiv="content-language" content="us">

<meta name="Language" content="english">

<meta name="robots" content="index,follow">

<meta name="revisit-after" content="3">

<link href="<?=_BASEURLCSSNEW_?>/index.css" rel="stylesheet" type="text/css" />

<link href="<?=_BASEURLCSSNEW_?>/index_sec.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="main_banner"><div class="shadow"><div class="im"><img src="<?=_BASEURLMEDIA_?>/bid_banner.jpg" alt="greenfair bid here" /></div><div class="text_main"><div class="in"><div class="not_im"><div class="lol"><div class="allp10px">

    <p>If you like to shop, pay next to nothing, enjoy bargains, like to have fun, while engaging in suspense driven auctions, then look no further.<br />

      We invite you to browse our product offerings, map your strategy, and test your bidding skills, on our nail biting eco-friendly entertainment shopping engine.<br />

      Wow what a mouthful!</p>

    <p>Ok very simple. Every time you participate you will take an active role in reducing your impact on the environment, while paying pennies on the dollar for items you purchase.<br />

      Our goal is to make everyone a winner, including our Planet… </p></div>

    <div class="join"><a href="<?=_BASEURL_?>/register/index.html"><img src="<?=_BASEURLMEDIA_?>/join_now.png" alt="join greenfair now" /></a></div></div></div></div></div></div></div>

  <div id="wrapper_index">

    <div class="lefty">

      <div id="feat_pro">

        <div class="yellow_top">

          <div class="corner_l">

            <div class="star">

              <div class="featured_text"></div>

            </div>

          </div>

          <div class="corner_r"></div>

        </div>

        <div class="main">

       

            <div class="frame_text">

              <div> <a href="<?=get_cat_name($data['cid']);?>/<?=str_replace(" ","-",trim($data['pname']));?>/auction/<?=$data['pid']?>" class="product_title" style="font-size:17px">

                <?=$data['pname'];?>

                </a><br />

                <div class="normaltextlightgrey">

                  <?=substr($data['brand'],0,100);?>

                  &nbsp; <a href="<?=get_cat_name($data['cid']);?>/<?=str_replace(" ","-",trim($data['pname']));?>/auction/<?=$data['pid']?>" class="smalwhere">

                  <?=_MORE_?>

                  </a> </div>

              </div>

              <div align="left" style="padding:10px; "><span class="normaltextnotbold">

                <?=_TM_LFT_?>

                </span>

                <div class="normaltextblackbold199" style="margin-left:0px;" id="productcounter_<?=$data[pid]?>">

                  <div id="counter_index_page_<?=$data['pid']?>"></div>

                </div>

                <div style="display:none" id="maximumbid_<?=$data['pid']?>" class="highestbid"></div>

              </div>

              <div align="left"  style="padding-left:12px; padding-top:0px;color:#99BB22; font-weight:bold"> <span class="normaltextblackbold111">

                <?=_VALUE_?>

                </span>

                <?=$currency_symbol_new?>

                <?=$data['price']?>

                <br />

                <span class="normaltextblackbold111">

                <?=_BIDCOST_?>

                </span>

                <?=$currency_symbol_new?>

                <span  id="price_index_page_<?=$data['pid']?>"></span><br />

                <span class="normaltextblackbold111">

                <?=_END_TM_?>

                </span>

                <?=$data['end_time']?>

              </div>

              <div  style="padding:5px">

                <div id="winner_index_page_<?=$data['pid']?>" class="normaltext sfl lm8px">

                  <?=get_fieldval(id,uname,user,$data['bider_id'])?>

                </div>

                <br/>

                <br/>

                <br/>

                <br/>

                <div  id="button_finished_index_page_<?=$data['pid']?>" style="cursor:pointer; padding-top:0px; padding-left:30px; display:none" >

                  <?  if($uid==''){?>

                  

                  <input type="button" name="bid" id="submit1" value=" " onClick="javascript:window.location='<?=_BASEURL_?>/login/index.html'" class="inputsubmitbid"/>

                  

                  <? }

				 else {?>

                  <input type="button"  name="bid" id="submit1" class="inputsubmitbid"  value=" " onclick="product_bid('<?=$data[pid]?>'); return false;"/>

                  <? }?>

                </div>

              </div>

            </div>

            <div class="frame_image">

              <div style="background-image:url(images/product/<?=$data['pid'];?>/<?=name_450($data['pid']);?>); background-position:left; height:320px; width:445px; background-repeat:no-repeat">

                <? if($data['type1']=='1'){?>

                <div class="fixed_price1"></div>

                <? }else if($data['type1']=='2'){?>

                <div class="penny_prd1"></div>

                <? }else if($data['type1']=='3'){?>

                <div class="s100_off1"></div>

                <? }?>

              </div>

          

          </div>

        </div>

      </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'"))  ;



	  $curr_bid=get_uname($diff[bider_id]);

	  if($curr_bid=='') 

	  $curr_bid="No Bidder Yet";

	  else

	  $curr_bid="<span class='normaltextredbold13_profile'>$curr_bid</span>";

	  ?>

        <input type="hidden" name="price_<?=$pid?>" value="<?=$diff[bid_price]?>" />

        <input type="hidden" name="bider_<?=$pid?>" value="<?=$curr_bid?>" />

        <input type="hidden" name="diff_<?=$pid?>" value="<?=$diff[0]?>" />

        <input type="hidden" name="new_<?=$pid?>" value="0" />

        <?

   }

	echo "</form>";

 ?>

      </div>

      <div id="close_pro">

        <div class="yellow_top">

          <div class="corner_l">

            <div class="featured_text"></div>

          </div>

          <div class="corner_r"></div>

        </div>

        <div class="main">

          <div class="clb">

            <?



 $i=1;

 while($myrow=mysql_fetch_array($homeres))

{



?>

            <div id="top_n_top">

              <div class="imagex">

                <div class="allp5px"><a href="<?=get_cat_name($myrow['cid']);?>/<?=str_replace(" ","-",trim($myrow['pname']))?>/auction/<?=$myrow['pid']?>" class="product_title">

                  <?=image_130($myrow['pid']); ?>

                  </a></div>

              </div>

              <div class="detailx">

                <div class="detail"> <a href="<?=get_cat_name($myrow['cid']);?>/<?=str_replace(" ","-",trim($myrow['pname']))?>/auction/<?=$myrow['pid']?>" class="product_title_or">

                  <?=substr($myrow['pname'],0,25);?>

                  </a>

                  <div class="tm5px normaltextlightgrey">

                    <?=substr($myrow['brand'],0,90);?>

                  </div>

                </div>

                <div class="pricex">

                  <div class="allp5px">

                    <div style="display:none" id="maximumbid_<?=$myrow['pid']?>" class="highestbid"></div>

                    <div  id="productprice_<?=$myrow[pid]?>" class="normaltextorangebold19">

                      <?=$currency_symbol_new?>

                      <span  id="price_index_page_<?=$myrow['pid']?>">

                      <?

		  echo $myrow['bid_price'];

		?>

                      </span> </div>

                    <div id="productcounter_<?=$myrow[pid]?>" class="normaltextblackbold19">

                      <div id="counter_index_page_<?=$myrow['pid']?>"></div>

                    </div>

                  </div>

                </div>

              </div>

              <div class="image_show sfl">

                <? if($myrow['type1']=='1'){?>

                <div class="fixed_price1"></div>

                <? }else if($myrow['type1']=='2'){?>

                <div class="penny_prd1"></div>

                <? }else if($myrow['type1']=='3'){?>

                <div class="s100_off1"></div>

                <? }?>

              </div>

              <div id="winner_index_page_<?=$myrow['pid']?>" class="submitbidout sfl"></div>

              <div class="button_bgf">

                <div  id="button_finished_index_page_<?=$myrow['pid']?>" style="cursor:pointer; padding-top:0px; display:none" >

                  <?  if($uid==''){?>

                 

                  <input type="button" name="bid" id="submit1" value="" onClick="javascript:window.location='<?=_BASEURL_?>/login/index.html'" class="inputsubmitbid" />

                  

                  <? }

				 else {?>

                  <input type="button" name="bid" id="submit1" value="" class="inputsubmitbid" onclick="product_bid('<?=$myrow[pid]?>'); return false;"/>

                  <? }?>

                </div>

              </div>

            </div>

            <? 

		$i++; }?>

          </div>

        </div>

      </div>

      <div id="live_pro">

        <div class="yellow_top">

          <div class="corner_l">

            <div class="featured_text"></div>

          </div>

          <div class="corner_r"></div>

        </div>

        <div class="main">

          <div class="boringfeat">

            <?



if($num_live>0){

 $j=1;

 while($myrowl=mysql_fetch_array($homeres1))

{



?>

            <div class="clbeat">

              <div class="imagex">

                <div class="wid"><a href="<?=get_cat_name($myrowl['cid']);?>/<?=str_replace(" ","-",$myrowl['pname']);?>/auction/<?=$myrowl['pid']?>/"  target="_parent">

                  <div class="img_bor">

                    <?=image_90($myrowl['pid']); ?>

                  </div>

                  </a></div>

                <div class="productx">

                  <div class="wider"><a href="<?=get_cat_name($myrowl['cid']);?>/<?=str_replace(" ","-",$myrowl['pname']);?>/auction/<?=$myrowl['pid']?>/" class="mainptitleframe" title="<?=$myrowl['pname'];?>">

                    <?=$myrowl['pname'];?>

                    </a>

                    <p>

                      <?=$myrowl['brand'];?>

                    </p>

                  </div>

                  <div class="pricex">

                    <div class="demo">

                      <div class="image_show_beat">

                        <? if($myrowl['type1']=='1'){?>

                        <div class="fixed_price1"></div>

                        <? }else if($myrowl['type1']=='2'){?>

                        <div class="penny_prd1"></div>

                        <? }else if($myrowl['type1']=='3'){?>

                        <div class="s100_off1"></div>

                        <? }?>

                      </div>

                      <div class="tm5px"><br />

                        <br />

                        <br />

                        <div id="winner_index_page_<?=$myrowl['pid']?>" ></div>

                      </div>

                    </div>

                    <div class="detailx sfl lm10px tac">

                      <div style="display:none" id="maximumbid_<?=$myrowl['pid']?>" class="highestbid"></div>

                      <div class="tm-10px tac" id="button_finished_index_page_<?=$myrowl['pid']?>"  style="display:none" >

                        <?  if($uid==''){?>

                       

                        <input type="button" name="bid"  value=" " onClick="javascript:window.location='<?=_BASEURL_?>/login/index.html'" class="button"/>

                        <? } else if($myres<=0){?>

                        <input type="button" name="bid" onclick="alert('<?=_UR_NTABL_BDH_?>')" value=" " class="button" />

                        <?  } else {?>

                        <input type="button" name="bid"   onclick="product_bid('<?=$myrowl[pid]?>'); return false;" value=" " class="button" />

                        <? }?>

                         </div>

                      <div id="productprice_<?=$myrowl[pid]?>" class="normaltextorangebold19c tac">

                        <?=$currency_symbol_new?>

                        <span id="price_index_page_<?=$myrowl['pid']?>">

                        <? 

		  echo $myrowl['bid_price'];

		?>

                        </span> </div>

                      <div class="normaltextblackbold19c" id="productcounter_<?=$myrowl[pid]?>"> <span class="normaltextblackbold19c" id="counter_index_page_<?=$myrowl['pid']?>"></span> </div>

                    </div>

                  </div>

                </div>

              </div>

            </div>

            <?

			$j++;	

			}	// end of while loop



			?>

            <? } else {

?>

            <div class="allp10px normaltextblackbold13">

              <div class="allp10px tac">We will be having auctions for this particular category for you soon.</div>

            </div>

            <? }

?>

          </div>

        </div>

      </div>

      <div id="out_pro">

        <div class="yellow_top">

          <div class="corner_l">

            <div class="featured_text"></div>

          </div>

          <div class="corner_r"></div>

        </div>

        <div class="main">

          <div class="boringfeat">

            <?

 $sql="select * from t123go_product_sold group by pid order by id desc limit 2";

	$rwd=mysql_query($sql);

   $i=0;

   if(mysql_num_rows($rwd)){

  

   

         while($myuser=mysql_fetch_array($rwd)){



		 $myrow=mysql_fetch_array(mysql_query("SELECT * FROM t123go_product where pid='".$myuser['pid']."' "));







		  ?>

            <div class="clbeat">

              <div class="imagex">

                <div class="wid"><a href="<?=get_cat_name($myrow['cid']);?>/<?=str_replace(" ","-",$myrow['pname']);?>/auction/<?=$myrow['pid']?>/"  target="_parent">

                  <?=image_90($myrow['pid']); ?>

                  </a></div>

                <div class="productx">

                  <div class="wider"><a href="<?=get_cat_name($myrow['cid']);?>/<?=str_replace(" ","-",$myrow['pname']);?>/auction/<?=$myrow['pid']?>/" class="mainptitleframe" title="<?=$myrow['pname'];?>">

                    <?=$myrow['pname'];?>

                    </a>

                    <p>

                      <?=$myrow['brand'];?>

                    </p>

                  </div>

                  <div class="pricex">

                    <div class="demo">

                      <h1><?=$currency_symbol_new?>

                      <? echo $myrow['bid_price'];?></h1>

                      <p>Winner: <span>

                        <?=get_fieldval(id,uname,user,$myuser['uid'])?>

                        </span></p>

                    </div>

                    <div class="detailx">

                      <p>

                        <?=$myuser['sold_date']?>

                      </p>

                    </div>

                  </div>

                </div>

              </div>

            </div>

            <?

				

			}	// end of while loop



			?>

            <? }else {

?>

            <div class="allp10px normaltextblackbold13">

              <div class="allp10px tac">No product has been sold recently in past few hours.</div>

            </div>

            <?

}?>

          </div>

        </div>

      </div>

    </div>

    <div class="righty"><div class="newest"> <br /><br /><br />

     <?

	   $sql22="select uname, stat_date from user where confirm='1' and dummy='0' order by id desc limit 4";

	$rwd22=mysql_query($sql22);

	  while($myuser22=mysql_fetch_array($rwd22)){

	  $date=substr($myuser22['stat_date'],0,10);

			 $time=substr($myuser22['stat_date'],11,19);

	  

	  ?>

     

      <div class="allp5px" style="border-bottom:1px dotted #ccc">

      <span class="normaltextorangebold"><?=$myuser22['uname'];?></span>&nbsp;<span class="normaltextlightgrey">&nbsp;<? echo formated_time($date,$time);?></span>

      </div>

  

      <?

	  }?>    </div>



      <div id="latest_news">

        <div class="latest_news">

          <div class="show_news">

            <? $sql_news="SELECT * FROM t123go_news where blocked='1' order by submit_date desc limit 2";

$res_news=mysql_query($sql_news);

if(mysql_num_rows($res_news)){

while($latest_news=mysql_fetch_array($res_news)){

?>

            <div>

              <fieldset class="fieldset_news">

              <div class="bm10px"><a href="news/<?=$latest_news['id']?>" class="smalla1b">

                <?=$latest_news[title]?>

                </a> -- <span class="normaltextblackbold11p5px">

                <?=$latest_news['submit_date'];?>

                </span></div>

              <div>

                <?=substr($latest_news[description],0,455)?>

                <div class="tar"><a href="news/<?=$latest_news['id']?>">

                  <?=_READ_MORE_?>

                  </a></div>

              </div>

              </fieldset>

            </div>

            <br />

            <? }}else {

?>

            <div class="tm5px bm5px normaltextblackbold13 tac"> We will be having some News for you very soon! </div>

            <?

}?>

          </div>

        </div>

        <div class="tft1">

          <div class="tft2"></div>

          <div class="tft3"></div>

        </div>

      </div>

      <div id="adv_sponsors_index">

        <div class="buygreen1" >

          <div class="buygreen2 tac"><img src="<?=_BASEURLMEDIA_?>/adv_sponsors.gif" alt="advertisement sponsors" /> </div>

          <div class="buygreen3"> </div>

        </div>

        <div class="allm100px">

         <? 

  $page='homepage';

  $query_num=mysql_query("select bid from zb_banners where `status`='1' and pagename='$page' order by rand() limit 0,2");

 while($brow=mysql_fetch_array($query_num))

  {

  ?>

<?=banner_home("homepage","right",215,215,$brow['bid']);?>

<? }?>

        </div>

        <div class="tft1">

          <div class="tft2"></div>

          <div class="tft3"></div>

        </div>

      </div>

    </div>

  </div>

</div>

<div id="container">

  <div id="main_site_green">

    <div class="lefty"> </div>

  </div>

  <div class="clb">

    <? include("footer.php");?>



