182 lines
5.4 KiB
Plaintext
182 lines
5.4 KiB
Plaintext
<!-- #include virtual = "lib/config.asp" -->
|
|
<!-- #include virtual = "include/JSON_2.0.4.asp" -->
|
|
<%
|
|
Response.CharSet = "EUC-KR" 'ÇѱÛ
|
|
Response.AddHeader "Pragma","no-cache"
|
|
Response.AddHeader "cache-control", "no-staff"
|
|
Response.Expires = -1
|
|
|
|
Select Case Request("command")
|
|
Case "hangmok"
|
|
p_depart = Session("Depart_Code")
|
|
|
|
if (p_depart = 0) or (p_depart >= 20 and p_depart <= 95) then
|
|
d_cost_type = "research"
|
|
ElseIf p_depart = 17 Then
|
|
d_cost_type = "support"
|
|
ElseIf p_depart = 18 Then
|
|
d_cost_type = "support"
|
|
ElseIf p_depart = 19 Then
|
|
d_cost_type = "support"
|
|
else
|
|
d_cost_type = "field"
|
|
end If
|
|
|
|
if request("d_cost_type") <> "" Then
|
|
d_cost_type = request("d_cost_type")
|
|
End If
|
|
|
|
response.write "<option value=''>¼± ÅÃ</option>"
|
|
|
|
query = " "
|
|
query = query & " SELECT id, d_cost_code, d_cost_name, d_cost_kind "
|
|
query = query & " FROM direct_costcode "
|
|
query = query & " WHERE 1=1 "
|
|
if d_cost_type <> "all" Then
|
|
query = query & " AND d_cost_kind = '"& d_cost_type &"' "
|
|
End If
|
|
query = query & " AND d_cost_useyn = 'Y' "
|
|
query = query & " AND d_cost_parents = '0' "
|
|
query = query & " ORDER BY "
|
|
if d_cost_type = "all" Then
|
|
query = query & " d_cost_kind, "
|
|
End If
|
|
query = query & " d_cost_code "
|
|
Adors.Open query, adoConn, 1
|
|
|
|
for i=1 to Adors.recordCount
|
|
response.write "<option value='"& Adors("id")&"'>"
|
|
if d_cost_type = "all" Then
|
|
response.write "(" & Adors("d_cost_kind") & ")"
|
|
End If
|
|
response.write Adors("d_cost_name")
|
|
response.write "</option>"
|
|
Adors.movenext
|
|
next
|
|
|
|
Adors.close
|
|
Case "sebu"
|
|
hangmok = request("hangmok")
|
|
|
|
response.write "<option value=''>¼± ÅÃ</option>"
|
|
|
|
query = " "
|
|
query = query & " SELECT id, d_cost_code, d_cost_name "
|
|
query = query & " FROM direct_costcode "
|
|
query = query & " WHERE d_cost_kind = (SELECT TOP 1 d_cost_kind FROM direct_costcode WHERE id = '"& hangmok &"') "
|
|
query = query & " AND d_cost_useyn = 'Y' "
|
|
query = query & " AND d_cost_parents = (SELECT TOP 1 d_cost_code FROM direct_costcode WHERE id = '"& hangmok &"') "
|
|
query = query & " ORDER BY d_cost_code "
|
|
Adors.Open query, adoConn, 1
|
|
|
|
for i=1 to Adors.recordCount
|
|
response.write "<option value='"& Adors("id")&"'>"&Adors("d_cost_name")&"</option>"
|
|
Adors.movenext
|
|
next
|
|
|
|
Adors.close
|
|
Case "est"
|
|
p_sn = request("p_sn")
|
|
p_child_sn = request("p_child_sn")
|
|
hangmok = request("hangmok")
|
|
sebu = Request("sebu")
|
|
|
|
query = ""
|
|
query = query & " SELECT ISNULL(SUM(CAST(est_money AS money)), 0) as money "
|
|
query = query & " FROM direct_cost dc LEFT OUTER JOIN direct_costcode dcc ON dc.cost_type = dcc.d_cost_kind AND dc.sebu = dcc.d_cost_name AND dcc.d_cost_parents > 0 "
|
|
query = query & " WHERE p_sn = '"& p_sn &"' "
|
|
query = query & " AND hangmok = '"& hangmok &"' "
|
|
If sebu <> "" Then
|
|
query = query & " AND dcc.id = '"& sebu &"' "
|
|
End If
|
|
query = query & " AND del_yes_no = 'no' "
|
|
query = query & " AND p_child_sn = '"& p_child_sn &"' "
|
|
|
|
Adors.Open query, adoConn, 1
|
|
if Adors.recordCount > 0 then
|
|
Response.Write Adors("money")
|
|
else
|
|
Response.Write "0"
|
|
end if
|
|
|
|
Adors.close
|
|
Case "act"
|
|
p_sn = request("p_sn")
|
|
p_child_sn = request("p_child_sn")
|
|
hangmok = request("hangmok")
|
|
sebu = Request("sebu")
|
|
|
|
query = ""
|
|
query = query & " SELECT ISNULL(sum(CONVERT(money, CONVERT(varchar(30), a.target5))), 0) as money "
|
|
query = query & " FROM ¹®¼³»¿ë a LEFT OUTER JOIN Document b on a.¹®¼¹øÈ£ = b.d_no "
|
|
query = query & " WHERE d_order_cnt <> '99' "
|
|
query = query & " AND a.del_yes_no <> 'yes' "
|
|
query = query & " AND p_sn LIKE '"& p_sn &",' "
|
|
query = query & " AND a.target11 LIKE '"& hangmok &"' "
|
|
If sebu <> "" Then
|
|
query = query & " AND a.target12 LIKE '"& sebu &"' "
|
|
End If
|
|
query = query & " AND a.target20 LIKE '"& p_child_sn &"' "
|
|
|
|
Adors.Open query, adoConn, 1
|
|
|
|
if Adors("money") <> "" then
|
|
Response.Write Adors("money")
|
|
else
|
|
Response.Write "0"
|
|
end if
|
|
|
|
Adors.close
|
|
Case "dupnum"
|
|
p_child_sn = request("p_child_sn")
|
|
expence_num = request("expence_num")
|
|
|
|
query = ""
|
|
query = query & " SELECT case when a.target20 LIKE '"& p_child_sn &"' then '1' else '0' end as chk, ¹®¼¹øÈ£, target5, target1, target20 "
|
|
query = query & " FROM ¹®¼³»¿ë a LEFT OUTER JOIN Document b on a.¹®¼¹øÈ£ = b.d_no "
|
|
query = query & " WHERE d_order_cnt <> '99' "
|
|
query = query & " AND a.del_yes_no <> 'yes' "
|
|
query = query & " AND a.target18 LIKE '"& expence_num &"' "
|
|
|
|
Adors.Open query, adoConn, 1
|
|
Redim data(Adors.recordcount-1)
|
|
iCnt = 0
|
|
if Adors.RecordCount > 0 then
|
|
Do While Not Adors.Eof
|
|
set dup = jsObject()
|
|
dup("chk") = Adors("chk")
|
|
dup("d_no") = Adors("¹®¼¹øÈ£")
|
|
dup("cost") = Adors("target5")
|
|
dup("p_child_sn") = Adors("target20")
|
|
dup("p_subject") = Adors("target1")
|
|
set data(iCnt) = dup
|
|
iCnt = iCnt + 1
|
|
Adors.MoveNext
|
|
Loop
|
|
else
|
|
|
|
end if
|
|
|
|
response.write toJSON(data)
|
|
|
|
Adors.close
|
|
|
|
Case "projectCompany"
|
|
p_sn = request("p_sn")
|
|
|
|
query = ""
|
|
query = query & " SELECT p_project_type_cd "
|
|
query = query & " FROM T_PROJECT_BASE "
|
|
query = query & " WHERE p_sn = '" & p_sn & "' "
|
|
|
|
Adors.Open query, adoConn, 1
|
|
if Adors.RecordCount > 0 then
|
|
response.write Adors("p_project_type_cd")
|
|
else
|
|
response.write ""
|
|
end if
|
|
Adors.close
|
|
Case Else
|
|
Response.Write "0"
|
|
End Select
|
|
%> |