<?php   
if(!file_exists(dirname(__FILE__).'/install/install.php.lock'))
{
    header('Location:install/install.php');
    exit();
}
include 'comm/conn.php';
include 'comm/config.php';
session_start();
$num=0;
$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
	die('数据库链接出错: ' . mysql_error());
}
mysql_select_db($dbname);
$_SESSION["tjrid"]=$_GET["pid"];
$cookieusername = $_COOKIE['username']; 
$cookiepassword = $_COOKIE['password']; 
//echo $cookieusername;
if($cookieusername<>NULL&&$_SESSION["username"]==NULL)
{
	mysql_query("set names gbk");	
	$q = "SELECT * FROM user where ddusername='".$cookieusername."' and ddpassword='".$cookiepassword."'";
	$rs = mysql_query($q);
	$num = mysql_num_rows($rs);
	
	if($num!=0)
	{   	
		$sj= date("Y-m-d H:i:s");
		$q = "update user set loginnum=loginnum+1 ,lastlogintime='$sj' where ddusername='".$cookieusername."'";	
		mysql_query($q);
		$_SESSION["username"] = $cookieusername; 
	}
}

$ddusername=$_SESSION["username"];
if($ddusername<>NULL)
{
	mysql_query("set names gbk");	
	$sql="select id from msg where ddusername='$ddusername' and see=0";
	//echo $sql;
	//exit;
	$rs = mysql_query($sql);
	$num = mysql_num_rows($rs);
	mysql_close($link);
	//echo $num;
}
?>
<link href="images/style2.css" rel="stylesheet" type="text/css">
<DIV id=toubiao >
<table cellspacing="0" width="950" height="23" style="border:1px  solid #FFDF70;" align="center">  
  <tr <?php if($_SESSION["username"]==NULL){ echo "style=display:true"; }else{ echo "style=display:none";}?>><form id="form1" name="form1" method="post" action="../user/checklogin.php">
    <td width="52%" height="23" align="left" bgcolor="FEFEE9"><a style="FLOAT: none" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('<?php echo $url ?>');" href="#">设为首页</a><img src="img/top_ioc_index.gif" align="absmiddle" />&nbsp;&nbsp;&nbsp;<a style="FLOAT: none;cursor:hand" onClick="window.external.addFavorite('<?php echo $url ?>','<?php echo $webtitle ?>');return false;">收藏本站</a><img src="img/top_ioc_favorites.gif" align="absmiddle" /></A>&nbsp;&nbsp;&nbsp;<A style="FLOAT: none" href="user/login.php" target=_blank><font color="#990000"><?php      
		$sy = gmdate("Y", time()+8*60*60); 
		$sm = gmdate("m", time()+8*60*60);
		$sd = gmdate("d", time()+8*60*60);
		if($sd>20)
		{
			$sm=$sm;
		}
		else
		{
		$sm=$sm-1;
		}
		if($sm>12)
		{
			$sy=$sy+1;
			$sm="01";
		}
		echo $sy."年".$sm."月20日"
		?>佣金已结算</font></A></td>
    <td width="48%" height="23" align="right" bgcolor="FEFEE9">      用户名
      <input name="username" type="text" size="10" maxlength="50" class="btn" />
        密码
        <input name="password" type="password" size="10" maxlength="50" class="btn" />
      <input type="submit" name="Submit" value="登录" class="btn2" />&nbsp;&nbsp;<a href="../reg.htm" target=_blank class="link1">注册新用户</a>&nbsp;<a href="../user/repaword.htm" target=_blank class="link1">忘记密码</a></td>
      </form>
  </tr>
  <tr <?php if($_SESSION["username"]==NULL){ echo "style=display:none"; }else{ echo "style=display:true";}?>>
	    <td width="48%" height="23" align="left" bgcolor="FEFEE9"><a style="FLOAT: none" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('<?php echo $url ?>');" href="#">设为首页</a><img src="img/top_ioc_index.gif" align="absmiddle" />&nbsp;&nbsp;&nbsp;<a style="FLOAT: none;cursor:hand" onClick="window.external.addFavorite('<?php echo $url ?>','<?php echo $webtitle ?>');return false;">收藏本站</a><img src="img/top_ioc_favorites.gif" align="absmiddle" /></A>&nbsp;&nbsp;&nbsp;<A style="FLOAT: none" href="user/login.php" target=_blank><font color="#990000"><?php      
		$sy = gmdate("Y", time()+8*60*60); 
		$sm = gmdate("m", time()+8*60*60);
		$sd = gmdate("d", time()+8*60*60);
		if($sd>20)
		{
			$sm=$sm;
		}
		else
		{
		$sm=$sm-1;
		}
		if($sm>12)
		{
			$sy=$sy+1;
			$sm="01";
		}
		echo $sy."年".$sm."月20日"
		?>佣金已结算</font></A></td>
    <td  width="52%" height="23" align="right" bgcolor="FEFEE9"><img src="/img/kids.gif" width="15" height="14"><a href="../user/usercenter.php" target=_blank class="link2"><b><?php echo $ddusername;?></b></a> 欢迎您再次光临<?php echo $webtitle;?>！&nbsp;&nbsp;<a href="../user/usercenter.php" target=_blank class="link1">会员中心</a>&nbsp;&nbsp;<?php if($num<>0) echo "<a href=user/msglist.php target=_blank ><img  src=images/msg.gif width=16  height=16 hspace=4 border=0  alt=您有新的短消息 /></a> <embed src=user/news.mp3 width=0 height=0 border=0 autostart=true loop=false> ";?> <a href="../user/loginout.php"  class="link1">退出</a><a style="CURSOR: hand" onClick=toueme()><img  src="../img/close.gif" width=84 height=11 hspace="6" border=0></a></td>
  </tr>
</table>
</DIV>