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

📄 zbap_add.asp

📁 具有计划、任务、通告、公文、员工档案、等网络办公功能
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
oabusyname=request.cookies("oabusyname")
oabusyusername=request.cookies("oabusyusername")
oabusyuserdept=request.cookies("oabusyuserdept")
oabusyuserlevel=request.cookies("oabusyuserlevel")
if oabusyusername="" then 
	response.write("<script language=""javascript"">")
	response.write("window.top.location.href='../../default.asp';")
	response.write("</script>")
	response.end
end if
%>
<%
set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("adodb.recordset")
sql="select * from userinf where username='" & oabusyusername&"'"
rs.open sql,conn,1
allow_manage_docstoreroom=rs("allow_manage_docstoreroom")    
conn.close
set conn=nothing
set rs=nothing
if allow_manage_docstoreroom<>"yes" then
response.write("<font color=red size=""+1"">对不起,需要档案卷宗权限!</font>")
	response.end
	end if
%>
<!--#include file="islogin.asp"-->
<%

Response.Expires =0
dim sql,ors,page,count,shuMu,duty_id,duty_name,note,id,arrWp(),relname
dim strUrl

duty_id=Request.QueryString ("duty_id")
call get_recordset(ors)
connect_db()

select case Request.Form ("action")
case "add_qj":
	sql="select * from tb_duty_info where id is null"	
	ors.Open sql,conn,1,2
	ors.addnew
	ors("Duty_name")=trim(Request.Form ("Duty_name"))
	ors("note")=trim(Request.Form ("note"))
	ors("type")=0	
	ors.update()
	ors.close()
	Response.Redirect "zbap_add.asp"
case "add_ap":	
	sql="select * from tb_duty_info where id is null"	
	ors.Open sql,conn,1,2
	ors.addnew
	ors("Duty_name")=trim(Request.Form ("Duty_name"))
	ors("Duty_id")=duty_id
	ors("Department")=trim(Request.Form ("Department"))
	ors("Start_time")=trim(Request.Form ("Start_time"))	
	ors("end_time")=trim(Request.Form ("end_time"))
	ors("liaison")=trim(Request.Form ("liaison"))
	ors("type")=1
	ors.update()
	ors.close()
	Response.Redirect "zbap_add.asp"
case "modify_duty":
	id=Request.Form ("id")
	sql="select * from tb_duty_info where id ="&id
	ors.Open sql,conn,1,2
	
	ors("Duty_name")=trim(Request.Form ("Duty_name"))
	'ors("Duty_id")=duty_id
	ors("Department")=trim(Request.Form ("Department"))
	ors("Start_time")=trim(Request.Form ("Start_time"))	
	ors("end_time")=trim(Request.Form ("end_time"))
	ors("liaison")=trim(Request.Form ("liaison"))
	'ors("type")=1
	ors.update()
	ors.close()
	Response.Redirect "zbap_add.asp"
case "delete_doc":
	conn.BeginTrans
	dim choice_temp
	
    for each choice_temp in Request.Form("choice_id")		
		sql = "delete from tb_duty_info where id="&choice_temp
		
        conn.Execute(sql)                
    next
    conn.CommitTrans
    
    Response.Redirect "zbap_add.asp" 
end select
sql="select top 1 id,duty_name,note 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")
	duty_name=ors("duty_name")
	note=ors("note")
end if
ors.close()
set ors=nothing
close_db()	
%>
<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 post_data(num)
{
	var a;
	switch(num)
	{
	case 1:
		a=document.form1;
		a.action.value="add_qj";
		a.Duty_name.value=Trim(a.Duty_name.value);
		a.note.value=Trim(a.note.value);
		if(a.Duty_name.value=="")
		{
			alert("值班期不能为空!");
			a.Duty_name.focus();
			return;
		}
		if(a.note.value=="")
		{
			alert("值班说明不能为空!");
			a.note.focus();
			return;
		}
		a.submit();
		break;
	case 2:
		var a=document.myform;
		if(a.Duty_name.value=="")
		{
			alert("请你选择值班人!");
			return;
		}
		a.Start_time.value=Trim(a.Start_time.value);
		a.End_time.value=Trim(a.End_time.value);
		if(a.Start_time.value=="" || a.End_time.value=="")
		{
			alert("时间安排不能为空!");
			return;
		}
		if(!chkdate(a.Start_time.value) || !chkdate(a.End_time.value))
		{
			alert("请正确输入日期格式!");
			return;
		}
		a.submit();
		break;
	}
}
function add_wp_show()
{		
	window.form_hidden.style .display="block";
	document.myform .reset();
	document.myform .action .value ="add_ap";
	document.myform .id .value ="";	
}
function modify_show()
{
	window.form_hidden.style .display="none";
	
	var a=document.form3 ;
	var count=select_count(a);
		
	if(count<0)
		return ;
	if(count==0)
	{		
		alert("请你选择要修改的文件!");
		return ;
	}
	if(count>1)
	{
		alert("只能选择一个进行修改!");
		return;
	}
	var b=document.myform ;
	b.action.value="modify_duty";
	var id;
	id=get_select_value(a);
	var nIndex = a.duty_value.length;
	var str;
	var arrStr;
	
	for(var i=0;i<nIndex;i++)
	{
		str=a.duty_value.options[i].value;
		arrStr=str.split(String.fromCharCode (27))
		if(arrStr[0]==id)
		{
			b.id.value=id;
			b.Duty_name.value=arrStr[1];
			b.Department.value=arrStr[2];
			b.Start_time.value=arrStr[3];
			b.End_time.value=arrStr[4];
			b.liaison.value=arrStr[5];
			b.show_Duty_name.value=arrStr[6];
			break;
		}
	}
	window.form_hidden.style .display="block";
}
function select_all()
{	
	window.form_hidden.style .display="none";
	var isselect,v;
	var a=document.form3 ;
	
	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)

⌨️ 快捷键说明

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