361 lines
20 KiB
Plaintext
361 lines
20 KiB
Plaintext
<!-- #include virtual = "include/header.asp" -->
|
|
<%
|
|
dim command
|
|
command = Request("command")
|
|
|
|
s_date_st = request("s_date_st")
|
|
s_date_end = request("s_date_end")
|
|
s_name = request("s_name")
|
|
s_work = request("s_work")
|
|
s_p_sn = request("s_p_sn")
|
|
s_p_subject = request("s_p_subject")
|
|
s_column = replace(request("s_column"), " ", "")
|
|
|
|
Dim column_dic
|
|
Set column_dic = Server.CreateObject("Scripting.Dictionary")
|
|
With column_dic
|
|
.Add "p_child_sn", "프로젝트코드"
|
|
.Add "p_subject", "프로젝트명"
|
|
.Add "prj_code", "CATI코드"
|
|
.Add "new_id", "면접원ID"
|
|
.Add "log_user_name", "면접원명"
|
|
.Add "log_date", "업무일자"
|
|
.Add "in_time", "출근시간"
|
|
.Add "out_time", "퇴근시간"
|
|
.Add "first_call", "첫Call"
|
|
.Add "Last_call", "마지막Call"
|
|
.Add "완료", "완료"
|
|
.Add "에러", "에러"
|
|
.Add "중단", "중단"
|
|
.Add "쿼터오버", "쿼터오버"
|
|
.Add "거절", "거절"
|
|
.Add "대상자아님", "대상자아님"
|
|
.Add "결번", "결번"
|
|
.Add "비수신", "비수신"
|
|
.Add "통화중", "통화중"
|
|
.Add "부재중", "부재중"
|
|
End With
|
|
|
|
if command <> "excel" then
|
|
%>
|
|
<!-- #include virtual = "include/left.asp" -->
|
|
<!-- Content Wrapper. Contains page content -->
|
|
<div class="content-wrapper">
|
|
<style>
|
|
.t_table .t_head{
|
|
cursor:pointer;
|
|
}
|
|
</style>
|
|
<!-- Content Header (Page header) -->
|
|
<div class="content-header">
|
|
<h1>CATI 면접원 현황</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=CATI_Status.xls"
|
|
end if
|
|
%>
|
|
<form name="work_status" method="post">
|
|
<input type="hidden" value="<%=command %>" name="command" />
|
|
<input type="hidden" value="<%=s_work %>" name="s_work_arr" />
|
|
<input type="hidden" value="<%=s_column %>" name="s_column_arr" />
|
|
<table class="table table-sm table-sm2 table-bordered table-head tr-colors">
|
|
<% If command <> "excel" Then %>
|
|
<tr>
|
|
<td align="center" width="12%">기 간</td>
|
|
<td align="left" width="38%">
|
|
<input type="text" style="width:120;text-align:center;CURSOR: pointer;" value="<%=s_date_st %>" name="s_date_st" class='selectDate' readonly />
|
|
~
|
|
<input type="text" style="width:120;text-align:center;CURSOR: pointer;" value="<%=s_date_end %>" name="s_date_end" class='selectDate' readonly />
|
|
</td>
|
|
<td align="center" width="12%">면접원 성명</td>
|
|
<td align="left" width="38%">
|
|
<input type="text" name="s_name" value="<%=s_name %>" style="width:200px;"/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="12%">프로젝트 코드</td>
|
|
<td align="left" width="38%">
|
|
<input type="text" name="s_p_sn" value="<%=s_p_sn %>" style="width:200px;"/>
|
|
</td>
|
|
<td align="center" width="12%">프로젝트 명</td>
|
|
<td align="left" width="38%">
|
|
<input type="text" name="s_p_subject" value="<%=s_p_subject %>" style="width:200px;"/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="12%">집계 Column 선택</td>
|
|
<td align="left" width="88%" colspan="3">
|
|
<label class='mx-2' for="log_date"><input type="checkbox" value="log_date" id="log_date" name="s_column"/> 업무날짜</label>
|
|
<label class='mx-2' for="intranet_project"><input type="checkbox" value="p_child_sn,p_subject" id="intranet_project" name="s_column"/> 인트라넷 프로젝트</label>
|
|
<label class='mx-2' for="prj_code"><input type="checkbox" value="p_child_sn,p_subject,prj_code" id="prj_code" name="s_column"/> CATI 프로젝트</label>
|
|
<label class='mx-2' for="log_user_name"><input type="checkbox" value="log_user_name" id="log_user_name" name="s_column"/> 면접원 성명</label>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3" align="right"><font color="red"><b>검색 시 1분에서 10분 가량 소요될 수 있습니다</b></font></td>
|
|
<td colspan="1" align="right">
|
|
<a href="javascript:search_go('view');"><img src="/images/common/btn_smallsrch.gif" /></a>
|
|
<a href="javascript:search_go('excel');"><img src="/images/common/btn_smallexcel.gif" /></a>
|
|
</td>
|
|
</tr>
|
|
<% End if %>
|
|
<% if command <> "" Then %>
|
|
<tr>
|
|
<td colspan="4" align="center">
|
|
<div style="width:100%;overflow-y:scroll;max-height:545px;height:545px;">
|
|
<table class="t_table table table-sm table-sm2 table-bordered table-head tr-colors" style='font-size:12px;'>
|
|
<%
|
|
query = " SELECT "
|
|
if s_column <> "" Then
|
|
query = query & " " & s_column & ", "
|
|
else
|
|
query = query & " p_child_sn, p_subject, prj_code, new_id, log_user_name, log_date, in_time, out_time, first_call, Last_call, "
|
|
End if
|
|
query = query & " SUM(완료) as 완료, SUM(에러) as 에러, SUM(중단) as 중단, SUM(쿼터오버) as 쿼터오버, SUM(거절) as 거절, "
|
|
query = query & " SUM(대상자아님) as 대상자아님, SUM(결번) as 결번, SUM(비수신) as 비수신, SUM(통화중) as 통화중, SUM(부재중) as 부재중 "
|
|
query = query & " FROM "
|
|
query = query & " ( "
|
|
query = query & " SELECT c.p_child_sn, c.p_subject, a.prj_code, "
|
|
query = query & " a.log_user, (SELECT TOP 1 new_id FROM man WHERE id = a.log_user) AS new_id, a.log_user_name, a.log_date, "
|
|
query = query & " a.in_time, a.out_time, a.first_call, a.Last_call, "
|
|
query = query & " 완료, 에러, 중단, 쿼터오버, 거절, 대상자아님, 결번, 비수신, 통화중, 부재중 "
|
|
query = query & " FROM V_Cati_callcount a LEFT JOIN new_cati.dbo.project b "
|
|
query = query & " ON a.prj_code = b.prj_code LEFT JOIN project2.dbo.T_project_method c "
|
|
query = query & " ON b.intranet_project = c.p_child_sn "
|
|
query = query & " WHERE a.log_date BETWEEN '" & s_date_st & "' AND '" & s_date_end & "' "
|
|
query = query & " ) T "
|
|
If s_name <> "" Then
|
|
query = query & " AND log_user_name LIKE '%" & s_name & "%' "
|
|
End If
|
|
If s_p_sn <> "" Then
|
|
query = query & " AND p_child_sn LIKE '" & s_p_sn & "%' "
|
|
End If
|
|
If s_p_subject <> "" Then
|
|
query = query & " AND p_subject LIKE '%" & s_p_subject & "%' "
|
|
End If
|
|
if s_column <> "" Then
|
|
query = query & " GROUP BY " & s_column & " "
|
|
query = query & " ORDER BY " & s_column & " "
|
|
Else
|
|
query = query & " GROUP BY p_child_sn, p_subject, prj_code, new_id, log_user_name, log_date, in_time, out_time, first_call, Last_call "
|
|
query = query & " ORDER BY p_child_sn, p_subject, prj_code, new_id, log_user_name, log_date, in_time, out_time, first_call, Last_call "
|
|
End if
|
|
'response.Write query
|
|
AdoRs.open query, adoconn, adopenstatic, adlockreadonly
|
|
|
|
Dim all_cnt
|
|
If AdoRs.RecordCount > 0 Then
|
|
%>
|
|
<tr height="25px" class="t_head">
|
|
<%
|
|
For i = 0 To AdoRs.fields.count - 1
|
|
%>
|
|
<%If column_dic.Item(AdoRs.fields(i).Name)="완료" Then %>
|
|
<td align="center">총 Count </td>
|
|
<%End If %>
|
|
|
|
<td align="center"><%= column_dic.Item(AdoRs.fields(i).Name) %> </td>
|
|
<%
|
|
Next
|
|
%>
|
|
</tr>
|
|
<%
|
|
Else
|
|
%>
|
|
<tr height="25px">
|
|
<td align="center" width="100%">검색 결과가 없습니다</td>
|
|
</tr>
|
|
<%
|
|
End If
|
|
|
|
Do While Not AdoRs.Eof
|
|
%>
|
|
<tr class="t_contents">
|
|
<%
|
|
For i = 0 To AdoRs.fields.count - 1
|
|
If column_dic.Item(AdoRs.fields(i).Name) = "완료" Then
|
|
all_cnt = 0
|
|
all_cnt = Adors("완료") + Adors("에러") + Adors("중단") + Adors("쿼터오버") +Adors("거절") + Adors("대상자아님")+ Adors("결번")+ Adors("거절")+ Adors("통화중")+ Adors("부재중")
|
|
%>
|
|
<td align="center" style=""><%= all_cnt %></td>
|
|
<%
|
|
End If
|
|
%>
|
|
<td align="center" style=""><%= AdoRs.fields(i) %></td>
|
|
<%
|
|
Next
|
|
%>
|
|
</tr>
|
|
<%
|
|
AdoRs.MoveNext
|
|
Loop
|
|
%>
|
|
</table>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<% End if %>
|
|
</table>
|
|
</form>
|
|
<%if command <> "excel" then%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- /.content -->
|
|
<!-- REQUIRED SCRIPTS -->
|
|
<script>
|
|
$(function () {
|
|
$(".selectDate").datepicker();
|
|
if ($("input[name=s_work_arr]").val() != "") {
|
|
$("input[name=s_work]").each(function (i) {
|
|
if ($("input[name=s_work_arr]").val().indexOf("'" + $(this).val() + "'") > -1) {
|
|
$(this).prop("checked", true);
|
|
}
|
|
});
|
|
}
|
|
if ($("input[name=s_column_arr]").val() != "") {
|
|
$("input[name=s_column]").each(function (i) {
|
|
if ($("input[name=s_column_arr]").val().indexOf($(this).val()) > -1) {
|
|
$(this).prop("checked", true);
|
|
}
|
|
});
|
|
}
|
|
var sort_col_check = [];
|
|
$(".t_table .t_head td").each(function (index) {
|
|
sort_col_check[index] = 0; // 1은 asc, 2는 desc, 0은 초기
|
|
});
|
|
$(".t_table .t_head td").click(function () {
|
|
// $(".t_table .t_head td").index(this) 클릭한 컬럼의 INDEX
|
|
// $(".t_table .t_head > td").length tr의 column 수
|
|
// $(".t_table .t_contents").length tr의 row 수
|
|
// var arr_tb = new array($(".t_table .t_contents").length, $(".t_table .t_head > td").length);
|
|
var num_yn = true;
|
|
var equal_value = true;
|
|
var prev_value = "";
|
|
var s_col_index = $(".t_table .t_head td").index(this);
|
|
var arr_tb = [];
|
|
if (sort_col_check[s_col_index] == 1) {
|
|
sort_col_check[s_col_index] = 2;
|
|
} else {
|
|
sort_col_check[s_col_index] = 1;
|
|
}
|
|
$(".t_table .t_contents").each(function (tr_i) {
|
|
arr_tb[tr_i] = $(this).find("td").eq(s_col_index).text();
|
|
if (prev_value == "") {
|
|
prev_value = arr_tb[tr_i];
|
|
}
|
|
if (prev_value != arr_tb[tr_i]) {
|
|
equal_value = false;
|
|
}
|
|
if (isNaN(arr_tb[tr_i]) == true) {
|
|
num_yn = false;
|
|
}
|
|
$(this).find("td").each(function (td_i) {
|
|
if (td_i != s_col_index) {
|
|
arr_tb[tr_i] = arr_tb[tr_i] + "^||^" + $(this).text();
|
|
}
|
|
});
|
|
});
|
|
if (equal_value != true) { // 컬럼의 모든 값이 같지 않아야 Sort 진행
|
|
if (num_yn == true) { // 숫자일 때 정렬
|
|
if (sort_col_check[s_col_index] == 1) {
|
|
arr_tb.sort(function (a, b) { return a.split("^||^")[0] - b.split("^||^")[0]; }); // 숫자 정렬 Asc
|
|
$(".t_table .t_head td").each(function (e) {
|
|
if (e == s_col_index) {
|
|
$(this).text($(this).text().replace("▲", "").replace("▼", "") + "▼");
|
|
} else {
|
|
$(this).text($(this).text().replace("▲", "").replace("▼", ""));
|
|
}
|
|
});
|
|
} else if (sort_col_check[s_col_index] == 2) {
|
|
arr_tb.reverse(function (a, b) { return a.split("^||^")[0] - b.split("^||^")[0]; }); // 숫자 정렬 Desc
|
|
$(".t_table .t_head td").each(function (e) {
|
|
if (e == s_col_index) {
|
|
$(this).text($(this).text().replace("▲", "").replace("▼", "") + "▲");
|
|
} else {
|
|
$(this).text($(this).text().replace("▲", "").replace("▼", ""));
|
|
}
|
|
});
|
|
}
|
|
} else { // 문자일 때 정렬
|
|
if (sort_col_check[s_col_index] == 1) {
|
|
arr_tb.sort(); // 문자 정렬 Asc
|
|
$(".t_table .t_head td").each(function (e) {
|
|
if (e == s_col_index) {
|
|
$(this).text($(this).text().replace("▲", "").replace("▼", "") + "▼");
|
|
} else {
|
|
$(this).text($(this).text().replace("▲", "").replace("▼", ""));
|
|
}
|
|
});
|
|
} else if (sort_col_check[s_col_index] == 2) {
|
|
arr_tb.reverse(); // 문자 정렬 Desc
|
|
$(".t_table .t_head td").each(function (e) {
|
|
if (e == s_col_index) {
|
|
$(this).text($(this).text().replace("▲", "").replace("▼", "") + "▲");
|
|
} else {
|
|
$(this).text($(this).text().replace("▲", "").replace("▼", ""));
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
$(".t_table .t_contents").each(function (tr_i) {
|
|
var tmp_arr = arr_tb[tr_i].split("^||^");
|
|
var chk_ind = 0;
|
|
$(this).find("td").eq(s_col_index).text(tmp_arr[0]);
|
|
for (var i = 0; i < tmp_arr.length; i++) {
|
|
if (i != s_col_index) {
|
|
chk_ind = chk_ind + 1;
|
|
$(this).find("td").eq(i).text(tmp_arr[chk_ind]);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
function dateDiff(_date1, _date2) {
|
|
var diffDate_1 = _date1 instanceof Date ? _date1 : new Date(_date1);
|
|
var diffDate_2 = _date2 instanceof Date ? _date2 : new Date(_date2);
|
|
|
|
diffDate_1 = new Date(diffDate_1.getFullYear(), diffDate_1.getMonth() + 1, diffDate_1.getDate());
|
|
diffDate_2 = new Date(diffDate_2.getFullYear(), diffDate_2.getMonth() + 1, diffDate_2.getDate());
|
|
|
|
var diff = Math.abs(diffDate_2.getTime() - diffDate_1.getTime());
|
|
diff = Math.ceil(diff / (1000 * 3600 * 24));
|
|
|
|
return diff;
|
|
}
|
|
|
|
function search_go(command) {
|
|
var month_limit = 90;
|
|
var frm = document.work_status;
|
|
var chk_yn = false;
|
|
if (frm.s_date_st.value == "" || frm.s_date_end.value == "") {
|
|
alert("기간을 선택해주세요");
|
|
return;
|
|
}
|
|
if (dateDiff(frm.s_date_st.value, frm.s_date_end.value) > 90) {
|
|
alert("90일 이하의 기간만 검색이 가능합니다");
|
|
return;
|
|
}
|
|
frm.action = "./n_work_status.asp?command=" + command;
|
|
frm.submit();
|
|
}
|
|
</script>
|
|
</div>
|
|
<!-- /.content-wrapper -->
|
|
<!-- #include virtual = "include/footer.asp" -->
|
|
<% end if %> |