최초커밋
This commit is contained in:
450
statistics/projectlist_cost.asp
Normal file
450
statistics/projectlist_cost.asp
Normal file
@@ -0,0 +1,450 @@
|
||||
<!-- #include virtual = "include/header.asp" -->
|
||||
<!-- #include virtual = "include/left.asp" -->
|
||||
<%
|
||||
p_statistics = request("p_statistics")
|
||||
If p_statistics = "" Then
|
||||
p_statistics = year(date)
|
||||
If cint(month(date)) <= 3 Then
|
||||
p_statistics = p_statistics - 1 ' 4<><34> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>̰<EFBFBD>
|
||||
End If
|
||||
End If
|
||||
nowDate = now()
|
||||
%>
|
||||
<!-- Content Wrapper. Contains page content -->
|
||||
<div class="content-wrapper">
|
||||
<style>
|
||||
.filterSelect{
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
#rsTb > table td{
|
||||
word-break: keep-all;
|
||||
}
|
||||
#rsTb > table > thead > tr > td{
|
||||
cursor:pointer;
|
||||
position:sticky;
|
||||
top:-1px;
|
||||
}
|
||||
#rsTb > table > tbody > tr.over95 > td{
|
||||
background-color:#e85e5e !important;
|
||||
}
|
||||
#rsTb > table > tbody > tr.over85 > td{
|
||||
background-color:#ff9a7e !important;
|
||||
}
|
||||
#rsTb > table > tbody > tr.over75 > td{
|
||||
background-color:#ffc095 !important;
|
||||
}
|
||||
#rsTb > table > tbody > tr.over65 > td{
|
||||
background-color:#ffdb9c !important;
|
||||
}
|
||||
|
||||
#rsTb > table > tbody > tr:hover > td{
|
||||
border-bottom: 1px solid #682dff !important;
|
||||
}
|
||||
|
||||
#rsTb > table > tfoot > #sumTr{
|
||||
background-color:#ffb9b9 !important;
|
||||
font-weight:bold;
|
||||
}
|
||||
.rate_legend{
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
height: 14px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#f_rate_act option[value='under65']{
|
||||
background: #dbe9f2;
|
||||
}
|
||||
#f_rate_act option[value='over65']{
|
||||
background: #ffdb9c;
|
||||
}
|
||||
#f_rate_act option[value='over75']{
|
||||
background: #ffc095;
|
||||
}
|
||||
#f_rate_act option[value='over85']{
|
||||
background: #ff9a7e;
|
||||
}
|
||||
#f_rate_act option[value='over95']{
|
||||
background: #e85e5e;
|
||||
}
|
||||
</style>
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<h1><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ȳ</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 name="prjfrm" method="post">
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<span style="font-size: 12pt; font-weight: bold;"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ȳ - (<span id="thisTime"><%=nowDate%></span> <20><><EFBFBD><EFBFBD>)</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Filter <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC><EFBFBD>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:5 0 0 0">
|
||||
<table class="table table-sm table-sm2 table-bordered table-head tr-colors" style="font-size:12px;">
|
||||
<tr>
|
||||
<td bgcolor="#DFDFDF" style="padding-left:10px;">
|
||||
<select id="p_statistics">
|
||||
<% For i=2018 To year(date) %>
|
||||
<option value="<%=i%>" <%= iif(cint(i) = cint(p_statistics), " selected ", "") %>><%=cstr(i)%>~<%=RIGHT(cstr(i+1), 2)%></option>
|
||||
<% Next %>
|
||||
</select>
|
||||
</td>
|
||||
<td bgcolor="#DFDFDF" class="tbFilter tahoma_blk" style="padding-left:10px;"></td>
|
||||
<td bgcolor="#DFDFDF" style="padding-left:10px;">
|
||||
<span>
|
||||
<b><3E><><EFBFBD><EFBFBD></b> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
65-75% : <span class="rate_legend" style="background-color:#ffdb9c;"></span>
|
||||
75-85% : <span class="rate_legend" style="background-color:#ffc095;"></span>
|
||||
85-95% : <span class="rate_legend" style="background-color:#ff9a7e;"></span>
|
||||
95% <20><> : <span class="rate_legend" style="background-color:#e85e5e;"></span>
|
||||
</span>
|
||||
</td>
|
||||
<td bgcolor="#DFDFDF" align="right" style="padding-right:10px;">
|
||||
<input type="button" id="btnExport" value="Excel Download"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:10 0 0 0">
|
||||
<div style="width:100%;height:650px;overflow-y:scroll;" id="rsTb">
|
||||
<table class="table table-sm table-sm2 table-bordered table-head tr-colors js-sort-table" style="font-size:11px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="js-sort-number align-middle text-center" style="width: ;">No.</td>
|
||||
<td class="js-sort-string align-middle text-center" style="width: ;"><3E><EFBFBD></td>
|
||||
<td class="js-sort-string align-middle text-center" style="width: ;"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD>ڵ<EFBFBD></td>
|
||||
<td class="js-sort-string align-middle text-center" style="width: ;"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE></td>
|
||||
<td class="js-sort-string align-middle text-center" style="width: ;">Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ</td>
|
||||
<td class="js-sort-string align-middle text-center" style="width: ;"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></td>
|
||||
<td class="js-sort-number align-middle text-center" style="width: 55px;">ǥ<><C7A5><EFBFBD><EFBFBD></td>
|
||||
<td class="js-sort-number align-middle text-center" style="width: 90px;"><3E><><EFBFBD><EFBFBD><br><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><>)</td>
|
||||
<td class="js-sort-number align-middle text-center" style="width: 80px;"><3E><><EFBFBD><EFBFBD><br><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><>)</td>
|
||||
<td class="js-sort-number align-middle text-center" style="width: 63px;"><3E><><EFBFBD><EFBFBD><br><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></td>
|
||||
<td class="js-sort-number align-middle text-center" style="width: 80px;"><3E><><EFBFBD><EFBFBD><br><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><>)</td>
|
||||
<td class="js-sort-number align-middle text-center" style="width: 63px;"><3E><><EFBFBD><EFBFBD><br><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></td>
|
||||
<td class="js-sort-string align-middle text-center" style="width: 75px;"><3E><><EFBFBD><EFBFBD><br><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></td>
|
||||
<td class="js-sort-string align-middle text-center" style="width: 75px;"><3E><><EFBFBD><EFBFBD><br><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></td>
|
||||
<td class="js-sort-string align-middle text-center" style="width: 40px;"><3E><><EFBFBD><EFBFBD></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="15" bgcolor="#d5d5d5" height="1"></td>
|
||||
</tr>
|
||||
<tr id="sumTr"></tr>
|
||||
<tr>
|
||||
<td colspan="15" bgcolor="#d5d5d5" height="1"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.content -->
|
||||
<%
|
||||
query = ""
|
||||
query = query & " SELECT ROW_NUMBER() OVER (ORDER BY TPM.p_child_sn) AS no, p_rsch_dept, p_field_dept, p_is_dept, " & vbCrLf
|
||||
query = query & " DFI.depart_name, " & vbCrLf
|
||||
query = query & " TPM.p_child_sn, TPM.p_subject, VCC.p_cli_company_nm, " & vbCrLf
|
||||
query = query & " TPM.p_method_cd, TPMC.p_method_nm, ISNULL(TPM.p_sample, 0) as p_sample, " & vbCrLf
|
||||
query = query & " TPM.p_cont_cost, 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 & " TPM.p_con_date_st, TPM.p_con_date_end, " & vbCrLf
|
||||
query = query & " TPM.p_progress_status, TPM.p_input_complete, " & 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 & " FROM project2.dbo.T_PROJECT_METHOD TPM LEFT JOIN " & vbCrLf
|
||||
query = query & " project2.dbo.T_PROJECT_BASE TPB ON TPM.p_sn = TPB.p_sn LEFT JOIN " & vbCrLf
|
||||
query = query & " project2.dbo.T_PROJECT_METHOD_CD TPMC ON TPM.p_method_cd = TPMC.p_method_cd LEFT JOIN " & vbCrLf
|
||||
query = query & " project2.dbo.V_CLIENT_COMP VCC ON TPM.p_cli_company_cd = VCC.p_cli_company_cd 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 " & vbCrLf
|
||||
query = query & " WHERE before_t_cd1 NOT IN ('18', '0') " & vbCrLf
|
||||
query = query & " ) DFI ON CASE WHEN TPM.p_rsch_dept <> '900' THEN TPM.p_rsch_dept ELSE TPB.p_depart_dep END = 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 & " FROM project2.dbo.direct_cost " & 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 LEFT JOIN project2.dbo.Document D 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.V_BUSI_COST CA " & vbCrLf
|
||||
query = query & " WHERE CA.cost_money > 0 " & 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_statistics in ('" & p_statistics & "','" & p_statistics+1 & "') " & vbCrLf
|
||||
if cint(session("Depart_Code")) >= 20 Then
|
||||
query = query & " AND (p_rsch_dept = '" & session("Depart_Code") & "' " & vbCrLf
|
||||
' if session("User_Number") = "20180701" Then '<27><>ȿ<EFBFBD><C8BF>
|
||||
' query = query & " Or p_rsch_dept = '30' Or p_rsch_dept = '62' " & vbCrLf
|
||||
' End If
|
||||
' if session("User_Number") = "20200302" Then '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
' query = query & " Or p_rsch_dept = '71' " & vbCrLf
|
||||
' End If
|
||||
query = query & " ) " & vbCrLf
|
||||
Else '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ȳ
|
||||
if session("User_Number") = "20190601" Then '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
query = query & " AND p_rsch_dept in ('71', '72', '73') " & vbCrLf
|
||||
End IF
|
||||
if session("User_Number") = "20160205" Then '<27><><EFBFBD><EFBFBD>ö - 2024-06-18 M3<4D><EFBFBD> (20210105)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD> <20><EFBFBD> <20><><EFBFBD>̵<EFBFBD><CCB5><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20>Է<EFBFBD><D4B7>ؾ<EFBFBD><D8BE><EFBFBD>.
|
||||
query = query & " AND p_rsch_dept in ('61', '62','63','64','65','66') " & vbCrLf
|
||||
End IF
|
||||
End if
|
||||
query = query & " ORDER BY TPM.p_child_sn " & vbCrLf
|
||||
|
||||
adors.Open query, adoConn, 1
|
||||
Dim tmpDepStr
|
||||
jsonRs = "["
|
||||
if adors.RecordCount > 0 then
|
||||
for i = 1 To adors.RecordCount
|
||||
jsonRs = jsonRs & "{"
|
||||
jsonRs = jsonRs & """no"":""" & adors("no") & ""","
|
||||
If adors("depart_name") = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̳뺣<CCB3>̼<EFBFBD>" Then
|
||||
tmpDepStr = "DIN"
|
||||
ElseIf adors("depart_name") = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD><DAB8><EFBFBD><EFBFBD><EFBFBD>" Then
|
||||
tmpDepStr = "DCO"
|
||||
ElseIf adors("depart_name") = "<22><><EFBFBD><EFBFBD><EFBFBD>Ͻ<EFBFBD><CFBD><EFBFBD><EFBFBD>θ<EFBFBD><CEB8><EFBFBD>" Then
|
||||
tmpDepStr = "BP"
|
||||
Else
|
||||
tmpDepStr = adors("depart_name")
|
||||
End If
|
||||
|
||||
jsonRs = jsonRs & """depart_name"":""" & tmpDepStr & ""","
|
||||
jsonRs = jsonRs & """p_child_sn"":""" & adors("p_child_sn") & ""","
|
||||
jsonRs = jsonRs & """p_subject"":""" & adors("p_subject") & ""","
|
||||
jsonRs = jsonRs & """p_cli_company_nm"":""" & adors("p_cli_company_nm") & ""","
|
||||
jsonRs = jsonRs & """p_method_nm"":""" & adors("p_method_nm") & ""","
|
||||
jsonRs = jsonRs & """p_sample"":""" & formatNumber(adors("p_sample"), 0) & ""","
|
||||
jsonRs = jsonRs & """p_cont_cost"":""" & formatNumber(cDbl(adors("p_cont_cost")), 0) & ""","
|
||||
jsonRs = jsonRs & """sum_est"":""" & formatNumber(adors("sum_est"), 0) & ""","
|
||||
if adors("p_cont_cost") = "0" Then
|
||||
jsonRs = jsonRs & """rate_est"":""0.00%"","
|
||||
jsonRs = jsonRs & """rate_act"":""0.00%"","
|
||||
else
|
||||
jsonRs = jsonRs & """rate_est"":""" & formatNumber(iif(adors("sum_est")*100/cDbl(adors("p_cont_cost")) > 999, 999.99, adors("sum_est")*100/cDbl(adors("p_cont_cost"))), 2) & "%" & ""","
|
||||
jsonRs = jsonRs & """rate_act"":""" & formatNumber(iif(adors("sum_act")*100/cDbl(adors("p_cont_cost")) > 999, 999.99, adors("sum_act")*100/cDbl(adors("p_cont_cost"))), 2) & "%" & ""","
|
||||
end if
|
||||
jsonRs = jsonRs & """sum_act"":""" & formatNumber(adors("sum_act"), 0) & ""","
|
||||
jsonRs = jsonRs & """p_con_date_st"":""" & adors("p_con_date_st") & ""","
|
||||
jsonRs = jsonRs & """p_con_date_end"":""" & adors("p_con_date_end") & ""","
|
||||
jsonRs = jsonRs & """status"":""" & iif(adors("p_research_complete")+adors("p_field_complete")+adors("p_dp_complete") = 3, "<22><><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD>") & """"
|
||||
jsonRs = jsonRs & "}"
|
||||
adors.MoveNext
|
||||
if not adors.Eof then
|
||||
jsonRs = jsonRs & ","
|
||||
end if
|
||||
Next
|
||||
End if
|
||||
adors.Close
|
||||
jsonRs = jsonRs & "]"
|
||||
|
||||
'response.write query
|
||||
%>
|
||||
<!-- REQUIRED SCRIPTS -->
|
||||
<script>
|
||||
var jsonRS = <%=jsonRs%>;
|
||||
var filterCol = ["depart_name", "p_cli_company_nm", "p_method_nm", "status", "rate_act"]; // <20><EFBFBD>, Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><> Filter <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
var filterColKor = ["<22><EFBFBD>", "Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"]; // Filter <20><><EFBFBD>ɿ<EFBFBD><C9BF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ѱ<EFBFBD>.
|
||||
var filterObj = new Object();
|
||||
|
||||
function tbDraw(colArr, valArr){
|
||||
var jsonFilter = jsonRS;
|
||||
if(colArr != undefined && valArr != undefined && colArr.length == valArr.length){
|
||||
$.each(colArr, function(idx, obj){
|
||||
if(valArr[idx] != ""){
|
||||
if(obj == "rate_act"){
|
||||
jsonFilter = $.grep(jsonFilter, function(o, i){
|
||||
var tmpBoolean = false;
|
||||
if(valArr[idx] == "under65"){
|
||||
tmpBoolean = o[obj].replace(/[^0-9.]/gi, '')*1 < 65;
|
||||
}else if(valArr[idx] == "over65"){
|
||||
tmpBoolean = o[obj].replace(/[^0-9.]/gi, '')*1 >= 65 && o[obj].replace(/[^0-9.]/gi, '')*1 < 75;
|
||||
}else if(valArr[idx] == "over75"){
|
||||
tmpBoolean = o[obj].replace(/[^0-9.]/gi, '')*1 >= 75 && o[obj].replace(/[^0-9.]/gi, '')*1 < 85;
|
||||
}else if(valArr[idx] == "over85"){
|
||||
tmpBoolean = o[obj].replace(/[^0-9.]/gi, '')*1 >= 85 && o[obj].replace(/[^0-9.]/gi, '')*1 < 95;
|
||||
}else if(valArr[idx] == "over95"){
|
||||
tmpBoolean = o[obj].replace(/[^0-9.]/gi, '')*1 >= 95;
|
||||
}else{
|
||||
|
||||
}
|
||||
return tmpBoolean;
|
||||
});
|
||||
}else{
|
||||
jsonFilter = $.grep(jsonFilter, function(o, i){ return o[obj] == valArr[idx]; });
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$.each(filterCol, function(idx, col){
|
||||
filterObj[col] = new Array(); // <20>迭<EFBFBD><E8BFAD> <20>ʱ<EFBFBD>ȭ
|
||||
});
|
||||
|
||||
$("#rsTb > table > tbody").html("");
|
||||
$(".tbFilter").html("");
|
||||
var cont_cost_sum = 0;
|
||||
var sum_est_sum = 0;
|
||||
var sum_act_sum = 0;
|
||||
$.each(jsonFilter, function(idx, obj){
|
||||
var tmpHTML = '';
|
||||
var rate_act_tmp = obj.rate_act.replace(/[^0-9.]/gi, '')*1;
|
||||
var tmpClass = "";
|
||||
if(rate_act_tmp >= 95){
|
||||
tmpClass = "over95";
|
||||
}else if(rate_act_tmp >= 85 && rate_act_tmp < 95){
|
||||
tmpClass = "over85";
|
||||
}
|
||||
else if(rate_act_tmp >= 75 && rate_act_tmp < 85){
|
||||
tmpClass = "over75";
|
||||
}
|
||||
else if(rate_act_tmp >= 65 && rate_act_tmp < 75){
|
||||
tmpClass = "over65";
|
||||
}
|
||||
tmpHTML = tmpHTML + '<tr class="' + tmpClass + '">';
|
||||
tmpHTML = tmpHTML + '<td class="text-center align-middle">' + obj.no + '</td>';
|
||||
tmpHTML = tmpHTML + '<td class="text-center align-middle">' + obj.depart_name + '</td>';
|
||||
tmpHTML = tmpHTML + '<td class="text-center align-middle">';
|
||||
tmpHTML = tmpHTML + '<a href="javascript:prjOpen(\'' + obj.p_child_sn + '\');">' + obj.p_child_sn + '</a></td>';
|
||||
tmpHTML = tmpHTML + '<td class="text-left align-middle" >' + obj.p_subject + '</td>';
|
||||
tmpHTML = tmpHTML + '<td class="text-center align-middle">' + obj.p_cli_company_nm + '</td>';
|
||||
tmpHTML = tmpHTML + '<td class="text-center align-middle">' + obj.p_method_nm + '</td>';
|
||||
tmpHTML = tmpHTML + '<td class="text-center align-middle">' + obj.p_sample + '</td>';
|
||||
tmpHTML = tmpHTML + '<td class="text-center align-middle">' + obj.p_cont_cost + '</td>';
|
||||
tmpHTML = tmpHTML + '<td class="text-center align-middle">' + obj.sum_est + '</td>';
|
||||
tmpHTML = tmpHTML + '<td class="text-center align-middle">' + obj.rate_est + '</td>'; //-- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
tmpHTML = tmpHTML + '<td class="text-center align-middle">' + obj.sum_act + '</td>';
|
||||
tmpHTML = tmpHTML + '<td class="text-center align-middle">' + obj.rate_act + '</td>'; //-- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
tmpHTML = tmpHTML + '<td class="text-center align-middle">' + obj.p_con_date_st + '</td>';
|
||||
tmpHTML = tmpHTML + '<td class="text-center align-middle">' + obj.p_con_date_end + '</td>';
|
||||
tmpHTML = tmpHTML + '<td class="text-center align-middle">' + obj.status + '</td>';
|
||||
tmpHTML = tmpHTML + '</tr>';
|
||||
$("#rsTb > table > tbody").append(tmpHTML);
|
||||
cont_cost_sum = cont_cost_sum + (obj.p_cont_cost.replace(/,/gi, '')*1);
|
||||
sum_est_sum = sum_est_sum + (obj.sum_est.replace(/,/gi, '')*1);
|
||||
sum_act_sum = sum_act_sum + (obj.sum_act.replace(/,/gi, '')*1);
|
||||
|
||||
$.each(filterCol, function(i, col){
|
||||
filterObj[col].push(obj[col]);
|
||||
});
|
||||
});
|
||||
$("#rsTb > table > tfoot > #sumTr").html("");
|
||||
var tmpSumHTML = '';
|
||||
tmpSumHTML = tmpSumHTML + '<td align="center" colspan="7"> <20><> <20><> </td>';
|
||||
tmpSumHTML = tmpSumHTML + '<td align="center" style="letter-spacing:-1px;">' + cont_cost_sum.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + '</td>';
|
||||
tmpSumHTML = tmpSumHTML + '<td align="center" style="letter-spacing:-1px;">' + sum_est_sum.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + '</td>';
|
||||
tmpSumHTML = tmpSumHTML + '<td align="center" >' + (sum_est_sum*100/cont_cost_sum).toFixed(2) + '%</td>';
|
||||
tmpSumHTML = tmpSumHTML + '<td align="center" style="letter-spacing:-1px;">' + sum_act_sum.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + '</td>';
|
||||
tmpSumHTML = tmpSumHTML + '<td align="center" >' + (sum_act_sum*100/cont_cost_sum).toFixed(2) + '%</td>';
|
||||
tmpSumHTML = tmpSumHTML + '<td align="center" colspan="3"></td>';
|
||||
$("#rsTb > table > tfoot > #sumTr").append(tmpSumHTML);
|
||||
|
||||
//-- <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD>
|
||||
$.each(filterObj, function(idx, arr){
|
||||
arr = $.unique(arr.sort());
|
||||
var tmpSelect = "";
|
||||
tmpSelect = tmpSelect + "<select class='filterSelect' id='f_" + idx + "'>";
|
||||
if(idx == "rate_act"){
|
||||
tmpSelect = tmpSelect + "<option value='' " + (valArr != undefined ? (valArr[$.inArray(idx, colArr)] == "" ? "selected" : "") : "") + ">" + filterColKor[$.inArray(idx, filterCol)] + "(<28><>ü)</option>";
|
||||
tmpSelect = tmpSelect + "<option value='under65' " + (valArr != undefined ? (valArr[$.inArray(idx, colArr)] == "under65" ? "selected" : "") : "") + ">65% <20><></option>";
|
||||
tmpSelect = tmpSelect + "<option value='over65' " + (valArr != undefined ? (valArr[$.inArray(idx, colArr)] == "over65" ? "selected" : "") : "") + ">65-75%</option>";
|
||||
tmpSelect = tmpSelect + "<option value='over75' " + (valArr != undefined ? (valArr[$.inArray(idx, colArr)] == "over75" ? "selected" : "") : "") + ">75-85%</option>";
|
||||
tmpSelect = tmpSelect + "<option value='over85' " + (valArr != undefined ? (valArr[$.inArray(idx, colArr)] == "over85" ? "selected" : "") : "") + ">85-95%</option>";
|
||||
tmpSelect = tmpSelect + "<option value='over95' " + (valArr != undefined ? (valArr[$.inArray(idx, colArr)] == "over95" ? "selected" : "") : "") + ">95% <20><></option>";
|
||||
}else{
|
||||
tmpSelect = tmpSelect + "<option value='' " + (valArr != undefined ? (valArr[$.inArray(idx, colArr)] == "" ? "selected" : "") : "") + ">" + filterColKor[$.inArray(idx, filterCol)] + "(<28><>ü)</option>";
|
||||
$.each(arr, function(i, txt){
|
||||
tmpSelect = tmpSelect + "<option value='" + txt + "' " + (valArr != undefined ? (valArr[$.inArray(idx, colArr)] == txt ? "selected" : "") : "") + ">" + txt + "</option>";
|
||||
});
|
||||
}
|
||||
|
||||
//console.log("--- "+ filterColKor[$.inArray(idx, filterCol)] +"--- "+ $.inArray(idx, filterCol) );
|
||||
|
||||
|
||||
tmpSelect = tmpSelect + "</select>";
|
||||
$(".tbFilter").append(tmpSelect);
|
||||
});
|
||||
|
||||
//-- <20><EFBFBD><D7B7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
//-- <20>쿡<D7B7><ECBFA1> <20>ߺ<EFBFBD> <20><><EFBFBD><EFBFBD> 2020-10-15 12:31:45
|
||||
var foundedinputs = [];
|
||||
$("select[id=f_depart_name] option").each(function() {
|
||||
if($.inArray(this.value, foundedinputs) != -1) $(this).remove();
|
||||
foundedinputs.push(this.value);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function prjOpen(p_child_sn){
|
||||
var url = "/project/project_list2_dep_2014.asp?p_sn=" + p_child_sn.split("_")[0] + "&p_sub_type=C&p_child_sn="+p_child_sn;
|
||||
window.open(url, '', 'left=0,top=0,width=1400,height=800,scrollbars=yes,resizeable=yes');
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$(document).off("change", ".filterSelect").on("change", ".filterSelect", function(){
|
||||
var colArr = new Array();
|
||||
var valArr = new Array();
|
||||
$.each($(".filterSelect"), function(idx, obj){
|
||||
colArr.push($(obj).attr("id").substr($(obj).attr("id").indexOf("_")+1, 100));
|
||||
valArr.push($(obj).val());
|
||||
});
|
||||
tbDraw(colArr, valArr);
|
||||
});
|
||||
|
||||
tbDraw();
|
||||
|
||||
$("#btnExport").on("click", function(e) {
|
||||
var a = document.createElement('a');
|
||||
var data_type = 'data:application/vnd.ms-excel;charset=euc-kr';
|
||||
var table_html = encodeURIComponent($("#rsTb").html());
|
||||
a.href = data_type + ', ' + table_html;
|
||||
a.download = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȳ '+ $("#thisTime").text() +'.xls';
|
||||
a.click();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$("#p_statistics").on("change", function(){
|
||||
location.href="./projectlist_cost.asp?p_statistics=" + $("#p_statistics option:selected").val();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
<!-- #include virtual = "include/footer.asp" -->
|
||||
Reference in New Issue
Block a user