477 lines
17 KiB
Plaintext
477 lines
17 KiB
Plaintext
<!-- #include virtual = "lib/config.asp" -->
|
|
<OBJECT RUNAT=Server PROGID=ADODB.Recordset id=adoRs2></OBJECT>
|
|
<%
|
|
dim tmpstr
|
|
dim p_no
|
|
dim Query
|
|
dim i
|
|
dim user_name(2) '현재 사용자,0:사원코드, 1:이름,2:직급
|
|
dim bal_user_name(5) '발급자 ,0:사원코드, 1:이름,2:직급,3:부서,4:직통번호,5:담당업무
|
|
dim Max_Width
|
|
dim title
|
|
dim krc_no '증명서 발급번호
|
|
dim target_name '발급대상자 이름
|
|
dim target_gap(11) '발급대상자의 값, 0:사원코드, 1:이름, 2:주민번호, 3:현주소1,4::현주소2,5:근무부,6:직급,7:담당업무,8:입사일,9:퇴사일 또는 오늘날짜, 10:급호,11:휴직기간(날짜수)
|
|
dim Curr_date '오늘날짜
|
|
dim Company(4)
|
|
dim print_date
|
|
dim menu_option '1:재직, 2:경력
|
|
dim print_type '1:보기, 2:진짜프린트
|
|
dim db_table_name
|
|
|
|
db_table_name = "문서내용"
|
|
|
|
menu_option = request("menu_option") '1:재직증명서, 2:경력증명서
|
|
|
|
|
|
if menu_option = 1 then
|
|
title = "재 직"
|
|
else
|
|
title = "경 력"
|
|
end if
|
|
target_gap(0) = request("p_no")
|
|
print_type = request("print_type")
|
|
' Response.Write tmpstr
|
|
|
|
Max_Width =750
|
|
|
|
Curr_date = year(date) & "년 " & month(date) & "월 " & day(date) & "일"
|
|
print_date = request("txt_print_date")
|
|
print_date = mid(print_date,1,4) & "년 " & mid(print_date,6,2) & "월 " & mid(print_date,9,2) & "일"
|
|
|
|
''//===============
|
|
''회사 회사명, 사업자등록번호, 대표자명, 주소 가져오기
|
|
Query = "select * from company"
|
|
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
|
|
Company(1) = adors("com_name")
|
|
Company(2) = adors("사업자등록번호")
|
|
Company(3) = adors("대표자명")
|
|
Company(4) = adors("주소")
|
|
adoRs.close
|
|
|
|
|
|
''///===============
|
|
''로그인 사용자 정보
|
|
user_name(0) = Session("User_Number")
|
|
Query = "select p_name, p_rank_name from V_person where p_no ='" & user_name(0) & "'"
|
|
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
|
|
user_name(1) = adoRs("p_name") '이름
|
|
user_name(2) = adoRs("p_rank_name") '직위 코드
|
|
adoRs.close
|
|
|
|
''///===============
|
|
''발급자 정보
|
|
'##### 조직도 개편(2019)
|
|
bal_user_name(0) = request("sel_person")
|
|
Query = "select p_name, p_rank_name, p_team_name, p_job_name, p_tel3 from V_person where p_no ='" & bal_user_name(0) & "'"
|
|
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
|
|
bal_user_name(1) = adoRs("p_name") '이름
|
|
bal_user_name(2) = adoRs("p_rank_name") '직위 코드
|
|
bal_user_name(3) = adoRs("p_team_name") '부서 코드
|
|
bal_user_name(4) = adoRs("p_tel3") '발급자 직통번호
|
|
bal_user_name(5) = adoRs("p_job_name") '##### 담당업무
|
|
adoRs.close
|
|
|
|
''///===============
|
|
''증명서 발급 대상자 정보
|
|
Query = "SELECT vp.p_name, p.jumin, p.address1_1, p.address1_2, vp.p_team_name, vp.p_rank_name, vp.krc_in_date, vp.p_job_name, p.p_depart_last, p.p_pos_last, p.krc_out_date "
|
|
Query = Query & "FROM project2.dbo.V_Person vp JOIN project2.dbo.person p ON vp.p_no = p.p_no "
|
|
Query = Query & "WHERE vp.p_no = " & target_gap(0) & " "
|
|
|
|
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
|
|
target_gap(1) = adoRs("p_name")
|
|
target_gap(2) = adoRs("jumin")
|
|
target_gap(2) = left(decode(target_gap(2), 0),8) + "******"
|
|
if adoRs("address1_1")="" or isnull(adoRs("address1_1")) then
|
|
target_gap(3)=" "
|
|
target_gap(4)=" "
|
|
else
|
|
target_gap(3) = adoRs("address1_1")
|
|
target_gap(4) = adoRs("address1_2")
|
|
end if
|
|
|
|
if IsNull(adoRs("p_team_name")) then
|
|
target_gap(10) = ""
|
|
if IsNull(adoRs("p_depart_last")) then
|
|
target_gap(5) = ""
|
|
else
|
|
target_gap(5) = adoRs("p_depart_last")
|
|
end if
|
|
else
|
|
target_gap(5) = adoRs("p_team_name")
|
|
end if
|
|
|
|
if IsNull(adoRs("p_rank_name")) then
|
|
if isnull(adoRs("p_pos_last")) then
|
|
target_gap(6) = ""
|
|
else
|
|
target_gap(6) = adoRs("p_pos_last")
|
|
end if
|
|
target_gap(10) = ""
|
|
else
|
|
target_gap(6) = adoRs("p_rank_name")
|
|
end if
|
|
|
|
if adoRs("krc_in_date")= "" or isnull(adoRs("krc_in_date")) then
|
|
target_gap(8) = "모름"
|
|
else
|
|
target_gap(8) = mid(adoRs("krc_in_date"),1,4) & "년 " & mid(adoRs("krc_in_date"),6,2) & "월 " & mid(adoRs("krc_in_date"),9,2) & "일"
|
|
end if
|
|
|
|
|
|
if replace(title," ","") = "경력" then
|
|
if adoRs("krc_out_date")= "" or isnull(adoRs("krc_out_date")) then
|
|
target_gap(9) = "모름"
|
|
else
|
|
target_gap(9) = mid(adoRs("krc_out_date"),1,4) & "년 " & mid(adoRs("krc_out_date"),6,2) & "월 " & mid(adoRs("krc_out_date"),9,2) & "일"
|
|
end if
|
|
else
|
|
target_gap(9) = request("txt_end_date")
|
|
target_gap(9) = mid(target_gap(9),1,4) & "년 " & mid(target_gap(9),6,2) & "월 " & mid(target_gap(9),9,2) & "일"
|
|
end if
|
|
|
|
'##### 조직도 개편(2019) - 담당업무 기준으로 신규 조직코드 구분
|
|
If adoRs("p_job_name") = "" or isnull(adoRs("p_job_name")) Then
|
|
target_gap(7) = "모름"
|
|
Else
|
|
target_gap(7) = adoRs("p_job_name")
|
|
End If
|
|
|
|
target_gap(10) = "0" '휴직기간일자수
|
|
adoRs.close
|
|
if target_gap(5) <> "" then
|
|
'##### 조직도 개편(2019) - 담당업무 기준으로 신규 조직코드 구분
|
|
if isNumeric(target_gap(5)) then
|
|
If replace(title, " ", "") = "경력" Then
|
|
query = "select * from depart where d_code = " & target_gap(5)
|
|
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
|
|
target_gap(5) = adors("d_name")
|
|
adoRs.close
|
|
End If
|
|
End If
|
|
else
|
|
target_gap(5) = "모름"
|
|
end if
|
|
if target_gap(6) <> "" then
|
|
if isNumeric(target_gap(6)) then
|
|
If replace(title, " ", "") = "경력" Then
|
|
query = "select * from position where p_code = " & target_gap(6)
|
|
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
|
|
target_gap(6) = adors("p_name")
|
|
adoRs.close
|
|
end if
|
|
end if
|
|
else
|
|
target_gap(6) = "모름"
|
|
end if
|
|
|
|
|
|
if cint(print_type) = 2 then
|
|
''///===============
|
|
''문서번호 정보
|
|
Query = "select 문서번호 as krc_no from " & db_table_name
|
|
query = query & " where 문서제목 = '" & replace(title, " ", "") & "' "
|
|
query = query & " and substring(문서번호,5,4) = '" & year(date) & "' "
|
|
query = query & " order by 문서번호"
|
|
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
|
|
if adoRs.recordcount <= 0 then
|
|
krc_no = 0
|
|
else
|
|
adoRs.movelast
|
|
tmpstr = split(trim(adoRs("krc_no")),"-")
|
|
krc_no = tmpstr(3)
|
|
end if
|
|
adoRs.close
|
|
krc_no = int(krc_no) + 1
|
|
'##### 회사명 변경
|
|
'tmpstr = "KRC-" & year(date) & "-"
|
|
tmpstr = "KRI-" & year(date) & "-"
|
|
if replace(title, " ", "") = "재직" then
|
|
tmpstr = tmpstr & "J-"
|
|
else
|
|
tmpstr = tmpstr & "K-"
|
|
end if
|
|
krc_no = tmpstr & ZeroFormat(krc_no,5)
|
|
|
|
'//========================
|
|
'내용 저장하기
|
|
query = "insert into " & db_table_name & " (문서번호, 문서제목, target1, target2, target3, target4, target5, "
|
|
query = query & " target6, target7, target8, target9, 발급일, 발급시각, login_p_no, login_이름,login_ip,발급자_p_no, 발급자_이름) values ( "
|
|
query = query & "'" & krc_no & "', "
|
|
query = query & "'" & replace(title, " ", "") & "', "
|
|
query = query & "'" & target_gap(0) & "', "
|
|
query = query & "'" & target_gap(1) & "', "
|
|
query = query & "'" & target_gap(2) & "', "
|
|
query = query & "'" & target_gap(3) & "', "
|
|
query = query & "'" & target_gap(4) & "', "
|
|
query = query & "'" & target_gap(5) & "', "
|
|
if replace(title, " ", "") = "경력" then
|
|
tmpstr = target_gap(6) & ", " & target_gap(10)
|
|
else
|
|
tmpstr = target_gap(6)
|
|
end if
|
|
query = query & "'" & tmpstr & "', "
|
|
query = query & "'" & target_gap(8) & "부터 " & target_gap(9) & "', "
|
|
query = query & "'" & print_date & "', "
|
|
query = query & "'" & year(date) & "-" & zeroformat(month(date),2) & "-" & zeroformat(day(date),2) & "', "
|
|
query = query & "'" & time() & "', "
|
|
query = query & "'" & user_name(0) & "', "
|
|
query = query & "'" & user_name(1) & "', "
|
|
query = query & "'" &Session("USERIP") & "', "
|
|
query = query & "'" & bal_user_name(0) & "', "
|
|
query = query & "'" & bal_user_name(1) & "') "
|
|
' if session("loginuser") = "김홍근" or session("loginuser") = "강두형" then
|
|
if session("loginuser") = "김홍근" then
|
|
else
|
|
adoconn.execute query
|
|
end if
|
|
|
|
'//========================
|
|
''로그저장
|
|
query = "insert into " & db_table_name & "_log (문서번호, 문서제목, 내용, 대상자_p_no, 대상자_이름, "
|
|
query = query & " 발급일, 발급시각, 발급자_p_no, 발급자_이름, 발급자_ip) values ( "
|
|
query = query & "'" & krc_no & "', "
|
|
query = query & "'" & replace(title, " ", "") & "', "
|
|
query = query & "'발급', "
|
|
query = query & "'" & target_gap(0) & "', "
|
|
query = query & "'" & target_gap(1) & "', "
|
|
query = query & "'" & year(date) & "-" & zeroformat(month(date),2) & "-" & zeroformat(day(date),2) & "', "
|
|
query = query & "'" & time() & "', "
|
|
query = query & "'" & user_name(0) & "', "
|
|
query = query & "'" & user_name(1) & "', "
|
|
query = query & "'" & Session("USERIP") & "')"
|
|
' if session("loginuser") = "김홍근" or session("loginuser") = "강두형" then
|
|
if session("loginuser") = "김홍근" then
|
|
else
|
|
adoconn.execute query
|
|
end if
|
|
end if
|
|
%>
|
|
<style>
|
|
.doc_title{
|
|
text-align: justify;
|
|
-moz-text-align-last: justify;
|
|
-webkit-text-align-last: justify; /* not implemented yet, and will not be */
|
|
text-align-last: justify; /* IE */
|
|
padding-left: 15px;
|
|
padding-right: 15px;
|
|
}
|
|
</style>
|
|
<script language=javascript>
|
|
|
|
function win_close()
|
|
{
|
|
window.close();
|
|
}
|
|
function win_print()
|
|
{
|
|
var menu_option = document.frm_certificate.menu_option.value;
|
|
var p_no = document.frm_certificate.p_no.value;
|
|
var txt_print_date = document.frm_certificate.txt_print_date.value;
|
|
var sel_person = document.frm_certificate.sel_person.value;
|
|
var txt_end_date = document.frm_certificate.txt_end_date.value;
|
|
|
|
var url = "cert_poe_print.asp?menu_option=" + menu_option +"&p_no=" + p_no;
|
|
url = url + "&txt_print_date=" + txt_print_date;
|
|
url = url + "&sel_person=" + sel_person;
|
|
url = url + "&txt_end_date=" + txt_end_date;
|
|
url = url + "&print_type=2";
|
|
|
|
document.frm_certificate.action=url;
|
|
document.frm_certificate.submit();
|
|
}
|
|
|
|
|
|
|
|
function print_ie()
|
|
{
|
|
|
|
//
|
|
if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1){ // Chrome Browser Detected?
|
|
window.PPClose = false; // Clear Close Flag
|
|
window.onbeforeunload = function(){ // Before Window Close Event
|
|
if(window.PPClose === false){ // Close not OK?
|
|
return 'Leaving this page will block the parent window!\nPlease select "Stay on this Page option" and use the\nCancel button instead to close the Print Preview Window.\n';
|
|
}
|
|
}
|
|
window.print(); // Print preview
|
|
window.PPClose = true; // Set Close Flag to OK.
|
|
}else{
|
|
window.print();
|
|
window.close();
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/css/basic.css">
|
|
<%if cint(print_type) = 2 then%>
|
|
<body onload="window.status=('<%=replace(title," ","")%> 인쇄');print_ie();">
|
|
<%else%>
|
|
<body onload="window.status=('<%=replace(title," ","")%> 인쇄')">
|
|
<%end if%>
|
|
|
|
<form method='post' name='frm_certificate'>
|
|
|
|
<td width="100%" valign="top">
|
|
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td colspan="2" style="padding:20;">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<%if cint(print_type) = 1 then%>
|
|
<tr>
|
|
<td style="padding:0 0 5 0;">
|
|
<img src="/images/common/btn_print2.jpg" onClick="win_print()" style="CURSOR:pointer;">
|
|
<img src="/images/common/btn_cancel.jpg" onClick="win_close();" style="CURSOR:pointer;">
|
|
</td>
|
|
</tr>
|
|
<%end if%>
|
|
<tr height=100>
|
|
<td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td><img src="/images/approval/docbg_top.jpg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="710" align="center" style="padding:10;border-left:1px solid #dedede;border-right:1px solid #dedede;">
|
|
<table width="100%" cellpadding="3" cellspacing="0" border="0" style="border-collapse:collapse;">
|
|
<tr height=50>
|
|
<td align="center"><b style="font-size:22px;font-family:Dotum;"><%=title%> 증 명 서</b></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td>증명서 발급번호 : <font class="tahoma"><%=krc_no%></td>
|
|
</tr>
|
|
<tr height=50>
|
|
<td style="padding:15 3 3 3"><b><%=replace(title," ","")%>자 인적사항</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<table width="100%" cellpadding="5" cellspacing="0" border="0" style="border-collapse:collapse;">
|
|
<tr height=30>
|
|
<td width="120" class="doc_title tit8">성 명</td>
|
|
<td ><%=target_gap(1)%></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td class="doc_title tit8">주 민 등 록 번 호</td>
|
|
<td ><font class="tahoma"><%=target_gap(2)%></font></td>
|
|
</tr>
|
|
<tr height=60>
|
|
<td class="doc_title tit8">주 소</td>
|
|
<td ><font class="tahoma"> <%=target_gap(3)%><br><br> <%=target_gap(4)%></font></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr height=50>
|
|
<td style="padding:15 3 3 3"><b><%=title%> 사 항</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<table width="100%" cellpadding="5" cellspacing="0" border="0" style="border-collapse:collapse;">
|
|
<tr height=30>
|
|
<td width="120" class="doc_title tit8">회 사 명</td>
|
|
<td ><font class="tahoma"><%=company(1)%></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td class="doc_title tit8">대 표 이 사</td>
|
|
<td ><font class="tahoma"><%=replace(company(3), ",", ", ")%></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td class="doc_title tit8">회 사 주 소</td>
|
|
<td ><font class="tahoma"><%=company(4)%></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td class="doc_title tit8">사 업 자 등 록 번 호</td>
|
|
<td ><font class="tahoma"><%=company(2)%></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td class="doc_title tit8">근 무 부 서</td>
|
|
<td ><font class="tahoma"><%=target_gap(5)%></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td class="doc_title tit8">직 급</td>
|
|
<td ><font class="tahoma">
|
|
<%=target_gap(6)%>
|
|
</td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td class="doc_title tit8">근 무 기 간</td>
|
|
<td >
|
|
<font class="tahoma"><%=target_gap(8)%> 부터 <%=target_gap(9)%></font>
|
|
<%if cint(target_gap(11)) > 0 then%>
|
|
<font class="tahoma">(휴직기간<%=target_gap(11)%> 일 포함)
|
|
<%end if%>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr height=60>
|
|
<td align="center" style="padding:15 3 15 3">
|
|
<b style="font-size:14px;font-family:Dotum;">상기인에 대하여 위와 같이
|
|
<%if replace(title," ","") = "재직" then%>
|
|
재직중임을
|
|
<%else%>
|
|
재직 하였음을
|
|
<%end if%>
|
|
증명합니다. </b>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr height=50>
|
|
<td style="padding:15 3 3 3"><b>확 인 자</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<table width="100%" cellpadding="5" cellspacing="0" border="0" style="border-collapse:collapse;">
|
|
<tr height=30>
|
|
<td width="120" class="doc_title tit8">부 서</td>
|
|
<td width="150" ><font class="tahoma"><%=bal_user_name(3)%></td>
|
|
<td rowspan=4 >
|
|
<br> <font class="tahoma"><%=print_date%><br>
|
|
<br><br><br><br><br>
|
|
<font class="tahoma"><%=company(1)%></font>
|
|
|
|
<font class="tahoma"><직인></font>
|
|
</td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td class="doc_title tit8">직 급</td>
|
|
<td ><font class="tahoma"><%=bal_user_name(2)%></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td class="doc_title tit8">성 명</td>
|
|
<td ><font class="tahoma"><%=bal_user_name(1)%> <img src='/images/common/sign.gif' width=15 height=15></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td class="doc_title tit8">직 통</td>
|
|
<td ><font class="tahoma"><%=bal_user_name(4)%>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="2" align="center" style="padding:15 0 5 0"><!-- #include virtual= "approval/inc_logo.asp" --></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><img src="/images/approval/docbg_btm.jpg"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
|
|
<input type=hidden name="menu_option" value = "<%=request("menu_option")%>">
|
|
<input type=hidden name="p_no" value = "<%=request("p_no")%>">
|
|
<input type=hidden name="txt_print_date" value = "<%=request("txt_print_date")%>">
|
|
<input type=hidden name="sel_person" value = "<%=request("sel_person")%>">
|
|
<input type=hidden name="txt_end_date" value = "<%=request("txt_end_date")%>">
|
|
|
|
</form>
|
|
</body> |