kq_jddj_add.asp

来自「OFFICE办公自动化」· ASP 代码 · 共 242 行

ASP
242
字号
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->
<!-- #include file="../inc/pubfun_a.inc" -->

<script language="vbscript" src="..\js\pubfun_a_c.vbs"></script>
<script language="javascript" src="../js/fun_Script.js"></script>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
	<link rel="stylesheet" href="../css/main.css" type=text/css>
	<title>假单登记</title>
	<script language="vbscript">
	<!--
	   '选择职务
	function fun_xzzw()
		dim svalue,sygbh,svalue1
		if frmxx.sqr.value <> "" then
			sygbh = frmxx.sqr.value	
			svalue = popdialog("../inc/pop_xzzw.asp?ygbh=" & sygbh,"300px","300px")
			'msgbox svalue
			if  svalue<> ""then	
			    svalue1 = Split(svalue,vbTab)
			    frmxx.sqzw.value = svalue1(0)
				  frmxx.sqzwmc.value = svalue1(1) & "[" & svalue1(3) & "]"
				  frmxx.sqbm.value = svalue1(2)
			end if
		end if
	end function
    function fun_xzry()
		dim svalue,svalue1
		svalue = popdialog("../inc/pop_xzry.asp","300px","300px")
		if svalue <> "" then
		   
		   svalue1 = Split(svalue,vbTab)
		      if frmxx.sqr.value<>svalue1(0) then
		         frmxx.sqr.value = svalue1(0)
		         frmxx.sqrxm.value = svalue1(1)&"["&svalue1(3)&"]"
		         frmxx.sqbm.value = ""
		         frmxx.sqzw.value = ""
			     frmxx.sqzwmc.value = ""
		         call fun_xzzw
		      end if
		end if
     end function

		sub doSave
			dim ssqzw
			frmxx.yjkssj.value=trim(frmxx.yjkssj.value)
			frmxx.yjjssj.value=trim(frmxx.yjjssj.value)
			frmxx.sqsy.value=trim(frmxx.sqsy.value)			
			if frmxx.jb.value="" then
				msgbox "必须选择假别",vbInformation		,"提示"
				exit sub
			end if
			if not isdate(frmxx.yjkssj.value) then
				msgbox "预计开始时间必须输入日期格式,如" & formatdatetime_activenew(now,"yyyy-mm-dd hh:nn"),vbInformation,"提示"
				frmxx.yjkssj.focus
				exit sub
			end if
			frmxx.yjkssj.value=formatdatetime_activenew(frmxx.yjkssj.value,"yyyy-mm-dd hh:nn")
			if not isdate(frmxx.yjjssj.value) then
				msgbox "预计结束时间必须输入日期格式,如" & formatdatetime_activenew(now,"yyyy-mm-dd hh:nn"),vbInformation,"提示"
				frmxx.yjjssj.focus
				exit sub
			end if
			frmxx.yjjssj.value=formatdatetime_activenew(frmxx.yjjssj.value,"yyyy-mm-dd hh:nn")
			if frmxx.yjjssj.value<frmxx.yjkssj.value then
				msgbox "预计开始时间必须早于预计结束时间",vbInformation,"提示"
				frmxx.yjkssj.focus
				exit sub
			end if
			if frmxx.sqzw.value="" then
				msgbox "必须选择申请职务",vbInformation		,"提示"
				exit sub
			else
				ssqzw =frmxx.sqzw.value									
			end if
			dim strsplj	
			'msgbox "../share/pop_xzsplj.asp?sqzw=" & ssqzw &"&sqbm=" & frmxx.sqbm.value & "&sqlb=08"
			frmxx.bBC.style.display="none"
			frmxx.splc.value=strsplj
			frmxx.sqzw.value = ssqzw
			frmxx.submit
		end sub
		
		function fun_chgzw()
			dim funsqbm
			funsqbm = mid(frmxx.sqzw.value,instr(1,frmxx.sqzw.value,"/")+1)			
			frmxx.sqbm.value = funsqbm
		end function
	//-->	
	</script>
</head>
<body>
<div class="TitleBar">请假单登记</div>
<%
	Response.Expires=0
	Dim rs,ssql,sygbh,ssqxh
	set rs=server.CreateObject("ADODB.recordset")
	sygbh=session("LoginID")
	ssqxh=request("sqxh")
	''''''''检查考勤参数
	rs.Open "select * from kq_csb",oConn,1,1
	if rs.EOf then
		rs.Close
		set rs=nothing
		oConn.close
		set oConn=nothing
		Response.Write "未定义考勤参数"
		Response.End
	end if
	rs.Close
	'''''''返回部门职位名称
	dim init_jb,init_sqsy,init_spqk,init_kssj,init_jssj
	init_jb=""
	init_sqsy=""
	init_spqk=""
	init_kssj=now()
	init_jssj=now()
	if ssqxh<>"" then
	ssql="select * from kq_qjd a,oa_sqjbxx b where a.sqxh=b.sqxh and a.sqxh="&ssqxh
	rs.Open ssql,oConn,1,1
	sygbh=rs("sqr")
	init_jb=rs("jb")
	init_sqsy=rs("sqsy")
	init_spqk=rs("xjyj")
	init_kssj=rs("yjkssj")
	init_jssj=rs("yjjssj")
    rs.Close
    else
    ssqxh=""
	end if
	
	dim init_bmbh,init_zw_str,init_Name,init_bmmc
	init_bmbh = ""
	init_zw_str = ""
	init_bmmc = ""
	sql="Select RoleID,Name from tbioaUser where ID="&sygbh
	set rs=oConn.execute(sql)
	if not rs.eof and not rs.bof then
	  init_zw_str=rs("RoleID")
	  init_Name=rs("Name")
	end if
	if init_zw_str & "" <>"" then
	  init_zw_str1 = split(init_zw_str,",")
	    if UBound(init_zw_str1)>=0 then
		   init_zw = init_zw_str1(0)
	       sql="select A.rolename as zwmc,B.name as bmmc,A.department as bmbh from tbioaRole A,tbioaDepartment B where" _
					& " A.id=" & clng(init_zw) & " and a.department=b.id"
	       set rs=oConn.execute(sql)
	       
	       if not rs.eof and not rs.bof then
				 init_bmbh = rs("bmbh")
				 init_bmmc = rs("bmmc")
	       init_zwmc=rs("zwmc") & "[" & rs("bmmc") & "]"
	       end if
	    end if
	end if 
	rs.close
	
%>
<table class=tab width="480" border=0 align=center cellpadding=2 cellspacing=1>
	<form name="frmxx" id="frmxx" method="post" action="kq_jddj_add_save.asp">
		<input type="hidden" id="splc" name="splc">
		<input type="hidden" id="sqxh" name="sqxh" value=<%=ssqxh%>>
		<tr class=td2>
			<td width=80 align=right>假别</td>
			<td class="InputAreaCell" colspan="3">
					<select id="jb" name="jb" rows="1">
			<%
				rs.Open "Select * from KQ_JBZD",oConn,1,1
				do while not rs.EOf 
					%>
					<option value="<%=rs("dm") & ""%>" <% if init_jb=rs("dm") then Response.Write "selected"%>><%=server.HTMLEncode(rs("mc") & "")%></option>
					<%
					rs.Movenext	
				loop
				rs.Close
			%>
					</select>
			</td>
		</tr>
		<tr class=td2> 
		  <td class="InputLabelCell" width="80" nowrap align="right"> 
		    <nobr>申请人</nobr>
		  </td>
		  
		  <td class="InputAreaCell" width="40%" align="left"> 
		  <nobr>  
		    <input type="hidden" name="sqr" value="<%=sygbh%>">    
		    <img src="../images/selectman.gif" border="0" alt="选择人员" name="btn_xzry" onclick="vbscript:fun_xzry()" style="cursor:hand">
		  	<input type="text" class="inputreadonly" name="sqrxm" readonly value="<%=init_Name&"["&init_bmmc&"]"%>">  	
		  </nobr>	
		  </td>
		  
		  <td class="InputLabelCell" width="80" nowrap align="right"> 
		    <nobr>职位[部门]</nobr>
		  </td>  
		  
		  <td class="InputAreaCell" width="40%" align="left">
		  <nobr>
			<input type="hidden" name="sqzw" id="sqzw" value="<%=init_zw%>">
			<input type="hidden" name="sqbm" value="<%=init_bmbh%>">
			<img src="../images/select.gif" alt="选择职位" name="btn_xzzw" border="0" style="cursor:hand" onclick="vbscript:fun_xzzw()">
			<input type="text" class="inputreadonly" name="sqzwmc" readonly value="<%=server.htmlencode(init_zwmc&"")%>">	
		  </nobr>
		  </td>
		    
		</tr>

		<tr class=td2>
			<td width=80 align=right>开始时间</td>
			<td class="InputAreaCell"><input type="text" class="input" id="yjkssj" name="yjkssj" size="20" maxlength="20" value="<%=formatdatetime_activenew(init_kssj,"yyyy-mm-dd hh:nn")%>"></td>
			<td width=80 align=right>结束时间</td>
			<td class="InputAreaCell"><input type="text" class="input" id="yjjssj" name="yjjssj" size="20" maxlength="20" value="<%=formatdatetime_activenew(init_jssj,"yyyy-mm-dd hh:nn")%>"></td>
		</tr>
		
		<tr class=td2>
			<td width=80 align=right>事由</td>
			<td class="InputAreaCell" colspan="3" width="400"><textarea class=inputarea rows="3" style="width:360; id="sqsy" name="sqsy"><%=server.HTMLEncode(init_sqsy&"")%></textarea></td>
		</tr>
		<tr class=td2>
			<td width=80 align=right>审批情况</td>
			<td class="InputAreaCell" colspan="3" width="400"><textarea class=inputarea rows="3" style="width:360;" id="spqk" name="spqk"><%=server.HTMLEncode(init_spqk&"")%></textarea></td>
		</tr>
	<tr class=td1>
		<td align="center" colspan="4">
			<input type="button" class="button" id="bBC" name="bBC" onclick="vbscript:doSave" value="确定">
			<input type="button" class="button" id="bfH" name="bfH" onclick="javascript:location.href='kq_jddj.asp';" value="返回">
		</td>
	</tr>
	</form>
</table>
<br>
<%
	set rs=nothing
	oConn.close
	set oConn=nothing
%>
</body>
</html> 

⌨️ 快捷键说明

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