<%@ codepage="949" language="VBScript" %> <% '#################################################################################################### ''???@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Dim sel_logo sel_logo = "kri" ''@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ adoConn.CommandTimeout = 0 adoConn.ConnectionTimeout = 6000 Dim clientIp: clientIp = Request.ServerVariables("REMOTE_ADDR"): 'Response.Write clientIp GNB_TITLE = "Korea Research Intranet" Dim DevNode : DevNode = "real" 'DevNode = "TEST" If DevNode = "TEST" Then GNB_TITLE = "[" & DevNode & "] " & GNB_TITLE End If ''//============ If( DevNode = "real" )Then session("db_connect") = "Provider=SQLNCLI10.1;Password=krco#51304;Persist Security Info=True;User ID=sa;Initial Catalog=project2;Data Source=10.10.11.6;" Else session("db_connect") = "Provider=SQLOLEDB.1;Password=krco#51304;Persist Security Info=True;User ID=sa;Initial Catalog=project2;Data Source=10.10.15.177,1313" End if adoConn.open session("db_connect") If split(request.servervariables("HTTP_url"), "/")(1) <> "login.asp" _ And split(split(request.servervariables("HTTP_url"), "/")(1), "?")(0) <> "login_ok.asp" _ And split(request.servervariables("HTTP_url"), "/")(1) <> "nk" Then 'response.write " IP check " 'call Time_Check(Session("Login_Check")) End If response.write "
"& Request.ServerVariables("REMOTE_ADDR") 'response.write "
"& replace(replace(Request.ServerVariables("REMOTE_ADDR"), "10.10.20.", "10.10.13."), "10.10.17.", "10.10.13.") 'response.write "
"& left(replace(replace(Request.ServerVariables("REMOTE_ADDR"), "10.10.20.", "10.10.13."), "10.10.17.", "10.10.13."),9) if( left(replace(replace(Request.ServerVariables("REMOTE_ADDR"), "10.10.20.", "10.10.13."), "10.10.17.", "10.10.13."),9) <> "10.10.13." )then response.write Request.ServerVariables("REMOTE_ADDR") response.end end if %> <% Response.Charset = "EUC-KR" Response.codePage = "949" Response.ContentType="text/html;charset=euc-kr" %> <%=GNB_TITLE%> <% If Request("dialog") <> "1" Then %> <% If Request("command") <> "excel" Then %> <% End If %> <% End If %>
<% Dim sdate : sdate = Request("sdate") Dim edate : edate = Request("edate") sdate = "2022-01-01" edate = Date() query = "" query = query &"select * from"&VbCrlf query = query &" ("&VbCrlf query = query &" select"&VbCrlf query = query &" isnull(PCode,'') PCode, isnull(PTeam,'') PTeam, p_sn, p_subject, p_cli_company_nm, '' as p_method, ''as p_sample ,"&VbCrlf query = query &" p_cont_cost, isnull(p_total_cost,0) as p_total_cost, '' as pc_con_cost, '' as sum_est, '' as rate_est, '' as sum_act, '' as rate_act, "&VbCrlf query = query &" '' as r_est, '' as r_act, '' as f_est, '' as f_act, convert(varchar(10), p_decide_date,23) p_decide_date,"&VbCrlf query = query &" '' as p_con_date_st, '' as p_con_date_end, p_state, '' as r_user, '' as f_user, p_input_user, p_name, convert(varchar(10), p_input_dt,23) p_input_dt, '' as p_input_progress from"&VbCrlf query = query &" ("&VbCrlf query = query &" select f.Code as PCode, f.T_Name as PTeam,T.* from"&VbCrlf query = query &" ("&VbCrlf query = query &" select p_sn, p_subject, a.p_cli_company_cd, b.p_cli_company_nm, p_total_cost, p_obtain_cost,"&VbCrlf query = query &" p_cont_cost, p_decide_date, a.p_input_dt, a.p_input_user, e.p_name,"&VbCrlf query = query &" case p_state"&VbCrlf query = query &" when 'E' then '검토(가망)'"&VbCrlf query = query &" when 'K' then '제안'"&VbCrlf query = query &" when 'D' then '연기'"&VbCrlf query = query &" when 'X' then '탈락'"&VbCrlf query = query &" when 'P' then '수주'"&VbCrlf query = query &" when 'C' then '진행'"&VbCrlf query = query &" when 'F' then '완료' end p_state,"&VbCrlf query = query &" Case "&VbCrlf query = query &" When p_Depart_N is null then cast(p_depart_dep as varchar)"&VbCrlf query = query &" Else p_Depart_N+p_Team_N"&VbCrlf query = query &" End Team"&VbCrlf query = query &" from project2.dbo.T_PROJECT_BASE a with(nolock) "&VbCrlf query = query &" left join project2.dbo.V_CLIENT_COMP b with(nolock) on a.p_cli_company_cd=b.p_cli_company_cd"&VbCrlf query = query &" left join project2.dbo.V_Person e with(nolock) on a.p_input_user = e.p_no"&VbCrlf query = query &" ) T"&VbCrlf query = query &" left join project2.dbo.v_Department f with(nolock) on T.Team=f.Code or T.Team=f.before_t_cd1"&VbCrlf query = query &" ) as A"&VbCrlf query = query &" union all"&VbCrlf query = query &" "&VbCrlf query = query &" select"&VbCrlf query = query &" isnull(Tcode,'') Tcode, isnull(depart_name,'') depart_name, p_child_sn as p_sn, p_subject, p_cli_company_nm, p_method_nm, isnull(p_sample,'') p_sample, p_cont_cost, p_total_cost, isnull(pc_cont_cost,0) pc_cont_cost,"&VbCrlf query = query &" sum_est, case when pc_cont_cost = 0 or isnull(pc_cont_cost,0) = 0 then 0 else (isnull(sum_est,0)*100)/pc_cont_cost end as rate_est,"&VbCrlf query = query &" sum_act, case when pc_cont_cost = 0 or isnull(pc_cont_cost,0) = 0 then 0 else (isnull(sum_act,0)*100)/pc_cont_cost end as rate_act,"&VbCrlf query = query &" r_est, r_act, f_est, f_act, '', "&VbCrlf query = query &" isnull(p_con_date_st,'') p_con_date_st, isnull(p_con_date_end,'') p_con_date_end, p_state, isnull(r_user, '') as r_user, isnull(f_user, '') as f_user, p_input_user, isnull(p_name,'') p_name, convert(varchar(10), p_input_dt,23) p_input_dt, "&VbCrlf query = query &" CASE WHEN left(p_input_complete, 1) = 'x' THEN '연구 ' ELSE '' END + "&VbCrLf query = query &" CASE WHEN substring(p_input_complete, 2, 1) = 'x' THEN '실사' + "&VbCrLf query = query &" CASE WHEN p_field_dept = '8' THEN "&VbCrLf query = query &" CASE WHEN ISNULL(qc_prog, '') = '' THEN '(QC) ' ELSE '' END "&VbCrLf query = query &" WHEN p_field_dept = '9' THEN "&VbCrLf query = query &" CASE WHEN ISNULL(SV_prog, '') = '' THEN '(SV) ' ELSE '' END "&VbCrLf query = query &" ELSE "&VbCrLf query = query &" CASE WHEN ISNULL(SV_prog, '') = '' THEN "&VbCrLf query = query &" '(SV' + "&VbCrLf query = query &" CASE WHEN ISNULL(qc_prog, '') = '' THEN ', QC) ' ELSE ') ' END "&VbCrLf query = query &" ELSE "&VbCrLf query = query &" CASE WHEN ISNULL(qc_prog, '') = '' THEN '(QC) ' ELSE '' END "&VbCrLf query = query &" END "&VbCrLf query = query &" END "&VbCrLf query = query &" ELSE '' "&VbCrLf query = query &" END + "&VbCrLf query = query &" CASE WHEN left(p_input_complete, 1) = 'x' OR substring(p_input_complete, 2, 1) = 'x' THEN '직접비 미입력' ELSE '' END AS p_input_progress "&VbCrLf query = query &" from"&VbCrlf query = query &" ("&VbCrlf query = query &" SELECT p_field_dept, p_is_dept,"&VbCrlf query = query &" TPB.p_Depart_N+TPB.p_Team_N as Tcode,"&VbCrlf query = query &" ISNULL(ISNULL(DRE.depart_name, DFI.depart_name), DDE.depart_name) AS depart_name,"&VbCrlf query = query &" TPM.p_child_sn, TPM.p_subject,"&VbCrlf query = query &" VCC.p_cli_company_nm,"&VbCrlf query = query &" TPM.p_method_cd,"&VbCrlf query = query &" TPMC.p_method_nm,"&VbCrlf query = query &" TPM.p_sample, --표본"&VbCrlf query = query &" TPB.p_cont_cost, --예상계약액"&VbCrlf query = query &" TPB.p_total_cost, --실제계약액"&VbCrlf query = query &" TPM.p_cont_cost as pc_cont_cost, --단위계약"&VbCrlf query = query &" ISNULL(DC.sum_est, 0) AS sum_est, --예상직접비"&VbCrlf query = query &" (ISNULL(DC.sum_act, 0) + ISNULL(MC.marketing_cost, 0) + ISNULL(JC.job_money, 0)) AS sum_act, --집행직접비"&VbCrlf query = query &" ISNULL(DC.sum_act, 0) AS sum_act_tmp,"&VbCrlf query = query &" ISNULL(DC.r_est, 0) AS r_est,"&VbCrlf query = query &" ISNULL(DC.r_act, 0) AS r_act,"&VbCrlf query = query &" ISNULL(DC.f_est, 0) AS f_est,"&VbCrlf query = query &" ISNULL(DC.f_act, 0) AS f_act,"&VbCrlf query = query &" TPM.p_con_date_st,"&VbCrlf query = query &" TPM.p_con_date_end,"&VbCrlf query = query &" TPM.p_progress_status,"&VbCrlf query = query &" TPM.p_input_complete,"&VbCrlf query = query &" DCF.sv_prog,"&VbCrlf query = query &" DCF.qc_prog,"&VbCrlf query = query &" ISNULL(TPM.p_research_complete, 0) AS p_research_complete,"&VbCrlf query = query &" ISNULL(TPM.p_field_complete, 0) AS p_field_complete,"&VbCrlf query = query &" ISNULL(TPM.p_dp_complete, 0) AS p_dp_complete,"&VbCrlf query = query &" TPM.p_sn, RU.p_name as r_user, FU.p_name as f_user, VP.p_name, TPB.p_input_user, TPM.p_input_dt,"&VbCrlf query = query &" case p_progress_status when '008' then case when p_research_complete='1' and p_field_complete='1' and p_dp_complete='1' then '완료' else '진행' end else '미진행' end p_state"&VbCrlf query = query &" FROM project2.dbo.T_PROJECT_METHOD TPM with(nolock) LEFT JOIN"&VbCrlf query = query &" project2.dbo.T_PROJECT_BASE TPB with(nolock) on TPM.p_sn = TPB.p_sn LEFT JOIN"&VbCrlf query = query &" project2.dbo.T_PROJECT_METHOD_CD TPMC with(nolock) ON TPM.p_method_cd = TPMC.p_method_cd LEFT JOIN"&VbCrlf query = query &" project2.dbo.V_Person VP with(nolock) ON TPB.p_input_user = VP.p_no LEFT JOIN"&VbCrlf query = query &" project2.dbo.V_Person RU with(nolock) ON TPM.p_rsch_1_a = RU.p_no LEFT JOIN"&VbCrlf query = query &" project2.dbo.V_Person FU with(nolock) ON TPM.p_sv_1 = FU.p_no LEFT JOIN"&VbCrlf query = query &" project2.dbo.V_CLIENT_COMP VCC with(nolock) ON TPM.p_cli_company_cd = VCC.p_cli_company_cd LEFT JOIN"&VbCrlf query = query &" project2.dbo.direct_cost_field DCF with(nolock) ON TPM.p_child_sn = DCF.p_child_sn AND DCF.del_yn = 'n' LEFT JOIN"&VbCrlf query = query &" ("&VbCrlf query = query &" SELECT DISTINCT LEFT(CASE WHEN D_Code = 'S' AND before_t_cd1 IN (17, 18, 19) THEN 'DCO' ELSE T_Name END, 8) AS depart_name, "&VbCrlf query = query &" before_t_cd1 AS depart_code "&VbCrlf query = query &" FROM project2.dbo.v_Department with(nolock) "&VbCrlf query = query &" WHERE before_t_cd1 NOT IN ('0', '18')"&VbCrlf query = query &" ) DDE ON TPB.p_depart_dep = DDE.depart_code LEFT JOIN"&VbCrlf query = query &" ("&VbCrlf query = query &" SELECT DISTINCT LEFT(T_Name, 8) AS depart_name, before_t_cd1 AS depart_code"&VbCrlf query = query &" FROM project2.dbo.v_Department with(nolock) "&VbCrlf query = query &" WHERE before_t_cd1 NOT IN ('17', '18', '0')"&VbCrlf query = query &" ) DRE ON TPM.p_rsch_dept = DRE.depart_code LEFT JOIN"&VbCrlf query = query &" ("&VbCrlf query = query &" SELECT DISTINCT LEFT(T_Name, 8) AS depart_name, before_t_cd1 AS depart_code"&VbCrlf query = query &" FROM project2.dbo.v_Department with(nolock) "&VbCrlf query = query &" WHERE before_t_cd1 NOT IN ('17', '18', '0')"&VbCrlf query = query &" ) DFI ON TPM.p_field_dept = DFI.depart_code LEFT JOIN"&VbCrlf query = query &" ("&VbCrlf query = query &" SELECT p_child_sn,"&VbCrlf query = query &" sum(CONVERT(money, est_money)) AS sum_est,"&VbCrlf query = query &" sum(CONVERT(money, act_money)) AS sum_act,"&VbCrlf query = query &" sum(case when cost_type = 'research' then CONVERT(money, est_money) else 0 end) AS r_est,"&VbCrlf query = query &" sum(case when cost_type = 'research' then CONVERT(money, act_money) else 0 end) AS r_act,"&VbCrlf query = query &" sum(case when cost_type = 'field' then CONVERT(money, est_money) else 0 end) AS f_est,"&VbCrlf query = query &" sum(case when cost_type = 'field' then CONVERT(money, act_money) else 0 end) AS f_act"&VbCrlf query = query &" FROM project2.dbo.direct_cost with(nolock) "&VbCrlf query = query &" WHERE p_child_sn > '17' AND del_yes_no = 'no'"&VbCrlf query = query &" GROUP BY p_child_sn"&VbCrlf query = query &" ) DC ON TPM.p_child_sn = DC.p_child_sn LEFT JOIN"&VbCrlf query = query &" ("&VbCrlf query = query &" SELECT M.p_sn, SUM(CONVERT(money, REPLACE(CONVERT(varchar(100), M.target6), ',', ''))) AS marketing_cost"&VbCrlf query = query &" FROM project2.dbo.문서내용 M with(nolock) LEFT JOIN project2.dbo.Document D with(nolock) ON M.문서번호 = D.d_no"&VbCrlf query = query &" WHERE M.문서제목 = '접대비보고서' AND M.del_yes_no = 'no'"&VbCrlf query = query &" AND D.d_order_cnt = '77'"&VbCrlf query = query &" GROUP BY M.p_sn"&VbCrlf query = query &" ) MC ON TPM.p_child_sn = MC.p_sn LEFT JOIN"&VbCrlf query = query &" ("&VbCrlf query = query &" SELECT CA.p_sn, SUM(CA.cost_money) AS job_money"&VbCrlf query = query &" FROM project2.dbo.cost_account CA with(nolock) LEFT JOIN project2.dbo.문서내용 M with(nolock) ON CA.d_no = M.문서번호"&VbCrlf query = query &" LEFT JOIN project2.dbo.Document D with(nolock) ON M.문서번호 = D.d_no"&VbCrlf query = query &" WHERE CA.cost_money > 0 AND CA.approval = 'yes'"&VbCrlf query = query &" AND M.del_yes_no = 'no' AND D.d_order_cnt = '77'"&VbCrlf query = query &" GROUP BY CA.p_sn"&VbCrlf query = query &" ) JC ON TPM.p_child_sn = JC.p_sn"&VbCrlf query = query &" where TPM.p_child_sn is not null"&VbCrlf query = query &" ) as A"&VbCrlf query = query &" ) AA"&VbCrlf query = query&" where p_input_dt between '"&sdate&"' and '"&edate&"' and p_state <> '수주'"&VBCrlf if Depart <> "1" Then if cint(session("Depart_Code")) >= 20 Then query = query & " AND (PCode = '" & Session("N_depart") & Session("N_team") &"' " & vbCrLf if session("depart_code") = 64 Then query = query & " OR PCode = 'R601' " & vbCrLf End IF if session("depart_code") = 63 Then query = query & " OR PCode = 'R602' " & vbCrLf End IF query = query & " ) " End if if session("User_Number") = "20000201" Then query = query & " AND PCode in ('R601', 'R602', 'R603','R604') " & vbCrLf End IF if session("User_Number") = "20190601" Then query = query & " AND PCode in ('R701', 'R702', 'R501') " & vbCrLf End IF if session("User_Number") = "20190301" Then '조우철 - 2024-06-17 M3그룹 (20210105)부재로 인한 대리 query = query & " AND PCode in ('R703', 'R704') " & vbCrLf End IF End If query = query&" ORDER BY p_sn"&VbCrlf 'response.write query rsc.Open query, adoConn, 1 Redim data(rsc.recordcount-1) iCnt = 0 if not rsc.eof then while not rsc.eof 'if rsc("PTeam") = "" Then ' Contact("Team") = "미지정" 'Else ' Contact("Team") = rsc("PTeam") 'End If 'Contact("p_sn") = rsc("p_sn") 'Contact("p_subject") = replace(rsc("p_subject"), """", """) 'Contact("p_cli_company_nm") = rsc("p_cli_company_nm") 'If rsc("p_method") = "" Then ' Contact("p_method") = "미지정" 'Else ' Contact("p_method") = rsc("p_method") 'End If 'Contact("p_sample") = Cdbl(rsc("p_sample")) 'Contact("p_cont_cost") = Cdbl(rsc("p_cont_cost")) 'Contact("p_total_cost") = Cdbl(rsc("p_total_cost")) 'Contact("pc_con_cost") = Cdbl(rsc("pc_con_cost")) 'Contact("sum_est") = Cdbl(rsc("sum_est")) 'Contact("rate_est") = Round(Cdbl(rsc("rate_est")),2) 'Contact("sum_act") = Cdbl(rsc("sum_act")) 'Contact("rate_act") = Round(Cdbl(rsc("rate_act")),2) 'Contact("r_est") = Cdbl(rsc("r_est")) 'Contact("r_act") = Cdbl(rsc("r_act")) 'Contact("f_est") = Cdbl(rsc("f_est")) 'Contact("f_act") = Cdbl(rsc("f_act")) 'Contact("p_decide_date") = rsc("p_decide_date") 'Contact("p_con_date_st") = rsc("p_con_date_st") 'Contact("p_con_date_end") = rsc("p_con_date_end") 'Contact("p_state") = rsc("p_state") 'If rsc("p_name") = "" then ' Contact("p_input_user") = "미지정" 'Else ' Contact("p_input_user") = rsc("p_name") 'End If 'If rsc("r_user") = "" then ' Contact("r_user") = "미지정" 'Else ' Contact("r_user") = rsc("r_user") 'End If 'If rsc("f_user") = "" then ' Contact("f_user") = "미지정" 'Else ' Contact("f_user") = rsc("f_user") 'End If 'Contact("p_input_dt") = rsc("p_input_dt") 'Contact("p_input_progress") = rsc("p_input_progress") iCnt = iCnt + 1 response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" rsc.movenext wend End If rsc.close %>
부서 진행 상태 프로젝트 코드 프로젝트 명 클라이언트 명 조사방법 표본수 예상 계약액 실제 계약액 단위 계약액 예상 직접비 예상 직접비율 집행 직접비 집행 직접비율 결정 예정일 계약 시작일 계약 종료일 예상 직접비 정보 연구 담당자 실사 담당자 등록자 등록일
"& rsc("PTeam") &""&rsc("p_state") &""&rsc("p_sn") &""&rsc("p_subject") &""&rsc("p_cli_company_nm") &""&rsc("p_method") &""&rsc("p_sample") &""&rsc("p_cont_cost") &""&rsc("p_total_cost") &""&rsc("pc_con_cost") &""&rsc("sum_est") &""&rsc("rate_est") &""&rsc("sum_act") &""&rsc("rate_act") &""&rsc("p_decide_date") &""&rsc("p_con_date_st") &""&rsc("p_con_date_end") &""&rsc("p_input_progress") &""&rsc("r_user") &""&rsc("f_user") &""&rsc("p_input_user") &""&rsc("p_input_dt") &"