<!-- #include file="../conn.asp" -->
<!-- #include file="../const.asp" -->
<%call chksunzom()
if instr(quanxs,"x5t")<=0 then call sunzomqx()
bid=chk0(requestA("bid"))
%>
<html>
<head>
<title><%=dianming%> - 部门管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/sunzom.css" rel="stylesheet" type="text/css">

<script>
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++)    {
    var e = form.elements[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked; 
   }
  }
</script>
</HEAD>
<BODY>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>
<td><img src="../images/r_1.gif" alt="" /></td>
<td width="100%" background="../images/r_0.gif">
  <table cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>&nbsp;修改 / 删除单位/部门</td>
	  <td align="right"><%if instr(quanxs,"zxtj")>0 then%><input type="button" value="添加部门" onClick="window.location.href='zu_add.asp'" class="button"><%end if%>&nbsp;</td>
    </tr>
  </table>
</td>
<td><img src="../images/r_2.gif" alt="" /></td>
</tr>
<tr>
<td></td>
<td>
<form name="form1" action="zu_del.asp">
<table align="center" cellpadding="4" class="toptable" border="1">
  <tr align="center">
    <td height="30" class="category" width="60%">单位/部门名称(点击修改)&nbsp; （zu_login|zu）</td>
   
	<td class="category">展开</td>
	<td class="category">排序</td>
	 <%if instr(quanxs,"xxtg")>0 then%><td class="category">修改</td>
	<%end if%>
	<%if instr(quanxs,"sxtc")>0 then%>
    <td class="category">删除</td>
	<%end if%>
  </tr>
  <%
  if bid>0 then
  sql="select * from zu_login where bid="&bid&" order by zupx desc,id asc"
  else
  sql="select * from zu_login where bid=0 order by zupx desc,id asc"
  end if
  set rs_zu=conn.execute(sql)
  do while rs_zu.eof=false
  zid=rs_zu("id")
  %>
  <tr onMouseOver="this.className='highlight'" onMouseOut="this.className=''">
    <td height="25"><img border="0" src="../images/folder_close.gif"><b><a href="zu_add.asp?chk=edit&id=<%=zid%>"><%=rs_zu("zu")%></a></b>  
    (<%sql="select * from zu_login where bid="&zid&" order by zupx desc,id asc" 
set rsx2 =server.createobject("ADODB.RecordSet")	  
rsx2.open sql,conn,1,3
if not rsx2.eof then
do while not rsx2.eof
Response.Write "<a title=""点击修改"" href=""zu_add.asp?chk=edit&id="&rsx2("id")&""">"&rsx2("zu")&"</a>,"
rsx2.movenext
loop
else
Response.Write "暂无下级"
end if
rsx2.close:set rsx2=nothing
 %>)
    
    </td>
	<td align="center"><a href="zu.asp?bid=<%=zid%>">&gt;&gt;&gt;</a></td>    
	<td align="center"><%=rs_zu("zupx")%></td>    <%if instr(quanxs,"xxtg")>0 then%>
	<td align="center"><input onclick="location.href='zu_add.asp?chk=edit&id=<%=rs_zu("id")%>'" value="修改"  type=button name="moren"> <input onclick="location.href='zu_add.asp?zuid=<%=rs_zu("id")%>'" value="添加下级"  type=button name="moren"></td>
	<%end if%>
	<%if instr(quanxs,"sxtc")>0 then%>
    <td align="center"><input type="checkbox" name="ID" value="<%=rs_zu("id")%>" style="border:0"></td>
	<%end if%>
  </tr>
  <%
    rs_zu.movenext
  loop
  %>
  <tr>
    <td colspan="5" height="30" class="category">
	<table cellpadding=0 cellspacing=0 width="100%">
	<tr>
	<td align="left" style="color:#FF0000;">　</td>  
	<td align="right">
    <%if instr(quanxs,"sxtc")>0 then%>
	<input name="chkall" type="checkbox" id="chkall" value="select" onClick="CheckAll(this.form)" style="border:0"> 全选
	<input type="submit" value="删 除" class="button" onClick="return confirm('将同时删除此部门下的所有员工！！！请慎重！！！\n\n确定要删除此部门吗？')">
	<%end if%>
  </td>
  </tr></table></td></tr>   
</table>
</form>
</td>
<td></td>
</tr>
<tr>
<td><img src="../images/r_4.gif" alt="" /></td>
<td></td>
<td><img src="../images/r_3.gif" alt="" /></td>
</tr>
</table>
</body>
</html>