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

View File

@@ -0,0 +1,68 @@
<% @Language='vbscript' codepage='65001'%>
<!--METADATA TYPE= "typelib" NAME= "ADODB Type Library" FILE="C:\Program Files\Common Files\SYSTEM\ADO\msado15.dll" -->
<%
Option Explicit
Response.CharSet="utf-8"
Session.codepage="65001"
Response.codepage="65001"
Response.ContentType="text/html;charset=utf-8"
'Survey DB 설정
Dim SV_NAME,DB_NAME,UID,PWD
Dim SV_NAME1,DB_NAME1,UID1,PWD1,SV_NAME2,DB_NAME2,UID2,PWD2
Dim DBconn
Dim User_Agent : User_Agent = Request.ServerVariables("HTTP_USER_AGENT") '접속자 브라우저 타입
Dim PRJCODE : PRJCODE = "[@PROJECTCODE]"
Dim PRJNAME : PRJNAME = "[@PROJECTTITLE]"
Dim PCOLOR : PCOLOR = "[@PROJECTCOLOR]"
Dim ip: ip = Request.ServerVariables("REMOTE_ADDR"): 'Response.Write ip
Dim DevNode: DevNode = "real"
If( ip = "10.10.13.82" or ip = "10.10.13.115" or ip = "10.10.13.117" or ip = "10.10.13.118" or ip = "10.10.13.130" )Then
DevNode = "dev"
Else
DevNode = "real"
End if
'-------------------------------//
DevNode = "real"
'#######################################################################################
'DB 설정값 Read
'#######################################################################################
SV_NAME = "1.235.195.34"
DB_NAME= "capi"
UID = "sa"
PWD = "krco#51304"
SV_NAME1 = "1.235.195.34"
DB_NAME1= "krc_survey"
UID1 = "sa"
PWD1 = "krco#51304"
If( DevNode = "dev" )then
SV_NAME2 = "10.10.13.177,1313"
DB_NAME2= "kon"
UID2 = "kon"
PWD2 = "kon#51304"
Else
SV_NAME2 = "1.235.195.8,20022"
DB_NAME2= "kon"
UID2 = "kon"
PWD2 = "kon#51304"
end if
%>
<!-- #include Virtual = "./Lib/DBConn.asp" -->
<!-- #include Virtual = "./Lib/DBLib.asp" -->
<!-- #include Virtual = "./Lib/FileLib.asp" -->
<!-- #include Virtual = "./Lib/SiteFunc.asp" -->
<!-- #include Virtual = "./Lib/CAPICOM.asp" -->
<!-- #include Virtual = "./Lib/Func.asp" -->
<!-- #include Virtual = "./Lib/aspJSON1.17.asp" -->

View File

@@ -0,0 +1,148 @@
<!--#include File="Config.asp"-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="google" content="notranslate">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width">
<link id="favicon" rel="shortcut icon" type="image/x-icon" href="../../img/favicon.ico" />
<title>KRI ONLINE</title>
<!-- Custom Theme JavaScript -->
<script src="/js/jquery-1.10.2.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<link href="/bootstrap-4.4.1/css/bootstrap.min.css" rel="stylesheet" />
<script src="/bootstrap-4.4.1/js/bootstrap.min.js"></script>
<!-- js 기능 모듈화 -->
<script src="/js/kfunc.js?ver=4.1"></script>
<script src="/js/knode.js"></script>
<script src="/js/polyfill.js"></script>
<script src="/js/bluebird.min.js"></script>
<script src="/module/survey.js?dt=<%=date_time() %>"></script>
<script src="/store/store_.js"></script>
<script src="/module/ToastrCustom.js?ver=1"></script>
<!-- 그리는 js -->
<script src="/module/Qmodule/attr.js"></script>
<script src="/module/Qmodule/single.js"></script>
<script src="/module/Qmodule/com.js"></script>
<script src="/module/Qmodule/open.js"></script>
<script src="/module/Qmodule/multi.js"></script>
<script src="/module/Qmodule/rank.js"></script>
<script src="/module/Qmodule/scale.js"></script>
<script src="/module/Qmodule/group.js"></script>
<script src="/module/Qmodule/description.js"></script>
<!-- 문항 생성 및 문항 내부 로직 모듈화 -->
<script src="/module/CreateQuestion.js"></script>
<!-- 자그마한 이미지 -->
<link href="/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!--#include virtual = "/Lib/RSExec.asp" -->
<%
'//--- 프로젝트 정보 호출
Dim h_SQL, h_Rcset, h_rs
Dim h_PKEY, h_title, h_status, h_report, h_companytype, h_companytype_logo
h_companytype_logo = "non_logo.png"
h_SQL = " select PKEY "
h_SQL = h_SQL + ", JSON_VALUE(PROJECTJSON,'$.must.title') as title "
h_SQL = h_SQL + ", JSON_VALUE(PROJECTJSON,'$.must.status') as status "
h_SQL = h_SQL + ", JSON_VALUE(PROJECTJSON,'$.must.report') as report "
h_SQL = h_SQL + ", JSON_VALUE(PROJECTJSON,'$.must.companytype') as companytype "
h_SQL = h_SQL + " from PROJECT "
h_SQL = h_SQL & " where PKEY = '"& PRJCODE &"' "
h_SQL = h_SQL & "order by id desc "
'response.write "<br>========================================="& SQL
'response.write fncRequestVariables("LOCAL_ADDR")
Set h_rs = DBExec(h_SQL,"kon")
If Not h_rs.EOF Then
h_PKEY = h_rs(0)
h_title = h_rs(1)
h_status = h_rs(2)
h_report = h_rs(3)
h_companytype = h_rs(4)
End If
Call DBExecClose(h_rs)
'response.write "<br>DBExec TEST [ "& h_PKEY &" ] , [ "& h_title &" ] , [ "& h_status &" ] , [ "& h_report &" ] , [ "& h_companytype &" ] "
if( h_companytype = 2 )then
h_companytype_logo = "non_krc_logo.png"
end if
if( h_companytype = 6 )then
h_companytype_logo = "KRd_logo.jpg"
end if
%>
<!-- 폰트 -->
<% if h_companytype = 3 then %>
<% h_companytype_logo = "kiwi_logo_2.svg" %>
<link href='//spoqa.github.io/spoqa-han-sans/css/SpoqaHanSansNeo.css' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="./css/style_kiwi.css">
<script>
$("#favicon").attr("href","../../img/favicon-16x16.png");
document.title = "키위서베이";
function resSurvey(winWidth){
if(winWidth > 992){
$("#btn-box").removeClass("position-fixed d-inline-flex");
if($("#btn-box").children().length == 1){
$("#btn-box").children().removeClass("w-100 p-2");
}
$("#btn-box").children().addClass("w-auto h-auto");
}else{
$("#btn-box").addClass("position-fixed d-inline-flex");
if($("#btn-box").children().length == 1){
$("#btn-box").children().addClass("w-100 p-2");
}
$("#btn-box").children().removeClass("w-auto h-auto");
}
}
$(function(){
$(window).resize(function(){
resSurvey($(window).width());
});
resSurvey($(window).width());
$(document).on("click", ".list-group-item-action input", function(){
$(".list-group-item-action").each(function(){
if($(this).find("input:checked").length > 0){
$(this).addClass("cusInput-active");
}else{
$(this).removeClass("cusInput-active");
}
})
});
$(document).on("click", ".scaleBtn", function(){
$(this).find("input[type=radio]").prop("checked", true);
$(".scaleBtn").each(function(){
if($(this).find("input:checked").length > 0){
$(this).addClass("cusInput-active");
}else{
$(this).removeClass("cusInput-active");
}
})
});
$(document).on("click", ".singleBtn", function(){
$(this).find("input[type=radio]").prop("checked", true);
$(".singleBtn").each(function(){
if($(this).find("input:checked").length > 0){
$(this).parent().addClass("cusInput-active");
}else{
$(this).parent().removeClass("cusInput-active");
}
})
});
});
</script>
<% else %>
<link href="https://fonts.googleapis.com/css?family=Nanum+Gothic&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./css/style.css">
<% end if %>
</head>

View File

@@ -0,0 +1,252 @@
<!-- #include File="./Config.asp"-->
<%
Server.ScriptTimeOut = 60 * 5
Dim SQL,Rcset,Rcset2
Dim COMMAND : COMMAND = Request("COMMAND")
Dim ObjCmd : set ObjCmd = Server.CreateObject("ADODB.Command")
Dim JSON
Dim iCnt,cCnt
Dim Field
Dim CODE,QCODE,IDKEY,SURVEYTYPE
CODE = request("CODE")
QCODE = request("QCODE")
IDKEY = request("IDKEY")
SURVEYTYPE = request("SURVEYTYPE")
Set Rcset = Server.CreateObject("ADODB.RecordSet")
Set Rcset2 = Server.CreateObject("ADODB.RecordSet")
Call DBConnect2()
SELECT CASE COMMAND
CASE "PRJINFO"
response.ContentType = "application/json"
SQL = " select JSON_QUERY(PROJECTJSON , '$.must') as ix from kon.dbo.PROJECT with(nolock) where PKEY = '"& CODE &"' "
Rcset.Open SQL,DBConn,3,1,1
Response.Write Rcset("ix")
Response.end
CASE "GROUP"
response.ContentType = "application/json"
With ObjCmd
.ActiveConnection = DBConn
.CommandText = "kon.dbo.question_group"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@PKEY", adVarWChar, adParamInput, 20)
.Parameters.Append .CreateParameter("@GID", adVarWChar, adParamInput, 100)
.Parameters("@PKEY") = CODE
.Parameters("@GID") = REQUEST("GROUP")
Set Rcset = .execute
End With
While Not Rcset.eof
response.write Rcset(0)
Rcset.movenext
WEND
Response.end
CASE "ROTA"
SQL = " SELECT DISTINCT STUFF(( select ',' + QID from kon.dbo.QUESTION where PKEY = '" & CODE & "' and JSON_VALUE(QUESTIONJSON ,'$.rota') = '" & request("ROTA") & "' order by newID() FOR XML PATH('')),1,1,'') AS ROTA "
Rcset.Open SQL,DBConn,3,1,1
IF Rcset.eof or Rcset.bof THEN
ELSE
response.write Rcset(0)
END IF
CASE "GETROTAPAGE"
response.write getRotationEndPage(request("ROTA"),CODE)
CASE "QINFO" ' 문항 정보 - 저장 프로시저'
response.ContentType = "application/json"
With ObjCmd
.ActiveConnection = DBConn
.CommandText = "kon.dbo.nowpage_qinfo"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@PKEY", adVarWChar, adParamInput, 20)
.Parameters.Append .CreateParameter("@IDKEY", adVarWChar, adParamInput, 100)
.Parameters.Append .CreateParameter("@QID", adVarWChar, adParamInput, 20)
.Parameters("@PKEY") = CODE
.Parameters("@IDKEY") = IDKEY
.Parameters("@QID") = QCODE
Set Rcset = .execute
End With
While Not Rcset.eof
response.write Rcset(0)
Rcset.movenext
WEND
Response.end
CASE "LINFO" ' LANGUAGE 정보 '
SQL = " select LTYPE,LCODE,[text] from kon.dbo.LANGUAGE with(nolock) where PKEY = '"&CODE&"' and QID = '"&QCODE&"' and CCODE = '"& REQUEST("LANGUAGE") &"' FOR JSON AUTO "
Rcset.Open SQL,DBConn,3,1,1
While Not Rcset.eof
response.write Rcset(0)
Rcset.movenext
WEND
Response.end
CASE "LINFOLIST" ' LANGUAGE 정보 -변환용 '
SQL = " select QID,LCODE,[text] from kon.dbo.LANGUAGE with(nolock) where PKEY = '"&CODE&"' and QID in (" & REQUEST("QLIST")& ") and CCODE = '"& REQUEST("LANGUAGE") &"' and LTYPE in ('single','multi','scale') FOR JSON AUTO "
Rcset.Open SQL,DBConn,3,1,1
While Not Rcset.eof
response.write Rcset(0)
Rcset.movenext
WEND
Response.end
CASE "LINFOLISTALL" ' LANGUAGE 정보 - 그룹 문항 변경용 '
SQL = " select QID,LTYPE,LCODE,[text] from kon.dbo.LANGUAGE with(nolock) where PKEY = '"&CODE&"' and QID in (" & REQUEST("QLIST")& ") and CCODE = '"& REQUEST("LANGUAGE") &"' FOR JSON AUTO "
Rcset.Open SQL,DBConn,3,1,1
While Not Rcset.eof
response.write Rcset(0)
Rcset.movenext
WEND
Response.end
CASE "GETDATA" ' 사용자가 입력한 데이터 가져오기 '
response.write ReadUTF_File("/log/"&CODE&"/JSON/"&IDKEY&".json")
CASE "GETDATA_DB"
response.ContentType = "application/json"
SQL = ""
SQL = SQL &" SELECT json_query(N'{'+STRING_AGG('""'+DV.[KEY]+'"":""'+DV.[VALUE]+'""', ',')+'}') as USERDATA"&vbcrlf
SQL = SQL &" FROM [Kon].[dbo].[DATA] DA with(nolock)"&vbcrlf
SQL = SQL &" cross apply openjson(DA.[DATJSON]) DJ"&vbcrlf
SQL = SQL &" cross apply openjson(DJ.[VALUE]) DV"&vbcrlf
SQL = SQL &" where PKEY='"&CODE&"' and [IDKEY] ='" & IDKEY & "'"&vbcrlf
Rcset.Open SQL,DBConn,3,1,1
IF Rcset.eof or Rcset.bof THEN
response.write "[]"
ELSE
response.write "[" & Rcset(0) & "]"
END IF
Response.end
CASE "ERROR_REPORT"
SQL = "INSERT INTO kon.dbo.ERROR values('"&CODE&"','"& Request("IDKEY") &"', '"&QCODE&"', '"& Replace(Request("ERRSTRING"),"'","´") &"', getDate() )"
DBConn.Execute SQL
CASE "GETLINFO"
response.ContentType = "application/json"
With ObjCmd
.ActiveConnection = DBConn
.CommandText = "kon.dbo.question_label"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@PKEY", adVarWChar, adParamInput, 20)
.Parameters.Append .CreateParameter("@QARR", adVarWChar, adParamInput, 20)
.Parameters("@PKEY") = CODE
.Parameters("@QARR") = REQUEST("QLIST")
Set Rcset = .execute
End With
While Not Rcset.eof
response.write Rcset(0)
Rcset.movenext
WEND
Response.end
IF Rcset.RecordCount > 0 THEN
While Not Rcset.eof
response.write Rcset(0)
Rcset.movenext : Wend
ELSE
Response.Write "{}"
END IF
response.end
CASE "SETDATA" ' 사용자가 입력한 데이터 입력하기 '
SAVEJSON "/log/" & CODE & "/JSON/" & IDKEY &".json" , REQUEST("DAT")
CASE "ATTENDEE"
response.ContentType = "application/json"
SQL = " select USER_INFO_JSON from kon.dbo.KON_GANG_TB with(nolock) where PKEY_CD = '"&CODE&"' and USER_ID = '" & Request("ID") & "' and USER_PW = '"& Request("PW") &"' "
Rcset.Open SQL,DBConn,3,1,1
IF Rcset.eof or Rcset.bof THEN
response.write "[]"
ELSE
response.write "[" & Rcset("USER_INFO_JSON") & "]"
END IF
Response.end
CASE "GET_CATEGORY_CODE" '시, 구/ 브랜드, 모델 같은 카테고리별 하위 코드 반환'
response.ContentType = "application/json"
DIM MAINCODE : MAINCODE = request("MAINCODE")
DIM CODEDEPTH : CODEDEPTH = request("CODEDEPTH")
IF CODEDEPTH = "" THEN 'CODEDEPTH가 없으면 가장 상위 DEPTH로 설정'
CODEDEPTH = "0"
END IF
IF MAINCODE = "" THEN 'MAINCODE가 없으면 MAIN 코드 리스트 반환'
SQL = " SELECT MAIN_CODE1, MAIN_CODE2, MAIN_NAME FROM CATEGORY_CODE_LIST WHERE PKEY ='" & CODE & "' AND QID='" & Request("QID") & "' AND CODE_DEPTH = " & CODEDEPTH & " GROUP BY MAIN_CODE1, MAIN_CODE2, MAIN_NAME ORDER BY MAIN_CODE1; "
ELSE
SQL = " SELECT SUB_CODE1, SUB_CODE2, SUB_NAME FROM CATEGORY_CODE_LIST WHERE PKEY ='" & CODE & "' AND QID='" & Request("QID") & "' AND CODE_DEPTH = " & CODEDEPTH & " AND MAIN_CODE1 = " & MAINCODE & " GROUP BY SUB_CODE1, SUB_CODE2, SUB_NAME ORDER BY SUB_CODE1; "
END IF
Rcset.Open SQL,DBConn,3,1,1
IF Rcset.eof or Rcset.bof THEN
response.write "[]"
ELSE
response.write RecordToJson(Rcset)
END IF
Response.end
CASE "WORD_LIST" '오픈문항과 문항내용 일치 시 value로 반환'
DIM TEXT : TEXT = request("TEXT")
response.ContentType = "application/json"
SQL = "SELECT word_value FROM Wordtable where pkey='"& CODE &"' and LOWER(replace(word_text,' ','')) = '"& TEXT &"'"
Rcset.Open SQL,DBConn,3,1,1
IF Rcset.eof or Rcset.bof THEN
response.write "[]"
ELSE
response.write RecordToJson(Rcset)
END IF
Response.end
CASE "LISTDATA"
response.ContentType = "application/json"
SQL = " select USER_INFO_JSON from kon.dbo.KON_LIST_TB with(nolock) where PKEY_CD = '"&CODE&"' and IDKEY = '" & Request("ID") & "' "
Rcset.Open SQL,DBConn,3,1,1
IF Rcset.eof or Rcset.bof THEN
response.write "[]"
ELSE
response.write "[" & Rcset("USER_INFO_JSON") & "]"
END IF
Response.end
CASE "CHECK_QUOTA"
DIM QSORDER : QSORDER = request("QSORDER")
SQL = "SELECT distinct QJ.[KEY] AS QID FROM [QUOTA] QT cross apply openjson([QUOTAJSON]) QJ where pkey = '" & CODE & "' and QSORDER = " & QSORDER
Rcset.Open SQL,DBConn,3,1,1
IF Rcset.RecordCount > 0 THEN
DIM QSQL : QSQL = ""
DIM KSQL : KSQL = ""
DIM TSQL : TSQL = ""
QSQL = QSQL & " select sum(case when IS_USE = 1 then cnt else 0 end) as [cnt], sum(case when IS_USE = 1 then COM else 0 end) as [com]" & vbcrlf
QSQL = QSQL & " from (" & vbcrlf
QSQL = QSQL & " SELECT QUOTAJSON, CNT,COUNT(DT.IDKEY) AS [com], IS_USE " & vbcrlf
QSQL = QSQL & " FROM [QUOTA] QT " & vbcrlf
KSQL = KSQL & " INNER JOIN [DATA] DK ON QT.PKEY = DK.PKEY AND DK.IDKEY = '" & IDKEY & "'" & vbcrlf
TSQL = TSQL & " LEFT JOIN [DATA] DT ON QT.PKEY = DT.PKEY AND DT.Status = '10' AND DT.SURVEY_TYPE != 'TEST'" & vbcrlf
While Not Rcset.eof
KSQL = KSQL & " AND case when JSON_VALUE(DK.[DATJSON], '$." & Rcset("QID") & "." & Rcset("QID") & "') != '' then JSON_VALUE(DK.[DATJSON], '$." & Rcset("QID") & "." & Rcset("QID") & "') else JSON_VALUE(QT.QUOTAJSON, '$." & Rcset("QID") & "') end = JSON_VALUE(QT.QUOTAJSON, '$." & Rcset("QID") & "')" & vbcrlf
TSQL = TSQL & " AND JSON_VALUE(DT.[DATJSON], '$." & Rcset("QID") & "." & Rcset("QID") & "') = JSON_VALUE(QT.QUOTAJSON, '$." & Rcset("QID") & "') " & vbcrlf
Rcset.movenext : Wend
QSQL = QSQL & KSQL & TSQL
QSQL = QSQL & " WHERE QT.PKEY = '" & CODE & "' AND QT.QSORDER = " & QSORDER
QSQL = QSQL & " group by QUOTAJSON, CNT, IS_USE" & vbcrlf
QSQL = QSQL & " ) a"
Rcset2.Open QSQL,DBConn,3,1,1
IF Cint(Rcset2("cnt")) <= Cint(Rcset2("com")) THEN
Response.Write "2"
ELSE
Response.Write "1"
END IF
ELSE
Response.Write "1"
END IF
Response.end
CASE ELSE
END SELECT
call DBClose()
%>

View File

@@ -0,0 +1 @@
{ "language":"Q115","SQ1":"Q1","SQ2":"Q2","SQ3":"Q3","SQ4":"Q4","SQ5":"Q5","SQ5_1":"Q119","SQ6":"Q6","SQ7":"Q7","SQ8":"Q8","SQ9":"Q111","SQ9_1":"Q112","SQ10":"Q10","SQ11":"Q11","SQ12":"Q12","SQ12_1":"Q13","SQ13":"Q14","SQ14":"Q15","AQ1":"Q17","AQ2":"Q18","AQ3":"Q19","AQ4":"Q20","AQ4_1":"Q21","AQ5":"Q22","AQ6":"Q23","AQ7":"Q24","AQ8":"Q25","AQ9":"Q26","BQ1":"Q27","BQ2":"Q28","BQ3":"Q29","BQ4":"Q30","BQ5":"Q31","BQ5_1":"Q32","BQ6":"Q33","BQ6_1":"Q34","BQ7":"Q35","BQ7_1":"Q36","BQ8":"Q37","BQ9":"Q38","BQ9_1":"Q39","BQ9_2":"Q40","BQ9_3":"Q41","BQ10":"Q42","BQ10_1":"Q43","BQ10_2":"Q44","BQ10_3":"Q45","BQ11":"Q46","BQ12":"Q47","BQ13":"Q48","CQ1":"Q49","CQ2":"Q50","CQ3":"Q51","CQ4":"Q52","CQ5":"Q53","CQ6":"Q120","CQ6_1":"Q122","CQ6_2":"Q123","DQ1":"Q54","DQ2":"Q55","DQ3":"Q56","DQ4":"Q57","DQ4_1":"Q58","DQ5":"Q59","DQ6":"Q60","DQ7":"Q61","DQ8":"Q62","DQ9":"Q63","DQ10":"Q64","DQ11":"Q65","DQ12":"Q113","DQ12_1":"Q114","DQ12_2":"Q66","DQ13":"Q67","DQ14":"Q68","DQ14_1":"Q69","EQ1":"Q70","EQ2":"Q71","EQ2_1":"Q72","EQ2_2":"Q73","EQ2_3":"Q74","EQ3":"Q75","EQ3_1":"Q76","EQ3_2":"Q77","EQ3_3":"Q78","EQ3_4":"Q79","EQ3_5":"Q80","FQ1":"Q85","FQ2":"Q86","FQ2_1":"Q87","FQ3":"Q94","PINEINFO":"Q116","FQ4":"Q95","FQ5":"Q96","PINECHANGEINFO":"Q117","FQ6":"Q97","FQ7":"Q98","TIME":"Q118","FQ8":"Q99","FQ9":"Q100","TIMESWITCH":"Q124","FQ10":"Q125","FQ11":"Q126","GQ1":"Q101","GQ2":"Q102","GQ3":"Q103","GQ4":"Q104","GQ5":"Q105","GQ6":"Q106","GQ7":"Q107","HQ1":"Q108","HQ2":"Q109","HQ3":"Q110"}