<?
  //error_reporting(0);
	include("config/connect.php");
	include("functions.php");
	if($_SESSION["userid"])	$uid = $_SESSION["userid"];

	$ipaddress = $_SERVER['REMOTE_ADDR']; 
		
	if($_SESSION["ipid"]=="" && $_SESSION["login_logout"]=="")
	{
		$qryipins = "Insert into login_logout (ipaddress,load_time) values('".$ipaddress."',NOW())";
		mysql_query($qryipins) or die(mysql_error());
		$ipid = mysql_insert_id();

		$qryipsel = "select * from login_logout where id='$ipid'";
		$rsip = mysql_query($qryipsel);
		$obj = mysql_fetch_object($rsip);
		$_SESSION["ipid"] = $obj->load_time;
		$_SESSION["ipaddress"] = $ipaddress;
	}
?>


<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>拍客网</title>
<link href="style/css/index.css" rel="stylesheet" type="text/css" />
<meta name="Description" content="竞拍 抢拍 一元拍 拍卖 gobid weabid " />
<meta name="Keywords" content="竞拍 抢拍 一元拍 拍卖 gobid weabid " />

<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script language="javascript" src="jquery.js"></script>
<script language="javascript" src="effect.js"></script>
<script language="javascript" src="default.js"></script>
<script language="javascript" src="jqModal.js"></script>
<script language="javascript" src="function.js"></script>
<script language="javascript" src="basic.js"></script>
  <script language="javascript">
    function _delete_login_fields(_field, _default, _current) {
      if (_default == _current) {
        _field.value='';
      }
    }
  </script>
</head>
<body id="main_div" onload="OnloadPage();">
<?
	include("d1.php");
	
?>		

<div id="wrap">
	<div id="col1">
    	<div class="banner">
<script language='javascript'>
linkarr = new Array();
picarr = new Array();
textarr = new Array();
var swf_width=693;
var swf_height=179;
var configtg="0xffffff:文字颜色|100000:文字位置|0x000000:文字背景颜色|30:文字背景透明度|0xffffff:按键文字颜 色|0x4f6898:按键默认颜色|0x000033:按键当前颜色|3:自动播放时间|3:图片过渡效果|1:是否显示按钮|_blank:打开新窗 口";
var files = "";
var links = "";
var texts = "";
//这里设置调用标记
<?php
   $i=0;
	$query="select * from `flash`";
	$result=mysql_query($query) or die (mysql_error());
			  while($row = mysql_fetch_array($result)){
			    $i++;
				$id=$row['id'];
				$imgname=$row['imgname'];
				$image = $row['imgurl'];	
				$imglink=$row['arcurl'];
?>
linkarr[<?php echo $i;?>] = "<?php echo $imglink;?>";
picarr[<?php echo $i;?>]  = "<?php echo $image;?>";
textarr[<?php echo $i;?>] = "<?php echo $imgname;?>";
<?php
};
?>
for(i=1;i<picarr.length;i++){
if(files=="") files = picarr[i];
else files += "|"+picarr[i];
}
for(i=1;i<linkarr.length;i++){
if(links=="") links = linkarr[i];
else links += "|"+linkarr[i];
}
for(i=1;i<textarr.length;i++){
if(texts=="") texts = textarr[i];
else texts += "|"+textarr[i];
}
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
document.write('<param name="movie" value="images/bcastr3.swf"><param name="quality" value="high">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'&bcastr_config='+configtg+'">');
document.write('<embed src="images/bcastr3.swf" wmode="opaque" FlashVars="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'&bcastr_config='+configtg+'&menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); document.write('</object>'); 
</script>
			</div>
        <div class="info"><img src="style/images/inside1-info.gif" /></div>
        <div class="inside1-list">
        	<div class="list-title">新用户体验列表</div>
            <div class="list-wrap">
            	<ul>

	<?	$now=time();
	
	$qryauc = "select *, p.productID as pid,substring(p.name,1,10) as name,".$lng_prefix."short_desc as short_desc from auction a left join products p on a.productID=p.productID left join auc_due_table adt on a.auctionID=adt.auction_id where adt.auc_due_time>$now and a.is_close='0' and featured_flag='0' and  is_exprice=1 and a.auc_start_time <".$now." order by adt.auc_due_time limit 0,3";
	$resauc = mysql_query($qryauc);
	$totalauc = mysql_num_rows($resauc);
	
	
				   if($totalauc>0){ 
				   $a = 1;
				   $i=0;
				   while($objauc=mysql_fetch_array($resauc))
				   {	
					   
						if($a==1)
						{
							$co = "'".$objauc["auctionID"]."'";
							$arr = $objauc["auctionID"];
							$prr = $objauc["auc_due_price"];
						}
						else
						{
							$co .= ",'".$objauc["auctionID"]."'";
							$arr .= ",".$objauc["auctionID"];
							$prr .= ",".$objauc["auc_due_price"];
						}
				?>
                			
          <div class="auction-item" style="display: none" title="<?=$objauc["auctionID"];?>" id="auction_<?=$objauc["auctionID"];?>"></div>
					<li>
							
        <div class="thumb">
<a href="auction_<?=str_replace(" ","_",strtolower(stripslashes($objauc["name"])));?>_<?=$objauc["auctionID"];?>.html" target="_blank">
<img src="uploads/products/thumbs_big/thumbbig_<?=$objauc["picture1"];?>" alt="<?=stripslashes($objauc["name"]);?>" width="175" height="150" border="0" /></a></div>

        <div class="title"><a href="auction_<?=str_replace(" ","_",strtolower(stripslashes($objauc["name"])));?>_<?=$objauc["auctionID"];?>.html" target="_blank"><?=stripslashes($objauc["name"]);?>
</a></div>
			<div>					<div class="time">
								 <span id="counter_index_page_<?=$objauc["auctionID"];?>">
									<? 
			                         $now=time();
		                             $newtime=$objauc["auc_due_time"]-$now;
									echo "<script language='javascript' type='text/javascript'>
									document.getElementById('counter_index_page_".$objauc["auctionID"]."').innerHTML = calc_counter_from_time('".$newtime."');
									</script>";
								   ?>
								  </span>
								</div>
								<div  class="current-price">当前价：
									<span id="currencysymbol_<?=$objauc["auctionID"];?>"></span><span id="price_index_page_<?=$objauc["auctionID"];?>">---</span>
								</div>
								<div class="username">出价人: <span id="product_bidder_<?=$objauc["auctionID"];?>">---</span></div>
							</div>

							
						<div  class="bid-button">
						  	 <? 
						  	    if($uid=="")
						  	    { 
						  	 ?>
								<img src="style/images/bid-list-button.gif" border="0"  alt="BID" onmouseover="this.src='style/images/LOGIN_btn-2.png'" onmouseout="this.src='style/images/bid-list-button.gif'" onclick="javascript: window.location.href='login.html'" id="image_main_<?=$objauc["auctionID"];?>"  style="cursor: pointer"/>
						  <? } else { ?>
						    <?				       
						       if(getWonCount()<8)
						       {
						    ?> 
								<img src="style/images/bid-list-button.gif" border="0" class="bid-button-link" name="getbid.php?prid=<?=$objauc["productID"];?>&aid=<?=$objauc["auctionID"];?>&uid=<?=$uid;?>" alt="BID" onmouseover="this.src='style/images/bid-list-button.gif'" onmouseout="this.src='style/images/bid-list-button.gif'" id="image_main_<?=$objauc["auctionID"];?>"  style="cursor: pointer"/>
						  	<? }else{ ?>
								<img src="style/images/bid-list-button.gif" border="0" name="" alt="BID" onclick="alert( '<?=stripslashes($lng_notice_maxbidnum);?>' );" onmouseover="this.src='style/images/bid-list-button.gif'" onmouseout="this.src='style/images/bid-list-button.gif'" id="image_main_<?=$objauc["auctionID"];?>"  style="cursor: pointer"/>
						  	<?	 } ?>
						  <? }?>
							</div>
							 <div class="clear"></div>
						<!--div class="openAuction_itemvalue"><?=stripslashes($lng_itemvalue);?><?=$Currency.number_format($objauc["price"],2);?></div-->						
						<!--div style="height: 10px;">&nbsp;</div-->
					</li>

					<?
						$a++;
						}
					}
					else
					{
					?>
					<div style="height: 10px;">&nbsp;</div>
					<div class="noauction_message">没有用户新体验</div>	
					<?
					}
					?>
										
				
                         
                </ul>
            </div>
        </div>
    </div>


	 <div id="col2">
    	<div class="inside1-intro"><img src="style/images/inside1-intro.gif" /></div>       
        
        <div class="victory">
        	<div class="victory-title">看看喜友在忙什么</div>
            <div class="victory-list">
            	<ul>
				
					<?php
						$qryuser = "select username from registration order by register_date desc limit 0,7 ";
						$resnews = mysql_query($qryuser);
						$totalnews = mysql_num_rows($resnews);
				    if($totalnews>0)
				    { 
				      $i_news = 1;
				      while($objnews=mysql_fetch_array($resnews))
				      {
				      	?>

                    	
                	<li>
                    	<span class="username"><?=$objnews["username"];?>：</span>
                        <span class="info">刚刚加入拍客网</span>
                    </li>
					 <?
					}
				   }
					?>    
                	
                </ul>
            </div>
        </div>
        
        <div class="now">
        	<div class="now-title">正在竞拍</div>
            <div class="now-list">
            	<ul>
<?	$now=time();
	
	$qryauc = "select *, p.productID as pid,substring(p.name,1,10) as name,".$lng_prefix."short_desc as short_desc from auction a left join products p on a.productID=p.productID left join auc_due_table adt on a.auctionID=adt.auction_id where adt.auc_due_time>$now and a.is_close='0' and featured_flag='0' and is_exprice=0 and is_hot=0  and a.auc_start_time <".$now." order by adt.auc_due_time limit 0,6";
	$resauc = mysql_query($qryauc);
	$totalauc = mysql_num_rows($resauc);
	
	//$qryfu = "select *, p.productID as pid, p.name as name,short_desc as short_desc from auction a left join products p on a.productID=p.productID where a.auc_status=1";
	//$resfu = mysql_query($qryfu);
	//$totalfu = mysql_num_rows($resfu);
	
	//echo $uid;
	
				   if($totalauc>0){ 
				   $a = 1;
				   $i=0;
				   while($objauc=mysql_fetch_array($resauc))
				   {	
					   
						if($a==1)
						{
							$co = "'".$objauc["auctionID"]."'";
							$arr = $objauc["auctionID"];
							$prr = $objauc["auc_due_price"];
						}
						else
						{
							$co .= ",'".$objauc["auctionID"]."'";
							$arr .= ",".$objauc["auctionID"];
							$prr .= ",".$objauc["auc_due_price"];
						}
				?>
                	 <div class="auction-item" style="display: none" title="<?=$objauc["auctionID"];?>" id="auction_<?=$objauc["auctionID"];?>"></div>
					<li>
							
        <div class="thumb">
<a href="auction_<?=str_replace(" ","_",strtolower(stripslashes($objauc["name"])));?>_<?=$objauc["auctionID"];?>.html" target="_blank">
<img src="uploads/products/thumbs_big/thumbbig_<?=$objauc["picture1"];?>" alt="<?=stripslashes($objauc["name"]);?>" width="92" height="78" border="0" /></a></div>

        <div class="info">
                        	<div class="title">
                        	<a href="auction_<?=str_replace(" ","_",strtolower(stripslashes($objauc["name"])));?>_<?=$objauc["auctionID"];?>.html" target="_blank"><?=stripslashes($objauc["name"]);?>
</a> </div>
                         

				<div class="time">
								 <span id="counter_index_page_<?=$objauc["auctionID"];?>">
									<? 
			                         $now=time();
		                             $newtime=$objauc["auc_due_time"]-$now;
									echo "<script language='javascript' type='text/javascript'>
									document.getElementById('counter_index_page_".$objauc["auctionID"]."').innerHTML = calc_counter_from_time('".$newtime."');
									</script>";
								   ?>
								  </span>
								</div>
								
                            <div  class="price">当前价：
									<span id="currencysymbol_<?=$objauc["auctionID"];?>"></span><span id="price_index_page_<?=$objauc["auctionID"];?>">---</span>
								</div></div>
							
						
						 <div class="clear"></div>
					</li>

					<?
						$a++;
						}
					}
					else
					{
					?>
					<div style="height: 10px;">&nbsp;</div>
					<div class="noauction_message">没有竟拍</div>	
					<?
					}
					?>
                	                                                                                                                                                   
                </ul>
            </div>
        </div>
        
        <div class="help">
        	<div class="help-title">常见问题</div>
            <div class="help-list">
            	<ul>
                	<li><a href="faq.html">如何注册会员？</a></li>
                    <li><a href="faq.html">如何购买喜币参与竞拍？</a></li>
                    <li><a href="faq.html">如何查看我订单状态？</a></li>
                    <li><a href="faq.html">如何获得免费喜币？</a></li>    
                </ul>
            </div>
        </div>
    </div>
    <div class="clear"></div>
</div>




        
       

<input type="hidden" id="appPath" value="/" />
<script src="js/hp.js" type="text/javascript"></script>

<script type="text/javascript" src="js/o_code.js"></script>
<input type="hidden" id="qahp" value="qahp" />

<?php
  include("footer2.php");  
?>   
<span style="display: none;" class="firstimagebold" id="firstimage_bold"><?=$totalauc;?></span>
<!-- 主体内容结束-->

</body>
</html>
