first commit

This commit is contained in:
2026-08-07 12:53:18 +09:00
commit 0b0415f0f4
1523 changed files with 496649 additions and 0 deletions

145
user/ajax_user.asp Normal file
View File

@@ -0,0 +1,145 @@
<!-- #include Virtual="/Lib/Config.asp"-->
<%
Server.ScriptTimeOut = 60 * 5
Dim SQL,Rcset
Dim COMMAND : COMMAND = Request("COMMAND")
Dim CRUD : CRUD = Request("CRUD")
Dim JSON
Dim iCnt,cCnt
Dim Field
Dim PKEY : PKEY = Request("PKEY")
Dim QID : QID = Request("QID")
Dim QIDARR
Dim QORDER,STYPE,OPTIONS,NAME
Set Rcset = Server.CreateObject("ADODB.RecordSet")
Call DBConnect2()
SELECT CASE CRUD
' SELECT '
CASE "SELECT"
SELECT CASE COMMAND
CASE "SELECTLIST" '프로젝트 세부 정보'
response.ContentType = "application/json"
SQL = " select GKEY,JSON_QUERY(PROJECTJSON,'$.must') as JSON from PROJECT where PKEY = '"&PKEY&"' FOR JSON AUTO "
Rcset.Open SQL,DBConn,3,1,1
while not Rcset.eof
response.write Rcset(0)
Rcset.movenext
wend
response.end
CASE "QUESTIONLIST" '문항 리스트'
response.ContentType = "application/json"
SQL = " select QID,QORDER,JSON_VALUE(QUESTIONJSON,'$.variable') as variable,JSON_VALUE(QUESTIONJSON,'$.explain') as explain,JSON_VALUE(QUESTIONJSON,'$.qtype') as qtype ,JSON_VALUE(QUESTIONJSON,'$.qgroup') as [qgroup],JSON_VALUE(QUESTIONJSON,'$.rota') as rota from QUESTION where PKEY = '"&PKEY&"' order by QORDER FOR JSON AUTO "
Rcset.Open SQL,DBConn,3,1,1
IF Rcset.eof or Rcset.bof THEN
response.write "[]"
ELSE
while not Rcset.eof
response.write Rcset(0)
Rcset.movenext
wend
END IF
Response.end
CASE "GROUP" ' 그룹 정보
response.ContentType = "application/json"
SQL = " select QID,JSON_QUERY(QUESTIONJSON) as qx, CASE WHEN LOGICJSON <> '' THEN JSON_QUERY(LOGICJSON) ELSE '' END as jx, Qorder from kon.dbo.QUESTION where PKEY = '"&PKEY&"' and JSON_VALUE(QUESTIONJSON,'$.qgroup') = '"&REQUEST("GROUP")&"' order by Qorder FOR JSON AUTO "
Rcset.Open SQL,DBConn,3,1,1
IF Rcset.eof or Rcset.bof THEN
response.write "[]"
ELSE
while not Rcset.eof
response.write Rcset(0)
Rcset.movenext
wend
END IF
Response.end
CASE "GROUPLIST"
response.ContentType = "application/json"
SQL = " select OPTIONJSON from QOPTION where PKEY = '"&PKEY&"' and OTYPE = 'qgroup' "
Rcset.Open SQL,DBConn,3,1,1
IF Rcset.eof or Rcset.bof THEN
Response.Write "{}"
ELSE
Response.Write Rcset("OPTIONJSON")
END IF
Response.end
CASE "QUESTION" '문항 정보'
response.ContentType = "application/json"
SQL = " select JSON_QUERY(QUESTIONJSON,'$') as JSON from QUESTION where PKEY = '"&PKEY&"' and QID = '"&QID&"' "
Rcset.Open SQL,DBConn,3,1,1
response.write Rcset("JSON")
response.end
CASE "STRUCTURE" '데이터 구조'
response.ContentType = "application/json"
SQL = " select JSON_QUERY(QINFO,'$') as JSON from STRUCTURE where PKEY = '"&PKEY&"' "
Rcset.Open SQL,DBConn,3,1,1
response.write Rcset("JSON")
response.end
CASE "LOGIC" ' 로직 정보 '
SQL = " select CASE WHEN LOGICJSON = '' THEN '' ELSE JSON_QUERY( LOGICJSON,'$') END as JSON from QUESTION where QID = '"&QID&"' and PKEY = '"&PKEY&"' "
Rcset.Open SQL,DBConn,3,1,1
IF Rcset("JSON") <> "" THEN
response.ContentType = "application/json"
response.write Rcset("JSON")
ELSE
response.ContentType = "text/plain"
response.write ""
END IF
response.end
CASE "TOTALDATA" ' 총 부수
SQL = " SELECT COUNT(*) as cnt FROM DATA where Status='10' and SURVEY_TYPE <> 'TEST' and PKEY = '"& PKEY &"' group by Status "
Rcset.Open SQL,DBConn,3,1,1
IF Rcset.eof or Rcset.bof THEN
response.write "0"
ELSE
response.write Rcset("cnt")
END IF
response.end
CASE "DATA"
SQL = " select * from ( "
IF request("TYPE") = "TEST" THEN
SQL = SQL & " select IDKEY from DATA where PKEY = '" &PKEY& "' and Status='10' and SURVEY_TYPE = 'TEST' "
ELSE
SQL = SQL & " select IDKEY from DATA where PKEY = '" &PKEY& "' and Status='10' and SURVEY_TYPE <> 'TEST' "
END IF
SQL = SQL & " ) IA CROSS APPLY( "
SQL = SQL & " select DISTINCT '{' + STUFF(( "
SQL = SQL & " SELECT ',' + SUBSTRING(value,2, LEN(value)-2) "
SQL = SQL & " FROM OPENJSON((SELECT JSON_QUERY(DATJSON,'$') from DATA where PKEY = '"& PKEY &"' and IDKEY = IA.IDKEY )) "
SQL = SQL & " FOR XML PATH('') "
SQL = SQL & " ),1,1,' ') + '}' AS DAT "
SQL = SQL & " ) DAT FOR JSON AUTO "
Rcset.Open SQL,DBConn,3,1,1
IF Rcset.eof or Rcset.bof THEN
response.write "[]"
ELSE
While not Rcset.eof
response.write Rcset(0)
Rcset.movenext : wend
END IF
response.end
CASE "DATA_BASE"
SQL = SQL & " select [key] as qid ,variable,REPLACE(SUBSTRING([value],2,LEN([value])-2),'""','') as [value] from OPENJSON((SELECT QINFO fROM [STRUCTURE] where PKEY = '" & PKEY & "')) A CROSS APPLY( "
SQL = SQL & " SELECT QORDER,JSON_VALUE(QUESTIONJSON,'$.variable') as variable FROM QUESTION B WHERE PKEY = '"& PKEY &"' and A.[key] collate Korean_Wansung_CI_AS = B.QID "
SQL = SQL & " ) C where [value] <> '[]' ORDER BY QORDER FOR JSON AUTO"
Rcset.Open SQL,DBConn,3,1,1
IF Rcset.eof or Rcset.bof THEN
response.write "[]"
ELSE
While not Rcset.eof
response.write Rcset(0)
Rcset.movenext : wend
END IF
response.end
END SELECT
END SELECT
call DBClose()
%>

168
user/test.asp Normal file
View File

@@ -0,0 +1,168 @@
<!-- #include File="../include/Header.asp"-->
<style>
.qprogress-view-type,
.qprogress-item {
cursor: pointer;
}
.qprogress-item:hover,
.qprogress-view-type:hover,
.selecteditem {
background-color: #639bf1;
color: white
}
.qadmin-selected-item:hover,
.preved-variable-box {
border-color: red !important;
}
.select_qlist:hover {
border-color: #28a745 !important;
}
.qlist_selection,
.selected-variable-box {
border-color: #28a745 !important;
}
#question_list {
overflow-y: scroll;
max-height: 1200px;
}
#dialog {
padding: 5px !important;
}
.usercheck_value {
background-color: yellowgreen;
}
</style>
<%
Dim Code : Code = request("code")
%>
<body>
<div class="container-fluid mt-1" id="mframe">
<div class="row justify-content-center">
<div class="col-10">
<div id="mcontent">
</div>
</div>
</div>
</div>
</body>
<!-- css -->
<link rel="stylesheet" href="../js/jquery-ui/jquery-ui.min.css">
<link rel="stylesheet" href="../js/codemirror-5.54.0/lib/codemirror.css">
<link rel="stylesheet" href="../js/codemirror-5.54.0/theme/hopscotch.css">
<!-- js -->
<script src="../js/jquery-ui/jquery-ui.min.js"></script>
<script src="../js/jquery.dialogextend.min.js"></script>
<script src="../js/codemirror-5.54.0/lib/codemirror.js"></script>
<script src="../js/codemirror-5.54.0/mode/javascript/javascript.js"></script>
<script src="../js/xlsx.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.min.js"></script>
<script src="../store/store_.js"></script>
<script src="../eachPageModule/Question_.js"></script>
<script src="../eachPageModule/logic.js"></script>
<script src="../eachPageModule/qprogress.js"></script>
<script>
var ajaxUrl = "./ajax_user.asp"
var code = "<%=Code%>"
$(document).ready(function(){
kon.qprogress.progress_type = "user"
kon.qprogress.fn_make_qprogress_frame();
/* 설문 진행에서 설문 크기 변경하기 */
$("body").on("click", ".qprogress-view-type", function () {
$target = $(event.target);
var type = $target.attr("data-type");
var sizing = {
"height": "",
"width": "",
"margin": ""
}
switch (type) {
case "desktop":
sizing.height = "900px"
sizing.width = "100%"
sizing.margin = "0px"
break;
case "mobile-width":
sizing.height = "360px"
sizing.width = "640px"
sizing.margin = "100px"
break;
case "mobile-height":
sizing.height = "640px"
sizing.width = "360px"
sizing.margin = "100px"
break;
}
$("#iframe_question").animate({
width: sizing.width,
height: sizing.height,
marginTop: sizing.margin
})
})
/* 설문 진행에서 문항 이동하기 */
$("body").on("click", ".qprogress-item", function (e) {
var $target = $(e.target);
var nextpage = $target.attr("data-qid")
var iframe = document.getElementById("iframe_question");
var $content = $(iframe.contentDocument);
$content.find("input[name=NEXTPAGE]").val(nextpage);
$content.find("form[name=survey]").attr("onsubmit", "").submit();
})
$("body").on("click", ".iframe-btn", function (e) {
var dtype = e.target.getAttribute("data-type");
var iframe = document.getElementById("iframe_question");
var $content = $(iframe.contentDocument);
var userid = ""
if (dtype === "question") {
if ($("#question_dialog").dialog("isOpen")) {
$("#question_dialog").dialog("close")
} else {
$("#question_dialog").dialog("open")
}
} else if (dtype === "data") {
if ($("#data_dialog").dialog("isOpen")) {
$("#data_dialog").dialog("close")
} else {
$("#data_dialog").dialog("open")
}
} else {
userid = ID()
$content.find("input[name=IDKEY]").val(userid);
kon.qprogress.userid = userid
$("#qprocess-id").text(kon.qprogress.userid)
}
})
/* 설문 진행 검색 가능하게 */
$("body").on("keyup", "#qprogress_list", function (e) {
if (e.keyCode === 13) {
var item = $(".qprogress-item[data-qid='" + e.target.value + "']");
if (item.length > 0) {
item.trigger("click");
}
}
})
})
</script>