382 lines
17 KiB
Plaintext
382 lines
17 KiB
Plaintext
<!-- #include Virtual="/include/Header.asp"-->
|
|
<%
|
|
|
|
Dim PKEY : PKEY = Request("PKEY")
|
|
Dim PRJCODE : PRJCODE = Request("PKEY")
|
|
|
|
%>
|
|
|
|
<link rel="stylesheet" href="./quota_gang_css/style_quota.css">
|
|
|
|
|
|
<body style="padding-top: 55px;">
|
|
<div class="fixed-top p-3 bg-white text-center h5 shadow-lg">
|
|
<i class="fa fa-television" aria-hidden="true"></i> Gang 설문 진행 현황 페이지 : <input name="pkey" id="pkey" value="<%=pkey %>" >
|
|
|
|
<button type="button" id="gogogo" data-id="" data-code="" class="btn btn-sm btn-info">코드입력 후 확인</button>
|
|
|
|
</div>
|
|
<div class="container-fluid h-100" >
|
|
<div class="row h-100">
|
|
<div class="col-lg-12 pt-1 h-100 d-flex flex-column bg-navy-2 pb-2">
|
|
<div class="p-2 text-white d-flex flex-row" id="search-box" >
|
|
<!-- <div ><i class="fa fa-globe" aria-hidden="true"></i> 진행 현황 : 완료(<span id="end-cnt"></span>명) / 진행(<span id="going-cnt"></span>명) </div> -->
|
|
|
|
<div class="ml-2 position-relative" >
|
|
<a id="h-list" href="./quota_gang_ing.asp">
|
|
<i class="fa fa-child" aria-hidden="true"></i> 진행중 현황
|
|
</a>
|
|
</div>
|
|
<div class="flex-fill"></div>
|
|
<div onclick="window.location.reload()" style="cursor: pointer;" class=" text-right"><i class="fa fa-refresh" aria-hidden="true"></i> 새로고침</div>
|
|
</div>
|
|
|
|
<div class="p-2 main-box rounded bg-light h-100 d-flex flex-row shadow-sm" style="overflow-x: auto;">
|
|
<div class="p-2 d-flex flex-column flex-fill border bg-white rounded shadow-sm">
|
|
|
|
<div id="list-box" class="d-flex flex-row p-2 flex-fill" style="height:1px">
|
|
<div class="p-2 m-1 border shadow-sm rounded" style="min-width:800px;overflow-y: auto;">
|
|
<div class="d-flex flex-row align-items-center">
|
|
<div><i class="fa fa-table" aria-hidden="true"></i> 응답자 테이블</div>
|
|
<div class="m-1 flex-fill text-primary filter-list"> <i class="fa fa-filter" aria-hidden="true"></i> </div>
|
|
</div>
|
|
<table id="list-table" class="table table-sm table-bordered" style="font-size: .7rem;">
|
|
<thead >
|
|
<tr class="text-white text-center bg-navy-3">
|
|
<!--<td class='filter-td' data-type="1"><i class="fa fa-filter" aria-hidden="true"></i> 그룹</td>-->
|
|
<td>ID</td>
|
|
<td>시작</td>
|
|
<td>종료</td>
|
|
<td class='filter-td' data-type="2"><i class="fa fa-filter" aria-hidden="true"></i> 상태</td>
|
|
</thead>
|
|
<tbody>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- 중간 FLEX -->
|
|
<div class="p-1 flex-fill d-flex flex-row align-items-center justify-content-center">
|
|
<div class="p-1 border d-flex flex-column shadow-sm rounded bg-white h-100 w-100 overflow-auto" style="font-size: .8rem;">
|
|
<div class="p-1 border-bottom d-flex flex-row align-items-center">
|
|
<div>
|
|
<i class="fa fa-info" aria-hidden="true"></i> [<span id='id-label' class="text-primary">--</span>] 세부 사항
|
|
</div>
|
|
</div>
|
|
<div id="DAT_ARR_VAL" >
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
var list = ""
|
|
|
|
var lgModule = (function(){
|
|
var list = "";
|
|
var img_list = "";
|
|
var selected_list = "";
|
|
var list_question = "";
|
|
var prjcode = $("#pkey").val();
|
|
|
|
var hlist = "";
|
|
|
|
var filter_list = {
|
|
"group":"",
|
|
"model":"",
|
|
"prev":""
|
|
}
|
|
|
|
function set_filter(type, value){
|
|
this.filter_list[type] = value;
|
|
$("span.filter_"+type).remove();
|
|
if(value !== ""){
|
|
$(".filter-list").append("<span class='filter_"+type+"' >"+value+"</span>")
|
|
}
|
|
this.filtering_list()
|
|
}
|
|
|
|
function get_list() {
|
|
|
|
this.list = ajax_returnData("./quota_gang-ajax.asp",{"COMMAND":"LIST", "PRJCODE":prjcode});
|
|
|
|
var listcount = ajax_returnData("./quota_gang-ajax.asp",{"COMMAND":"LISTCOUNT", "PRJCODE":prjcode}).split(",");
|
|
|
|
$("#end-cnt").text(listcount[0]);
|
|
$("#going-cnt").text(listcount[1]);
|
|
}
|
|
|
|
function get_list_question() {
|
|
this.list_question = ajax_returnData("./quota_gang-ajax.asp",{"COMMAND":"LIST_QUESTION", "PRJCODE":prjcode});
|
|
}
|
|
|
|
function filtering_list(){
|
|
$(".tr-none").removeClass("tr-none");
|
|
|
|
if(filter_list["group"]){
|
|
|
|
$(".data-filter-1").each(function(i,elem){
|
|
if(elem.innerText !== filter_list["group"]){
|
|
$(elem).closest("TR").addClass("tr-none");
|
|
}
|
|
})
|
|
}
|
|
|
|
if(filter_list["model"]){
|
|
$(".data-filter-2").each(function(i,elem){
|
|
var $tr = $(elem).closest("TR")
|
|
if($tr.hasClass("tr-none")) return true;
|
|
|
|
if(elem.innerText.substring(0,2) !== filter_list["model"]){
|
|
$tr.addClass("tr-none");
|
|
}
|
|
})
|
|
}
|
|
|
|
}
|
|
|
|
function draw_list(){
|
|
var img_list = this.img_list
|
|
var tr_list = this.list.map(function(item){
|
|
var img_target = img_list[item["IDKEY"]];
|
|
var td = [
|
|
//item["grp"], // 이름
|
|
item["IDKEY"], // 아이디
|
|
//item["attendee_pw"], //휴대폰
|
|
item["start_date"], // start_date
|
|
item["end_date"], // end_date
|
|
item["Status"] === "0" ? "없음"
|
|
: item["Status"] === "1" ? "진행" + "(" + item["IB"][0]["value"] + ")"
|
|
: "완료"
|
|
];
|
|
td = td.map(function(txt){return createnode("TD",txt,{"style":"vertical-align:middle"})});
|
|
|
|
$(td[0]).attr("class","data-filter-1")
|
|
$(td[4]).attr("class","data-filter-2")
|
|
$(td[3]).append(" <button type='button' data-id='"+item["IDKEY"]+"' class='view-btn'>보기</button>")
|
|
|
|
return createnode("TR",td,{"class":"text-center " + (item["target_cd"] === "1" ? "target-tr" : ""),"data-idkey":item["IDKEY"]});
|
|
});
|
|
|
|
document.querySelector('#list-table > tbody').appendM(tr_list);
|
|
|
|
|
|
}
|
|
|
|
function chk_target(){
|
|
if( this.selected_list === "" ){
|
|
alert("대상을 먼저 선택해주세요.");
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function choice_target(id) {
|
|
// console.log(id);
|
|
this.selected_list = this.list.filter(function(item){ return item["IDKEY"] === id ? true : false})[0];
|
|
}
|
|
|
|
//-- replace function
|
|
function replaceAll(str, searchStr, replaceStr) {
|
|
|
|
return str.split(searchStr).join(replaceStr);
|
|
}
|
|
function view_detail(id){
|
|
if(chk_target.call(this)){
|
|
$("#DAT_ARR_VAL div").remove();
|
|
var selected_list = this.selected_list
|
|
$("#id-label").text(selected_list["IDKEY"]);
|
|
|
|
var data = selected_list["DAT"].split(','); //-- 응답값
|
|
|
|
var list_question = this.list_question; //-- 질문정보
|
|
|
|
for (var i = 0; i < list_question.length; i++) {
|
|
|
|
var td_tt = "";
|
|
arr_num01 = list_question[i].variable;
|
|
arr_num02 = list_question[i].qid;
|
|
arr_num03 = list_question[i].value;
|
|
arr_num11 = "";
|
|
|
|
var arr_num03_split = arr_num03.split(",");
|
|
//-- console.log(" arr_num01 = "+ arr_num01 + " arr_num02 = "+ arr_num02 + " arr_num03 = "+ arr_num03);
|
|
//-- console.log(" arr_num03_split.length = "+ arr_num03_split.length);
|
|
|
|
if( arr_num03_split.length == 1 ){
|
|
for (var j = 0; j < data.length; j++) {
|
|
data[j] = replaceAll(data[j],"{","")
|
|
data[j] = replaceAll(data[j],"}","")
|
|
data[j] = replaceAll(data[j],'"','')
|
|
data_arr = data[j].split(":");
|
|
arr_val01 = data_arr[0].trim();
|
|
arr_val02 = data_arr[1].trim();
|
|
|
|
//console.log("data_arr = "+ data_arr[0].trim() );
|
|
//console.log("arr_val01 = "+ arr_val01 +" arr_num03 = "+ arr_num03 );
|
|
if( arr_val01 == arr_num03){
|
|
arr_num11 = arr_val02;
|
|
//-- console.log( arr_val01 +" - "+ arr_val02 +" - "+ arr_num03 );
|
|
break; // for 문 종료
|
|
}
|
|
}
|
|
td_tt += "<div class='DAT_ARR_VAL p-1 border rounded d-flex flex-column m-1'>"
|
|
td_tt += "<div >"+ arr_num01 +" (<font style='font-size: x-small;' >"+ arr_num03 +"</font>) : "+ arr_num11 +"</div>"
|
|
td_tt +="</div>"
|
|
}else{
|
|
for(var k = 0; k < arr_num03_split.length; k++){
|
|
arr_num03 = arr_num03_split[k]
|
|
for (var j = 0; j < data.length; j++) {
|
|
data[j] = replaceAll(data[j],"{","")
|
|
data[j] = replaceAll(data[j],"}","")
|
|
data[j] = replaceAll(data[j],'"','')
|
|
data_arr = data[j].split(":");
|
|
arr_val01 = data_arr[0].trim();
|
|
arr_val02 = data_arr[1].trim();
|
|
|
|
arr_num11 = "";
|
|
if( arr_val01 == arr_num03){
|
|
arr_num11 = arr_val02;
|
|
//-- console.log( "k >>> "+ arr_val01 +" - "+ arr_val02 +" - "+ arr_num03 );
|
|
break; // for 문 종료
|
|
}
|
|
}
|
|
td_tt += "<div class='DAT_ARR_VAL p-1 border rounded d-flex flex-column m-1'>"
|
|
td_tt += "<div >"+ arr_num01 +" (<font style='font-size: x-small;' >"+ arr_num03 +"</font>) : "+ arr_num11 +"</div>"
|
|
td_tt +="</div>"
|
|
}
|
|
}
|
|
$("#DAT_ARR_VAL").append( td_tt );
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
var data = selected_list["DAT"].split(',');
|
|
for (var i = 0; i < data.length; i++) {
|
|
data[i] = replaceAll(data[i],"{","")
|
|
data[i] = replaceAll(data[i],"}","")
|
|
data[i] = replaceAll(data[i],'"','')
|
|
console.log(data[i]);
|
|
data_arr = data[i].split(":");
|
|
|
|
arr_num01 = data_arr[0].trim();
|
|
arr_num02 = data_arr[1].trim();
|
|
td_tt = "<div class='DAT_ARR_VAL p-1 border rounded d-flex flex-column m-1'>"
|
|
td_tt += "<div >"+ arr_num01 +" : "+ arr_num02 +"</div>"
|
|
//td_tt +="<div class='border-bottom' >"+ data_arr[0] +"</div>"
|
|
//td_tt +="<div class='detail-label text-primary' >"+ data_arr[1] +"</div>"
|
|
td_tt +="</div>"
|
|
|
|
chk_show_val = 1 //보여줄 것인가?
|
|
if( data_arr[0] == "GROUP") chk_show_val = 0
|
|
if( data_arr[0] == "CROTA") chk_show_val = 0
|
|
|
|
if( chk_show_val == 1 ){
|
|
$("#DAT_ARR_VAL").append( td_tt );
|
|
}
|
|
} */
|
|
//DAT_ARR_VAL
|
|
}
|
|
}
|
|
|
|
return {
|
|
list:list, /* 전체 리스트 2002021_A 데이터 */
|
|
selected_list:selected_list, /* 선택된 리스트 */
|
|
get_list:get_list, /* 리스트 받아오기 */
|
|
get_list_question:get_list_question, /* 리스트 받아오기 */
|
|
img_list:img_list, /* 이미지 리스트 2002021_B */
|
|
filter_list,filter_list, /* 필터 옵션 */
|
|
draw_list:draw_list, /* 리스트 그리기 */
|
|
set_filter:set_filter, /* 필터 설정 */
|
|
filtering_list:filtering_list, /* 필터링된 리스트 */
|
|
view_detail:view_detail, /* 세부사항 항목 그리기 */
|
|
choice_target:choice_target, /* 리스트 선택 */
|
|
}
|
|
})()
|
|
|
|
$("document").ready(function(){
|
|
|
|
$("body").on("click","#gogogo",function(e){
|
|
location.href="?pkey="+ $("#pkey").val();
|
|
})
|
|
|
|
<% if( pkey <> "" )then %>
|
|
lgModule.get_list();
|
|
lgModule.draw_list();
|
|
lgModule.get_list_question();
|
|
<% end if %>
|
|
|
|
$("body").on("click",".view-btn",function(e){
|
|
prjcode = pkey;
|
|
var $target = $(e.target);
|
|
var id = $target.attr("data-id");
|
|
lgModule.choice_target(id)
|
|
lgModule.view_detail();
|
|
})
|
|
|
|
$("#h-list").click(function(e){
|
|
var visible_flag = $("#h-list-item").attr("data-visible")
|
|
$("#h-list-item").attr("data-visible",visible_flag === "true" ? "false" : "true");
|
|
});
|
|
|
|
$("body").on("click",".hlist-item",function(e){
|
|
var $target = $(e.target);
|
|
var id = $target.attr("data-id");
|
|
var filterd_list = lgModule.hlist.filter(function(item){ return item["IDKEY"] === id ? true : false });
|
|
|
|
if(filterd_list.length === 1) {
|
|
lgModule.selected_list = filterd_list[0];
|
|
}
|
|
});
|
|
|
|
$("body").on("click",".filter-option p",function(e){
|
|
var option = $(e.target).parent().attr("data-option");
|
|
lgModule.set_filter(option, e.target.innerText)
|
|
$(".filter-option").remove();
|
|
});
|
|
|
|
$("body").on("click",".filter_group",function(e){
|
|
lgModule.set_filter("group", "")
|
|
$(e.target).remove();
|
|
});
|
|
|
|
$("body").on("click",".filter_model",function(e){
|
|
lgModule.set_filter("model", "")
|
|
$(e.target).remove();
|
|
});
|
|
|
|
|
|
$(".filter-td").click(function(e){
|
|
var type = $(this).attr("data-type");
|
|
var grpArr = [];
|
|
$("tr:gt(0)").each(function(i,e){grpArr.push(parseInt($(e).find("td:eq(0)").text()))})
|
|
$.unique(grpArr).sort(function(a, b){return a - b});
|
|
|
|
|
|
if($(e.target).hasClass("filter-td")){
|
|
$(".filter-option").remove();
|
|
if(type==="1") {
|
|
$div= $("<div class='filter-option position-absolute p-1' data-option='group'></div>")
|
|
$.each(grpArr, function(i, e){$div.append("<p>"+e+"</p>");})
|
|
$(this).append($div);
|
|
} else if(type==="2") {
|
|
$(this).append("<div class='filter-option position-absolute p-1' data-option='model' ><p>진행</p><p>완료</p></div>")
|
|
}
|
|
}
|
|
});
|
|
})
|
|
|
|
</script>
|
|
|
|
<!-- #include Virtual="/include/Footer.asp"-->
|
|
<script>
|
|
var loc = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/'));
|
|
var pkey = $("#pkey").val();
|
|
clklog("wi11u215oh",pkey,"","현황 페이지 gang","","");
|
|
</script> |