224 lines
8.2 KiB
Plaintext
224 lines
8.2 KiB
Plaintext
<!-- #include virtual = "lib/config.asp" -->
|
|
<%
|
|
dim doc_type : doc_type = "project_report"
|
|
'''프로젝트수행계획서 결재 상신
|
|
''무조건 임원까지 결재(2013-03월)
|
|
set rsp = server.CreateObject("ADODB.RECORDSET")
|
|
set rsm = server.CreateObject("ADODB.RECORDSET")
|
|
|
|
p_sn = request("p_sn")
|
|
x = request("x")
|
|
l = request("l")
|
|
p_memo_etc = request("p_memo_etc")
|
|
tmp_txt1 = request("tmp_txt1")
|
|
tmp_txt2 = request("tmp_txt2")
|
|
tmp_txt3 = request("tmp_txt3")
|
|
tmp_txt4 = request("tmp_txt4")
|
|
tmp_txt5 = request("tmp_txt5")
|
|
tmp_txt6 = request("tmp_txt6")
|
|
tmp_txt7 = request("tmp_txt7")
|
|
tmp_txt8 = request("tmp_txt8")
|
|
tmp_txt9 = request("tmp_txt9")
|
|
tmp_txt10 = request("tmp_txt10")
|
|
depart = request("depart")
|
|
writedate = request("writedate")
|
|
|
|
subject = request("subject")
|
|
client = request("client")
|
|
cliname = request("cliname")
|
|
budget = request("budget")
|
|
vat = request("vat")
|
|
esticost = request("esticost")
|
|
esticostprop = request("esticostprop")
|
|
|
|
rschname = request("rschname")
|
|
sv = request("sv")
|
|
dp = request("dp")
|
|
extract = request("extract")
|
|
intention = request("intention")
|
|
surveycnt = request("surveycnt")
|
|
method = request("method")
|
|
sample = request("sample")
|
|
contactor = request("contactor")
|
|
cliclass = request("cliclass")
|
|
|
|
target = request("target")
|
|
area = request("area")
|
|
|
|
convdate = request("convdate")
|
|
convterm = request("convterm")
|
|
report = request("report")
|
|
premeet = request("premeet")
|
|
ot = request("ot")
|
|
fielddate = request("fielddate")
|
|
punchdate = request("punchdate")
|
|
dpdate = request("dpdate")
|
|
|
|
p_export_range = request("p_export_range")
|
|
|
|
p_sub_type = request("p_sub_type")
|
|
|
|
if x = "2" then
|
|
realcost = request("realcost")
|
|
realcostprop = request("realcostprop")
|
|
|
|
convterm2 = request("convterm2")
|
|
report2 = request("report2")
|
|
premeet2 = request("premeet2")
|
|
ot2 = request("ot2")
|
|
fielddate2 = request("fielddate2")
|
|
punchdate2 = request("punchdate2")
|
|
dpdate2 = request("dpdate2")
|
|
end if
|
|
|
|
'--------------------------------------------------------------------
|
|
'문서번호 만들기
|
|
query = "SELECT * "
|
|
query = query & "FROM Document "
|
|
query = query & "WHERE d_no LIKE 'KRC-" & year(date()) & "-V-%' "
|
|
query = query & "ORDER BY d_sn DESC "
|
|
'Response.Write query & "<BR>"
|
|
rsc.Open query, adoConn, 1
|
|
if rsc.RecordCount > 0 then
|
|
tmp_cnt = right("0000" & int(right(rsc("d_no"), 5)) + 1, 5)
|
|
else
|
|
tmp_cnt = "00001"
|
|
end if
|
|
rsc.Close
|
|
|
|
tmp_document_cnt = "KRC-" & year(date()) & "-V-" & tmp_cnt
|
|
'Response.Write tmp_document_cnt & "<BR>"
|
|
'--------------------------------------------------------------------
|
|
esticostprop = Replace(esticostprop, "," ,"")
|
|
%>
|
|
<!-- #include file = "../approval/inc_payapproval.asp" -->
|
|
<!-- #include file = "../approval/inc_payapproval_line.asp" -->
|
|
<!-- #include file = "../approval/inc_preapproval.asp" -->
|
|
<%
|
|
'====================================================================
|
|
'Document table에 삽입
|
|
query = "INSERT INTO Document "
|
|
query = query & " (d_no, d_name, d_write_name, d_write_date, d_flag, d_type, "
|
|
query = query & " d_order_cnt, d_orders,"
|
|
query = query & " d_order1, d_order2, d_order3, d_order4, d_order5, "
|
|
query = query & " d_order6, d_order7, d_order8, d_order9, d_order10, "
|
|
query = query & " d_view, d_delok) "
|
|
query = query & "VALUES "
|
|
query = query & " ('" & tmp_document_cnt & "', '프로젝트수행계획서', '" & Session("loginuser") & "', '" & date() & "', '2', '" & d_type & "', "
|
|
query = query & " '" & d_order_cnt & "', '" & d_orders & "', "
|
|
query = query & " '" & d_order1 & "', '" & d_order2 & "', '" & d_order3 & "', '" & d_order4 & "', '" & d_order5 & "', "
|
|
query = query & " '" & d_order6 & "', '" & d_order7 & "', '" & d_order8 & "', '" & d_order9 & "', '" & d_order10 & "', "
|
|
query = query & " 'Y', 'N') "
|
|
|
|
set dbin = server.CreateObject("ADODB.CONNECTION")
|
|
dbin.Open adoConn
|
|
dbin.Execute query
|
|
dbin.Close
|
|
'====================================================================
|
|
|
|
'====================================================================
|
|
'문서내용 table 내용 만들기
|
|
target99 = tmp_txt1 & "^^" & tmp_txt2 & "^^" & tmp_txt3 & "^^" & tmp_txt4 & "^^" & tmp_txt5 & "^^ ^^"
|
|
target100 = tmp_txt6 & "^^" & tmp_txt7 & "^^" & tmp_txt8 & "^^" & tmp_txt9 & "^^" & tmp_txt10 & "^^ ^^"
|
|
|
|
if x = "1" then
|
|
target1 = "Project 계약보고서"
|
|
realcost = " "
|
|
realcostprop= " "
|
|
|
|
tmp_p_child_sn = ""
|
|
If p_sub_type = "C" Then
|
|
tmp_p_child_sn = request("p_child_sn1")
|
|
Else
|
|
tmp_p_child_sn = p_sn & "_M01"
|
|
End if
|
|
elseif x = "2" then
|
|
target1 = "Project 완료보고서"
|
|
end if
|
|
target2 = depart & "^^" & writedate & "^^" & subject & "^^" & client & "^^" & cliname
|
|
target3 = budget & "^^" & vat & "^^" & esticost & "^^" & esticostprop & "^^" & realcost & "^^" & realcostprop
|
|
target4 = rschname & "^^" & sv & "^^" & dp & "^^" & extract & "^^" & intention & "^^" & surveycnt & "^^" & method & "^^" & sample
|
|
target5 = contactor & "^^" & cliclass & "^^" & target & "^^" & area
|
|
target6 = convdate & "^^" & convterm & "^^" & report & "^^" & premeet & "^^" & ot & "^^" & fielddate & "^^" & punchdate & "^^" & dpdate
|
|
target7 = convdate & "^^" & convterm2 & "^^" & report2 & "^^" & premeet2 & "^^" & ot2 & "^^" & fielddate2 & "^^" & punchdate2 & "^^" & dpdate2
|
|
'--------------------------------------------------------------------
|
|
'문서내용 table에 삽입
|
|
query = "INSERT INTO 문서내용 "
|
|
query = query & " (문서번호, 문서제목, 발급일, 발급시각, login_p_no, login_이름, login_ip, del_yes_no, "
|
|
query = query & " target1, target2, target3, target4, target5, target6, target7, target10, target99, target100, p_sn, p_child_sn) "
|
|
query = query & "VALUES "
|
|
query = query & " ('" & tmp_document_cnt & "', '프로젝트수행계획서', '" & date() & "', '" & time() & "', '" & Session("User_Number") & "', '" & Session("loginuser") & "', '" & Request.ServerVariables("REMOTE_ADDR") & "', 'no', "
|
|
query = query & " '" & target1 & "', '" & target2 & "', '" & target3 & "', '" & target4 & "', '" & target5 & "', '" & target6 & "', '" & target7 & "', '" & p_memo_etc & "', '" & target99 & "', '" & target100 & "', '" & p_sn & "', '" & tmp_p_child_sn & "') "
|
|
|
|
dbin.Open adoConn
|
|
dbin.Execute query
|
|
dbin.Close
|
|
|
|
query = "UPDATE [project2].[dbo].[T_PROJECT_METHOD] "
|
|
query = query & "SET p_progress_status = '007' "
|
|
query = query & "WHERE p_sn = '" & p_sn & "' "
|
|
query = query & "and p_sub_type = '" & p_sub_type & "' "
|
|
|
|
If p_sub_type = "C" Then
|
|
query = query & " and p_child_sn = '" & tmp_p_child_sn & "' "
|
|
End if
|
|
adoconn.Execute query
|
|
'====================================================================
|
|
'결재 최종완료
|
|
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 = '" & p_sn & "' "
|
|
query = query & "and p_sub_type = '" & p_sub_type & "' "
|
|
If request("p_sub_type") = "C" Then
|
|
query = query & " and p_child_sn = '" & tmp_p_child_sn & "' "
|
|
End if
|
|
|
|
adoconn.Execute query
|
|
' response.write "query : " & query & "<br/>"
|
|
|
|
query = "UPDATE [project2].[dbo].[T_PROJECT_BASE] "
|
|
query = query & "SET p_state = 'P' "
|
|
query = query & "WHERE p_sn = '" & p_sn & "' "
|
|
|
|
adoconn.Execute query
|
|
' response.write "query : " & query & "<br/>"
|
|
|
|
query = "insert into 문서내용_log (문서번호, 문서제목, 대상자_p_no, 대상자_이름, 내용,"
|
|
query = query & " 발급일, 발급시각, 발급자_p_no, 발급자_이름, 발급자_ip) values ( "
|
|
query = query & "'" & tmp_document_cnt & "', "
|
|
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 & "'" & Session("USERIP") & "')"
|
|
|
|
adoconn.execute query
|
|
|
|
End if
|
|
%>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
|
|
<LINK rel="stylesheet" type="text/css" href="/lib/text.css">
|
|
<title>
|
|
</title>
|
|
<script language=javascript>
|
|
function goit(x) {
|
|
<% if d_order_cnt = 77 then %>
|
|
alert('결재완료 되었습니다');
|
|
<% else %>
|
|
alert('결재요청 되었습니다');
|
|
<% end if %>
|
|
self.close();
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onLoad="goit('<%=l%>')">
|
|
<form name="pms" method="post">
|
|
<input type="hidden" name="p_sn" value="<%=p_sn%>">
|
|
</body>
|
|
</html> |