<?php
/***********  添加成功显示的信息  ***********/
if ($action == 'yes') {
	print <<<EOT

本次操作成功!

EOT;
	exit;
}



//管理员列表
elseif ($action == 'admin') {
	print <<<EOT
	
	<table border="1" >

	<tr  align="center">
<td width="150"> ID </td><td width="400"> 用户名称 </td><td width="60"> 管理组 </td><td width="60" > 功能 </td> 
</tr>
EOT;
	while( $admin = $adminset->FetchRow()) {
		$a_id = $admin['a_id'];
		$u_id = $admin['u_id'];
		$u_name = $admin['u_name'];
		foreach ($group_id['admin'] as $k => $v){
			$k == $admin['groupid'] && $group_name = $v;
		}
		print <<<EOT
<tr  align="center">
<td> $u_id  </td>
<td> $u_name  </td>
<td> $group_name  </td>
<td>	<a href="?action=upadmin&id=$a_id&uid=$u_id">修改</a>  </td>
<td>	<a href="javascript:if(confirm(' 确定删除? ')){location='?action=admin&type=del&id=$a_id';}">删除</a>  </td>
	</tr>	
EOT;
}

print <<<EOT
</table>
EOT;
}

//修改管理
elseif ($action == 'upadmin') {
	InitGP(array('id','uid',));
	foreach ($group_id['admin'] as $ks => $vs){
		$group_select .= '<option value="'.$ks.'">'.$vs.'</option> ';
	}
	print <<<EOT

<form action="?action=up_admin" enctype="multipart/form-data" method="POST" >
用户  I D :<input type="text" name="admin_id" size="10" value="$id" >  <br><br>
<input type="hidden" name="uid" size="10" value="$uid" >
用户权限:
<select name="group_select" size="4"> 
$group_select
</select> 
<br><br>
<input type="submit" value=" 修 改 "> 
</form>

EOT;
}
//添加管理
elseif ($action == 'addadmin') {
	foreach ($group_id['admin'] as $ks => $vs){
		$group_select .= '<option value="'.$ks.'">'.$vs.'</option> ';
	}
	print <<<EOT

<form action="?action=addadmin&type=up" enctype="multipart/form-data" method="POST" >
用户  I D :<input type="text" name="admin_id" size="10" >  <br><br>
用户权限:
<select name="group_select" size="4"> 
$group_select
</select> 
<br><br>
<input type="submit" value="提 交"> 
<input type="reset" value="重 置"> 
</form>

EOT;
}

//以上如果都不匹配
elseif ($action == 'user') {
	print <<<EOT



EOT;
}

//以上如果都不匹配
elseif ($action == 'web') {
	print <<<EOT



EOT;
}
?>
