<!--#include file="top_m.asp" -->
<!--#include file="checkuserflag.asp"-->
<%call CheckUserFlag("34")

Set ObjDCW = Server.CreateObject("dc_data100_v1_0.C_A_Config") 

selAnnounce=request.form("selAnnounce")'删除记录
if not isempty(selAnnounce) then
   aaa=ObjDCW.del_record(DataPathFile,"A_Manage_Department","A_M_D_ID",selAnnounce)
end if

dim totalPut'总记录数
maxperpage=10'每页最大数
dim CurrentPage'当前页
dim i,j
if not isempty(request("page")) then
   currentPage=cint(request("page"))
else
   currentPage=1
end if

dim D_data

department=ObjDCW.read_record(D_data,DataPathFile,"A_Manage_Department","A_M_D_ID,A_M_D_Name,A_M_D_Manager,A_M_D_Exp"," where A_M_D_company_id="&Session("DC_Manage_CompanyID")&" order by A_M_D_ID")'读出记录,结果保存在D_data数组中

if department=0 then 
   response.write "<p align='center'>对不起，没有您要查询的信息</p>" 
elseif department=1 then
	totalput = UBound(D_data)'总记录数
	aaa=ObjDCW.setpage(D_data,totalput,maxperpage,currentPage,Num_b,Num_o)'设置分页
	showContent totalput,MaxPerPage,currentPage,Num_b,Num_o
end if 

function showContent(totalput,MaxPerPage,currentPage_s,Num_b_s,Num_o_s)
%>
<br>
<Form name="d_form" method="POST" action="department_list.asp">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
 <tr height=25>
   <td align="left" class="f11">部门管理(点击部门名称进行相应操作)--</td>
   <td align="right"><a href="department_add.asp" target="_self"><font color=#ff0000>添加部门</font></a></td>
 </tr>
</table>
<table width="96%" border=0 align="center" cellPadding=4 cellSpacing=1>
  <tr height=28 bgcolor="#99ccff"> 
    <td width="8%" align="center">ID号</td>
    <td width="18%" align="center">部门名称</td>
    <td width="14%" align="center">负责人</td>
    <td width="52%">说明</td>
    <td width="8%" align="center"><input type='submit' value='删除' class="smallInput"></td>
  </tr>
<%	for i=Num_b_s to Num_o_s step 1
		department_record=D_data(i)
		rs_record=split(department_record,",")
%>
  <tr height="28" bgcolor="#ffffff"> 
    <td width="8%"  align="center"><font face="Arial"><b><%=rs_record(0)%></b></font></td>
    <td width="18%" align="center"><a href="department_update.asp?id=<%=rs_record(0)%>"><%=rs_record(1)%></a></td>
    <td width="14%" align="center"><%=rs_record(2)%></td>
    <td width="52%" align="left"><%=rs_record(3)%></td>
    <td width="8%" align="center"><input class="smallInput" type='checkbox' name='selAnnounce' value='<%=cstr(rs_record(0))%>'></td>
  </tr>
 <%  next
 %>
<tr><td colspan="6" height="23" bgcolor="#e8f4ff"><%ObjDCW.showpage totalput,MaxPerPage,"department_list.asp",currentPage_s%></td></tr>
</table>
<%
end function
%>