<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%
ColumnName="":Tablename="HX_SchEduleSort":action=request("action"):WS_SEID=request("WS_SEID")
if WS_SEID<>"" and isnumeric(WS_SEID) then Orderby=" where WS_SEID="&WS_SEID else Orderby=" ORDER BY WS_SEID ASC"
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
WS_SchEduleSortName=WS_S.HX_Replace(request.form("WS_SchEduleSortName"))
WS_OrderBy=WS_S.HX_Replace(request.form("WS_OrderBy"))
select case action
case "addsaveinfo"	   
       msg="添加成功!"
       rs.addnew : rs("WS_SchEduleSortName")=WS_SchEduleSortName:rs("WS_OrderBy")=WS_OrderBy:rs.update
	   call WS_S.SaveAdminLog(LOGINUSERNAME,LogAppointment,msg)
       HX_GoBack msg,"SchEduleSetSort.asp"
case "editsaveinfo"
       msg="修改成功!"
	   rs("WS_SchEduleSortName")=WS_SchEduleSortName:rs("WS_OrderBy")=WS_OrderBy:rs.update
	   call WS_S.SaveAdminLog(LOGINUSERNAME,LogAppointment,msg)
       HX_GoBack msg,"SchEduleSetSort.asp"
case "del"
     msg="删除成功"
     conn.execute("delete * from "&Tablename&" where WS_SEID="&WS_SEID)	
	 call WS_S.SaveAdminLog(LOGINUSERNAME,LogAppointment,msg) 
	 HX_GoBack msg,"SchEduleSetSort.asp"  
end select
response.write "<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><title>日程设置</title><link rel=stylesheet type=text/css href='../HXinclude/HX_Style.css'></head><body topmargin='20' leftmargin='0' bottommargin='0'><table width='596'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#613c25'><tr><td colspan='2' bgcolor=FFFBE8><table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>日程设置</font></td></tr></table><table width='100%'  border='0' cellspacing='1' cellpadding='3' bgcolor='#FFFBE8'><form name='form1' method='post' action='?action=addsaveinfo'><tr bgcolor='#BF9B73' class='td4'><td width='46%'><div align='center'>日程类别</div></td><td><div align='center'>排 序</div></td><td><div align='center'>操 作</div></td></tr><tr bgcolor='#FFFBE8'><td align='center'><input type='text' name='WS_SchEduleSortName' size='35' value='"&WS_SchEduleSortName&"'></td><td width='33%' align='center'><input type='text' name='WS_OrderBy' size='10' value='"&rs.recordcount+1&"'></td><td width='21%' align='center'><input type='submit' name='Submit' value=' 添 加 '></td></tr></form></table><br><table width='100%'  border='0' cellspacing='1' cellpadding='3' bgcolor='#FFFBE8'><tr bgcolor='#BF9B73' class='td4'><td width='8%'><div align='center'>序　号</div></td><td width='43%'><div align='center'>日程类别</div></td><td><div align='center'>排 序</div></td><td><div align='center'>操 作</div></td></tr>"
   if rs.recordcount<=0 then
	 response.write "<tr><td height=30 align=center colspan=4 bgcolor=FFFBE8>暂无日程类别,请添加</td></tr>"
	else
	rs.PageSize =15 '每页记录条数
	iCount=rs.RecordCount '记录总数
	iPageSize=rs.PageSize
    	maxpage=rs.PageCount 
    	page=request("page")
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    rs.AbsolutePage=Page
	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	i=0
	do while not rs.EOF
	response.write "<form name='form1' method='post' action='?action=editsaveinfo&WS_SEID="&rs("WS_SEID")&"'><tr bgcolor='#FFFBE8'><td align='center'>"&rs("WS_SEID")&"</td><td align='center'><input type='text' name='WS_SchEduleSortName' size='35' value='"&rs("WS_SchEduleSortName")&"'></td><td width='25%' align='center'><input type='text' name='WS_OrderBy' size='10' value='"&rs("WS_OrderBy")&"'></td><td width='24%' align='center'><input type='submit' name='Submit' value=' 修改 '>&nbsp;<input type='button' name='Submit' value=' 删除 ' onclick=""javascript:if(!confirm('是否要删除此类别及其下面的日程！')) return false;else location.href='SchEduleSetSort.asp?action=del&WS_SEID="&rs("WS_SEID")&"';""></td></tr></form>"
    i=i+1
	if i>=rs.PageSize then Exit Do
	rs.movenext
    loop
    WS_S.HX_RSClose rs
    call WS_S.PageControl(iCount,maxpage,page,"border=0 align=right","<p align=right>",4)
  end if
  response.write "</table></td></tr></table>"%>