365 lines
12 KiB
Plaintext
365 lines
12 KiB
Plaintext
<!-- #include virtual = "lib/config.asp" -->
|
|
<%'####################################################
|
|
'0:이 화면은 viewer 후 인쇄하는는 화면입니다.
|
|
'1. 사용인감계 인쇄
|
|
'2. 문서번호 A로 구분
|
|
'3. 일반용지에 인쇄
|
|
'로그도 저장하기 -
|
|
'내용도 저장하기 -
|
|
'2006년 12월 일 완료
|
|
'####################################################
|
|
%>
|
|
<%
|
|
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%>
|
|
<%
|
|
|
|
|
|
|
|
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 Curr_date '오늘날짜
|
|
dim Company(6)
|
|
dim client_name
|
|
dim print_date
|
|
dim db_table_name
|
|
|
|
db_table_name = "문서내용"
|
|
|
|
|
|
client_name = request("txt_client")
|
|
|
|
|
|
title="사 용 인 감 계"
|
|
Max_Width =750
|
|
Curr_date = year(date) & "-" & zeroformat(month(date),2) & "-" & zeroformat(day(date),2)
|
|
print_date = request("txt_print_date")
|
|
if print_type=2 then
|
|
print_date = mid(print_date,1,4) & "년 " & mid(print_date,6,2) & "월 " & mid(print_date,9,2) & "일"
|
|
end if
|
|
|
|
|
|
''//===============
|
|
''회사 회사명, 사업자등록번호, 대표자명, 주소 가져오기
|
|
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 =3 then '진짜 프린트이면 로그저장하기
|
|
'//========================
|
|
''로그저장
|
|
'먼저 사용인감계의 문서번호 생성
|
|
''///===============
|
|
''문서번호 정보
|
|
Query = "select 문서번호 as krc_no from " & db_table_name & "_log "
|
|
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 & "A-"
|
|
krc_no = tmpstr & ZeroFormat(krc_no,5)
|
|
|
|
|
|
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") = "김홍근" 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-right: 40px;
|
|
}
|
|
</style>
|
|
<script language=javascript>
|
|
function win_close()
|
|
{
|
|
window.close();
|
|
}
|
|
|
|
function win_print()
|
|
{
|
|
var txt_print_date = document.frm_Sayung.txt_print_date.value;
|
|
var txt_client = document.frm_Sayung.txt_client.value;
|
|
|
|
var url = "cert_cos_print.asp?print_type=3";
|
|
url = url + "&txt_print_date=" + txt_print_date;
|
|
url = url + "&txt_client=" + txt_client;
|
|
document.frm_Sayung.action=url;
|
|
document.frm_Sayung.submit();
|
|
}
|
|
|
|
|
|
function goPrint()
|
|
{//프린트 하기
|
|
var txt_print_date = document.frm_Sayung.txt_print_date.value;
|
|
var txt_client = document.frm_Sayung.txt_client.value;
|
|
|
|
var url = "cert_cos_print.asp?print_type=2";
|
|
url = url + "&txt_print_date=" + txt_print_date;
|
|
url = url + "&txt_client=" + txt_client;
|
|
|
|
window.open(url,"","left=0 top=50 menubar=no location=no status=no toolbar=no width=820 height=600 scrollbars=yes resizable=no");
|
|
// document.frm_Sayung.action="사용인감계_print.asp?print_type=2";
|
|
// document.frm_Sayung.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>
|
|
|
|
<%if cint(print_type) = 2 then%>
|
|
<body onload="print_ie();">
|
|
<%end if%>
|
|
<form method='post' name='frm_Sayung'>
|
|
|
|
<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;"><%=title%></b></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" style="padding:10 0 10 0">
|
|
<table width="70%" cellpadding="5" cellspacing="0" border="0" style="border-collapse:collapse; margin-left: 15px;">
|
|
<tr height=30>
|
|
<td width="155" class='doc_title'>법 인 명</td>
|
|
<td><%=company(1)%></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td class='doc_title'>주 소</td>
|
|
<td><%=company(4)%></td>
|
|
</tr>
|
|
<%tmpstr=split(company(3),",")
|
|
for i=0 to ubound(tmpstr)%>
|
|
<tr>
|
|
<td class='doc_title'>대 표 이 사</td>
|
|
<td><%=tmpstr(i)%></td>
|
|
</tr>
|
|
<%next%>
|
|
<tr height=30>
|
|
<td class='doc_title'>사 업 자 등 록 번 호</td>
|
|
<td><%=company(2)%></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td class='doc_title'>법 인 등 록 번 호</td>
|
|
<td><%=company(5)%></td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td class='doc_title'>전 화 번 호</td>
|
|
<td><%=company(6)%></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<%if cint(print_type) = 2 then%>
|
|
<tr height=50>
|
|
<td> </td>
|
|
</tr>
|
|
<%end if%>
|
|
<tr>
|
|
<td align="center" style="padding:10;"><b style="font-size:14px;font-family:Dotum;">다음의 인감을 사용인감계로 제출합니다.</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center">
|
|
<table width="60%" cellpadding="5" cellspacing="0" border="2" >
|
|
<tr height=30>
|
|
<td align="center" colspan="2" style="width:66%;">법인인감</td>
|
|
<td align="center" style="width:33%;">사용인감</td>
|
|
</tr>
|
|
<tr height="100">
|
|
<td align="center"> </td>
|
|
<td align="center"> </td>
|
|
<td align="center"> </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<%if cint(print_type) = 2 then%>
|
|
<tr height=50>
|
|
<td> </td>
|
|
</tr>
|
|
<%end if%>
|
|
<tr>
|
|
<td align="right">
|
|
<table width="50%" cellpadding="5" cellspacing="0" border="0" style="border-collapse:collapse;">
|
|
<tr height=30>
|
|
<td class='doc_title'>제 출 일 자</td>
|
|
<td align="left">
|
|
<%if cint(print_type)= 2 or cint(print_type) =3 then%>
|
|
<font class="tahoma"><%=print_date%>
|
|
<%else%>
|
|
<input type="text" class="number" name="txt_print_date" style="width:100px;text-align:right" maxlength="8" OnBlur="OnFormatDate(this)" OnFocus="OnReplaceDate(this)" OnKeyup="OnlyNumber(this)" value="<%=curr_date%>" readonly>
|
|
<img src="/images/common/btn_calendar.jpg" align="absmiddle" OnClick="winopn('/include/calendar.html?actval=txt_print_date')" class="imglink" title='날짜를 선택하세요' style="cursor:pointer">
|
|
<%end if%>
|
|
</td>
|
|
</tr>
|
|
<tr height=30>
|
|
<td class='doc_title'>법 인 명</td>
|
|
<td align="left"> <%=company(1)%></td>
|
|
</tr>
|
|
<%tmpstr=split(company(3),",")
|
|
for i=0 to ubound(tmpstr)%>
|
|
<tr height=30>
|
|
<td class='doc_title'>대 표 이 사</td>
|
|
<td align="left">
|
|
<%=trim(tmpstr(i))%> <img src='/images/common/sign.gif' width=15 height=15>
|
|
</td>
|
|
</tr>
|
|
<%next%>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr height=50>
|
|
<td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center">
|
|
<b style="font-size:18px;font-family:Dotum;line-height:200%"><%=client_name%> 귀중</b>
|
|
</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>
|
|
|
|
<%if print_type=2 then%>
|
|
<input type=hidden name='txt_print_date' value ='<%=print_date%>'>
|
|
<%end if%>
|
|
<input type=hidden name='txt_client' value ='<%=client_name%>'>
|
|
</form>
|
|
<%if cint(print_type) = 2 then%>
|
|
</body>
|
|
<%else%>
|
|
|
|
<%end if%>
|
|
|
|
|
|
|