⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plan_list.asp

📁 OFFICE办公自动化
💻 ASP
字号:
<%
'功能:查看所有日程
'参数:	request("page")=int #当前页码; request("selectdate")="date" #显示当日日程
'	request("userid")="int" #日程填写人ID; request("DepartmentID")="int" #部门ID; 
%>

<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->

<%
'response.buffer=false
'------------------------------------------------设置参数
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '当前用户ID
UserID=request("userid") '日程填写人ID
maxmessage=15 '每页显示记录数
currentpage=request("page") '当前页码
selectdate=request("selectdate") '是否显示所有日程
DepartmentID=request("DepartmentID") '部门ID; 
'------------------------------------------------
'------------------------------------------------取记录
'取用户信息 (返回rs_user对象)
'
set rs_user=Server.CreateObject("ADODB.RecordSet")
sql="select * from vioaUser where ID="&LoginID
rs_user.open sql,oConn,1,1
'------------------------------------------------
if not returnqx("0106") or DepartmentID="" then UserID=LoginID '如果没有指定查看部门或没有查看权限则只能看自己的
'------------------------------------------------取记录
'分页取日程记录 (返回rs对象)
'rs.recordcount 为记录总数
'rs.PageSize 为本页记录数
'(StartDate < DATEADD(dd, 1, '2004-10-18'))
Search="WHERE "
if DepartmentID<>"" then	Search = Search & "DepartmentID='" & DepartmentID & "' and "
if selectdate<>""   then	Search = Search & "StartDate<DATEADD(dd, 1, '"&selectdate&"') and EndDate>='"&selectdate&"' and "
if UserID<>""    then	Search = Search & "UserID='" & UserID & "' and "
Search=Search & "1=1"

set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from vioaPlan "&Search&" order by ID desc"
'response.write sql
rs.open sql,oConn,1,1
Showpage=Paging(rs,maxmessage,currentpage,"selectdate="&selectdate&"&DepartmentID="&DepartmentID)
'------------------------------------------------
%>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/main.css" type=text/css>
<title>main</title>
<base target="FrmMain">
</head>

<body topmargin="10" leftmargin="10">

<!--#include file="plan_menu.html"-->

<hr width="100%" size=1 color="#000000">
<table width="550" height="22" border=0 cellspacing="0" cellpadding="0">
<form name="eventfrm" method="Post" action="plan_list.asp?selectdate=<%=SelectDate%>" onSubmit='if (this.DepartmentID.value=="") {alert("请选择部门!"); this.DepartmentID.focus(); return false}'>
  <tr>
    <td width=90><img border="0" src="../images/icon_user.gif" align="left"><a href="plan_list.asp?selectdate=<%=SelectDate%>">我的日程</td>
<%if (returnqx("0106")) then%>
    <td width=100><img border="0" src="../images/icon_list.gif" align="left"><a href="plan_list.asp?DepartmentID=<%=rs_user("Department")%>&selectdate=<%=SelectDate%>">本部门日程</td>
    <td width=100><img border="0" src="../images/icon_users.gif" align="left"><a href="#" onclick="javascript:if (selectdepartment.style.display=='none')selectdepartment.style.display=''; else selectdepartment.style.display='none'; return false;" onfocus="this.blur()">下属部门日程</td>
    <td width=260>
      <div id="selectdepartment" style="display:none">←
        选择部门:
	<select name="DepartmentID" size=1  class="input" style="WIDTH:135; background-color: #F0F0F0">
	<%
	Function ListDepartment(ParentID,Heads)
	set rs_department=Server.CreateObject("ADODB.RecordSet")
	sql="select * from tbioaDepartment where ParentID="& ParentID &" order by ID"
	rs_department.open sql,oConn,1,1
	while not rs_department.EOF '循环
		response.write "<option value='"&rs_department("ID")&"'>"& Heads & rs_department("Name")&"</option>"
		Call ListDepartment(rs_department("ID"),Heads&"·")
	rs_department.MoveNext: wend
	rs_department.close
	End Function
	Call ListDepartment(rs_user("Department"),"")
	%>
	</select>
        <input type="submit" value="查看" style="height: 17" class="button0" onmouseout=className="button0" onmouseover=className="button1">
      </div>
    </td>
<%end if%>
  </tr></form>
</table>

<hr width="100%" size=1 color="#000000">
<%if selectdate<>"" then response.write "查看日期:("&selectdate&") "%>
<%=Showpage%>
<br><br>
<%
if rs.RecordCount=0 then
	response.write "<BR><BR>暂时为空!"
else
%>

<table width="100%" cellspacing="1" cellpadding="2" class="tab">
  <tr>
    <%if UserID="" then%><td class="tdTop" width="68">填写人</td><%end if%>
    <td class="tdTop">日程标题</td>
    <td class="tdTop" width="68">开始日期</td>
    <td class="tdTop" width="68">结束日期</td>
    <td class="tdTop" width="68">重要程度</td>
    <td class="tdTop" width="68">完成情况</td>
    <td class="tdTop" colspan="3" width="100">相关操作</td>
  </tr>
<%for i = 0 to rs.PageSize-1 '循环
   If rs.EOF Then Exit For
   if i mod 2 = 0 then td_class="td1" else td_class="td2"
%>
  <tr>
    <%if UserID="" then%><td class="<%=td_class%>"><%=HtmlOut(rs("UserName"))%></td><%end if%>
    <td class="<%=td_class%>"><%=HtmlOut(rs("Title"))%></td>
    <td class="<%=td_class%>"><%=rs("StartDate")%></td>
    <td class="<%=td_class%>"><%=rs("EndDate")%></td>
    <td class="<%=td_class%>">
<%
	Select Case rs("Importance")
	   Case 1
	      Importance="<font color=#aaaaaa>低</font>"
	   Case 2
	      Importance="中"
	   Case 3
	      Importance="<font color=#ff0000><b>高</b></font>"
	   Case Else
	      Importance="未指定"
	End Select
%>
     <%=Importance%>
    </td>
    <td class="<%=td_class%>"><%=rs("Finish")%>%</td>
    <td class="<%=td_class%>" width="50">
      <img border="0" src="../images/icon_show.gif" align="left">
      <a href="plan_show.asp?id=<%=rs("ID")%>&page=<%=currentpage%>&selectdate=<%=selectdate%>&DepartmentID=<%=DepartmentID%>">查看</a>
   </td>
<%if UserID = LoginID then%>
    <td class="<%=td_class%>" width="50">
      <img border="0" src="../images/icon_edit.gif" align="left">  
      <a href="plan_edit.asp?id=<%=rs("ID")%>&page=<%=currentpage%>&selectdate=<%=selectdate%>">编辑</a>
    </td>
    <td class="<%=td_class%>" width="50">
      <img border="0" src="../images/icon_dele.gif" align="left">
      <a href="plan_dele.asp?id=<%=rs("ID")%>&page=<%=currentpage%>&selectdate=<%=selectdate%>" onClick="return confirm('确定要删除该条日程吗?\n该操作不可恢复!')">删除</a>
   </td>
<%end if%>
  </tr>
<%
rs.MoveNext
next
%>
</table>

<%
end if
rs.close
%>

</body>

</html>

<%'释放对象变量
oConn.close
%> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -