434 lines
15 KiB
Plaintext
434 lines
15 KiB
Plaintext
<!-- #include virtual = "lib/config.asp" -->
|
|
<%
|
|
dim print_type '1:작성, 2:보기, 3: 진짜 프린트
|
|
print_type = request("print_type")
|
|
%>
|
|
<%if cint(print_type) <> 2 then%>
|
|
<!-- #include file = "../include/top_menu.asp" -->
|
|
<%end if%>
|
|
<%'####################################################
|
|
'0:이 화면은 viewer 후 인쇄하는는 화면입니다.
|
|
'1. 위임장 인쇄
|
|
'2. 문서번호 B로 구분
|
|
'3. 일반용지에 인쇄
|
|
'로그도 저장하기 -
|
|
'내용도 저장하기 -
|
|
'2006년 12월 일 완료
|
|
'####################################################
|
|
%>
|
|
<%
|
|
|
|
|
|
|
|
Response.Expires = 0
|
|
'Response.Buffer = false
|
|
call Time_Check(Session("Login_Check"))
|
|
|
|
dim tmpstr
|
|
dim p_no
|
|
dim Query
|
|
dim i
|
|
dim user_name(4) '현재 사용자,0:사원코드, 1:이름,2:직급,3:전화번호, 4:부서코드(명)
|
|
dim Max_Width
|
|
dim title
|
|
dim krc_no '증명서 발급번호
|
|
dim target_name '발급대상자 이름
|
|
dim target_gap(4) '발급대상자의 값, 0:사원코드, 1:이름, 2:주민번호, 3:현주소1,4::현주소2
|
|
dim Curr_date '오늘날짜
|
|
dim Company(6)
|
|
dim client_name
|
|
dim gap(4) '위임내용
|
|
dim db_table_name
|
|
|
|
db_table_name = "문서내용"
|
|
|
|
client_name = request("txt_client")
|
|
print_type = request("print_type")
|
|
gap(1) = request("txt_gap_1")
|
|
gap(2) = request("txt_gap_2")
|
|
gap(3) = request("txt_gap_3")
|
|
gap(4) = request("txt_date")
|
|
if print_type=2 then
|
|
gap(4) = mid(gap(4),1,4) & "년 " & mid(gap(4),6,2) & "월 " & mid(gap(4),9,2) & "일"
|
|
end if
|
|
|
|
title="위 임 장"
|
|
Max_Width =750
|
|
Curr_date = year(date) & "년 " & month(date) & "월 " & day(date) & "일"
|
|
|
|
|
|
''//===============
|
|
''회사 회사명, 사업자등록번호, 대표자명, 주소 가져오기
|
|
Query = "select * from company"
|
|
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
|
|
Company(1) = adors("com_name")
|
|
Company(2) = adors("사업자등록번호")
|
|
Company(3) = adors("대표자명")
|
|
Company(4) = adors("주소")
|
|
Company(5) = adors("법인등록번호")
|
|
Company(6) = adors("회사대표전화번호")
|
|
adoRs.close
|
|
|
|
''///===============
|
|
''로그인 사용자 정보
|
|
user_name(0) = Session("User_Number")
|
|
Query = "SELECT p_name, p_team_name, p_rank_name, p_tel3 FROM project2.dbo.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") '직위 코드
|
|
user_name(3) = adoRs("p_tel3") '직통 전화
|
|
user_name(4) = adoRs("p_team_name") '부서코드
|
|
adoRs.close
|
|
|
|
|
|
''//====================
|
|
'' '위임받는자 가져오기
|
|
if print_type=2 or print_type=3 then
|
|
target_gap(0) = request("p_no")
|
|
else
|
|
target_gap(0) = request("sel_p_no_in")
|
|
end if
|
|
Query = "select * from person where 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) + "******"
|
|
target_gap(3) = adoRs("address1_1")
|
|
target_gap(4) = adoRs("address1_2")
|
|
adoRs.close
|
|
|
|
|
|
if print_type =3 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 = tmpstr & "B-"
|
|
krc_no = tmpstr & ZeroFormat(krc_no,5)
|
|
|
|
'//========================
|
|
'내용 저장하기
|
|
query = "insert into " & db_table_name & " (문서번호, 문서제목,target1, target2, target3, target4, target5, target6, target7, target8, target9,target10,"
|
|
query = query & " 발급일, 발급시각, login_p_no, login_이름,login_ip) 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 & "'" & client_name & "', "
|
|
query = query & "'" & gap(1) & "', "
|
|
query = query & "'" & gap(2) & "', "
|
|
query = query & "'" & gap(3) & "', "
|
|
query = query & "'" & gap(4) & "', "
|
|
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") & "') "
|
|
' Response.Write query & "<br>"
|
|
' 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 & "'" & user_name(0) & "', "
|
|
query = query & "'" & user_name(1) & "', "
|
|
query = query & "'" & client_name & "', "
|
|
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
|
|
%>
|
|
<%if cint(print_type) = 2 then%>
|
|
<body onload="print_ie();">
|
|
<%end if%>
|
|
|
|
<form method='post' name='frm_Uiim'>
|
|
<td width="100%" valign="top">
|
|
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
|
<%if cint(print_type) <> 2 then%>
|
|
<tr>
|
|
<!-- 확인 -->
|
|
</tr>
|
|
<%end if%>
|
|
<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;">
|
|
|
|
<font class="brown">위임내용 및 제출일자를 선택후 발급 버튼을 클릭하세요.</font><br>
|
|
<img src="/images/common/blank.gif" width="19" height="1" align="absmiddle">
|
|
<font class="k_darkorange">경영지원실만 사용가능합니다.</font>
|
|
</td>
|
|
</tr>
|
|
<%end if%>
|
|
<%if cint(print_type) = 2 then%>
|
|
<tr height=100>
|
|
<td> </td>
|
|
</tr>
|
|
<%end if%>
|
|
<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;"><%=replace(title," "," ")%></b></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" style="padding:10 0 10 0">
|
|
<table width="98%" cellpadding="5" cellspacing="0" border="1" >
|
|
<tr height=30>
|
|
<td width="20" align="center" rowspan="3">위임하는자</td>
|
|
<td width="120">법 인 명</td>
|
|
<td > <%=company(1)%></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td >주 소</td>
|
|
<td ><font class="tahoma"> <%=company(4)%></font></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td >사업자 등록번호</td>
|
|
<td ><font class="tahoma"> <%=company(2)%></font></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" style="padding:10 0 10 0">
|
|
<table width="98%" cellpadding="5" cellspacing="0" border="1" >
|
|
<tr height=30>
|
|
<td width="20" align="center" rowspan="3">위임받는자</td>
|
|
<td width="120">성 명</td>
|
|
<td > <%=target_gap(1)%></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td >주민 등록 번호</td>
|
|
<td ><font class="tahoma"> <%=target_gap(2)%></font></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td >주 소</td>
|
|
<td ><font class="tahoma"> <%=target_gap(3)%><br><br> <%=target_gap(4)%></font></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<%if cint(print_type) = 2 then%>
|
|
<tr height=30>
|
|
<td> </td>
|
|
</tr>
|
|
<%end if%>
|
|
<tr>
|
|
<td align="center" style="padding:10 0 10 0">
|
|
<table width="98%" cellpadding="5" cellspacing="0" border="1" >
|
|
<tr height=30>
|
|
<td width="150" align="center" rowspan="3">제 출 처</td>
|
|
<td > <%=client_name%></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<%if cint(print_type) = 2 then%>
|
|
<tr height=30>
|
|
<td> </td>
|
|
</tr>
|
|
<%end if%>
|
|
<tr>
|
|
<td align="center" style="padding:10;"><b style="font-size:14px;font-family:Dotum;">상기 "위임받는 자"에 대하여 <%=company(1)%>의 아래의 업무 일체를 위임함. </b></td>
|
|
</tr>
|
|
<%if cint(print_type) = 2 then%>
|
|
<tr height=30>
|
|
<td> </td>
|
|
</tr>
|
|
<%end if%>
|
|
<tr>
|
|
<td align="center" style="padding:10 0 10 0">
|
|
<table width="98%" cellpadding="5" cellspacing="0" border="1" >
|
|
<tr>
|
|
<td width="150" align="center" rowspan="3">위 임 내 용</td>
|
|
<td >
|
|
<%if print_type=2 or print_type=3 then
|
|
for i=1 to 3
|
|
' if trim(gap(i)) <> "" then
|
|
Response.Write trim(gap(i)) & "<br>"
|
|
' end if
|
|
next
|
|
else%>
|
|
<input type=text style="width:100%" name='txt_gap_1'><br>
|
|
<input type=text style="width:100%" name='txt_gap_2'><br>
|
|
<input type=text style="width:100%" name='txt_gap_3'>
|
|
<%end if%>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center">
|
|
<%if cint(print_type)= 2 or cint(print_type) =3 then%>
|
|
<font class="tahoma"><%=gap(4)%>
|
|
<%else%>
|
|
<input type="text" class="number" name="txt_date" style="width:100px;text-align:right" maxlength="8" OnBlur="OnFormatDate(this)" OnFocus="OnReplaceDate(this)" OnKeyup="OnlyNumber(this)" value="<%=date()%>">
|
|
<img src="/images/common/btn_calendar.jpg" align="absmiddle" OnClick="winopn('/include/calendar.html?actval=txt_date')" class="imglink" title='날짜를 선택하세요' style="cursor:pointer">
|
|
<%end if%>
|
|
<br><br><br>
|
|
<b style="font-size:18px;font-family:Dotum;line-height:200%"><%=company(1)%></b><br>
|
|
<%tmpstr=split(company(3),",")
|
|
for i=0 to ubound(tmpstr)%>
|
|
<b style="font-size:14px;font-family:Dotum;line-height:200%">대 표 이 사 <%=trim(tmpstr(i))%></b><br>
|
|
<%next%>
|
|
</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>
|
|
<%if cint(print_type) = 1 then%>
|
|
<tr>
|
|
<td style="padding:10 0 0 0;" align="center">
|
|
<img src="/images/management/btn_cert.jpg" title='작성완료' onclick='goPrint();' style='cursor:pointer'>
|
|
<a href="/management/certificate_select.asp"> <img src="/images/common/btn_cancel.jpg"></a>
|
|
</td>
|
|
</tr>
|
|
<%end if%>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
|
|
<input type=hidden name='txt_client' value ='<%=client_name%>'>
|
|
<input type=hidden name='txt_p_no' value ='<%=target_gap(0)%>'>
|
|
<%if print_type=2 then%>
|
|
<input type=hidden name='txt_gap_1' value ='<%=gap(1)%>'>
|
|
<input type=hidden name='txt_gap_2' value ='<%=gap(2)%>'>
|
|
<input type=hidden name='txt_gap_3' value ='<%=gap(3)%>'>
|
|
<input type=hidden name='txt_date' value ='<%=gap(4)%>'>
|
|
<%end if%>
|
|
|
|
|
|
</form>
|
|
<%if cint(print_type) = 2 then%>
|
|
</body>
|
|
<%else%>
|
|
|
|
<%end if%>
|
|
|
|
|
|
|
|
|
|
|
|
<script language=javascript>
|
|
function win_close()
|
|
{
|
|
window.close();
|
|
}
|
|
function win_print()
|
|
{
|
|
|
|
var txt_gap_1 = document.frm_Uiim.txt_gap_1.value;
|
|
var txt_gap_2 = document.frm_Uiim.txt_gap_2.value;
|
|
var txt_gap_3 = document.frm_Uiim.txt_gap_3.value;
|
|
var txt_date = document.frm_Uiim.txt_date.value;
|
|
var p_no = document.frm_Uiim.txt_p_no.value;
|
|
var txt_client = document.frm_Uiim.txt_client.value;
|
|
|
|
var url = "cert_poa_print.asp?print_type=3";
|
|
url = url + "&txt_gap_1=" + txt_gap_1;
|
|
url = url + "&txt_gap_2=" + txt_gap_2;
|
|
url = url + "&txt_gap_3=" + txt_gap_3;
|
|
url = url + "&txt_date=" + txt_date;
|
|
url = url + "&txt_client=" + txt_client;
|
|
url = url + "&p_no=" + p_no;
|
|
document.frm_Uiim.action=url;
|
|
document.frm_Uiim.submit();
|
|
}
|
|
|
|
|
|
function goPrint()
|
|
{//프린트 하기
|
|
|
|
var txt_gap_1 = document.frm_Uiim.txt_gap_1.value;
|
|
var txt_gap_2 = document.frm_Uiim.txt_gap_2.value;
|
|
var txt_gap_3 = document.frm_Uiim.txt_gap_3.value;
|
|
var txt_date = document.frm_Uiim.txt_date.value;
|
|
var p_no = document.frm_Uiim.txt_p_no.value;
|
|
var txt_client = document.frm_Uiim.txt_client.value;
|
|
|
|
var url = "cert_poa_print.asp?print_type=2";
|
|
url = url + "&txt_gap_1=" + txt_gap_1;
|
|
url = url + "&txt_gap_2=" + txt_gap_2;
|
|
url = url + "&txt_gap_3=" + txt_gap_3;
|
|
url = url + "&txt_date=" + txt_date;
|
|
url = url + "&txt_client=" + txt_client;
|
|
url = url + "&p_no=" + p_no;
|
|
window.open(url,"","left=50, top=50, menubar=no, location=no, status=no, toolbar=no, width=850 ,height=600 ,scrollbars=yes, resizable=no");
|
|
|
|
|
|
// document.frm_Uiim.action="위임장_print.asp?print_type=1&p_no="+p_no;
|
|
// document.frm_Uiim.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> |