<?php
//连接数据库
include "../userManage/include/dbConn.php";
$sql="select * from user";
$a=mysql_query($sql);
?>
<html>
<head>
<link rel="stylesheet" href="inc/css.css" type="text/css" />
<META http-equiv=Content-Type content="text/html; charset=utf-8">
</head>
<body>
//建表
<form name="form1" method="post" action="">
<table width="1052" border=0 align=center cellpadding=2 cellspacing=1 bordercolor="#799AE1" class=tableBorder>
<tbody>
<tr>
<th align=center colspan=16 style="height: 23px">竞拍项目管理</th>
</tr>
<tr bgcolor="#DEE5FA">
<td colspan="16" align="center" class=txlrow> </td>
</tr>
<tr align="center" bgcolor="#799AE1">
<td width="6%" align="center" class="txlHeaderBackgroundAlternate">选定</td>
<td width="7%" align="center" class=txlHeaderBackgroundAlternate>用户id</td>
<td width="9%" align="center" class=txlHeaderBackgroundAlternate>用户</td>
<td width="8%" align="center" class=txlHeaderBackgroundAlternate>password</td>
<td align="center" class=txlHeaderBackgroundAlternate>权限</td>
<td colspan="2" align="center" class=txlHeaderBackgroundAlternate类型</td>
</tr>
<?php
while($array=mysql_fetch_array($a)){
?>
//把数据库的信息传到表单里
<tr>
<td><input type="checkbox" name="idlist[]" value="<?php echo $array['id'];?>"></td>
<td><input type="text" name="pid" value="<?php echo $array['id'];?>"></td>
<td><input type="text" name="pusername" value="<?php echo $array['username'];?>"></td>
<td><input type="text" name="ppassword" value="<?php echo $array['password'];?>"></td>
<td><input type="text" name="plimit" value="<?php echo $array['limit'];?>"></td>
<td><input type="text" name="ptype" value="<?php echo $array['type'];?>"></td>
</tr>
<?php
}
?>
<tr bgcolor="#DEE5FA">
<td colspan="16" align=center bgcolor="#DEE5FA" class=txlrow>
<label></label>
<span class="tablebody2">
<input type="button" value="全选" name="Submit2" onClick="selectAll('qx')" />
<input type="button" value="反选" name="Submit2" onClick="selectAll('fx')" />
<input type="button" value="全不选" name="Submit2" onClick="selectAll('qbx')" />
<input type="button" value="添加" name="tianjia">
<input type="button" value="删除" name="shanchu">
<input type="button" value="修改" name="xiugai">
<input type="button" value="查询" name="chaxun">
</span>
<input type="submit" name="ok" value="确定" class="but"></td>
</tr>
<tr bgcolor="#DEE5FA">
<td colspan=16 align=center class=txlrow></td>
</tr>
</tbody></table>
</FORM>
<script language="javascript">
function selectAll(type)
{
var obj=document.getElementsByName("idlist[]");
if(type=='qx'){
for(var i=0;i<obj.length;i++){
obj[i].checked="true";
}
}
if(type=='qbx'){
for(var i=0;i<obj.length;i++){
obj[i].checked="";
}
}
if(type=='fx'){
for(var i=0;i<obj.length;i++){
if(obj[i].checked){
obj[i].checked="";
}else{
obj[i].checked="true";
}
}
}
}
</script>
</BODY>
</HTML>