Files
KIN/ess/request_ok.asp
2025-09-29 17:55:08 +09:00

225 lines
7.2 KiB
Plaintext

<!-- #include virtual = "lib/config.asp" -->
<!-- #include virtual = "include/holiday_count.asp" -->
<%
set adors2 = server.CreateObject("ADODB.RECORDSET")
set adors3 = server.CreateObject("ADODB.RECORDSET")
d_no = request("d_no")
x = request("x")
'Response.Write d_no & "'<br>"
query = " SELECT * "
query = query & " FROM Document as a "
query = query & " INNER JOIN 문서내용 as b on a.d_no = b.문서번호 "
query = query & " WHERE a.d_no='" & d_no & "' "
rsc.Open query, adoConn, 1
if rsc.RecordCount > 0 then
if x = "7" then '휴가원 취소
query = "UPDATE Document "
query = query & "SET "
query = query & " d_order_cnt = '99', "
query = query & " d_view = 'N', "
query = query & " d_delok = 'Y' "
query = query & "WHERE d_no = '" & d_no & "' "
set dbin = server.CreateObject("ADODB.CONNECTION")
dbin.Open adoConn
dbin.Execute query
dbin.Close
query = "UPDATE 문서내용 "
query = query & "SET "
query = query & " del_date = '" & date() & "', "
query = query & " del_time = '" & time() & "', "
query = query & " del_ip = '" & Request.ServerVariables("REMOTE_ADDR") & "', "
query = query & " del_user_name = '" & Session("loginuser") & "', "
query = query & " del_reason = '처리자 삭제', "
query = query & " del_yes_no = 'yes' "
query = query & "WHERE 문서번호 = '" & d_no & "' "
dbin.Open adoConn
dbin.Execute query
dbin.Close
else
'd_orders를 상신자로 교체
query = "UPDATE Document "
query = query & "SET "
query = query & " d_orders = '" & rsc("login_p_no") & "' "
query = query & "WHERE d_no = '" & d_no & "' "
set dbin = server.CreateObject("ADODB.CONNECTION")
dbin.Open adoConn
dbin.Execute query
dbin.Close
end if
if x = "2" Or x = "7" then '휴가원 처리
'담당자 처리시 자동으로 job테이블에 삽입해 줌
'tmp_1 Job_Code, tmp_2 업무 시간(h)
if rsc("target3") = "연차 휴가" then
tmp_1 = "8"
tmp_2 = "8"
elseif rsc("target3") = "오전 반차" then
tmp_1 = "10"
tmp_2 = "4"
elseif rsc("target3") = "오후 반차" then
tmp_1 = "11"
tmp_2 = "4"
elseif instr(1, rsc("target3"), "공가") then
tmp_1 = "18"
tmp_2 = "8"
elseif instr(1, rsc("target3"), "병가") then
tmp_1 = "12"
tmp_2 = "8"
elseif rsc("target3") = "포상 휴가" then
tmp_1 = "14"
tmp_2 = "8"
elseif rsc("target3") = "안식 휴가" then
tmp_1 = "15"
tmp_2 = "8"
elseif rsc("target3") = "경조 휴가" then
tmp_1 = "16"
tmp_2 = "8"
elseif instr(1, rsc("target3"), "산전") then
tmp_1 = "17"
tmp_2 = "8"
elseif rsc("target3") = "대체 휴무" then
tmp_1 = "9"
tmp_2 = "8"
elseif rsc("target3") = "기타 휴가" then
tmp_1 = "19"
tmp_2 = "8"
end if
for i = cdate(rsc("target1")) to cdate(rsc("target2"))
tmp_chk = "0"
Call day_off_chk(year(i), month(i), day(i))
if day_off = "true" then
tmp_chk = "1"
End if
if tmp_chk = "0" then '공휴일이 아니라면
p_no = rsc("login_p_no") ''결재 상신자 사번
if x = "2" Then
query = " SELECT * "
query = query & " FROM Job_List "
query = query & " WHERE p_no = '" & p_no & "' "
query = query & " AND j_contents = '" & tmp_1 & "' "
query = query & " AND j_date = '" & i & "' "
query = query & " AND j_Flag = '1' "
adors2.Open Query, adoConn,1' adOpenStatic, adLockReadOnly
If adors2.RecordCount > 0 Then
tmp_proc = "1"
else
tmp_proc = "0"
End If
adors2.Close
'+++++++++++------------------------------------------------
if tmp_proc = "0" then
query = " "
query = query & " INSERT INTO Job_List(p_no, j_date, j_p_sn, j_contents, j_time, j_ip) VALUES "
query = query & " (" & p_no & ", '" & i & "', '99999', " & tmp_1 & ", " & tmp_2 & ", '" & Request.ServerVariables("REMOTE_ADDR") & "') "
set dbin = server.CreateObject("ADODB.CONNECTION")
dbin.Open adoConn
dbin.Execute query
dbin.Close
End if
Elseif x = "7" Then
query = " UPDATE Job_List SET "
query = query & " j_flag = '0' "
query = query & " WHERE p_no = '" & p_no & "' "
query = query & " AND j_contents = '" & tmp_1 & "' "
query = query & " AND j_date = '" & i & "' "
set dbin = server.CreateObject("ADODB.CONNECTION")
dbin.Open adoConn
dbin.Execute query
dbin.Close
End if
End if
Next
elseif x = "6" then '출퇴근보고서 처리
p_no = request("txt_p_no") ''결재 상신자 사번
p_name = request("txt_p_name") '결재 상신자 이름
line_cnt = request("txt_line_cnt") '몇줄인가
dim gap()
redim gap(line_cnt,6)
for i=1 to line_cnt
gap(i,1) = request("gap1")(i)
gap(i,2) = request("gap2")(i)
gap(i,3) = request("gap3")(i)
gap(i,4) = request("gap4")(i)
gap(i,5) = replace(request("gap5")(i)," ","")
gap(i,6) = replace(request("gap6")(i)," ","")
for j=1 to 6
gap(i,j) = replace(gap(i,j),"&nbsp;","")
gap(i,j) = replace(gap(i,j),"&#160;","")
next
if not isEmpty(gap(i,5)) and not isnull(gap(i,5)) and gap(i,5) <> "&#160;" and trim(gap(i,5)) <> "" then
query = "insert into login (name, p_no, [date], [time], real_time, login_out, ip, edit_reason) values ("
query = query & "'" & p_name & "', "
query = query & "'" & p_no & "', "
query = query & "'" & gap(i,1) & "', "
query = query & "'" & replace(gap(i,5),":","") & "', "
query = query & "'" & FormatDateTime(date,0) & " " & FormatDateTime(time,4) & "', "
query = query & "'login-출퇴근보고서', "
query = query & "'" & Request.ServerVariables("remote_host") & "', "
query = query & "'" & gap(i,4) & "-" & session("User_Number") & "') "
'Response.Write query & "<BR>"
adoConn.Execute query
end if
if not isEmpty(gap(i,6)) and not isnull(gap(i,6)) and gap(i,5) <> "&#160;" and trim(gap(i,6)) <> "" then
query = "insert into login (name, p_no, [date], [time], real_time, login_out, ip, edit_reason) values ("
query = query & "'" & p_name & "', "
query = query & "'" & p_no & "', "
if mid(gap(i,6),1,2) >= 00 and mid(gap(i,6),1,2) < 07 then ''00시부터 07시 이전 퇴근이면 날짜를 1일 더하여 저
query = query & "'" & cdate(gap(i,1)) + 1 & "', "
else
query = query & "'" & gap(i,1) & "', "
end if
query = query & "'" & replace(gap(i,6),":","") & "', "
query = query & "'" & FormatDateTime(date,0) & " " & FormatDateTime(time,4) & "', "
query = query & "'login-출퇴근보고서', "
query = query & "'" & Request.ServerVariables("remote_host") & "', "
query = query & "'" & gap(i,4) & "-" & session("User_Number") & "') "
'Response.Write query & "<BR>"
adoConn.Execute query
end if
next
end if
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<LINK rel="stylesheet" type="text/css" href="/lib/text.css">
<title>
</title>
<script language=javascript>
function goit() {
<% if x = "7" then %>
alert('휴가원 처리가 취소되었습니다');
opener.location.reload();
window.close();
<% else %>
alert('처리 완료, 시간수정 완료되었습니다');
opener.location.reload();
window.close();
<% end if %>
}
</script>
</head>
<body onLoad="goit()">
<form name="ess" method="post">
</body>
</html>
<%
else
alert2 "DB 에러. 관리자에게 문의하세요"
end if 'if rsc.RecordCount > 0 then
rsc.Close
%>