<% 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 %>

직접비 관리

<% if search_flag = 2 then %>
<% 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 %> <% end if ' if search_flag = 2 then %>
선택하는 년/월은 조사 시작일을 의미합니다. 아래에서 찾을 조건을 선택하시고 "찾기"를 눌러주세요.
등록년도    조사시작월    본부    <% 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 %> 조사 방법    조건  
<% if p_depart_name = cost_type or p_depart_name = "admin" then %> <% end if %>