<?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;
}
?><!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=gb2312" />
<title><?php echo $webtitle;?> - <?php echo $description;?></title>
<meta name="description" content="<?php echo $description;?>" />
<meta name="keywords" content="<?php echo $keyword;?>" />
<link href="images/style1.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="favicon.ico" />
<script type="text/javascript">
function g(o){return document.getElementById(o);}
function QieHuan(i){    
      if(i=="0")
		{		
            g('DL_11').className='dis';
			g('DL_10').className='undis';
		}
        else
        { 
            g('DL_10').className='dis';
			g('DL_11').className='undis';
		}
}
//]]></script>
<style type="text/css">
<!--
.logo1 {
	margin-top: -40px;
}
.STYLE1 {color: #999999}
-->
</style>
</head>
<body topmargin="0" leftmargin="0">
<table cellspacing="0" width="955" 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/checklogin2.php">
    <td width="50%" height="23" align="left" bgcolor="FEFEE9"> <img src="/img/re.gif" alt="注册<?php echo $webtitle;?>会员就送现金，从本站上淘宝购物，每笔交易立刻节省1-30%!" width="19" height="23"><b><a href="user/register.php" target=_blank class="link1">注册</a>会员就送现金，从本站上淘宝购物，每笔交易立刻节省1-30%！<img src="/img/re.gif" alt="注册<?php echo $webtitle;?>会员就送现金，从本站上淘宝购物，每笔交易立刻节省1-30%!" width="19" height="23"></b>&gt;&gt; <img src="/img/qiang.gif" alt="上淘宝购物就可返利，轻松淘宝，立即注册<?php echo $webtitle;?>会员吧！" width="19" height="23"><a href="help/fxlc.html" target="_blank" class="link1">购物返现流程</a><img src="/img/qiang.gif" alt="上淘宝购物就可返利，轻松淘宝，立即注册<?php echo $webtitle;?>会员吧！" width="19" height="23"></td>
    <td width="35%" 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;<img src="/img/xin.gif" alt="上淘宝购物就可返利，轻松淘宝，立即注册<?php echo $webtitle;?>会员吧！" width="19" height="23"><a href="user/register.php" target=_blank class="link1">注册新用户</a><img src="/img/xin.gif" alt="上淘宝购物就可返利，轻松淘宝，立即注册<?php echo $webtitle;?>会员吧！" width="19" height="23">&nbsp;&nbsp;</td>
      </form>
  </tr>
  <tr <?php if($_SESSION["username"]==NULL){ echo "style=display:none"; }else{ echo "style=display:true";}?>>
	    <td width="55%" height="23" align="left" bgcolor="FEFEE9"> <img src="/img/re.gif" alt="注册<?php echo $webtitle;?>会员就送现金，从本站上淘宝购物，每笔交易立刻节省1-30%!" width="19" height="23"><b><a href="user/register.php" target=_blank class="link1">注册</a>会员就送现金，从本站上淘宝购物，每笔交易立刻节省1-30%！<img src="/img/re.gif" alt="注册<?php echo $webtitle;?>会员就送现金，从本站上淘宝购物，每笔交易立刻节省1-30%!" width="19" height="23"></b>&gt;&gt; <img src="/img/qiang.gif" alt="上淘宝购物就可返利，轻松淘宝，立即注册<?php echo $webtitle;?>会员吧！" width="19" height="23"><a href="help/fxlc.html" target="_blank" class="link1">返现流程</a></td>
    <td  width="45%" height="23" align="right" bgcolor="FEFEE9"><?php if($num<>0) echo "<a href=user/msglist.php target=_blank ><img src=images/msg.gif border=0 align=texttop alt=您有新的短消息 /></a> <embed src=user/news.mp3 width=0 height=0 border=0 autostart=true loop=false> ";?> <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;<a href="user/loginout.php"  class="link1">退出</a>&nbsp;&nbsp;</td>
  </tr>
</table>
</body>
</html>