483 lines
23 KiB
Plaintext
483 lines
23 KiB
Plaintext
<%@ codepage="949" language="VBScript" %>
|
||
<!--METADATA TYPE = "typelib" NAME="ADODB Type Library" FILE="C:\Program Files\Common Files\SYSTEM\ADO\msado15.dll" -->
|
||
<OBJECT RUNAT=Server PROGID=ADODB.Connection id=adoConn></OBJECT>
|
||
<OBJECT RUNAT=Server PROGID=ADODB.Recordset id=Rs></OBJECT>
|
||
<OBJECT RUNAT=Server PROGID=ADODB.Recordset id=rsc></OBJECT>
|
||
<OBJECT RUNAT=Server PROGID=ADODB.Recordset id=adors></OBJECT>
|
||
<!-- #include file = "../lib/function.asp" -->
|
||
<%
|
||
'####################################################################################################
|
||
''???@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||
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 "<br>"& Request.ServerVariables("REMOTE_ADDR")
|
||
'response.write "<br>"& replace(replace(Request.ServerVariables("REMOTE_ADDR"), "10.10.20.", "10.10.13."), "10.10.17.", "10.10.13.")
|
||
'response.write "<br>"& 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
|
||
|
||
|
||
%>
|
||
<!-- #include virtual = "ess/0config_ess.asp" -->
|
||
<!-- #include virtual = "lib/logger.asp" -->
|
||
<%
|
||
|
||
Response.Charset = "EUC-KR"
|
||
Response.codePage = "949"
|
||
Response.ContentType="text/html;charset=euc-kr"
|
||
%>
|
||
|
||
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="euc-kr">
|
||
<meta name="viewport" content="width=1800">
|
||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
|
||
<title><%=GNB_TITLE%></title>
|
||
<% If Request("dialog") <> "1" Then %>
|
||
<% If Request("command") <> "excel" Then %>
|
||
<!-- Font Awesome Icons -->
|
||
<link rel="stylesheet" href="/css/all.min.css">
|
||
<!-- Template style -->
|
||
<link rel="stylesheet" href="/css/AdminLTE.css">
|
||
<!-- kiwi style -->
|
||
<link rel="stylesheet" href="/css/koin.css">
|
||
<!-- jQuery Ui -->
|
||
<link rel="stylesheet" href="/css/jquery-ui.min.css">
|
||
<!-- jQuery Confirm -->
|
||
<link rel="stylesheet" href="/css/jquery-confirm.min.css">
|
||
<!-- Bootstrap Select -->
|
||
<link rel="stylesheet" href="/css/bootstrap-select.min.css"/>
|
||
<!-- chartjs -->
|
||
<link rel="stylesheet" href="/css/Chart.min.css">
|
||
<!-- datatables -->
|
||
<link rel="stylesheet" href="/css/datatables.min.css"/>
|
||
<!-- tree js -->
|
||
<link rel="stylesheet" href="/css/treejs.min.css">
|
||
<!-- common style -->
|
||
<link rel="stylesheet" href="/css/main-common.css?ver=<%=date_time() %>">
|
||
<% End If %>
|
||
|
||
<!-- jQuery -->
|
||
<script src="/js/jquery.min.js"></script>
|
||
<!-- jQuery Pjax -->
|
||
<script src="/js/jquery.pjax.min.js"></script>
|
||
<!-- Bootstrap 4 -->
|
||
<script src="/js/bootstrap.bundle.min.js"></script>
|
||
<!-- AdminLTE App -->
|
||
<script src="/js/adminlte.min.js"></script>
|
||
<!-- jQuery Ui -->
|
||
<script src="/js/jquery-ui.min.js"></script>
|
||
<!-- jQuery Cookie -->
|
||
<script src="/js/jquery.cookie.js"></script>
|
||
<!-- jQuery Dialog Extend -->
|
||
<script src="/js/jquery.dialogextend.js"></script>
|
||
<!-- jQuery Confirm -->
|
||
<script src="/js/jquery-confirm.min.js"></script>
|
||
<!-- jQuery Form -->
|
||
<script src="/js/jquery.form.min.js"></script>
|
||
<!-- jQuery AjaxCall -->
|
||
<script src="/js/jquery-ajax-call.js"></script>
|
||
<!-- jQuery table2excel -->
|
||
<script src="/js/jquery.table2excel.js?v=1"></script>
|
||
<!-- Bootstrap Select -->
|
||
<script src="/js/bootstrap-select.min.js"></script>
|
||
<!-- Moment -->
|
||
<script src="/js/moment.js"></script>
|
||
<!-- chartjs -->
|
||
<script src="/js/Chart.js"></script>
|
||
<!-- datatables -->
|
||
<script src="/js/datatables.min.js"></script>
|
||
<!-- filterDropDown -->
|
||
<script src="/js/filterDropDown.js"></script>
|
||
<!-- Pagination Js -->
|
||
<script src="/js/pagination.js"></script>
|
||
<!-- FileSaver -->
|
||
<script src="/js/FileSaver.min.js"></script>
|
||
<!-- tree js -->
|
||
<script src="/js/tree.min.js"></script>
|
||
<!-- sort js -->
|
||
<script src="/js/sort-table.js"></script>
|
||
<!-- pdf js -->
|
||
<script src="/js/pdf.js"></script>
|
||
<script src="/js/pdf.worker.js"></script>
|
||
<!-- common -->
|
||
<script src="/js/common.js?ver=<%=date_time() %>"></script>
|
||
<% End If %>
|
||
|
||
<div class="content-body">
|
||
<div class="content">
|
||
<div class="container-fluid">
|
||
<div class="row">
|
||
<div class="col-12" >
|
||
<table class='table table-sm table-bordered table-headline nowrap' id="ContactList">
|
||
<thead>
|
||
<tr>
|
||
<th class=" "><3E>μ<EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20>ڵ<EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><></th>
|
||
<th class="t_label select-filter">Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ <20><></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter">ǥ<><C7A5><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<!--
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20>ǻ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20>ǻ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
-->
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E>ǻ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
<th class="t_label select-filter"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>
|
||
</tr>
|
||
</thead>
|
||
<%
|
||
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 '<27><><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>)'"&VbCrlf
|
||
query = query &" when 'K' then '<27><><EFBFBD><EFBFBD>'"&VbCrlf
|
||
query = query &" when 'D' then '<27><><EFBFBD><EFBFBD>'"&VbCrlf
|
||
query = query &" when 'X' then 'Ż<><C5BB>'"&VbCrlf
|
||
query = query &" when 'P' then '<27><><EFBFBD><EFBFBD>'"&VbCrlf
|
||
query = query &" when 'C' then '<27><><EFBFBD><EFBFBD>'"&VbCrlf
|
||
query = query &" when 'F' then '<27>Ϸ<EFBFBD>' 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 '<27><><EFBFBD><EFBFBD> ' ELSE '' END + "&VbCrLf
|
||
query = query &" CASE WHEN substring(p_input_complete, 2, 1) = 'x' THEN '<27>ǻ<EFBFBD>' + "&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 '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Է<EFBFBD>' 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, --ǥ<><C7A5>"&VbCrlf
|
||
query = query &" TPB.p_cont_cost, --<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"&VbCrlf
|
||
query = query &" TPB.p_total_cost, --<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"&VbCrlf
|
||
query = query &" TPM.p_cont_cost as pc_cont_cost, --<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"&VbCrlf
|
||
query = query &" ISNULL(DC.sum_est, 0) AS sum_est, --<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"&VbCrlf
|
||
query = query &" (ISNULL(DC.sum_act, 0) + ISNULL(MC.marketing_cost, 0) + ISNULL(JC.job_money, 0)) AS sum_act, --<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"&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 '<27>Ϸ<EFBFBD>' else '<27><><EFBFBD><EFBFBD>' end else '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' 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.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> M with(nolock) LEFT JOIN project2.dbo.Document D with(nolock) ON M.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ = D.d_no"&VbCrlf
|
||
query = query &" WHERE M.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1BAB8B0><EFBFBD>' 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.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> M with(nolock) ON CA.d_no = M.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ"&VbCrlf
|
||
query = query &" LEFT JOIN project2.dbo.Document D with(nolock) ON M.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ = 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 <> '<27><><EFBFBD><EFBFBD>'"&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 '<27><><EFBFBD><EFBFBD>ö - 2024-06-17 M3<4D><EFBFBD> (20210105)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>븮
|
||
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") = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||
'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") = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||
'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") = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||
'Else
|
||
' Contact("p_input_user") = rsc("p_name")
|
||
'End If
|
||
'If rsc("r_user") = "" then
|
||
' Contact("r_user") = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||
'Else
|
||
' Contact("r_user") = rsc("r_user")
|
||
'End If
|
||
'If rsc("f_user") = "" then
|
||
' Contact("f_user") = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||
'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 "<tr>"
|
||
|
||
|
||
response.write "<td >"& rsc("PTeam") &"</td>"
|
||
response.write "<td >"&rsc("p_state") &"</td>"
|
||
response.write "<td >"&rsc("p_sn") &"</td>"
|
||
response.write "<td >"&rsc("p_subject") &"</td>"
|
||
response.write "<td >"&rsc("p_cli_company_nm") &"</td>"
|
||
response.write "<td >"&rsc("p_method") &"</td>"
|
||
response.write "<td >"&rsc("p_sample") &"</td>"
|
||
response.write "<td >"&rsc("p_cont_cost") &"</td>"
|
||
response.write "<td >"&rsc("p_total_cost") &"</td>"
|
||
response.write "<td >"&rsc("pc_con_cost") &"</td>"
|
||
response.write "<td >"&rsc("sum_est") &"</td>"
|
||
response.write "<td >"&rsc("rate_est") &"</td>"
|
||
response.write "<td >"&rsc("sum_act") &"</td>"
|
||
response.write "<td >"&rsc("rate_act") &"</td>"
|
||
response.write "<td >"&rsc("p_decide_date") &"</td>"
|
||
response.write "<td >"&rsc("p_con_date_st") &"</td>"
|
||
response.write "<td >"&rsc("p_con_date_end") &"</td>"
|
||
response.write "<td >"&rsc("p_input_progress") &"</td>"
|
||
response.write "<td >"&rsc("r_user") &"</td>"
|
||
response.write "<td >"&rsc("f_user") &"</td>"
|
||
response.write "<td >"&rsc("p_input_user") &"</td>"
|
||
response.write "<td >"&rsc("p_input_dt") &"</td>"
|
||
|
||
response.write "</tr>"
|
||
|
||
rsc.movenext
|
||
wend
|
||
|
||
|
||
End If
|
||
rsc.close
|
||
%>
|
||
|
||
|
||
|
||
</table>
|
||
<input type="hidden" name="DepartAll" id="DepartAll" />
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- /.content -->
|
||
<!-- REQUIRED SCRIPTS -->
|
||
<script>
|
||
function numberPad(n, width) {
|
||
n = n + '';
|
||
return n.length >= width ? n : new Array(width - n.length + 1).join('0') + n;
|
||
}
|
||
var ColArr=[];
|
||
|
||
|
||
$(document).ready(function(){
|
||
|
||
|
||
|
||
$(".main-header").remove(); //-- <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||
$("#ContactList_filterWrapper").remove() //-- <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||
|
||
|
||
|
||
});
|
||
</script>
|
||
</div> |