<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<title>首页</title>
<script language="javascript">
function BulletinWin(url) {
var oth="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=200,top=200";
oth = oth+",width=400,height=300";
var BulletinWin = window.open(url,"BulletinWin",oth);
BulletinWin.focus();
return false;
}
</script>
</head>
<body>
<table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolorlight="#FF9933" bordercolordark="#FFFFFF" bgcolor="#FFFFFF">
<tr>
<td width="100%" height="24" bgcolor="#63CFFF" align="center">
<font color="#FF0000"><b>站内公告</b></font></td>
</tr>
<?PHP
//session_start();
include('Class\Bulletin.php');
$obj = new Bulletin();
$results = $obj->GetBulletinlist();
//显示新闻信息
?>
<tr>
<td width="100%" bgcolor="#E1F5FF" height="70" valign="top">
<?PHP
$exist = false;
//按时间显示最新的10条新闻信息
for ($i=1; $i<=10; $i++)
{
$exist = true;
if($row = $results->fetch_row())
{
$title=$row[1];
//显示新闻标题以及网页链接
if(strlen($title)>29)//设置公告标题显示长度
{
$title=substr($title,0,29);
?><a href="BulletinView.php?id=<?PHP echo($row[0]); ?>" onClick="return BulletinWin(this.href)";target=_blank><?PHP echo $title; ?>......</a>
<?PHP }
else
{
?>
<a href="BulletinView.php?id=<?PHP echo($row[0]); ?>" onClick="return BulletinWin(this.href)";target=_blank><?PHP echo($title); ?></a>
<?PHP } // end of else ?><br>
<?PHP } //else of if ?>
<?PHP } // else of for ?>
</td>
</tr>
<?PHP
if(!$exist)
{
?>
<tr>
<td width="100%" height="70" bgcolor="#E1F5FF">暂且没有公告 </td>
</tr>
<?PHP }
include('Class\Users.php');
//从Session变量中读取注册用户信息,并连接到数据库验证
$objUser = new Users();
@$UserId=trim($_SESSION["user_id"]);
@$Pwd=trim($_SESSION["user_pwd"]);
//连接数据库,进行身份验证
$objUser->GetUsersInfo($UserId);
$_SESSION["user_name"]=$objUser->Name;
if($UserId!="" && $objUser->UserPwd==$Pwd)
{
?>
<tr>
<td width="100%" bgcolor="#97DDFF" height="18" align="center">用户信息</td>
</tr>
<tr>
<td width="100%" height="18" bgcolor="#E1F5FF">
<table border="0" cellspacing="1" width="100%">
<tr>
<td width="100%" bgcolor="#E1F5FF">用户名:<?PHP echo($objUser->UserId); ?><br>地址:
<?PHP echo($objUser->Address); ?><br>
E-mail:<?PHP echo($objUser->Email); ?><Br>电话:<?PHP echo($objUser->Telephone); ?>
</td>
</tr>
<tr>
<td width="100%" align="center" bgcolor="#E1F5FF">
<a href='user\UserView.php?uid=<?PHP echo($objUser->UserId); ?>' target="_blank">我的商品</a>
<a href="LoginExit.php" onclick="return newswin(this.href)">退出登录</a>
<a href='user\PwdChange.php?uid=<?PHP echo($objUser->UserId); ?>' >修改密码</a>
</td>
</tr>
</table>
</td>
</tr>
<?PHP }
else
{
?>
<tr>
<td width="100%" bgcolor="#97DDFF" height="24" align="center">用户登录</td>
</tr>
<tr>
<td width="100%" height="18" bgcolor="#E1F5FF">
<table border="0" cellspacing="1" height="58">
<tr>
<td width="100%" bgcolor="#E1F5FF" height="35">
<form method="POST" action="putSession.php">
用户名:
<input type="text" name="loginname" size="18" value="">
<br>密 码:
<input type="password" name="password" size="18" value="">
<br><br> <input type="submit" value="确定" name="B1">
<a href="user/UserAdd.php" target=_blank>用户注册</a>
</form>
</td>
</tr>
</table>
</td>
</tr>
<?PHP } ?>
</table>
<table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolorlight="#FF9933" bordercolordark="#FFFFFF" bgcolor="#FFFFFF">
<tr>
<td bgcolor="#97DDFF" height="24" align="center">最被关注商品 TOP
10</td>
</tr>
<tr>
<td bgcolor="#E1F5FF"><table border="0" width="100%" cellspacing="0" bordercolorlight="#FF9933" bordercolordark="#FFFFFF">
<tr>
<td width="100%" height="37" bgcolor="#E1F5FF">
<?PHP
include('Class\Goods.php');
$objGoods = new Goods();
//查询前10个点击次数(ClickTimes)最多的\未结束的商品信息
$results = $objGoods->GetTopnMaxClick(10);
$exist = false;
//如果结果集为空,则显示提示信息
//依次显示结果集中的商品信息
while($row = $results->fetch_row())
{
$exist = true;
?>
<a href="GoodsView.php?gid=<?PHP echo($row[0]); ?>" target="_blank"><?PHP echo($row[3]); ?></a> (浏览<font color="red"><?PHP echo($row[16]); ?></font>次)<br />
<?PHP
}
if (!$exist)
{
print "暂且没有商品";
}
?></td>
</tr>
</table></td>
</tr>
<tr>
<td width="100%" bgcolor="#97DDFF" height="24" align="center">最新活跃卖家 TOP 10</td>
</tr>
<tr>
<td width="100%" valign=top height="52" bgcolor="#E1F5FF">
<table border="0" cellspacing="0" bordercolorlight="#FF9933" bordercolordark="#FFFFFF" bgcolor="#FFFFFF">
<tr>
<td width="100%" bgcolor="#E1F5FF">
<?PHP
//获取发布商品最多的用户
$objUser = new Users();
$results = $objUser->GetTopnActiveUser(10);
$exist = false;
//使用循环语句,依次显示分类信息
while($row = $results->fetch_row())
{
$exist = true;
?>
<a href="user\UserView.php?uid=<?PHP echo($row[0]); ?>" target=_blank><?PHP echo($row[1]); ?></a>(<font color=red>
<?PHP echo($row[2]); ?>
</font>件)<br>
<?PHP
}
//如果结果集为空,则显示提示信息
if(!$exist)
{
print "暂且没有用户信息";
}
?> </td>
</tr>
</table> </td>
</tr>
</table>
</body>
</html>
- 1
- 2
前往页