최초커밋
This commit is contained in:
191
business/job_cost_total_group.asp
Normal file
191
business/job_cost_total_group.asp
Normal file
@@ -0,0 +1,191 @@
|
||||
<!-- #include virtual = "include/header.asp" -->
|
||||
<%
|
||||
dim command
|
||||
command = Request("command")
|
||||
if command <> "excel" then
|
||||
%>
|
||||
<!-- #include virtual = "include/left.asp" -->
|
||||
<!-- Content Wrapper. Contains page content -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<h1><3E><EFBFBD><D7B7><EFBFBD><EEBFB5> <20>캰 <20><><EFBFBD><EFBFBD></h1>
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
<!-- Main content -->
|
||||
<div class="content-body">
|
||||
<div class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<%
|
||||
end if
|
||||
|
||||
job_month = Request("job_month")
|
||||
search_depart = Request("search_depart")
|
||||
|
||||
if command = "excel" Then
|
||||
Response.CacheControl = "public"
|
||||
Response.ContentType = "application/vnd.ms-excel"
|
||||
Response.AddHeader "Content-Disposition","attachment;filename=<3D><EFBFBD><D7B7><EFBFBD><EEBFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_" & job_month & ".xls"
|
||||
end if
|
||||
%>
|
||||
<script>
|
||||
function search(command) {
|
||||
var url = "";
|
||||
var job_month = document.job_cost_total.job_month.value;
|
||||
|
||||
var search_depart = "";
|
||||
if($("select[name='search_depart']").length > 0){
|
||||
search_depart = $("select[name='search_depart'] :selected").val();
|
||||
}
|
||||
if (job_month == "") {
|
||||
alert("<22><>¥<EFBFBD><C2A5> <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC><EFBFBD>.");
|
||||
} else {
|
||||
url = "job_cost_total_group.asp?command=" + command + "&job_month=" + job_month + "&search_depart=" + search_depart;
|
||||
document.job_cost_total.action = url;
|
||||
document.job_cost_total.submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<form name="job_cost_total" method="post" >
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
||||
</tr>
|
||||
<%if command <> "excel" then%>
|
||||
<tr>
|
||||
<td style="padding:10 0 0 0;">
|
||||
<table style='width:1000px' class="table table-sm table-sm2 table-bordered table-head tr-colors" >
|
||||
<tr>
|
||||
<td align="left" >
|
||||
<select name="job_month" style="width:100px;letter-spacing:0px;">
|
||||
<option value=""><3E><> <20><><EFBFBD><EFBFBD></option>
|
||||
<%
|
||||
For i=0 To 24
|
||||
if LEFT(DateAdd("m", i*(-1), date), 7) > "2021-03" Then
|
||||
%>
|
||||
<option value="<%=LEFT(DateAdd("m", i*(-1), date), 7) %>" <%if job_month = LEFT(DateAdd("m", i*(-1), date), 7) then %> selected <% end if %>><%=LEFT(DateAdd("m", i*(-1), date), 7) %></option>
|
||||
<%
|
||||
End If
|
||||
Next
|
||||
%>
|
||||
</select>
|
||||
<%
|
||||
if Session("depart_code") = "18" or session("teamplace") = "6" Then
|
||||
%>
|
||||
<select name="search_depart" style="width:120px;">
|
||||
<option value=""><3E>μ<EFBFBD> <20><><EFBFBD><EFBFBD>(<28><>ü)</option>
|
||||
<%
|
||||
query = " SELECT depart, depart_cd FROM V_GROUP_COST_NEW with(nolock) where 1 = 1 AND left(cost_date,7) > '2021-04' group by depart, depart_cd order by depart asc "
|
||||
'Response.write query
|
||||
Adors.open query, adoconn, adopenstatic, adlockreadonly
|
||||
if Adors.RecordCount > 0 Then
|
||||
For i=1 to Adors.recordcount
|
||||
%><option value="<%=Adors("depart") %>" <%if(Adors("depart") = search_depart)then%>selected<%end if%>><%=Adors("depart") %></option>
|
||||
<%
|
||||
adors.movenext
|
||||
next
|
||||
AdoRs.close
|
||||
end if %>
|
||||
</select>
|
||||
<%
|
||||
End If
|
||||
%>
|
||||
</td>
|
||||
<td align="right">
|
||||
<button type="button" class='btn btn-sm btn-primary' onclick='search("view");'><3E><>ȸ</button>
|
||||
<button type="button" class='btn btn-sm btn-success' onclick='search("excel");'>Excel</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<% end if %>
|
||||
<% if command <> "" then %>
|
||||
<tr>
|
||||
<td style="padding:0 0 0 0;">
|
||||
<table style='width:1000px' class="table table-sm table-sm2 table-bordered table-head tr-colors" >
|
||||
<%
|
||||
query = ""
|
||||
query = query & " SELECT depart , sum(cost) as cost, count(1) as cnt "
|
||||
query = query & " FROM V_GROUP_COST_NEW with(nolock) "
|
||||
query = query & " where 1 = 1 "
|
||||
query = query & " AND left(cost_date,7) = '" & job_month & "' "
|
||||
if( search_depart <> "" )then
|
||||
query = query & " and depart = '" & search_depart & "' "
|
||||
end if
|
||||
if session("depart_code") <> "18" and session("teamplace") <> "6" Then
|
||||
query = query & " and ((depart_cd = '" & Session("depart_code") & "' "
|
||||
query = query & " and depart_cd <> '0') OR "
|
||||
query = query & " depart = '" & Session("loginuser") & "') "
|
||||
End If
|
||||
query = query & " group by depart "
|
||||
query = query & " order by depart asc "
|
||||
Adors.open query, adoconn, adopenstatic, adlockreadonly
|
||||
|
||||
if Adors.RecordCount > 0 Then
|
||||
sum_money = 0
|
||||
%>
|
||||
<tr height=30>
|
||||
<td align="center" style="width:10%;"><3E>μ<EFBFBD></td>
|
||||
<td align="center" style="width:10%;"><3E>ݾ<EFBFBD></td>
|
||||
</tr>
|
||||
<%
|
||||
For i=1 to Adors.recordcount
|
||||
IF list_bgcolor="#FFFFFF" Then
|
||||
list_bgcolor="floralwhite"
|
||||
Else
|
||||
list_bgcolor="#FFFFFF"
|
||||
End IF
|
||||
%>
|
||||
<tr height=30 style="background-color:<%=list_bgcolor%>;" >
|
||||
<td align="center" ><%=Adors("depart") %></td>
|
||||
<td align="center" ><%=Formatnumber(Adors("cost"), 0) %></td>
|
||||
</tr>
|
||||
<%
|
||||
sum_money = sum_money + CDbl(Adors("cost"))
|
||||
adors.movenext
|
||||
next
|
||||
AdoRs.close
|
||||
%>
|
||||
<tr height=30>
|
||||
<td align="center" > <20><> <20><> </td>
|
||||
<td align="center" ><%= Formatnumber(sum_money, 0) %></td>
|
||||
</tr>
|
||||
<%
|
||||
Else
|
||||
%>
|
||||
<tr height=30>
|
||||
<td align="center" style="width:10%;"><3E>μ<EFBFBD></td>
|
||||
<td align="center" style="width:10%;"><3E>ݾ<EFBFBD></td>
|
||||
</tr>
|
||||
<tr height=30 style="background-color:floralwhite;" >
|
||||
<td align="center" colspan="2"><3E>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD></td></td>
|
||||
</tr>
|
||||
<tr height=30>
|
||||
<td align="center" > <20><> <20><> </td>
|
||||
<td align="center" >0</td>
|
||||
</tr>
|
||||
<%
|
||||
End if
|
||||
%>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<% end if %>
|
||||
</table>
|
||||
</form>
|
||||
<% if command <> "excel" then%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.content -->
|
||||
<!-- REQUIRED SCRIPTS -->
|
||||
<script>
|
||||
|
||||
</script>
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
<!-- #include virtual = "include/footer.asp" -->
|
||||
<% end if %>
|
||||
Reference in New Issue
Block a user