%
dim tmpstr
dim Query
dim i,j
dim user_name(4) '현재 사용자,0:사원코드, 1:이름,2:직급,3:전화번호, 4:부서코드(명)
dim Max_Width
dim title
dim target_name '발급대상자 이름
dim Curr_date '오늘날짜
dim Company(6)
dim Gap()
dim krc_no
dim Max_length '입력가능 줄수정의
dim print_type '1:보기, 2:진짜프린트
dim db_table_name
dim depart_cost_type
dim cost_type(2) ''지출방법 구분
cost_type(1) = "개인법인카드"
cost_type(2) = "현금/개인카드"
d_no = request("d_no")
if request("d_no") = "" then
d_no = request("krc_no")
end if
x = request("x")
krc_no = d_no
print_type = request("print_type")
view_chk= request("view_chk")
db_table_name = "문서내용"
title="부서비신청서"
Max_Width =750
Curr_date = year(date) & "년 " & zeroformat(month(date),2) & "월 " & zeroformat(day(date),2) & "일"
''//==========================================
''2010년 3월 3일
'''인쇄여부 표시
if print_type = "2" then
query = "update 문서내용 set print_chk = 'Yes', print_cnt = print_cnt + 1 where 문서번호='" & d_no & "' "
adoConn.Execute query
end if
query = "SELECT * "
query = query & "FROM 문서내용 as a "
query = query & " INNER JOIN Document as b on a.문서번호 = b.d_no "
query = query & "WHERE a.문서번호='" & d_no & "' "
if x = "99" then
else
query = query & " AND b.d_delok = 'N' "
end if
rsc.Open query, adoConn, 1
if rsc("target20") = "팀" then
depart_cost_type = "1"
elseif rsc("target20") = "장" then
depart_cost_type = "2"
end if
if rsc("target29") = "" or isnull(rsc("target29")) then
Max_length = 20
else
Max_length = rsc("target29")
end if
redim gap(Max_length,8) 'x:순서, y:1:일자, 2:프로젝트명, 3:세부항목, 4:금액,5:프로젝트코드, 6:지출방법,7:퇴근시각, (0,0) : 총액
'response.write query
if rsc.RecordCount > 0 then
tmp_date = split(rsc("d_write_date"), "-")
Curr_date = tmp_date(0) & "년 " & tmp_date(1) & "월 " & tmp_date(2) & "일"
part = rsc("part")
tmp_0 = split(rsc("target97"), "^^")
user_name(0) = rsc("login_p_no") '사번
user_name(1) = tmp_0(0) '이름
user_name(2) = tmp_0(1) '직위 코드
user_name(3) = tmp_0(2) '직통 전화
user_name(4) = tmp_0(3) '부서코드
tmp_00 = split(rsc("target98"), "^^")
Company(1) = tmp_00(0)
Company(2) = tmp_00(1)
Company(3) = tmp_00(2)
Company(4) = tmp_00(3)
Company(5) = tmp_00(4)
Company(6) = tmp_00(5)
tmp_7 = split(rsc("target99"), "^^")
tmp_8 = split(rsc("target100"), "^^")
if instr(1,tmp_7(0), "반려") then
tmp_txt1 = tmp_7(0)
elseif instr(1,tmp_7(0), "
") then
tmp_t1 = split(tmp_7(0), "
")
tmp_txt1 = "
"
else
tmp_txt1 = tmp_7(0)
end if
if instr(1,tmp_7(1), "반려") then
tmp_txt2 = tmp_7(1)
elseif instr(1,tmp_7(1), "
") then
tmp_t2 = split(tmp_7(1), "
")
tmp_txt2 = "
"
else
tmp_txt2 = tmp_7(1)
end if
if instr(1,tmp_7(2), "반려") then
tmp_txt3 = tmp_7(2)
elseif instr(1,tmp_7(2), "
") then
tmp_t3 = split(tmp_7(2), "
")
tmp_txt3 = "
"
else
tmp_txt3 = tmp_7(2)
end if
if instr(1,tmp_7(3), "반려") then
tmp_txt4 = tmp_7(3)
elseif instr(1,tmp_7(3), "
") then
tmp_t4 = split(tmp_7(3), "
")
tmp_txt4 = "
"
else
tmp_txt4 = tmp_7(3)
end if
if instr(1,tmp_7(4), "반려") then
tmp_txt5 = tmp_7(4)
elseif instr(1,tmp_7(4), "
") then
tmp_t5 = split(tmp_7(4), "
")
tmp_txt5 = "
"
else
tmp_txt5 = tmp_7(4)
end if
tmp_txt6 = tmp_8(0)
tmp_txt7 = tmp_8(1)
tmp_txt8 = tmp_8(2)
tmp_txt9 = tmp_8(3)
tmp_txt10 = tmp_8(4)
for i = 1 to Max_length
if isnull(rsc("target" & i)) then
else
if trim(replace(rsc("target" & i), "^", "")) <> "" then
tmp_g = split(rsc("target" & i), "^^")
'response.write(rsc("target" & i))
'response.write(ubound(tmp_g) &" - "& Max_length)
for j=0 to ubound(tmp_g)
'response.write("
"& tmp_g(j) &" - "& j+1)
gap(i, j+1) = tmp_g(j)
next
if trim(gap(i, 4)) <> "" then
gap(0,0) = clng(gap(0,0)) + clng(replace(gap(i, 4) ,",",""))
end if
end if
end if
next
d_order_cnt = int(rsc("d_order_cnt"))
tmp_str_money = rsc("target22")
for i = 1 to Max_length
if trim(gap(i, 1)) <> "" then
Query = "select * from login "
Query = Query & " where p_no = '" & user_name(0) & "'"
Query = Query & " and ("
Query = Query & " ([date] = '" & gap(i, 1) & "' and cast([time] as int) >= 600) " '6시가 기준
Query = Query & " or "
Query = Query & " ([date] = '" & cdate(gap(i, 1)) + 1 & "' and cast([time] as int) < 600)"
Query = Query & " )"
query = query & " order by [date], [time]"
adoRs.Open query, adoConn, 1
if adoRs.recordcount > 0 then
adoRs.movelast
gap(i, 7) = mid(adoRs("time"),1,2) & ":" & mid(adoRs("time"),3,2)
else
gap(i, 7) = "No"
end if
adoRs.close
gap(i, 1) = mid(gap(i, 1),1,4) & "년 " & mid(gap(i, 1),6,2) & "월 " & mid(gap(i, 1),9,2) & "일"
end if
for j=1 to 6
if trim(gap(i, j)) = "" then
gap(i, j) = " "
end if
next
next
''로그저장
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 & "'" & Session("User_Number") & "', "
query = query & "'" & Session("loginuser") & "', "
query = query & "'문서열기', "
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 Request.ServerVariables("REMOTE_ADDr") = session("admin_ip") then
else
adoconn.execute query
end if
%>