<% set rsp = server.CreateObject("ADODB.RECORDSET") set rsm = server.CreateObject("ADODB.RECORDSET") d_no = request("d_no") approve_pass = request("approve_pass") tmp_pass_psn = request("tmp_pass_psn") 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 tmp = split(rsc("target99"), "^^") for i = 0 to ubound(tmp) if trim(tmp(i)) = "" then if approve_pass = "1" then tmp(i) = "부재" else tmp(i) = Session("loginuser") & "
" & replace(date(), "-", "") & "
" & Session("User_Number") end if tmp_i = i exit for end if next '---------------------------------------------------- 'target100에 날짜 삽입 tmp2 = split(rsc("target100"), "^^") tmp2(tmp_i) = month(now()) & " / " & day(now()) '---------------------------------------------------- '다음결재자를 가르키도록 하나를 더해 줌 tmp_i = tmp_i + 1 'Response.Write "tmp_end : " & tmp_end & "
" for i = int(rsc("d_order_cnt")) + 1 to ubound(tmp) + 1 if rsc("d_order" & i) = "전결" or rsc("d_order" & i) = "NO" then tmp_order_value = "전결" if rsc("d_order" & i) = "전결" then tmp_1 = "1" else tmp_1 = "0" end if if tmp_1 = "1" then tmp(tmp_i) = tmp_order_value tmp_i = tmp_i + 1 end if else d_order_cnt = i d_orders = rsc("d_order" & i) exit for end if next 'Response.Write "d_order_cnt : " & d_order_cnt & "
" '결재 최종완료 'if trim(tmp(ubound(tmp) + 1)) <> "" then if i > ubound(tmp) + 1 then d_order_cnt = "77" d_orders = rsc("login_p_no") end if 'Response.Write "d_order_cnt : " & d_order_cnt & "
" target99 = "" for i = 0 to ubound(tmp) if i <> 0 then target99 = target99 & "^^" end if target99 = target99 & tmp(i) next target100 = "" for i = 0 to ubound(tmp2) if i <> 0 then target100 = target100 & "^^" end if target100 = target100 & tmp2(i) next query = "UPDATE Document " query = query & "SET " query = query & " d_order_cnt = '" & d_order_cnt & "', " query = query & " d_orders = '" & d_orders & "' " query = query & "WHERE d_no = '" & d_no & "' " set dbin = server.CreateObject("ADODB.CONNECTION") dbin.Open adoConn dbin.Execute query dbin.Close '결재 최종완료 If d_order_cnt = "77" Then query = "UPDATE [project2].[dbo].[T_PROJECT_METHOD] " query = query & "SET p_progress_status = '008' " query = query & "WHERE p_sn = '" & rsc("p_sn") & "' " If request("p_sub_type") = "C" Then query = query & " and p_child_sn = '" & request("p_child_sn") & "' " End if adoconn.Execute query ' response.write "query : " & query & "
" query = "UPDATE [project2].[dbo].[T_PROJECT_BASE] " query = query & "SET p_state = 'P' " query = query & "WHERE p_sn = '" & rsc("p_sn") & "' " adoconn.Execute query ' response.write "query : " & query & "
" query = "insert into 문서내용_log (문서번호, 문서제목, 대상자_p_no, 대상자_이름, 내용," query = query & " 발급일, 발급시각, 발급자_p_no, 발급자_이름, 발급자_ip) values ( " query = query & "'" & d_no & "', " query = query & "'프로젝트수행계획서', " 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 & "'', '', " ' query = query & "'" & user_name(0) & "', " ' query = query & "'" & user_name(1) & "', " query = query & "'" & Session("USERIP") & "')" adoconn.execute query End if query = "UPDATE 문서내용 " query = query & "SET " query = query & " target99 = '" & target99 & "', " query = query & " target100 = '" & target100 & "' " query = query & "WHERE 문서번호 = '" & d_no & "' " set dbin = server.CreateObject("ADODB.CONNECTION") dbin.Open adoConn dbin.Execute query dbin.Close 'Response.Write target99 & "
" '부재 버튼 클릭하였을 때 document_pass 테이블에 삽입 if approve_pass = "1" then query = "INSERT INTO [Document_pass] " query = query & "(d_no, d_orders, d_write_date, d_view, d_delok) " query = query & "VALUES " query = query & "('" & d_no & "', " query = query & " '" & tmp_pass_psn & "', " query = query & " '" & date() & "', " query = query & " 'Y', " query = query & " 'N') " end if set dbin = server.CreateObject("ADODB.CONNECTION") dbin.Open adoConn dbin.Execute query dbin.Close %>
<% else alert2 "DB 에러. 관리자에게 문의하세요" end if 'if rsc.RecordCount > 0 then rsc.Close %>