<?

	ob_start();session_start();

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

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

		include("include/functions.php");

			include("include/meta_functions.php");

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

{

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

}

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

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



 		$db1=new db;

   $db1->open();

  mysql_query("SET NAMES 'utf8'");

    $currency_symbol_new=symbol_currency();

		

	

	   	if(isset($_POST['book']))

		   		{ 

				

				if (trim($_POST['bid_from'])=='')

				  {

				   $msg3="Enetr Starting Bids"; 

				    

				  }

				  

				else if (trim($_POST['bid_to'])=='')

				   {

				   $msg3="Enetr Last Bids"; 

				   header("location:product_details.php?msg=$msg3"); 

				   }

			}

				  

				   



		



		

	$prodid=$_REQUEST['prodid'];

	$pid=$_REQUEST['prodid'];

	$uid=$_SESSION['uid'];

	$myres=remainbid1();

	$prod_query=@mysql_query("select * from t123go_product where pid=".$prodid);

	$myrow=@mysql_fetch_array($prod_query);

	

	

	

	if(isset($_GET['wpid']))

	{



		$sql="select pid from watchlist where pid='".$_GET['wpid']."' and uid='".$uid."'";

		$rwd=mysql_query($sql);

		if(mysql_num_rows($rwd) > 0)

		{



header("location:"._BASEURL_."/product_details.php?prodid=".$_GET['wpid']);

		}

		else

		{

		

		$watch=mysql_query("insert into watchlist set pid='".$_GET['wpid']."', uid='".$uid."', add_time=now()");

				

		header("location:"._BASEURL_."/product_details.php?prodid=".$_GET['wpid']);

		}



	}

	

	

	if(isset($_POST['book']))

	{



	 if(mysql_num_rows(mysql_query("select id from t123go_butler where uid='".$uid."' and pid='".$prodid."'"))==0)

    {

 	 mysql_query("insert into t123go_butler set pid='".$prodid."',uid='".$uid."',min_price='".$_POST['bid_from']."',

	max_price='".$_POST['bid_to']."',no_bids='".$_POST['bids']."',create_date=now()");



	$url=$_SERVER['HTTP_REFERER'];

	header("location:".$url);

    }



  }



    $qry="select * from t123go_product where pid='".$_GET['prodid']."'";

	$myproduct=mysql_fetch_array(mysql_query($qry));

	$diff=mysql_fetch_array(mysql_query("SELECT TIME_TO_SEC( TIMEDIFF( end_time, now( ) ) ) FROM t123go_product

	where pid='".$_GET['prodid']."'"));

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



 	$pids=$_GET['prodid'].",";

 



?>

<!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">

<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_?>/product_details.css" rel="stylesheet" type="text/css" />

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

<link href="<?=_BASEURLCSSNEW_?>/myaccount.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("timer1.js.php");?>

<script language="javascript" type="text/javascript">

function valid()

{

if(document.butler.bid_from.value=='' )

	{

		alert("<?=_PLS_MIN_VL_?>");

		document.butler.bid_from.focus();

		return false;

	}

	if(document.butler.bid_to.value > document.butler.bid_from.value=='')

	{

		alert("<?=_PLS_MAX_VL_?>");

		document.butler.bid_to.focus();

		return false;



	}

	return true;

}





function chimg(x)

{

	document.refimg.src=x;

}



</script>

</head>

<body id="static" onload="caltime();">

<div id="container">  

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

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

	  $bidtype=mysql_fetch_array(mysql_query("select type from t123go_bid where pid=$pid order by id desc limit 1"));



	  ?>

      <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="bid_type_<?=$pid?>" value="<?=$bidtype[0]?>" />

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

      <?

   }

	echo "</form>";

 ?>

    </div>

    <div id="show_bar_product">

  <div class="product1 ">

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

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

            </a></div>

			<div class="normaltextwhite11_new lm5px"><?=substr($myrow['brand'],0,200);?></div>

			</div>

  <div class="product2"><div class="normaltextblackbold13 tm25px tac">Listing ID:&nbsp;<?=$myrow['pid']?></div></div></div>

  <div id="show_save_product">

 <div id="show_save_product_let">

  <div class="product4">

   <div id="productprice_<?=$myrow[pid]?>" class="normaltextorangebold19 tac" style="text-align:center"><?=$currency_symbol_new?><span id="price_index_page_<?=$myrow['pid']?>"> <? echo $myrow['bid_price'];	?> </span> </div>

            <img border='0' style="display:none" src="<?=_BASEURLTEMPLATEIMAGE_?>/blink.gif" width="189" height="25" id="blinkdiv_<?=$myrow['pid']?>"  />

            <div id="close_bid" style="display:none"><strong>

              <?=_CONGR_LATIONS_?>

              <div id="winner_name" ></div>

              <?=_WON_BID_?>

              </strong> </div>

            <div class="normaltextblackbold19">

              <div class="tac" style="display:none"><span id="counter_index_page_<?=$myrow['pid']?>"></span> </div>

            </div>

			 <div class="tm30px normaltextredbold13_profile tac" id="winner_index_page_<?=$myrow['pid']?>">

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

            </div>

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

  <div  id="button_finished_index_page_<?=$myrow['pid']?>" style="display:none" class="tac  tm10px">

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

            <a href="<?=_BASEURL_?>/login/index.html">

            <input type="button" name="bid"  class="inputsubmitbid"/>

            </a>

            <? }

				 else if($myres<=0){

	  ?>

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

            <?

	  }

			else	{

						  ?>

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

            <? }?>

          </div>

            <div class="normaltextlightgreyboldsmall tac  tm10px">

              <?=_WTH_BID_PRC_INCR_?><br/>

              <span class="normaltextblack"><?=$currency_symbol_new?>

              <?=$myrow['bid_increment']?>

              </span>

                 <div class="tac">

            <div class="timer"></div>

          </div>

        </div>

      </div>

  <div id="show_stat_prof">

  <div class="buygreen1" >

          <div class="buygreen2">

            <div>

              <div class=" normaltextorangebold19 tm5px">Savings Potential</div>

            </div>

          </div>

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

        </div>

         <div class="allm100px">

  <form name="price_save_form">

              <table border="0" cellpadding="0" cellspacing="0" width="98%" align="center" class="clb lm5px">

                <tr>

                  <td colspan="2" align="center" valign="top" class="normaltextblackbold13c"></td>

                </tr>

				<tr>

                  <td colspan="2" align="center" valign="top" class="normaltextblackbold13c"></td>

                </tr>

                <tr class="damnheight1">

                  <td  width="116" valign="bottom" class="normaltextredbold11_new">MSRP:</td>

                  <td width="59" align="left" valign="bottom" class="normaltextgreenbold11"><strong> <?=$currency_symbol_new?> <?=$myrow['price']?>

                    </strong></td>

                </tr>

                

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

				 <tr class="damnheight1">

                  <td  width="116" valign="bottom" class="normaltextredbold11_new">Fix Price</td>

                  <td width="59" align="left" valign="bottom" class="normaltextgreenbold11"><strong> <?=$currency_symbol_new?>

                    <?=$myrow['fixed_price']?>

                    </strong></td> 

                </tr>

                <? }

				if($myrow['type1']=='1')

				{

				$pay_price=$myrow['fixed_price'];

				}

				else if($myrow['type1']=='3')

				{

				$pay_price=0;

				}

				else

				{

				$pay_price=$myrow['bid_price'];

				}

				$save=$myrow['price']-$pay_price;

				$percent=$save*(100/$myrow['price']);

				

				if($myrow['type1']!='1')

				{

				?>

                 <tr>

                  <td valign="top" class="normaltextredbold11_new"><?=_CURRNT_PRC_?></td>

                  <td align="left" valign="top" class="normaltextgreenbold11" id="current_price_<?=$prodid?>">

				  <?=$currency_symbol_new?> <?=$pay_price?></td>

                  

                </tr> 

              <? }?>        

                <tr>

                  <td valign="top" class="normaltextredbold11_new"><?=_CUURNT_SVNG_?></td>

                  <td align="right" valign="top" class="normaltextbluebold11">

                    <input type="hidden" name="product_type" value="<?=$myrow['type1']?>" />

                    <input type="hidden" name="actual_price" value="<?=$myrow['price']?>" />

                    <div id="price_saving"><?=$currency_symbol_new?> <?=round($save,2)?></div>

                    </td> 

                </tr>

                <tr>

                  <td valign="top" class="normaltextredbold11_new"><?=_SAVNG_PRCENT_?></td>

                  <td align="left" valign="top" class="normaltextbluebold11">

                    <div id="percent_save"><?=floor($percent)?>% </div>

                  </td> 

                </tr>      

              

                <tr>

                  <td colspan="2" valign="top"><div  class="normaltextlightgrey tm20px">The MSRP reflects Manufacturer Suggested Retail Price.</div> 

                 

                  </td>

                </tr>

              </table>

            </form>

  </div>

        <div class="tft1">

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

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

        </div>

      </div>

    </div>

 



    <div id="show_green_product">

      <div id="show_news">

        <div class="latest_news">

          <div class="show_news">

            <div id="stats_test"></div>

          </div>

        </div>

        <div class="tft1">

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

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

        </div>

      </div>

  

 

   <div id="activate_green_bot">

  

    <form name="butler" method="post" action="" onsubmit="return valid();">

       <div class="activate_green_bot">

            <div>

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

              <a href="<?=_BASEURL_?>/login/index.html">

              <input type="submit" name="book" value="" class="active_now"/>

              </a>

              <? }

				 else { 

				$numsold= mysql_num_rows(mysql_query("select id from t123go_product_sold where pid='".$myrow['pid']."'"));

				 ?>

              <input type="button" name="book" class="active_now" disabled="disabled"  value="" <? if($numsold > 0)echo "disabled";?>/>

              <? }?>

            </div><div class="show_news">

              <div class="tm5px">

          

   

  

    <div><? 

					  if (trim($msg3)<>'')

					     {

						    echo $msg3="<font color=\"red\">Enter the starting BidS Amount !</font><br />";



						 }

					

					  

					  ?></div>

    <table border="0" cellspacing="0" cellpadding="0" width="98%" align="center">

                  <tr>

                    <td align="left" valign="top" class="normaltextnotbold">Starting Bid:</td>

                    <td align="left" valign="top"><input type="text" name="bid_from" class="inputtextp"/></td>

                  </tr>

                  <tr>

                    <td align="left" valign="top" class="normaltextnotbold">Ending Bid:</td>

                    <td align="left" valign="top"><input type="text" name="bid_to" class="inputtextp"/></td>

                  </tr>

                  <tr>

                    <td align="left" valign="top" class="normaltextnotbold">Maximum Bids Allowed:</td>

                    <td align="left" valign="top"><input type="text" name="bids" class="inputtextp"/></td>

                  </tr>

                </table>



   </div> </div>  </div> </form>

    <div class="tft1">

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

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

        </div>

      </div>

      <div id="new_to"> <a href="<?=_BASEURL_?>/register/index.html" title="New to Greenfair,  Well Register today and receive 5 Green Credits.">

        <div class="new_to"></div>

        </a> </div>

    </div>

  </div>

    <div id="show_main_image_prod">

    <div class="show_main_image_prod"><?=image_product_385($myrow['pid'],$myrow['thumbnail']);?>

 <div class="allm5px">

 

  <?

              $sql_qry="select * from t123go_product where pid='".$prodid."'";

			  $myrow1=mysql_query($sql_qry);

			  $myimg=mysql_fetch_array($myrow1);

			  ?>

              <div class="lm20px">

              <div class="prodigy lm40px">

             <?=image_product_50($prodid,$myimg['thumbnail']);?> </div>

          <div class="prodigy">

			  

        	  <?=image_product_50($prodid,$myimg['image1']);?></div>

          <div class="prodigy"> 

                  

            <?=image_product_50($prodid,$myimg['image2']);?></div>

              

              <div class="prodigy"> <?=image_product_50($prodid,$myimg['image3']);?> 

                </div>

        </div>

      </div>



 <div class="w95 cl tac">

 <div class="allp10px tac">

		 <? $sql="select * from watchlist where pid='".$prodid."' and uid='".$uid."'";

						$rwd=mysql_query($sql);

						if(mysql_num_rows($rwd) > 0){?>

						

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

            <a href='<?=_BASEURL?>/login.php?prodid=<?=$myrow[pid]?>'>

			</a><div class="yane"> &nbsp;</div> <?=_ADD_AUCT_WATCH111_?>

            <? } else{?>

          

            <? }?>

		

	  

        </div>

      </div>

    </div>

  </div>

  

  

  

  <div id="show_pr_dt_details">

    <div id="pr_desc">

      <div class="buygreen1" >

        <div class="buygreen2">

          <div><img src="<?=_BASEURLMEDIA_?>/product_detail.gif" alt="product details" /></div>

        </div>

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

      </div>

      <div class="allm100px">

        <div class="lefty">

          <div id="pr_descr">

            <div class="buygreen_1" >

              <div class="buygreen_2">

                <div><img src="<?=_BASEURLMEDIA_?>/product_description.gif" alt="product details" /></div>

              </div>

              <div class="buygreen_3"> </div>

            </div>

            <div class="allm_100px">

              <?=wordwrap($myrow['description'],30,"\n",true);?>

            </div>

            <div class="tft_1">

              <div class="tft_2"></div>

              <div class="tft_3"></div>

            </div>

          </div>

          <div id="pr_spec">

            <div class="buygreen_1" >

              <div class="buygreen_2">

                <div><img src="<?=_BASEURLMEDIA_?>/product_specs.gif" alt="product details" /></div>

              </div>

              <div class="buygreen_3"> </div>

            </div>

            <div class="allm_100px"><div class="allp5px"><?=wordwrap($myrow['description1'],30,"\n",true);?>

            </div></div>

            <div class="tft_1">

              <div class="tft_2"></div>

              <div class="tft_3"></div>

            </div>

          </div>

          <div id="pr_ship">

            <div class="buygreen_1" >

              <div class="buygreen_2">

                <div><img src="<?=_BASEURLMEDIA_?>/product_shipping.gif" alt="product details" /></div>

              </div>

              <div class="buygreen_3"> </div>

            </div>

            <div class="allm_100px">

              <div class="w99">

                <div class="w35 sfl tm10px tac"> <span class="normaltextbluebold13_new">Delivery Cost:</span><br />

                  <span class="normaltextredbold13_new">

                  <?=$currency_symbol_new?>

                  <?=$myrow['delivery_cost']?>

                  </span><br />

                  <span class="normaltextlightgrey">All items shipped within 3 days of payment.</span><br />

<br /> </div>

                <div class="w30 sfl tac" style="border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC; height:68px">

                  <div class="tm10px normaltextbluebold13_new">Returns:</div>

                  <div class="normaltextredbold13_new">30 Days</div>

                  <span class="normaltextlightgrey">Must be in original packaging.</span><br />

<br /> </div>

                <div class="w30 sfl tm10px tac">

                  <div class="normaltextbluebold13_new">Questions:</div>

                  <div class="tm10px"> <a href="contact.php">

                    <input type="button" name="contact"  value=" " class="inputsubmitbigc" />

                    </a> <br />

<br />

</div>

                </div>

              </div>

            </div>

          </div>

        </div>

        <div class="righty">

          <div id="pr_env">

            <div class="buygreen_1" >

              <div class="buygreen_2">

                <div><img src="<?=_BASEURLMEDIA_?>/Environmental_Impact.gif" alt="Environmental Impact" /></div>

              </div>

              <div class="buygreen_3"> </div>

            </div>

            <div class="allm_100pxs">

              <div>

                <h1>50</h1>

                <h2>(Renewable Energy Credits)</h2>

                <p>Each Renewable Energy Credit will offset 1000 pounds of CO2 emmissions released into our atmosphere.</p>

                <p>For more information please visit Green Project Section.</p>

              </div>

            </div>

          </div>

          <div id="pr_env">

            <div class="buygreen_1" >

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

              <div class="buygreen_3"> </div>

            </div>

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

              <br />

              <br />

              <br />

            </div>

            <div class="tft_1">

              <div class="tft_2"></div>

              <div class="tft_3"></div>

            </div>

          </div>

        </div>

      </div>

      <div class="tft1">

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

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

      </div>

    </div>

  </div>

 

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

</div>

</body>

</html>

