【php开源代码栏目提醒】:网学会员为广大网友收集整理了,adminent.php,希望对大家有所帮助!
<?php
session_start();
if(1<>$_SESSION['adminlogin'])
{
echo "<script language=
JavaScript>alert('您还未登陆或者超时,请重
登陆!');window.location.href = 'admin.php';</script>";
return;
}
require_once('../com/db.php');
$db = new DataAccess();
$db->connect();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css.css" type="text/css">
<title>企业用户管理</title>
<base target="_self">
</head>
<body vlink="#000000">
<table border="0" width="75%" cellspacing="0" cellpadding="4" bgcolor="#FFFFFF" style="border:0px solid #000000; " height="229">
<tr>
<td height="25" width="100%" colspan="5">
<p align="center"><font size="3" color="#000000"><b>企业用户管理</b></font></td>
</tr>
<tr>
<td height="100%" valign="top" width="709" colspan="5">
<table border="0" cellspacing="0" cellpadding="0" height="24">
<tr>
<td style="border-bottom: 1px dotted #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" width="200" height="25">
<p align="center"><b>帐号</b></td>
<td style="border-bottom: 1px dotted #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" width="200" height="25">
<p align="center"><b>公司名</b></td>
<td style="border-bottom: 1px dotted #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" width="200" height="25">
<p align="center"><b>VIP</b></td>
<td style="border-bottom: 1px dotted #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" width="200" height="25">
<p align="center"><b>锁定</b></td>
<td style="border-bottom: 1px dotted #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" width="200" height="25">
<p align="center"><b>
注册时间</b></td>
</tr>
<?php
$sql = "select fullname,enterprise_id,vip,locked,rdate from enterprise" ;
require_once('../com/page.php');
page($sql,'adminent.php');
echo $pagenav; //输出分页条
$sql = "select fullname,enterprise_id,vip,locked,rdate from enterprise order by rdate desc limit ".$begincount.",".$rows;
$result = $db->query($
sql);
while ($row = mysql_fetch_array($result))
{
?>
<tr>
<td style="border-bottom: 1px dotted #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" width="200" height="25">
<p align="center"><?php echo $row['enterprise_id']; ?></td>
<td style="border-bottom: 1px dotted #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" width="200" height="25">
<p align="center"><?php echo $row['fullname']; ?></td>
<td style="border-bottom: 1px dotted #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" width="200" height="25">
<p align="center"><?php if(1==$row['vip']){ ?><img src="images/yes.bmp"><?php } else{?><img src="images/no.bmp"><?php } ?></td>
<td style="border-bottom: 1px dotted #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" width="200" height="25">
<p align="center"><?php if(1==$row['locked']){ ?><img src="images/yes.bmp"><?php } else{?><img src="images/no.bmp"><?php } ?></td>
<td style="border-bottom: 1px dotted #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" width="200" height="25">
<p align="center"><?php echo $row['rdate']; ?></td>
</tr>
<?php
}
?>
</table>
<table>
<form name="form1" action="" method="post">
<tr>
<td>请选择企业名称:</td>
<td>
<SELECT SIZE='1' NAME='eid'>
<?php
$sql = "select fullname,enterprise_id from enterprise" ;
$result = $db->query($sql); //前面的$row已经执行到尾部,需要重新生成一遍
while($row =
mysql_fetch_array($result))
{
?>
<option value='<?php echo $row['enterprise_id']; ?>'><?php echo $row['fullname']; ?></option>
<?php
}
?>
</SELECT>
</td>
<td>
<p align="center"><input type="button" name="submit1" value="启用/停用VIP" onclick="tosubmit1()"></td> <!--input的name的值不能和onclick中的函数名重复-->
<td>
<p align="center"><input type="button" name="submit2" value="激活/锁定帐号" onclick="tosubmit2()"></td>
<td>
<p align="center"><input type="button" name="submit3" value="删除" onclick="tosubmit3()"></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<?php
$db->close();
?>
</body>
<script language="javascript">
function tosubmit1()
{
document.form1.action="editvip.php";
document.form1.su