Files
KIN/inspection/date_neakeun_work.asp
2025-09-29 17:55:08 +09:00

201 lines
12 KiB
Plaintext

<!-- #include virtual = "include/header.asp" -->
<%
dim command
command = Request("command")
p_sn = request("p_sn")
work_type = request("work_type")
neakeun_jumin = request("neakeun_jumin")
neakeun_name = request("neakeun_name")
work_date = request("work_date")
if work_date = "" or isnull(work_date) then
work_date = date()
end if
dim tmp_p_sn
dim sum_job_in_time
dim sum_job_out_time
dim sum_job_add_time
dim sum_all_work_time
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>일자별 내근직 근무현황</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
if command = "excel" then
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition","attachment;filename=일자별_내근직_근무현황.xls"
end if
%>
<%if command <> "excel" then%>
<% Dim f_menu : f_menu = "np" %>
<!-- #include file = "f_menu.asp" -->
<%End If%>
<form name="pms" method="post">
<table width="1200px" class="table table-sm table-sm2 table-bordered table-head tr-colors">
<%if command <> "excel" then %>
<tr>
<td width="15%" height="30px" align="center" >프로젝트 번호</td>
<td width="35%" height="30px" ><input name="p_sn" type="text" value="<%=p_sn %>" style="width:200px" ></td>
<%
query = " select *"
query = query & " from direct_costcode "
query = query & " where d_cost_kind = 'field' "
query = query & " and d_cost_useyn = 'y' "
query = query & " and d_cost_parents = '2' "
Adors.Open query, adoConn, 1
%>
<td width="15%" height="30px" align="center" >업무</td>
<td width="35%" height="30px" >
<select name="work_type">
<option value="">전체</option>
<% for i=1 to Adors.recordcount %>
<option value="<%=Adors("d_cost_code")%>" <% if CStr(Adors("d_cost_code")) = work_type then %>selected <%end if %>><%=Adors("d_cost_name") %></option>
<% Adors.movenext
next
Adors.close
%>
</select>
</td>
</tr>
<tr>
<td width="15%" height="30px" align="center" >면접원 주민번호</td>
<td width="35%" height="30px" ><input name="neakeun_jumin" type="text" value="<%=neakeun_jumin %>" style="width:200px" ></td>
<td width="15%" height="30px" align="center" >면접원 이름</td>
<td width="35%" height="30px" ><input name="neakeun_name" type="text" value="<%=neakeun_name %>" style="width:200px" ></td>
</tr>
<tr>
<td width="15%" height="30px" align="center" >근무 일자</td>
<td colspan="3" height="30px" >
<input type="text" style="width:200px;text-align:right;" name="work_date" id="work_date" readonly value="<%=work_date%>">
</td>
</tr>
<tr>
<td align="center" colspan="4" class="pt-2">
<img src="/images/common/btn_search.jpg" align="absmiddle" style="cursor:pointer" onclick="search('search')">
<img src="/images/common/btn_excel.jpg" align="absmiddle" onclick="search('excel')" style='CURSOR:pointer;' title ='엑셀로 내보내기'></p>
</td>
</tr>
<%end if %>
<% if command <> "" then %>
<tr>
<td align="center" colspan="4">
<table class="table table-sm table-sm2 table-bordered table-head tr-colors">
<tr>
<td align="center" >생년월일</td>
<td align="center" >이름</td>
<td align="center" >출근시간</td>
<td align="center" >퇴근시간</td>
<td align="center" >총 근무시간</td>
<td align="center" >초과 근무시간</td>
<td align="center" >추가 근무시간</td>
<td align="center" >누적 투입 시간</td>
</tr>
<%
'--프로젝트 별 내근직 소요비용 검색-종료 프로젝트
query = " select nw.neakeun_jumin, nw.neakeun_name, in_time, out_time, round(SUM(nw.job_in_time),2) as job_in_time, round(SUM(nw.job_out_time),2) as job_out_time, "
query = query & " sum(convert(float,nw.job_add_time)) as job_add_time, round(SUM(nw.job_in_time) + sum(convert(float,nw.job_add_time)),2) as all_work_time "
query = query & " from neakeun_work nw left outer join T_PROJECT_METHOD tpm on nw.p_child_sn = tpm.p_child_sn "
query = query & " left outer join project p on nw.p_child_sn = p.p_sn "
query = query & " where date = '"&work_date&"' "
if p_sn <> "" then
query = query & " AND nw.p_child_sn LIKE '%"& p_sn &"%' "
end if
if work_type <> "" then
query = query & " AND p_sebu_code = '"&work_type&"' "
end if
if neakeun_jumin <> "" then
query = query & " AND nw.neakeun_jumin like '%"&neakeun_jumin&"%' "
end if
if neakeun_name <> "" then
query = query & " AND nw.neakeun_name like '%"&neakeun_name&"%' "
end if
query = query & " group by nw.neakeun_jumin, nw.neakeun_name, in_time, out_time "
query = query & " order by nw.neakeun_name "
Adors.open query,adoconn,1
sum_job_in_time = 0
sum_job_out_time = 0
sum_job_add_time = 0
sum_all_work_time = 0
for i=1 to Adors.recordcount
if not isnull(Adors("neakeun_jumin")) then
sum_job_in_time = sum_job_in_time + Adors("job_in_time")
sum_job_out_time = sum_job_out_time + Adors("job_out_time")
sum_job_add_time = sum_job_add_time + Adors("job_add_time")
sum_all_work_time = sum_all_work_time + Adors("all_work_time")
end if
%>
<tr>
<td align="center"><%= left(Adors("neakeun_jumin"), 6)%></td>
<td align="center"><%= Adors("neakeun_name")%></td>
<td align="center"><%= Adors("in_time")%></td>
<td align="center"><%= Adors("out_time")%></td>
<td align="center"><%= Adors("job_in_time")%></td>
<td align="center"><%= Adors("job_out_time")%></td>
<td align="center"><%= Adors("job_add_time")%></td>
<td align="center"><%= Adors("all_work_time")%></td>
</tr>
<% Adors.movenext
next
Adors.close
%>
<tr>
<td align="right" colspan="4"><b>총 합계</b></td>
<td align="center"><b><%= sum_job_in_time%></b></td>
<td align="center"><b><%= sum_job_out_time%></b></td>
<td align="center"><b><%= sum_job_add_time%></b></td>
<td align="center"><b><%= sum_all_work_time%></b></td>
</tr>
</table>
</td>
</tr>
<% end if %>
</table>
</form>
<%if command <> "excel" then%>
</div>
</div>
</div>
</div>
</div>
<!-- /.content -->
<!-- REQUIRED SCRIPTS -->
<script>
$(function(){
$("#work_date").datepicker();
});
function search(a) {
if (document.pms.work_date.value == null || document.pms.work_date.value == "") {
alert("근무일자를 반드시 입력해야 합니다.");
return false;
} else {
document.pms.action = "date_neakeun_work.asp?command=" + a;
document.pms.submit();
}
}
</script>
</div>
<!-- /.content-wrapper -->
<!-- #include virtual = "include/footer.asp" -->
<% end if %>