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

📄 zbjl.asp

📁 具有计划、任务、通告、公文、员工档案、等网络办公功能
💻 ASP
字号:
<!--#include file="islogin.asp"-->
<%

Response.Expires =0
dim sql,ors,page,count,shuMu,posttime,duty_msg,name,duty_id,all_duty_user
dim strUrl
call get_recordset(ors)
connect_db()
if Request.Form ("action")="delete_doc" then
	conn.BeginTrans
	dim choice_temp
	
    for each choice_temp in Request.Form("choice_id")
		sql = "delete from tb_duty_msg where id="&choice_temp
		
        conn.Execute(sql)                
    next
    conn.CommitTrans   
    if Err.number <> 0 then
	%>
		<script language="javascript">
		<!--			
			alert("删除失败,删除库时发生错误!");
			window.history.back(); 						
		-->
		</script>
	<%	
	else
		Response.Redirect("zbjl.asp")
	end if
end if

sql="select top 1 id from tb_duty_info where type=0 order by id desc"
ors.Open sql,conn,1,1
if not ors.EOF then
	duty_id=ors("id")
end if
ors.close()


if duty_id<>"" then
	sql="select duty_name from tb_duty_info where type=1 and duty_id="&duty_id
	ors.Open sql,conn,1,1

	all_duty_user=""
	while not ors.EOF
		if all_duty_user="" then
			all_duty_user=ors("duty_name")
		else
			all_duty_user=all_duty_user&chr(27)&ors("duty_name")
		end if
		ors.MoveNext
	wend
	ors.close()
end if
set ors=nothing

close_db()
if all_duty_user="" then
	call deal_msg("值班安排",0,"系统提示:你没有被安排值班,不能添加值班记录!")
elseif instr(all_duty_user,oabusyusername)=0 then
	call deal_msg("值班安排",0,"系统提示:你没有被安排值班,不能添加值班记录!")
end if

%>
<html>
<head>
<title>WEBOA</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript" src="style.js"></script>
<script language="javascript" src="myfunction.js"></script>
<script language="javascript">
function page_check(a)
{//验证转页的条件
	a.page.value =  Trim(a.page .value);
	if(!a.page.value)
	{//检查是否有输入
		alert("请输入要转到的页数!");
		a.page.focus();
		return false;
	}
	else
	{
		if(!fucCheckNum(a.page.value))
			{//检查是否是数字
				alert("页数必须是数字!");
			    a.page.value = "";
			    a.page.focus();
			    return false;
			}
	}
	return true;
}

function go_page()
{//如果验证条件成立,则转到相应的页面
	var a=document.form1;
	if(page_check(a))
	{
		a.submit();
	}
}
function select_all()
{	
	var isselect,v;
	var a=document.myform ;
	
	if(!a.choice_id)
		return;
		
	isselect=a.isselect.value;
	
	if(isselect=="false")
		v=true;
	else
		v=false;
	
	if(!a.choice_id.length)
	{
		a.choice_id.checked=v;
	}
	else
	{
		for(var i=0;i<parseInt(a.choice_id.length);i++)
		{		
			a.choice_id(i).checked=v;
		}	
	}
	if(v)
		a.isselect.value="true";
	else
		a.isselect.value="false";
	return;
}

function select_count(a)
{//计算有多少条记录被选中
	var choice_count;
	choice_count=0;
	if(!a.choice_id)
		return -1;	
	if(!a.choice_id.length)
	{		
		if(a.choice_id.checked==true)
			choice_count++;
	}
	else
	{		
		for(var i=0;i<parseInt(a.choice_id.length);i++)
		{		
			if(a.choice_id(i).checked==true)
			{
				choice_count++;				
			}
		}	
	}
	return choice_count;
}

function get_select_value(a)
{//取要修改记录的唯一标志
	var choice_count,strValue;
	choice_count=0;
	strValue="";
	if(!a.choice_id)
		return strValue;
	if(!a.choice_id.length)
	{		
		if(a.choice_id.checked==true)
			strValue=a.choice_id.value;
		
	}
	else
	{		
		for(var i=0;i<parseInt(a.choice_id.length);i++)
		{		
			if(a.choice_id(i).checked==true)
			{
					strValue=a.choice_id(i).value;
					break;
			}
		}	
	}
	return strValue;
}

function delete_check(a)
{//验证删除的条件
	var b;
	b=select_count(a);
	if(b<0)
		return false;
	if(b==0)
	{		
		alert("请你选择要删除的文件!");
		return false;
	}
	return true;
}

function delete_doc()
{  //如果验证条件成立,则删除所选定的邮件
	var a=document.myform;
	if(delete_check(a))
	{	
		a.action.value="delete_doc";	
		a.submit();
	}
}
function edit_check(a)
{//验证删除的条件
	var b;
	b=select_count(a);
	
	if(b<0)
		return false;
	if(b==0)
	{		
		alert("请你选择要修改的文件!");
		return false;
	}
	if(b>1)
	{		
		alert("你只能选择一条进行修改!");
		return false;
	}
	return true;
}
function edit_doc()
{  //如果验证条件成立,则修改所选定的记录
	var a=document.myform;
	if(edit_check(a))
	{	
		window.location="zbjl_add.asp?id="+get_select_value(a);
	}
}
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="3" topmargin="0">
<table width="15%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="9"><img src="../images/left_1.gif" width="9" height="24"></td>
    <td bgcolor="#F7941d" align="center" nowrap><font color="#FFFFFF">值班记录</font></td>
    <td align="right" width="9"><img src="../images/right_1.gif" width="9" height="24"></td>
  </tr>
</table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td bgcolor="#0099FF">
      <table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
        <form action="zbjl.asp" method="post" name="myform">
        <tr bgcolor="#ffffff"> 
          <td height="20" align="center" width="67%">值班情况</td>
          <td height="20" align="center" width="17%">时间</td>
          <td height="20" align="center" width="9%">值班人</td>
          <td height="20" align="center" width="7%">选择
			<input type="hidden" name="action" value="">
			<input type="hidden" name="isselect" value="false">	
		  </td>
        </tr>
        
        <%
			 
			 if  duty_id<>"" then
				 page = trim(Request("page"))
				if page="" then
					page = 1
				end if
				page=cint(page)
														
				if page<=0 then
					page=1
				end if
				shuMu = 12
				 sql ="select id,Duty_msg,name,posttime from tb_duty_msg where duty_id="&duty_id&" order by posttime desc"
			 
				 'Response.Write sql
				 'Response.End 
				 connect_db()
				 call get_recordset(ors)
				 ors.open sql,conn,1,1
				 if not ors.EOF then
					ors.PageSize = shuMu
					count=ors.PageCount
					if page>count then
						page = count
					end if
					ors.Move ((page-1)*shuMu)
					while not ors.EOF and shuMu>=1
					name=get_name(ors("name"))						
				%>
        <tr> 
        
            <td bgcolor="#EFEFEF" height="20" width="67%"><a href="zbjl_show.asp?id=<%=ors("id")%>"><%=split_str(ors("Duty_msg"),45,45)%></a></td>
          <td bgcolor="#EFEFEF" height="20" align="center" width="17%"><%=ors("posttime")%></td>
          <td bgcolor="#EFEFEF" height="20" align="center" width="9%"><%=split_str(name,3,3)%></td>
            <td bgcolor="#EFEFEF" height="20" align="center" width="7%">
			  <%			  
			  if trim(ors("name"))=oabusyusername then
			  %>
              <input type="checkbox" name="choice_id" value="<%=ors("id")%>">
              <%end if%>
          </td>
        </tr>
        <%
						shuMu=shuMu-1
						ors.MoveNext()
						wend								
				end if
				ors.close()
				set ors=nothing
				close_db()
			end if
			%>		
		</form>
        <tr align="right"> 
          <form action="zbjl.asp" method="post" name="form1">
            <td bgcolor="#FFFFFF" height="20" colspan="4" class="F1"> 
              <%if page>1 and count >1 then%>
              <a href="zbjl.asp?page=<%=page-1%>">上一页</a> 
              <%else%>
              上一页 
              <%end if%>
              | 
              <%if page<count then%>
              <a href="zbjl.asp?page=<%=page+1%>">下一页</a> 
              <%else%>
              下一页 
              <%end if%>
              | <%=page%>/<%=count%>页 | 第 
              <input class="flat1b" name="page" size="2" value="<%=page%>">
              页<a href="#" onClick="go_page();return false;"><img src="../images/go.gif" width="21" height="21" align="absmiddle" border="0"></a></td>
          </form>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" align="right">
  <tr> 
    <td height="23" class="F1" width="9"><img src="../images/left_3.gif" width="9" height="23"></td>
    <td background="../images/bg_1.gif" class="F1" height="23"> 
      <table width="300" border="0" cellspacing="0" cellpadding="0">
        <tr align="center"> 
          <td><a href="#" onClick="javascript:select_all();return false;">全选</a></td>
          <td><a href="#" onClick="delete_doc();return false;">删除</a></td>
          <td><a href="#" onClick="edit_doc();return false;">修改</a></td>
          <td>
		  <%
		  if duty_id<>"" then
		  %><a href="zbjl_add.asp?duty_id=<%=duty_id%>">增加</a>
		  <%
		  else
		  %>
		  增加
		  <%
		  end if
		  %>
		  </td>
        </tr>
      </table>
    </td>
    <td align="right" class="F1" height="23" width="9"><img src="../images/right_3.gif" width="9" height="23"></td>
  </tr>
</table>
<br>
</body>
</html>

⌨️ 快捷键说明

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