369 lines
15 KiB
Plaintext
369 lines
15 KiB
Plaintext
<!-- #include virtual = "include/header.asp" -->
|
|
<!-- #include virtual = "include/left.asp" -->
|
|
<%
|
|
Response.Expires = 0
|
|
Dim Sql
|
|
dim i
|
|
dim j
|
|
Dim txtHtml
|
|
dim tempStr
|
|
Dim PrjCnt
|
|
dim direct_cost_PrjCnt
|
|
dim user_name
|
|
dim tmp_year
|
|
dim tmp_month
|
|
dim p_depart
|
|
dim sc_name
|
|
dim sc_name_type
|
|
dim sc_method
|
|
dim direct_cost_type
|
|
dim Search_flag
|
|
dim prj_list() 'È«±Ù Ãß°¡
|
|
dim krc_team()
|
|
dim krc_team_cnt
|
|
dim cost_type
|
|
|
|
p_depart = Session("Depart_Code")
|
|
if p_depart <= 10 or (p_depart >= 20 and p_depart <= 95) then
|
|
p_depart_name = "research"
|
|
elseif p_depart = 12 then
|
|
p_depart_name = "field"
|
|
else
|
|
p_depart_name = "admin"
|
|
end if
|
|
|
|
tmp_year = Request("tmp_year")
|
|
tmp_month = Request("tmp_month")
|
|
p_depart = Request("p_depart")
|
|
sc_name = Request("sc_name")
|
|
sc_name_type = Request("sc_name_type")
|
|
sc_method = Request("sc_method")
|
|
cost_type = request("cost_type")
|
|
if cost_type = "" then
|
|
cost_type = "field"
|
|
end if
|
|
|
|
if tmp_year = "" and tmp_month = "" and p_depart = "" and sc_method = "" then
|
|
search_flag = 1
|
|
else
|
|
search_flag = 2
|
|
end if
|
|
|
|
if tmp_year = "" then
|
|
tmp_year = year(date)
|
|
end if
|
|
|
|
if tmp_month = "" then
|
|
tmp_month = 0
|
|
end if
|
|
if p_depart = "" then
|
|
p_depart = 0
|
|
end if
|
|
|
|
if sc_method = "" then
|
|
sc_method = 100
|
|
end if
|
|
|
|
if sc_name_type = "" then
|
|
sc_name_type = 0
|
|
end if
|
|
|
|
sql = ""
|
|
sql = sql & " SELECT DISTINCT before_t_cd1 as d_code, LEFT(T_Name, 8) as d_name "
|
|
sql = sql & " FROM project2.dbo.v_Department "
|
|
sql = sql & " WHERE (before_t_cd1 in (12, 90) or before_t_cd1 between 20 and 99) "
|
|
sql = sql & " order by LEFT(T_Name, 8) "
|
|
Rs.open sql, adoconn,adopenstatic, adlockreadonly
|
|
krc_team_cnt = Rs.recordcount
|
|
redim krc_team(krc_team_cnt,2)
|
|
krc_team_cnt = 0
|
|
do while not Rs.eof
|
|
krc_team_cnt = krc_team_cnt + 1
|
|
krc_team(krc_team_cnt,1) = rs("d_code")
|
|
krc_team(krc_team_cnt,2) = rs("d_name")
|
|
Rs.movenext
|
|
loop
|
|
Rs.close
|
|
|
|
Sql = "select p_name from person where p_no ='" & Session("user_number") & "'"
|
|
Rs.open sql, adoconn,adopenstatic, adlockreadonly
|
|
user_name = Rs.fields("p_name")
|
|
Rs.close
|
|
%>
|
|
<!-- Content Wrapper. Contains page content -->
|
|
<div class="content-wrapper">
|
|
<!-- Content Header (Page header) -->
|
|
<div class="content-header">
|
|
<h1>Á÷Á¢ºñ °ü¸®</h1>
|
|
</div>
|
|
<!-- /.content-header -->
|
|
<!-- Main content -->
|
|
<div class="content-body">
|
|
<div class="content">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<form method='post' name='frm_direct_cost' onsubmit="return false;" >
|
|
<input type = 'hidden' readonly name = 'cost_type' value = '<%=cost_type%>'>
|
|
<input type = 'hidden' readonly name = 'p_depart_name' value = '<%=p_depart_name%>'>
|
|
<ul class="nav nav-tabs mb-0">
|
|
<li class="nav-item"><button onclick="location.href='./direct_cost_prjSearch_2014.asp?cost_type=field'" class="p-2 nav-link <% If cost_type="field" then %>active<% end if %>" type="button">½Ç»ç Á÷Á¢ºñ</button></li>
|
|
<li class="nav-item"><button onclick="location.href='./direct_cost_prjSearch_2014.asp?cost_type=research'" class="p-2 nav-link <% If cost_type="research" then %>active<% end if %>" type="button">¿¬±¸ Á÷Á¢ºñ</button></li>
|
|
</ul>
|
|
<table width="1200px" cellpadding="3" cellspacing="0" border="0" style="border-collapse:collapse;">
|
|
<tr>
|
|
<td style="padding:5 0 5 0" class="brown">
|
|
¼±ÅÃÇÏ´Â ³â/¿ùÀº Á¶»ç ½ÃÀÛÀÏÀ» ÀǹÌÇÕ´Ï´Ù.
|
|
¾Æ·¡¿¡¼ ãÀ» Á¶°ÇÀ» ¼±ÅÃÇϽðí "ã±â"¸¦ ´·¯ÁÖ¼¼¿ä.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding:5 0 5 0">
|
|
<table width="100%" height="37" cellpadding="0" cellspacing="1" border="0" bgcolor="#c0c0c0">
|
|
<tr>
|
|
<td bgcolor="#DFDFDF" style="padding:0 10 0 10">
|
|
µî·Ï³âµµ
|
|
<select name=tmp_year>
|
|
<%for i=cint(year(date)) to 2009 step -1 %>
|
|
<OPTION value='<%=i%>' <%if cint(i) = cint(tmp_year) then%> selected <%end if%>><%=i%></OPTION>
|
|
<%next%>
|
|
</SELECT>
|
|
Á¶»ç½ÃÀÛ¿ù
|
|
<select name=tmp_month>
|
|
<OPTION value='0'>Àüü</OPTION>
|
|
<% for i=1 to 12%>
|
|
<OPTION value='<%=zeroFormat(i,2)%>' <%if cint(i) = cint(tmp_month) then%> selected <%end if%>><%=i%>¿ù</OPTION>
|
|
<%next%>
|
|
</select>
|
|
º»ºÎ
|
|
<select name=p_depart>
|
|
<OPTION value='0' <%if cint(p_depart) = 0 then%> selected <%end if%>>Àüü</OPTION>
|
|
<%for i=1 to krc_team_cnt%>
|
|
<OPTION value='<%=krc_team(i,1)%>' <%if cint(p_depart) = cint(krc_team(i,1)) then%> selected <%end if%>><%=krc_team(i,2)%></OPTION>
|
|
<%next%>
|
|
</select>
|
|
<%
|
|
dim dir_cost_method_type() 'Á¶»ç¹æ¹ýÀÇ Á¾·ù(ºÐ·ù)
|
|
dim cost_sql
|
|
dim iii
|
|
|
|
cost_sql = "SELECT * FROM T_PROJECT_METHOD_CD WHERE p_method_yn = 'y' ORDER BY p_method_cd "
|
|
Rs.open cost_sql, adoconn, adopenstatic, adlockreadonly
|
|
redim dir_cost_method_type(rs.recordcount+1,2) 'Á¶»ç¹æ¹ýÀÇ Á¾·ù(ºÐ·ù)
|
|
dir_cost_method_type(0,1) = "100"
|
|
dir_cost_method_type(0,2) = "Àüü"
|
|
dir_cost_method_type(1,1) = "0"
|
|
dir_cost_method_type(1,2) = "¸ÖƼ(M)"
|
|
iii = 1
|
|
do while not Rs.eof
|
|
iii = iii + 1
|
|
dir_cost_method_type(iii,1) = trim(rs("p_method_cd"))
|
|
dir_cost_method_type(iii,2) = trim(rs("p_method_nm"))
|
|
Rs.movenext
|
|
loop
|
|
Rs.close
|
|
%>
|
|
Á¶»ç ¹æ¹ý
|
|
<select name="sc_method">
|
|
<%for i=0 to ubound(dir_cost_method_type)%>
|
|
<OPTION value='<%=dir_cost_method_type(i,1)%>' <%if cint(dir_cost_method_type(i,1))=cint(sc_method) then%> selected <%end if%>><%=dir_cost_method_type(i,2)%></OPTION>
|
|
<%next%>
|
|
</select>
|
|
Á¶°Ç
|
|
<select name=sc_name_type>
|
|
<OPTION value='0' <% if cint(sc_name_type) = 0 then %> selected <% end if %>>ÇÁ·ÎÁ§Æ® ÄÚµå</option>
|
|
<OPTION value='1' <% if cint(sc_name_type) = 1 then %> selected <% end if %>>ÇÁ·ÎÁ§Æ®¸í</option>
|
|
</select>
|
|
<input type="text" style="width:100" name=sc_name maxlength=20 style='ime-mode:inactive;' value='<%=sc_name%>'>
|
|
<img src="/images/common/btn_smallsrch.gif" align="absmiddle" onclick='go_search();' style='cursor:pointer' >
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<% if search_flag = 2 then %>
|
|
<br>
|
|
<%
|
|
query = "SELECT T.*, TPMC.p_method_nm "
|
|
query = query & "FROM ( "
|
|
query = query & " SELECT "
|
|
query = query & " CASE "
|
|
query = query & " WHEN TPM.p_child_sn = '' THEN TPM.p_sn ELSE TPM.p_child_sn "
|
|
query = query & " END AS p_sn "
|
|
query = query & " , TPM.p_subject "
|
|
query = query & " , TPM.p_sub_type "
|
|
query = query & " , TPM.p_method_cd "
|
|
query = query & " , TPM.p_method_nm "
|
|
query = query & " , TPM.p_intention "
|
|
query = query & " , TPM.p_input_dt "
|
|
query = query & " , ISNULL(D.dc_yn, 'N') as dc_yn "
|
|
query = query & " FROM V_PROJECT as TPB "
|
|
query = query & " INNER JOIN V_PROJECT_METHOD as TPM "
|
|
query = query & " ON TPB.p_sn = TPM.p_sn "
|
|
query = query & " AND TPM.p_progress_status >= '006' "
|
|
query = query & " AND TPM.p_sub_type = 'C' "
|
|
query = query & " LEFT JOIN ( SELECT DISTINCT p_child_sn, 'Y' as dc_yn "
|
|
query = query & " FROM direct_cost dc WHERE del_yes_no = 'no' AND cost_type = '" & cost_type & "' AND p_child_sn is not null ) D "
|
|
query = query & " ON TPM.p_child_sn = D.p_child_sn "
|
|
'Á¶È¸ ¿É¼Ç
|
|
if p_depart <> "0" AND p_depart <> "" then
|
|
query = query & " WHERE ( p_depart_dep = " & p_depart & " "
|
|
query = query & " or p_rsch_dept = " & p_depart & " "
|
|
query = query & " or p_field_dept = " & p_depart & " "
|
|
query = query & " or p_is_dept = " & p_depart & " "
|
|
query = query & " or p_supp_dept = " & p_depart & " "
|
|
query = query & " ) "
|
|
else
|
|
' query = query & " WHERE (p_depart_dep <= 10 or (p_depart_dep >= 31 and p_depart_dep <=49)) "
|
|
end If
|
|
query = query & " ) as T LEFT OUTER JOIN T_PROJECT_METHOD_CD TPMC ON T.p_method_cd = TPMC.p_method_cd"
|
|
'³â ¿É¼Ç
|
|
if tmp_year <> "0" and tmp_year <> "" then
|
|
query = query & " WHERE SUBSTRING(convert(varchar(30), T.p_input_dt, 112), 1, 4) = '" & tmp_year & "' "
|
|
else
|
|
query = query & " WHERE SUBSTRING(convert(varchar(30), T.p_input_dt, 112), 1, 4) = '" & year(date()) & "' "
|
|
end if
|
|
'¿ù ¿É¼Ç
|
|
if tmp_month <> "0" and tmp_month <> "" then
|
|
query = query & " AND SUBSTRING(convert(varchar(30), T.p_input_dt, 112), 5, 2) = '" & right("0" & tmp_month, 2) & "' "
|
|
end if
|
|
'À¯Çü ¿É¼Ç
|
|
if sc_method <> "100" and sc_method <> ""then
|
|
query = query & " AND T.p_method_cd = '" & sc_method & "' "
|
|
end if
|
|
if sc_name <> "" then
|
|
if cint(sc_name_type) = "0" then
|
|
query = query & " and p_sn like '%" & sc_name & "%'" 'ÇÁ·ÎÁ§Æ® ÄÚµå
|
|
else
|
|
query = query & " and p_subject like '%" & sc_name & "%'" 'ÇÁ·ÎÁ§Æ®À̸§º°
|
|
end if
|
|
end if
|
|
query = query & " order by p_sn DESC"
|
|
Rs.open query, adoconn, adopenstatic, adlockreadonly
|
|
PrjCnt = Rs.recordcount
|
|
|
|
redim prj_list(PrjCnt, 6)
|
|
i=0
|
|
do while not Rs.eof
|
|
i = i + 1
|
|
prj_list(i, 1) = Rs.fields("p_sn")
|
|
prj_list(i, 2) = Rs.fields("p_subject")
|
|
if rs("p_sub_type") = "C" then
|
|
prj_list(i, 3) = Rs.fields("p_method_nm")
|
|
elseif rs("p_sub_type") = "M" then
|
|
prj_list(i, 3) = "¸ÖƼ"
|
|
end if
|
|
prj_list(i, 4) = Rs.fields("p_intention")
|
|
prj_list(i, 5) = Rs.fields("p_sub_type")
|
|
prj_list(i, 6) = Rs.fields("dc_yn")
|
|
Rs.movenext
|
|
loop
|
|
Rs.close
|
|
%>
|
|
<tr>
|
|
<td>
|
|
<SELECT style='width:100%;HEIGHT: 300px' size=2 name=prj_list OnDblClick='direct_cost_print();'>
|
|
<%for i=1 to PrjCnt%>
|
|
<option value='<%=prj_list(i, 1)%>@<%=prj_list(i, 5) %>' <% if prj_list(i, 6) = "Y" Then %> style="font-weight:bold;color:red;" <% End If %>>
|
|
[<%=prj_list(i, 1) %>] <%=prj_list(i, 2)%> -- <%=prj_list(i, 3)%> --- <%= prj_list(i, 4)%>
|
|
</option>
|
|
<%next%>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" style="padding:10 0 0 0">
|
|
<% if p_depart_name = cost_type or p_depart_name = "admin" then %>
|
|
<img src="/images/common/btn_write.jpg" align="absmiddle" onclick='direct_cost();' style="cursor:pointer">
|
|
<img src="/images/common/btn_print.jpg" align="absmiddle" onclick='direct_cost_print();' style="cursor:pointer" >
|
|
<% end if %>
|
|
</td>
|
|
</tr>
|
|
<% end if ' if search_flag = 2 then %>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- /.content -->
|
|
<!-- REQUIRED SCRIPTS -->
|
|
<script>
|
|
function go_search(){
|
|
var tmp_year = document.frm_direct_cost.tmp_year.value;
|
|
var tmp_month = document.frm_direct_cost.tmp_month.value;
|
|
var p_depart = document.frm_direct_cost.p_depart.value;
|
|
var sc_name = document.frm_direct_cost.sc_name.value;
|
|
var sc_name_type = document.frm_direct_cost.sc_name_type.value;
|
|
var sc_method = document.frm_direct_cost.sc_method.value;
|
|
var cost_type = document.frm_direct_cost.cost_type.value;
|
|
var p_depart_name = document.frm_direct_cost.p_depart_name.value;
|
|
|
|
if (p_depart_name == "admin") {
|
|
if (cost_type == "field" || cost_type == "") {
|
|
p_depart_name = "field"
|
|
} else if (cost_type == "research") {
|
|
p_depart_name = "research"
|
|
} else if (cost_type == "dp") { //#####DP(ÄÚµù) Ãß°¡ 2018-02-28 ±èÁ¾ÈÖ
|
|
p_depart_name = "dp"
|
|
} else {
|
|
alert("°ü¸®ÀÚ ¹®ÀÇÇϽÿÀ");
|
|
}
|
|
} else if (cost_type != "" && cost_type != null) {
|
|
p_depart_name = cost_type;
|
|
}
|
|
document.frm_direct_cost.action = "direct_cost_prjSearch_2014.asp?tmp_year=" + tmp_year + "&tmp_month=" + tmp_month + "&p_depart=" + p_depart + "&sc_name=" + sc_name + "&sc_method=" + sc_method + "&sc_name_type=" + sc_name_type + "&cost_type=" + p_depart_name;
|
|
document.frm_direct_cost.submit();
|
|
}
|
|
|
|
function direct_cost() {//Á÷Á¢ºñ ÀÔ·ÂȸéÀ¸·Î °¡±â
|
|
if (document.frm_direct_cost.prj_list.value == "") {
|
|
alert("Á÷Á¢ºñ ÀÛ¼º¿ë ÇÁ·ÎÁ§Æ®¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
|
|
return false;
|
|
}else{
|
|
var p_sn = document.frm_direct_cost.prj_list.value;
|
|
var url;
|
|
if (new_project_2014(p_sn) == "1") {
|
|
url = "project_direct_cost.asp?p_sn=" + p_sn;
|
|
} else if (new_project_2014(p_sn) == "2") {
|
|
url = "project_direct_cost_2014.asp?p_sn=" + p_sn;
|
|
}
|
|
url = url + "&tmp_year=" + document.frm_direct_cost.tmp_year.value;
|
|
url = url + "&tmp_month=" + document.frm_direct_cost.tmp_month.value;
|
|
url = url + "&p_depart=" + document.frm_direct_cost.p_depart.value;
|
|
url = url + "&sc_name=" + document.frm_direct_cost.sc_name.value;
|
|
url = url + "&sc_method=" + document.frm_direct_cost.sc_method.value;
|
|
url = url + "&cost_type=" + document.frm_direct_cost.cost_type.value;
|
|
document.frm_direct_cost.action = url
|
|
document.frm_direct_cost.submit();
|
|
}
|
|
}
|
|
|
|
function direct_cost_print(){//ÀÔ·ÂµÈ Á÷Á¢ºñ º¸±â¿ëÀ¸·Î °¡±â
|
|
if (document.frm_direct_cost.prj_list.value == ""){
|
|
alert ("º¸°íÀÚ ÇÏ´Â Á÷Á¢ºñÀÇ ÇÁ·ÎÁ§Æ®¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
|
|
return false;
|
|
}else {
|
|
var p_sn = document.frm_direct_cost.prj_list.value;
|
|
var url;
|
|
if (new_project_2014(p_sn) == "1") {
|
|
url = "/ess/direct_cost_print.asp?p_sn=" + p_sn;
|
|
} else if (new_project_2014(p_sn) == "2") {
|
|
url = "/ess/direct_cost_print_2014.asp?p_sn=" + p_sn;
|
|
}
|
|
|
|
url = url + "&tmp_year=" + document.frm_direct_cost.tmp_year.value;
|
|
url = url + "&tmp_month=" + document.frm_direct_cost.tmp_month.value;
|
|
url = url + "&p_depart=" + document.frm_direct_cost.p_depart.value;
|
|
url = url + "&sc_name=" + document.frm_direct_cost.sc_name.value;
|
|
url = url + "&sc_method=" + document.frm_direct_cost.sc_method.value;
|
|
url = url + "&view_chk=2";
|
|
url = url + "&cost_type=" + document.frm_direct_cost.cost_type.value;
|
|
window.open (url,"Á÷Á¢ºñ ÇöȲ","left=50, top=50, menubar=no, location=no, status=no, toolbar=no, width=1200, height=800, scrollbars=yes ,resizable=no","");
|
|
}
|
|
}
|
|
</script>
|
|
</div>
|
|
<!-- /.content-wrapper -->
|
|
<!-- #include virtual = "include/footer.asp" --> |