first commit

This commit is contained in:
2026-08-07 12:52:33 +09:00
commit 7fb30dcd0d
1409 changed files with 473704 additions and 0 deletions

17
.gitignore vendored Normal file
View File

@@ -0,0 +1,17 @@
/.idea/
/Project/*
!/Project/.gitkeep
/log/*
!/log/.gitkeep
/ProjectUpload/*
!/ProjectUpload/.gitkeep
/uploadFile/*
!/uploadFile/.gitkeep
/WebProject/*
!/WebProject/.gitkeep
/_ServerLog/*
!/_ServerLog/.gitkeep
/Files/*
!/Files/.gitkeep

1
Files/.gitkeep Normal file
View File

@@ -0,0 +1 @@

163
Guide/index.asp Normal file
View File

@@ -0,0 +1,163 @@
<!-- #include Virtual="/include/Header.asp"-->
<style>
@font-face {
font-family: 'Noto-Sans';
src: url("/font/Noto_Sans_KR/NotoSansKR-Medium.otf")
}
@keyframes fadein {
0% {
opacity: 0.5;
}
100% {
opacity: 1;
}
}
body, html {
font-family: 'Noto-Sans';
height:100%
}
.bg-navy-1 {
background-color: #1A1A3A;
}
.bg-navy-2 {
background-color: #374669;
}
.bg-navy-3 {
background-color: #707699;
}
.bg-navy-4 {
background-color: #7A87BA;
}
ul.my-list {
list-style: none;
margin:0px;
padding:0px
}
ul.my-list li {
padding:1px 0px 5px 2px ;
border-bottom: 1px solid #374669;
transition: .5s;
cursor: pointer;
font-size: 15px;
}
ul.my-list li:hover {
background-color: #1A1A3A;
color: white;
padding-left:5px
}
ul.my-list li.selected {
background-color: #1A1A3A;
color: white;
padding-left:5px
}
.main-box div {
animation: .5s ease fadein;
}
.circle {
border-radius: 35px;
width:35px;
height:35px;
font-size: 15px;
line-height: 35px;
display: inline-block;
}
.list-box:hover{
color: #990000;
cursor: pointer;
transition: .3s;
}
.list-content {
font-size: 14px;
border-left:2px solid #607d8b;
background-color: #f1f1f1;
display: none;
}
</style>
<body style="padding-top: 55px;">
<div class="fixed-top p-3 bg-navy-1 text-white h5 shadow-sm">
<i class="fa fa-book" aria-hidden="true"></i> KON 가이드
<span class="p-1 ml-2" style="cursor: pointer;" onclick="window.location.href='/index.asp'"><i class="fa fa-home" aria-hidden="true"></i> 메인으로 </span>
</div>
<div class="container-fluid h-100" >
<div class="row h-100">
<div class="col-lg-1 pt-1 h-100 border-right">
<div class="pb-1">목록</div>
<ul class="my-list p-1 mt-1">
<li data-type="1">프로젝트 관리</li>
<li data-type="3">면접원 관리</li>
<li data-type="5">문항 관리</li>
<li data-type="6">갱 참석자 관리</li>
<li data-type="7">데이터 관리</li>
<li data-type="8">설문 테스트</li>
</ul>
</div>
<div class="col-lg-11 pt-1 h-100 d-flex flex-column bg-navy-3 pb-2">
<div class="p-2 text-white" > <i class="fa fa-book" aria-hidden="true"></i> 본문 </div>
<div class="p-2 main-box rounded h-100 bg-light shadow-sm">
<div class="d-none h-100" data-type="1">
<!-- #include file="./list/project_admin.asp"-->
</div>
<div class="d-none h-100" data-type="3">
<!-- #include file="./list/interviewer_admin.asp" -->
</div>
<div class="d-none h-100" data-type="5">
<!-- #include file="./list/question_admin.asp" -->
</div>
<div class="d-none h-100" data-type="6">
<!-- #include file="./list/gang_admin.asp" -->
</div>
<div class="d-none h-100" data-type="7">
<!-- #include file="./list/data_admin.asp" -->
</div>
<div class="d-none h-100" data-type="8">
<!-- #include file="./list/survey_test.asp" -->
</div>
</div>
</div>
</div>
</div>
</body>
<script>
$(document).ready(function(){
$("ul.my-list li").click(function(e){
var data_type = e.target.getAttribute("data-type");
$("ul.my-list li.selected").removeClass("selected")
$(e.target).addClass("selected")
$(".main-box div.d-block").removeClass("d-block").addClass("d-none")
$(".main-box div[data-type="+data_type+"]").addClass("d-block");
$(".list-content[data-show=true]").attr("data-show","false").toggle(150);
})
$(".list-box").click(function(e){
var $target = $(e.target)
var $next = $target
.parent()
.next()
if($next.attr("data-show") === "true") return false;
$(".list-content[data-show=true]").attr("data-show","false").toggle(130);
$next.animate({
height:"toggle"
}, 150 ,"linear", function(){
$next.attr("data-show","true")
})
})
})
</script>

87
Guide/list/data_admin.asp Normal file
View File

@@ -0,0 +1,87 @@
<div class="d-flex flex-column">
<!-- 1. 데이터 관리 페이지 이동 -->
<div class="d-flex flex-row">
<span class="circle text-white bg-navy-4 text-center">1</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>데이터 관리 페이지 이동</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>해당 프로젝트의 <strong class="text-primary">자원 관리</strong>버튼 클릭 </li>
<li> 페이지 상단의 <strong class="text-primary"><i class="fa fa-bars" aria-hidden="true"></i></strong> 버튼 클릭 </li>
<li> 데이터 관리 클릭</li>
<li> <strong class="text-primary">데이터 개별 수정</strong> 클릭</li>
</ol>
</div>
<!-- 2. ID -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">2</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>관리할 ID 검색</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>ID 관리창의 수정할 ID 입력 후 <strong class="text-primary">검색</strong>버튼 클릭</li>
</ol>
</div>
<!-- 3. 완료 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">3</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>데이터 완료</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>수정할 ID 우측의 <strong class="text-success">완료</strong>버튼 클릭 </li>
</ol>
</div>
<!-- 4. 삭제 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">4</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>데이터 삭제</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>수정할 ID 우측의 <strong class="text-danger">삭제</strong>버튼 클릭 </li>
</ol>
</div>
<!-- 5. 수정 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">5</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>데이터 수정</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>수정할 ID 우측의 <strong class="text-primary">수정</strong>버튼 클릭 </li>
<li>좌측 문항 리스트에서 수정할 문항 선택<br>
<small class="text-danger">※ 문항 설명이 <strong class="text-primary">파란색 글씨</strong>일 경우 사용자가 응답한 문항</small>
</li>
<li>
우측의 문항 입력 페이지에서 수정할 보기에 응답한 후 상단의 <strong class="text-success">페이지 데이터 저장</strong> 클릭
</li>
<li>
특정 문항의 데이터를 삭제할 경우 해당 문항 선택 후 <strong >상단의 페이지 데이터 삭제</strong> 버튼 클릭
</li>
</ol>
</div>
<!-- 6. 로직 검사 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">6</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>로직 검사</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>수정할 ID 우측의 <strong class="text-primary">수정</strong>버튼 클릭</li>
<li>좌측 문항 리스트 상단의 <strong class="text-primary">로직 검사</strong> 클릭</li>
<li>문항 리스트에서 <strong class="text-danger">※ 로직 에러</strong> 문항 확인 </li>
<li>에러난 문항의 데이터를 적절하게 수정 </li>
</ol>
</div>
</div>

110
Guide/list/gang_admin.asp Normal file
View File

@@ -0,0 +1,110 @@
<div class="d-flex flex-column">
<!-- 1. GANG 조사 설정 -->
<div class="d-flex flex-row">
<span class="circle text-white bg-navy-4 text-center">1</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>GANG 참석자 업로드</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li> KON 메인 페이지에서 해당 프로젝트의 조사 타입을 GANG으로 설정 </li>
<li> 설정 후 해당 프로젝트 업로드 버튼 선택 </li>
<li> 우측 프레임에 보이는 참석자 업로드 버튼 선택 </li>
<li> 파일 선택한 후 참석자 리스트 선택 <br>
<small class="text-danger">
※ 엑셀 파일만 가능, 첫번 째 시트에 리스트가 있어야 함
</small>
</li>
<li>
좌담회 참석자의 ID가 될 열의 번호와 비밀번호가 될 열의 번호를 선택
</li>
<li>
참석자 정보의 [KEY]가 될 행의 번호를 선택
<small class="text-danger">
※ [KEY]가 될 행에는 영어, 숫자, _ 만 가능
</small>
</li>
<li>
<strong class="text-primary">적용</strong> 버튼을 클릭하여 설정이 맞는 지 확인<br>
<small class="text-danger">
※ ID열은 노란 색, 비밀번호 열은 빨간 색, 라벨 행은 에메랄드 색
</small>
</li>
<li>
리스트 확인 후 정보가 맞다면 <strong class="text-success">저장</strong> 버튼 클릭
</li>
</ol>
</div>
<!-- 2. 참석자 관리 페이지 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">2</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>GANG 참석자 관리 페이지</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>해당 프로젝트의 <strong class="text-primary">자원 관리</strong>버튼 클릭 </li>
<li> 페이지 상단의 <strong class="text-primary"><i class="fa fa-bars" aria-hidden="true"></i></strong> 버튼 클릭 </li>
<li> 갱 참석자 관리 클릭<br>
<small class="text-danger">
※ 참석자가 등록되어 있어야 확인 가능
</small>
</li>
</ol>
</div>
<!-- 3. 참석자 정보 수정 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">3</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>GANG 참석자 정보 수정</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li> 참석자 리스트에서 [수정]열의 체크박스 선택 </li>
<li> 우측 정보들 수정 </li>
<li> 선택한 체크박스 해제 </li>
</ol>
</div>
<!-- 4. 참석자 삭제 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">4</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>GANG 참석자 삭제</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li> 참석자 리스트에서 삭제할 리스트의 <strong class="text-danger">삭제</strong> 버튼 클릭 </li>
</ol>
</div>
<!-- 5. 참석자 재 업로드 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">5</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>GANG 참석자 재 업로드</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li> 참석자 관리 페이지에서 <strong class="text-primary">양식 다운로드</strong>버튼 클릭 </li>
<li> 다운로드받은 문서에 양식에 맞추어 입력 </li>
<li> <strong class="text-danger">참석자 일괄 삭제</strong> 버튼 클릭 </li>
<li> 수정한 문서를 해당 프로젝트에 다시 업로드<br>
<small class='text-danger'>1) GANG 참석자 업로드 참고</small>
</li>
</ol>
</div>
<!-- 6. 참석자 확인 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">6</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>GANG 참석자 확인</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li> 참석자 리스트 상단의 <i class="fa fa-filter m-1 text-primary" aria-hidden="true"></i>버튼 클릭 </li>
<li> 조건에 맞는 체크박스 선택 후 <strong class="text-primary">적용</strong> 버튼 클릭 </li>
<li> 조건을 해제하고 싶은 경우 <i class="fa fa-times m-1 text-primary" aria-hidden="true"></i>버튼 클릭 </li>
</ol>
</div>
</div>

View File

@@ -0,0 +1,85 @@
<div class="d-flex flex-column">
<!-- 1. 면접원 관리 페이지 이동 -->
<div class="d-flex flex-row">
<span class="circle text-white bg-navy-4 text-center">1</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>면접원 관리 페이지 이동</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li> KON 메인 페이지 상단의 <strong class="text-primary"><i class="fa fa-bars" aria-hidden="true"></i></strong> 버튼 클릭 </li>
<li> CAPI 면접원 관리 클릭 </li>
</ol>
</div>
<!-- 2. 면접원 조사 페이지 이동 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">2</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>면접원 조사 페이지 이동</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>우측 링크 복사 후 면접원에게 전달 : <strong class="text-primary ">http://kon.kiwisurvey.kr/capi/user_login.asp </strong> </li>
<li>면접원 성함, 전화번호 입력하여 접속 </li>
<li>배정받은 프로젝트만 확인 가능 </li>
</ol>
</div>
<!-- 3. 면접원 입력 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">3</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>면접원 입력[개별]</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>면접원 개별 추가 선택</li>
<li>성함, 휴대폰 입력한 후 저장</li>
</ol>
</div>
<!-- 4. 면접원 입력 일괄 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">4</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>면접원 입력[일괄]</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>업로드 양식 다운로드 클릭</li>
<li>다운로드된 문서 양식에 맞춰 면접원 정보 입력</li>
<li>중복된 인원들 확인한 후 저장</li>
</ol>
</div>
<!-- 5. 면접원 관리 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">5</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>면접원 관리</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>해당 면접원의 <strong class="text-primary">관리</strong>버튼 클릭 </li>
<li>면접원을 삭제할 경우 출력된 창의 <strong class="text-danger">삭제</strong>버튼 클릭</li>
<li>면접원을 수정할 경우 출력된 창의 <strong class="text-primary">수정</strong>버튼 클릭</li>
<li>수정할 데이터 입력 후 <strong class="text-primary">저장</strong> 버튼 클릭</li>
</ol>
</div>
<!-- 6. 면접원 배정 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">6</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>면접원 배정</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>페이지 상단의 면접원 배정 버튼 클릭 </li>
<li>배정할 프로젝트 선택 후 면접원 선택<br>
<small class="text-danger">
※ 프로젝트 조사 타입이 CAPI인 경우만 선택 가능
</small>
</li>
<li>배정할 면접원 선택 후 <strong class="text-primary">저장</strong> 버튼 클릭</li>
</ol>
</div>
</div>

View File

@@ -0,0 +1,108 @@
<div class="d-flex flex-column">
<!-- 1. 프로젝트 등록 -->
<div class="d-flex flex-row">
<span class="circle text-white bg-navy-4 text-center">1</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>프로젝트 등록</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>프로젝트 등록 버튼 클릭 <i class="fa fa-picture-o" aria-hidden="true"></i> </li>
<li>프로젝트 코드 검색</li>
<li>조사 제목, 색상등 프로젝트 정보 입력</li>
<li>프로젝트 등록</li>
</ol>
</div>
<!-- 2. 프로젝트 검색 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">2</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>프로젝트 검색</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>프로젝트 명 검색 입력 창에 프로젝트 명 입력 후 엔터</li>
<li>프로젝트 명 코드 입력 창에 프로젝트 코드 입력 후 엔터</li>
</ol>
</div>
<!-- 3. 프로젝트 복사 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">3</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>프로젝트 복사</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>복사하려는 프로젝트의 <strong class='text-success'>Copy</strong> 버튼 클릭</li>
<li>타겟 프로젝트 검색</li>
<li>제목 입력 후 프로젝트 복사 클릭</li>
</ol>
</div>
<!-- 4. 설문 링크 복사 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">4</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>설문 링크 복사</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>해당 프로젝트의 <strong class='text-success'>URL</strong> 버튼 클릭</li>
<li>사용하고자 하는 링크 타입 클릭</li>
<li>클립보드에 복사된 링크 사용</li>
</ol>
</div>
<!-- 5. 설문 상태 변경 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">5</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>설문 상태 변경</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>해당 프로젝트의 <strong class='text-success'>수정</strong> 버튼 클릭</li>
<li>우측 화면의 [준비, 진행, 완료]중 원하는 상태 선택</li>
<li>상단의 저장 버튼 클릭</li>
</ol>
</div>
<!-- 6. 해외 조사 설정 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">6</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>해외 조사 설정</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>해당 프로젝트의 <strong class='text-success'>수정</strong> 버튼 클릭</li>
<li>해외 조사 여부에 체크</li>
<li>언어 선택 문항 입력하여 연동</li>
<li>상단의 저장 버튼 클릭</li>
</ol>
</div>
<!-- 7. 진행 현황 공유 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">7</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>프로젝트 진행 현황</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>프로젝트 전체 진행 현황은 해당 프로젝트의 <strong class='text-success'>데이터</strong>버튼 클릭</li>
<li>성별, 연령등 세부 진행 현황이 필요할 경우 <strong class='text-success'>쿼터뷰</strong>버튼 클릭 </li>
<li>쿼터뷰 이용 방법은 해당 페이지의 <strong class='text-warning'>Guide</strong>버튼 클릭하여 확인</li>
</ol>
</div>
<!-- 8. 조사 런칭 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">8</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>조사 런칭</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>프로젝트를 진행 상태로 변경<br><small class='text-danger'>5) 설문 상태 변경 참고</small> </li>
<li>프로젝트 타입에 맞는 링크 복사 후 응답자에게 전달<br><small class='text-danger'>4) 설문 링크 복사 참고</small> </li>
</ol>
</div>
</div>

View File

@@ -0,0 +1,32 @@
<div class="d-flex flex-column">
<div class="d-flex flex-row">
<span class="circle text-white bg-navy-4 text-center">1</span>
<div class='text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>프로젝트 검색</div>
</div>
<div class="ml-3 mt-1 border-left shadow-sm p-1">
<div class="media">
<img src="..." class="mr-3" alt="...">
<div class="media-body">
<small>
프로젝트 등록 버튼을 누른 후, 프로젝트 코드 "검색"을 누른다.<br>
프로젝트 검색 창에서 코드 혹은 이름을 입력 후 검색 검색된 리스트 중 해당 프로젝트를 선택한다. <br>
</small>
</div>
</div>
</div>
<div class="d-flex flex-row mt-2">
<span class="circle text-white bg-navy-4 text-center">2</span>
<div class='text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>프로젝트 설정</div>
</div>
<div class="ml-3 mt-1 border-left shadow-sm p-1">
<div class="media">
<img src="..." class="mr-3" alt="...">
<div class="media-body">
<small>
조사제목, 색상, 해당 연구팀 그룹, 조사 방식, KRI or KRC, 조사 시작시 나오는 안내 문구를 입력해준다.
</small>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,194 @@
<div class="d-flex flex-column">
<!-- 1. 프로젝트 등록 -->
<div class="d-flex flex-row">
<span class="circle text-white bg-navy-4 text-center">1</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>문항 관리 페이지 이동</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>해당 프로젝트의 <strong class='text-success'>문항</strong> 버튼 클릭 </li>
</ol>
</div>
<!-- 2. 문항 등록 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">2</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>문항 등록</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>문항 페이지의 <strong class='text-success'>문항 등록</strong> 버튼 클릭</li>
<li>우측 페이지의 문항 명[필수]입력 후 문항에 맞는 정보 입력<br><small class='text-danger'>※ 질문, 안내문, 단수, 복수, 척도, 자유, 속성, 순위 등</small> </li>
<li>문항에 맞는 정보 입력 후 우측 페이지의 하단에 나오는 미리보기 확인 후 맞으면 저장 버튼 클릭 </li>
</ol>
<div class="pl-4 p-2 bg-white shadow-sm m-1">
<div class="text-primary"><i class="fa fa-flag" aria-hidden="true"></i> Tip</div>
<ol class="m-0">
<li>Ctrl 단축키
<ul>
<li>
<kbd>Ctrl + S</kbd> 단수, 복수, 척도와 같은 문항 정보등을 저장
</li>
<li>
<kbd>Ctrl + D</kbd> 문항 자체를 저장
</li>
</ul>
</li>
<li>Alt 단축키
<ul>
<li>
<kbd>Alt + q</kbd> 질문 입력 창 출력
</li>
<li>
<kbd>Alt + d</kbd> 안내문 입력 창 출력
</li>
<li>
<kbd>Alt + s</kbd> 단수 입력 창 출력
</li>
<li>
<kbd>Alt + m</kbd> 복수 입력 창 출력
</li>
<li>
<kbd>Alt + c</kbd> 척도 입력 창 출력
</li>
<li>
<kbd>Alt + a</kbd> 속성 입력 창 출력
</li>
<li>
<kbd>Alt + r</kbd> 랭크 입력 창 출력
</li>
<li>
<kbd>Alt + o</kbd> 자유 입력 창 출력
</li>
</ul>
</li>
</ol>
</div>
</div>
<!-- 3. 문항 수정 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">3</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>문항 수정, 복사</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>해당 문항의 <strong class='text-primary'>수정</strong> 버튼 클릭 </li>
<li>문항 수정후 <strong class='text-success'>저장</strong> 버튼 클릭 </li>
</ol>
<ol class="m-0">
<li>해당 문항의 <strong class='text-primary'>복사</strong> 버튼 클릭 </li>
<li>문항 수정후 <strong class='text-success'>저장</strong> 버튼 클릭 </li>
</ol>
</div>
<!-- 4. 순서 변경 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">4</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>순서 변경</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>문항 페이지의 <strong class='text-primary'>순서 변경</strong> 버튼 클릭</li>
<li>변경할 문항들을 선택 후 이동할 자리의 화살표를 선택</li>
<li>상단의 <strong class='text-primary'>저장</strong> 버튼 클릭</li>
</ol>
</div>
<!-- 5. 로직 변경 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">5</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>로직 생성</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>페이지 상단의 로직 버튼 클릭</li>
<li>로직을 생성할 문항들을 선택</li>
<li>우측 페이지에 생성된 문항별 박스에서 상황에 맞게<stonrg class="text-primary">사전, 사후 로직 추가</stonrg>버튼 클릭 </li>
<li>하단에 생성된 박스에서 조건을 추가함 각 조건은 AND, OR로 엮을 수 있음</li>
<li>로직에 맞는 조건을 입력한 후 분기 문항에 이동할 페이지 입력</li>
<li>생성된 박스 순서대로 로직을 테스트 하며 앞에서 조건이 맞을 경우 남아있는 박스들은 테스트 하지 않고 로직에 맞춰 이동함
<br>
<small class="text-danger">
※ 예시) Q1=3가 Q10으로 이동, Q1=2가 Q12로 이동일 경우 Q1=3의 로직이 통과하면 Q1=2는 무시함
</small>
</li>
<div class="pl-4 p-2 bg-white shadow-sm m-1">
<div class="text-primary"><i class="fa fa-flag" aria-hidden="true"></i> Tip</div>
<ol class="m-0">
<li>
모든 페이지는 문항 ID 기준으로 입력
<ul>
<li>Q1[SQ1]인 경우 Q1이 문항 ID, SQ1이 문항 라벨</li>
</ul>
</li>
<li>
조건식
<ul>
<li><kbd>=</kbd>같음</li>
<li><kbd>!=</kbd>다름</li>
<li><kbd>&gt;</kbd>초과</li>
<li><kbd>&lt; </kbd>미만</li>
<li><kbd>&gt;=</kbd>이상</li>
<li><kbd>&lt;=</kbd>이하</li>
</ul>
</li>
<li>예시
<ul>
<li><kbd>Q1이 3이면서 Q2가 빈 값인 경우</kbd> Q1=3 AND Q2=</li>
<li><kbd>Q1이 3이상이거나 Q2가 1미만일 경우</kbd> Q1>=3 OR Q2&lt;1 </li>
</ul>
</li>
</ol>
</div>
</ol>
</div>
<!-- 6. 문항 옵션 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">6</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>문항 옵션</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<div class="ml-2 text-danger">※ 문항 타입에 옵션 부여할 경우 사용</div>
<ol class="m-0">
<li>상단의 문항 옵션 버튼 클릭</li>
<li>타입을 변경할 문항 선택 후 문항 검색 우측에 있는 <stonrg class="text-primary">선택 완료</stonrg>버튼 클릭</li>
<li>선택된 문항의 옵션 타입을 설정한 후 밑의 옵션 값을 알맞게 입력</li>
<li>문항 박스 선택하여 우측 프레임에서 미리보기</li>
<li>옵션 설정이 적용되었으면 리스트 상단의 <stonrg class="text-success">저장</stonrg> 버튼 클릭</li>
</ol>
</div>
<!-- 7. 문항 관리 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">7</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>문항 관리</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<div class="ml-2 text-danger">※ 문항 여러개를 복사, 그룹화, 로테이션 시킬 때 사용 </div>
<ol class="m-0">
<li>상단의 문항 관리 버튼 클릭</li>
<li>로테이션, 그룹, 복사중 원하는 옵션을 선택</li>
<li>
로테이션, 그룹의 경우 문항을 각각 필요한 만큼 한 묶음으로 구성, 묶음이 더 필요한 경우 <strong class="text-primary">추가</strong> 버튼 클릭하여 묶음 추가<br>
</li>
<li>
좌측의 원하는 문항들을 클릭하여 묶음용 박스에 문항 삽입
<br>
<small class="text-danger">
※ 초록색칠된 묶음용 박스에 삽입되며 박스는 선택하여 변경 가능
</small>
</li>
<li>설정이 끝난 후 상단의 <strong class="text-success">저장</strong> 버튼 클릭하여 저장</li>
<li>
복사할 문항들을 선택한 후 배수 설정 후 저장<br>
<small class="text-danger">
※ 예시) A1, A2 선택, 배수 '2'설정 후 저장할 경우 A1C1, A2C1, A1C2, A2C2의 문항들이 생성됨
</small>
</li>
</ol>
</div>
</div>

View File

@@ -0,0 +1,17 @@
<div class="d-flex flex-column">
<!-- 1. 프로젝트 등록 -->
<div class="d-flex flex-row">
<span class="circle text-white bg-navy-4 text-center">1</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>프로젝트 등록</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>프로젝트 등록 버튼 클릭</li>
<li>프로젝트 코드 검색</li>
<li>조사 제목, 색상등 프로젝트 정보 입력</li>
<li>프로젝트 등록</li>
</ol>
</div>
</div>

View File

@@ -0,0 +1,40 @@
<div class="d-flex flex-column">
<!-- 1. 테스트 페이지 이동 -->
<div class="d-flex flex-row">
<span class="circle text-white bg-navy-4 text-center">1</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>테스트 페이지 이동</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>해당 프로젝트의 <strong class="text-success">테스트</strong>버튼 클릭</li>
</ol>
</div>
<!-- 2. 네비게이션 페이지 -->
<div class="d-flex flex-row mt-3">
<span class="circle text-white bg-navy-4 text-center">2</span>
<div class='list-box text-dark-50 w-100 pl-1 d-flex flex-row align-items-center'>네비게이션 페이지</div>
</div>
<div class="ml-3 mt-1 p-1 list-content shadow-sm">
<ol class="m-0">
<li>해당 프로젝트의 <strong class="text-success">문항</strong>버튼 클릭</li>
<li>페이지 상단의 설문 진행 버튼 클릭</li>
<ol class="m-0" type="A">
<li>문항 이동</li>
<ol class="m-0" type="a">
<li>좌측 문항 리스트에서 이동할 문항의 이동 버튼 선택</li>
</ol>
<li>문항 검색하여 이동</li>
<ol class="m-0" type="a">
<li><strong>변수명 입력</strong>이 적혀있는 입력란에 문항 검색한 후 <kbd> Enter </kbd> </li>
</ol>
<li>이전 데이터 확인</li>
<ol class="m-0" type="a">
<li>해당 문항의 보라색으로 변한 데이터 버튼에 마우스를 올리면 이전 응답값 확인 가능</li>
</ol>
</ol>
</ol>
</div>
</div>

44
Lib/ApiLog.asp Normal file
View File

@@ -0,0 +1,44 @@
<%
'###########################################################################################
'api 호출 바디 구하기
'return : string
'###########################################################################################
Function ReadRequestBodySafe()
Dim ctype : ctype = LCase(Request.ServerVariables("CONTENT_TYPE"))
Dim body : body = ""
' JSON/XML/Text 류만 BinaryRead 시도
If InStr(ctype, "application/json")>0 Or InStr(ctype, "text/")>0 Or InStr(ctype, "application/xml")>0 Or InStr(ctype, "application/vnd.api+json")>0 Then
If Request.TotalBytes > 0 Then
On Error Resume Next
Dim bin, stm
bin = Request.BinaryRead(Request.TotalBytes) ' 이미 Form을 썼다면 여기서 0206 발생
If Err.Number = 0 Then
Set stm = Server.CreateObject("ADODB.Stream")
stm.Type = 1 : stm.Open : stm.Write bin
stm.Position = 0 : stm.Type = 2 : stm.Charset = "utf-8"
body = stm.ReadText
stm.Close : Set stm = Nothing
End If
Err.Clear
On Error GoTo 0
End If
' HTML Form-URL-Encoded: BinaryRead 금지, 키-값으로 요약
ElseIf InStr(ctype, "application/x-www-form-urlencoded")>0 Then
Dim k, s : s = ""
For Each k In Request.Form ' 여기서 처음 Form을 파싱하도록 함
s = s & k & "=" & Request.Form(k) & "&"
Next
If Len(s) > 0 Then
s = Left(s, Len(s)-1)
End If
body = s
' Multipart/Form-Data: 대용량/파일 포함 가능 → 요약만
ElseIf InStr(ctype, "multipart/form-data")>0 Then
body = "[multipart/form-data length=" & Request.TotalBytes & " bytes]"
End If
ReadRequestBodySafe = body
End Function
%>

240
Lib/Base64.asp Normal file
View File

@@ -0,0 +1,240 @@
<%
Dim sBASE_64_CHARACTERS
Dim sBASE_64_CHARACTERSansi
' Base64 ==================================================
sBASE_64_CHARACTERS= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
sBASE_64_CHARACTERSansi = strUnicode2Ansi(sBASE_64_CHARACTERS)
Function strUnicodeLen(asContents)
Dim asContents1 : asContents1 ="a" & asContents
Dim Len1 : Len1=Len(asContents1)
Dim K : K=0
Dim I, Asc1
For I=1 To Len1
Asc1 = asc(mid(asContents1,I,1))
IF Asc1 < 0 Then Asc1 = 65536 + Asc1
IF Asc1 > 255 Then
K = K + 2
ELSE
K = K + 1
End IF
Next
strUnicodeLen = K - 1
End Function
Function strUnicode2Ansi(asContents)
Dim Len1 : Len1 = Len(asContents)
Dim I, VarCHAR, VarASC, VarHEX, VarLOW, VarHIGH
strUnicode2Ansi = ""
For I = 1 to Len1
VarCHAR = Mid(asContents,I,1)
VarASC = Asc(VarCHAR)
IF VarASC < 0 Then VarASC = VarASC + 65536
IF VarASC > 255 Then
VarHEX = Hex(VarASC)
VarLOW = Left(VarHEX,2)
VarHIGH = Right(VarHEX,2)
strUnicode2Ansi = strUnicode2Ansi & ChrB("&H" & VarLOW ) & ChrB("&H" & VarHIGH )
Else
strUnicode2Ansi = strUnicode2Ansi & ChrB(VarASC)
End IF
Next
End Function
Function strAnsi2Unicode(asContents)
Dim Len1 : Len1 = LenB(asContents)
Dim VarCHAR, VarASC, I
strAnsi2Unicode = ""
IF Len1=0 Then Exit Function
For I=1 To Len1
VarCHAR = MidB(asContents,I,1)
VarASC = AscB(VarCHAR)
IF VarASC > 127 Then
strAnsi2Unicode = strAnsi2Unicode & Chr(AscW(MidB(asContents, I+1,1) & VarCHAR))
I = I + 1
Else
strAnsi2Unicode = strAnsi2Unicode & Chr(VarASC)
End IF
Next
End function
Function Base64encode(asContents)
Dim lnPosition
Dim lsResult
Dim Char1
Dim Char2
Dim Char3
Dim Char4
Dim Byte1
Dim Byte2
Dim Byte3
Dim SaveBits1
Dim SaveBits2
Dim lsGroupBinary
Dim lsGroup64
Dim M3, M4, Len1, Len2
Len1 =LenB(asContents)
IF Len1 < 1 Then
Base64encode = ""
Exit Function
End IF
M3=Len1 Mod 3
IF M3 > 0 Then asContents = asContents & String(3 - M3, ChrB(0))
IF m3 > 0 Then
Len1 = Len1 + (3 - M3)
Len2 = Len1 - 3
Else
Len2 = Len1
End IF
lsResult = ""
For lnPosition = 1 To Len2 Step 3
lsGroup64 = ""
lsGroupBinary = MidB(asContents, lnPosition, 3)
Byte1 = AscB(MidB(lsGroupBinary, 1, 1)) : SaveBits1 = Byte1 And 3
Byte2 = AscB(MidB(lsGroupBinary, 2, 1)) : SaveBits2 = Byte2 And 15
Byte3 = AscB(MidB(lsGroupBinary, 3, 1))
Char1 = MidB(sBASE_64_CHARACTERSansi, ((Byte1 And 252) \ 4) + 1, 1)
Char2 = MidB(sBASE_64_CHARACTERSansi, (((Byte2 And 240) \ 16) Or (SaveBits1 * 16) And &HFF) + 1, 1)
Char3 = MidB(sBASE_64_CHARACTERSansi, (((Byte3 And 192) \ 64) Or (SaveBits2 * 4) And &HFF) + 1, 1)
Char4 = MidB(sBASE_64_CHARACTERSansi, (Byte3 And 63) + 1, 1)
lsGroup64 = Char1 & Char2 & Char3 & Char4
lsResult = lsResult & lsGroup64
Next
IF M3 > 0 Then
lsGroup64 = ""
lsGroupBinary = MidB(asContents, Len2 + 1, 3)
Byte1 = AscB(MidB(lsGroupBinary, 1, 1)) : SaveBits1 = Byte1 And 3
Byte2 = AscB(MidB(lsGroupBinary, 2, 1)) : SaveBits2 = Byte2 And 15
Byte3 = AscB(MidB(lsGroupBinary, 3, 1))
Char1 = MidB(sBASE_64_CHARACTERSansi, ((Byte1 And 252) \ 4) + 1, 1)
Char2 = MidB(sBASE_64_CHARACTERSansi, (((Byte2 And 240) \ 16) Or (SaveBits1 * 16) And &HFF) + 1, 1)
Char3 = MidB(sBASE_64_CHARACTERSansi, (((Byte3 And 192) \ 64) Or (SaveBits2 * 4) And &HFF) + 1, 1)
IF M3=1 Then
lsGroup64 = Char1 & Char2 & ChrB(61) & ChrB(61)
Else
lsGroup64 = Char1 & Char2 & Char3 & ChrB(61)
End IF
lsResult = lsResult & lsGroup64
End IF
Base64encode = lsResult
End Function
Function Base64decode(asContents)
Dim lsResult
Dim lnPosition
Dim lsGroup64, lsGroupBinary
Dim Char1, Char2, Char3, Char4
Dim Byte1, Byte2, Byte3
Dim M4, Len1, Len2
Len1 = LenB(asContents)
M4 = Len1 Mod 4
IF Len1 < 1 Or M4 > 0 Then
Base64decode = ""
Exit Function
End IF
IF MidB(asContents, Len1, 1) = ChrB(61) Then M4 = 3
IF MidB(asContents, Len1-1, 1) = ChrB(61) Then M4 = 2
IF M4 = 0 Then
Len2 = Len1
Else
Len2 = Len1 - 4
End IF
For lnPosition = 1 To Len2 Step 4
lsGroupBinary = ""
lsGroup64 = MidB(asContents, lnPosition, 4)
Char1 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 1, 1)) - 1
Char2 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 2, 1)) - 1
Char3 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 3, 1)) - 1
Char4 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 4, 1)) - 1
Byte1 = ChrB(((Char2 And 48) \ 16) Or (Char1 * 4) And &HFF)
Byte2 = lsGroupBinary & ChrB(((Char3 And 60) \ 4) Or (Char2 * 16) And &HFF)
Byte3 = ChrB((((Char3 And 3) * 64) And &HFF) Or (Char4 And 63))
lsGroupBinary = Byte1 & Byte2 & Byte3
lsResult = lsResult & lsGroupBinary
Next
IF M4 > 0 Then
lsGroupBinary = ""
lsGroup64 = MidB(asContents, Len2 + 1, M4) & ChrB(65)
IF M4=2 Then
lsGroup64 = lsGroup64 & chrB(65)
End IF
Char1 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 1, 1)) - 1
Char2 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 2, 1)) - 1
Char3 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 3, 1)) - 1
Char4 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 4, 1)) - 1
Byte1 = ChrB(((Char2 And 48) \ 16) Or (Char1 * 4) And &HFF)
Byte2 = lsGroupBinary & ChrB(((Char3 And 60) \ 4) Or (Char2 * 16) And &HFF)
Byte3 = ChrB((((Char3 And 3) * 64) And &HFF) Or (Char4 And 63))
IF M4=2 Then
lsGroupBinary = Byte1
elseIF M4=3 Then
lsGroupBinary = Byte1 & Byte2
end IF
lsResult = lsResult & lsGroupBinary
End IF
Base64decode = lsResult
End Function
'###########################################################
'###########################################################
' Base64 <20><><EFBFBD>ڵ<EFBFBD>
Function Base64_Encode(ORIGNvalue)
Base64_Encode = strAnsi2Unicode(Base64encode(strUnicode2Ansi(ORIGNvalue)))
End Function
' Base64 <20><><EFBFBD>ڵ<EFBFBD>
Function Base64_Decode(EncodeA)
Base64_Decode = strAnsi2Unicode(Base64decode(strUnicode2Ansi(EncodeA)))
End Function
'###########################################################
'###########################################################
' Base64 ==================================================
%>

241
Lib/CAPICOM.asp Normal file
View File

@@ -0,0 +1,241 @@
<%
Dim sBASE_64_CHARACTERS, sBASE_64_CHARACTERSansi
sBASE_64_CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
sBASE_64_CHARACTERSansi = strUnicode2Ansi(sBASE_64_CHARACTERS)
Function strUnicodeLen(asContents)
Dim asContents1 : asContents1 ="a" & asContents
Dim Len1 : Len1=Len(asContents1)
Dim K : K=0
Dim I, Asc1
For I=1 To Len1
Asc1 = asc(mid(asContents1,I,1))
IF Asc1 < 0 Then Asc1 = 65536 + Asc1
IF Asc1 > 255 Then
K = K + 2
ELSE
K = K + 1
End IF
Next
strUnicodeLen = K - 1
End Function
Function strUnicode2Ansi(asContents)
Dim Len1 : Len1 = Len(asContents)
Dim I, VarCHAR, VarASC, VarHEX, VarLOW, VarHIGH
strUnicode2Ansi = ""
For I = 1 to Len1
VarCHAR = Mid(asContents,I,1)
VarASC = Asc(VarCHAR)
IF VarASC < 0 Then VarASC = VarASC + 65536
IF VarASC > 255 Then
VarHEX = Hex(VarASC)
VarLOW = Left(VarHEX,2)
VarHIGH = Right(VarHEX,2)
strUnicode2Ansi = strUnicode2Ansi & ChrB("&H" & VarLOW ) & ChrB("&H" & VarHIGH )
Else
strUnicode2Ansi = strUnicode2Ansi & ChrB(VarASC)
End IF
Next
End Function
Function strAnsi2Unicode(asContents)
Dim Len1 : Len1 = LenB(asContents)
Dim VarCHAR, VarASC, I
strAnsi2Unicode = ""
IF Len1=0 Then Exit Function
For I=1 To Len1
VarCHAR = MidB(asContents,I,1)
VarASC = AscB(VarCHAR)
IF VarASC > 127 Then
strAnsi2Unicode = strAnsi2Unicode & Chr(AscW(MidB(asContents, I+1,1) & VarCHAR))
I = I + 1
Else
strAnsi2Unicode = strAnsi2Unicode & Chr(VarASC)
End IF
Next
End function
Function Base64encode(asContents)
Dim lnPosition
Dim lsResult
Dim Char1
Dim Char2
Dim Char3
Dim Char4
Dim Byte1
Dim Byte2
Dim Byte3
Dim SaveBits1
Dim SaveBits2
Dim lsGroupBinary
Dim lsGroup64
Dim M3, M4, Len1, Len2
Len1 =LenB(asContents)
IF Len1 < 1 Then
Base64encode = ""
Exit Function
End IF
M3=Len1 Mod 3
IF M3 > 0 Then asContents = asContents & String(3 - M3, ChrB(0))
IF m3 > 0 Then
Len1 = Len1 + (3 - M3)
Len2 = Len1 - 3
Else
Len2 = Len1
End IF
lsResult = ""
For lnPosition = 1 To Len2 Step 3
lsGroup64 = ""
lsGroupBinary = MidB(asContents, lnPosition, 3)
Byte1 = AscB(MidB(lsGroupBinary, 1, 1)) : SaveBits1 = Byte1 And 3
Byte2 = AscB(MidB(lsGroupBinary, 2, 1)) : SaveBits2 = Byte2 And 15
Byte3 = AscB(MidB(lsGroupBinary, 3, 1))
Char1 = MidB(sBASE_64_CHARACTERSansi, ((Byte1 And 252) \ 4) + 1, 1)
Char2 = MidB(sBASE_64_CHARACTERSansi, (((Byte2 And 240) \ 16) Or (SaveBits1 * 16) And &HFF) + 1, 1)
Char3 = MidB(sBASE_64_CHARACTERSansi, (((Byte3 And 192) \ 64) Or (SaveBits2 * 4) And &HFF) + 1, 1)
Char4 = MidB(sBASE_64_CHARACTERSansi, (Byte3 And 63) + 1, 1)
lsGroup64 = Char1 & Char2 & Char3 & Char4
lsResult = lsResult & lsGroup64
Next
IF M3 > 0 Then
lsGroup64 = ""
lsGroupBinary = MidB(asContents, Len2 + 1, 3)
Byte1 = AscB(MidB(lsGroupBinary, 1, 1)) : SaveBits1 = Byte1 And 3
Byte2 = AscB(MidB(lsGroupBinary, 2, 1)) : SaveBits2 = Byte2 And 15
Byte3 = AscB(MidB(lsGroupBinary, 3, 1))
Char1 = MidB(sBASE_64_CHARACTERSansi, ((Byte1 And 252) \ 4) + 1, 1)
Char2 = MidB(sBASE_64_CHARACTERSansi, (((Byte2 And 240) \ 16) Or (SaveBits1 * 16) And &HFF) + 1, 1)
Char3 = MidB(sBASE_64_CHARACTERSansi, (((Byte3 And 192) \ 64) Or (SaveBits2 * 4) And &HFF) + 1, 1)
IF M3=1 Then
lsGroup64 = Char1 & Char2 & ChrB(61) & ChrB(61)
Else
lsGroup64 = Char1 & Char2 & Char3 & ChrB(61)
End IF
lsResult = lsResult & lsGroup64
End IF
Base64encode = lsResult
End Function
Function Base64decode(asContents)
Dim lsResult
Dim lnPosition
Dim lsGroup64, lsGroupBinary
Dim Char1, Char2, Char3, Char4
Dim Byte1, Byte2, Byte3
Dim M4, Len1, Len2
Len1 = LenB(asContents)
M4 = Len1 Mod 4
IF Len1 < 1 Or M4 > 0 Then
Base64decode = ""
Exit Function
End IF
IF MidB(asContents, Len1, 1) = ChrB(61) Then M4 = 3
IF MidB(asContents, Len1-1, 1) = ChrB(61) Then M4 = 2
IF M4 = 0 Then
Len2 = Len1
Else
Len2 = Len1 - 4
End IF
For lnPosition = 1 To Len2 Step 4
lsGroupBinary = ""
lsGroup64 = MidB(asContents, lnPosition, 4)
Char1 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 1, 1)) - 1
Char2 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 2, 1)) - 1
Char3 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 3, 1)) - 1
Char4 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 4, 1)) - 1
Byte1 = ChrB(((Char2 And 48) \ 16) Or (Char1 * 4) And &HFF)
Byte2 = lsGroupBinary & ChrB(((Char3 And 60) \ 4) Or (Char2 * 16) And &HFF)
Byte3 = ChrB((((Char3 And 3) * 64) And &HFF) Or (Char4 And 63))
lsGroupBinary = Byte1 & Byte2 & Byte3
lsResult = lsResult & lsGroupBinary
Next
IF M4 > 0 Then
lsGroupBinary = ""
lsGroup64 = MidB(asContents, Len2 + 1, M4) & ChrB(65)
IF M4=2 Then
lsGroup64 = lsGroup64 & chrB(65)
End IF
Char1 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 1, 1)) - 1
Char2 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 2, 1)) - 1
Char3 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 3, 1)) - 1
Char4 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 4, 1)) - 1
Byte1 = ChrB(((Char2 And 48) \ 16) Or (Char1 * 4) And &HFF)
Byte2 = lsGroupBinary & ChrB(((Char3 And 60) \ 4) Or (Char2 * 16) And &HFF)
Byte3 = ChrB((((Char3 And 3) * 64) And &HFF) Or (Char4 And 63))
IF M4=2 Then
lsGroupBinary = Byte1
elseIF M4=3 Then
lsGroupBinary = Byte1 & Byte2
end IF
lsResult = lsResult & lsGroupBinary
End IF
Base64decode = lsResult
End Function
Public Function Encrypt(Message)
Dim ed, key
key = gcKEY
Set ed = CreateObject("CAPICOM.EncryptedData")
ed.Content = Message
ed.SetSecret key
Encrypt = ed.Encrypt
Set ed = Nothing
End Function
Public Function Decrypt(EncMessage)
Dim ed, key
key = gcKEY
Set ed = CreateObject("CAPICOM.EncryptedData")
ed.SetSecret key
ed.Decrypt EncMessage
Decrypt = ed.Content
Set ed = Nothing
End Function
%>

693
Lib/ComLib.asp Normal file
View File

@@ -0,0 +1,693 @@
<%
'###########################################################################################
'Request 데이터 받아오기
'###########################################################################################
Function getRD(dataname)
If Not IsNull(Request.Form(dataname)) Then
getRD = getRF(dataname)
ElseIf Not IsNull(Request.QueryString(dataname)) Then
getRD = getRQ(dataname)
Else
getRD = null
End If
End Function
Function getRF(dataname)
getRF=checkValue(Request.Form(dataname))
End Function
Function getRQ(dataname)
getRQ=checkValue(Request.QueryString(dataname))
End Function
Function getR(dataname)
getR=checkValue(Request(dataname))
End Function
'###########################################################################################
'lenchk : 바이트수 짜르기
' title_msg - 문자열
' title_length - 짜를바이트수
'###########################################################################################
function lenchk(title_msg,title_length)
dim k,tmpv,j,tmps
k = 0
tmpv=""
if vartype(title_msg) = vbnull or trim(title_msg)="" then
lenchk = title_msg
exit Function
End If
If Len(title_msg)<CLng(title_length) Then
lenchk = title_msg
exit Function
end if
for j = 1 to len(title_msg)
tmps = asc(mid(title_msg,j,1))
if tmps < 0 then
k=k+2
else
k=k+1
end if
if k > clng(title_length) then
exit for
else
tmpv= tmpv & mid(title_msg,j,1)
end if
next
if len(title_msg) > int(title_length / 2) then
lenchk = tmpv &"..."
else
lenchk = tmpv
end if
end Function
'###########################################################################################
' 숫자0채우기 : format(123, "00000") ==> 000123
'###########################################################################################
Function format(ByVal szString, ByVal Expression)
If Len(szString) < Len(Expression) Then
format = Left(expression,Len(Expression)-Len(szString)) & szString
Else
format = szString
End If
End Function
'###########################################################################################
' 문자짜르고점으로표현 : cutString("스트링문자들",num) ==> 스트링문...
'###########################################################################################
Function cutString(ByVal szString,num)
if len(szString) > num then
cutString = left(szString,9) & "..."
end if
End Function
'##############################################################################
'#날짜 2자리로 만들기
'##############################################################################
Function DateLenChk(dat)
If Len(Trim(dat))=1 Then
DateLenChk = "0" & Trim(dat)
Else
DateLenChk = Trim(dat)
End IF
End Function
'###########################################################################################
'정규식을 이용하여 문자열을 치환하는 함수
'###########################################################################################
Public Function eregi_replace(ByVal pattern, ByVal replacestr, ByVal text)
Dim eregObj
'** Create regular expression
Set eregObj = New RegExp
eregObj.Pattern = pattern '** Set Pattern(패턴 설정)
eregObj.IgnoreCase = True '** Set Case Insensitivity(대소문자 구분 여부)
eregObj.Global = True '** Set All Replace(전체 문서에서 검색)
eregi_replace = eregObj.Replace(text, replacestr) '** Replace String
End Function
'###########################################################################################
'HTML 실행 방지 함수
'###########################################################################################
Public Function SpecialHtmlChars(ByVal str, ByVal dtype, ByVal tags)
Dim contents: contents = str
Dim doctype: doctype = LCase(dtype)
Dim allowTagList: allowTagList = Replace(tags,",","|")
if str<>"" Then
Select Case doctype
Case "text"
contents = Replace(contents,"<","&lt;")
contents = Replace(contents,">","&gt;")
contents = Replace(contents," ","&nbsp; ")
contents = Replace(contents," ","&nbsp; &nbsp; ")
contents = Replace(contents,Chr(13),"<br />") '** 줄바꿈을 <br />태그로 변환
Case "html"
contents = eregi_replace("<(\/?)(?!\/|" & allowTagList & ")([^<>]*)?>", "&lt;$1$2&gt;", contents) '** 허용한 태그 이외의 모든 태그를 변환
contents = eregi_replace("(javascript\:|vbscript\:)+","$1** ",contents) '** 클라이언트 스크립트 실행 방지
contents = eregi_replace("(\.location|location\.|onload=|\.cookie|alert\(|window\.open\(|onmouse|onkey|onclick|view\-source\:)+", "** ", contents) '** 스크립트 이벤트 실행 방지
contents = Replace(contents,"<" & "%","&lt;%") '** ASP태그 방지
contents = Replace(contents,"%" & ">","&lt;%") '** ASP태그 방지
Case "br"
contents = eregi_replace("<(\/?)(?!\/|" & allowTagList & ")([^<>]*)?>", "&lt;$1$2&gt;", contents) '** 허용한 태그 이외의 모든 태그를 변환
contents = eregi_replace("(javascript\:|vbscript\:)+","$1** ",contents) '** 클라이언트 스크립트 실행 방지
contents = eregi_replace("(\.location|location\.|onload=|\.cookie|alert\(|window\.open\(|onmouse|onkey|onclick|view\-source\:)+", "** ", contents) '** 스크립트 이벤트 실행 방지
contents = Replace(contents,"<" & "%","&lt;%") '** ASP태그 방지
contents = Replace(contents,"%" & ">","&lt;%") '** ASP태그 방지
contents = Replace(contents,Chr(13),"<br />") '** 줄바꿈을 <br />태그로 바꿈
Case Else
contents = eregi_replace("<(\/?)(?!\/|)([^<>]*)?>","&lt;$1$2&gt;", contents) '** 모든 <>태그 실행 방지
contents = Replace(contents,Chr(13),"<br />") '** 줄바꿈을 <br />태그로 바꿈
End Select
Else
contents = ""
End if
SpecialHtmlChars = contents
End Function
'#################################################################################
'# 금액에 콤마넣기
'#################################################################################
Function InsertComma(money)
Dim Value,factor,su,src,comi
if not money = "" AND Not isNull(money) then
if mid(money,1,1)="-" then
Value = mid(money,2,len(money))
else
Value =money
end if
factor = len(Value) MOD 3
su = (len(Value) - factor) / 3
src = mid(Value,1,factor)
For comi = 0 to su-1
if factor = 0 and comi = 0 then
src = src&mid(Value, factor+(3*comi)+1, 3)
else
src = src&","
src = src&mid(Value, factor+(3*comi)+1, 3)
end if
next
if mid(money,1,1)="-" then
insertComma = "-"&src
else
insertComma = src
end if
else
insertComma=0
end if
End Function
'#################################################################################
'# 금액에 콤마넣기
'#################################################################################
Function InsertCommaNull(money)
Dim factor,su,src,comi
if not money = "" AND Not isNull(money) then
if mid(money,1,1)="-" then
Value = mid(money,2,len(money))
else
Value =money
end if
factor = len(Value) MOD 3
su = (len(Value) - factor) / 3
src = mid(Value,1,factor)
For comi = 0 to su-1
if factor = 0 and comi = 0 then
src = src&mid(Value, factor+(3*comi)+1, 3)
else
src = src&","
src = src&mid(Value, factor+(3*comi)+1, 3)
end if
next
if mid(money,1,1)="-" then
InsertCommaNull = "-"&src
else
InsertCommaNull = src
end if
else
InsertCommaNull=""
end if
End Function
'#################################################################################
'# 금액에 콤마지우기
'#################################################################################
Function DelComma(money)
Dim result,comi
if not money = "" AND Not isNull(money) then
For comi = 0 to len(money)
if Mid(money,comi+1,1)<>"," Then
result = result & Mid(money,comi+1,1)
End if
Next
End if
DelComma = result
End Function
'#################################################################################
'#날짜만 가져오기
'#월, 일을 "." 으로 변경하기
'#################################################################################
Function ConvertDate(val)
Dim result
if not val = "" AND Not isNull(val) Then
result = Replace(Split(val," ")(0),"-",".")
End if
ConvertDate = result
End Function
'#################################################################################
'#월, 일을 "." 으로 변경하기
'#################################################################################
Function ConvertDate2(val)
Dim result,left_result
if not val = "" AND Not isNull(val) Then
result = Replace(val,"-",".")
End if
ConvertDate2 = result
End Function
'#################################################################################
'#연령 계산
'#################################################################################
Function GET_AGE(jumin1,age_type)
Dim nAge
Dim BirthDay,nowBirthDay
Dim strYY
If CLng(Left(jumin1,2))>0 Then
strYY = "19"
Else
strYY = "20"
End If
BirthDay = dateserial(strYY & Left(jumin1, 2),mid(jumin1,3,2),mid(jumin1,5)) '생년월일
nowBirthDay = DateSerial(Year(date()),Month(date()),Day(date()))
If age_type="2" Then
nAge = DateDiff("yyyy", BirthDay, Date()) + 1
Else
If CDate(nowBirthDay) > CDate(Now()) Then '생일이 안 지났다면 나이-1
nAge = DateDiff("yyyy", BirthDay, Date()) - 1
Else
nAge = DateDiff("yyyy", BirthDay, Date())
End If
End If
GET_AGE = CStr(nAge)
End Function
'#################################################################################
'#연령 계산
'#################################################################################
Function READ_AGE(jumin1, jumin2, B_Date, age_type) 'age_type 1-만나이,2-일반나이
Dim nowBirthDay 'B_Date의 생일
Dim BirthDay '생년월일
Dim strYY
Dim nAge
Select Case Mid(jumin2, 1, 1)
Case 0, 9: strYY = "18"
Case 1, 2, 5, 6: strYY = "19"
Case 3, 4, 7, 8: strYY = "20"
End Select
BirthDay = dateserial(strYY & Left(jumin1, 2),mid(jumin1,3,2),mid(jumin1,5)) '생년월일
nowBirthDay = DateSerial(Year(B_Date), Month(BirthDay), Day(BirthDay))
if age_type = "2" then
nAge = DateDiff("yyyy", BirthDay, B_Date) + 1
else
If CDate(nowBirthDay) > CDate(B_Date) Then '생일이 안 지났다면 나이-1
nAge = DateDiff("yyyy", BirthDay, B_Date) - 1
Else
nAge = DateDiff("yyyy", BirthDay, B_Date)
End If
end if
READ_AGE = CStr(nAge)
End Function
'###########################################################################################
'# 자바스크립트 메세지 처리
'###########################################################################################
Sub WriteJMessage(message,url)
Dim bodys
bodys = ReadFile("/inc/JMSG.htm")
bodys = Replace(bodys,"[$MESSAGE$]",message)
bodys = Replace(bodys,"[$PAGENAME$]",url)
Response.Write bodys
Response.end
End Sub
'###########################################################################################
'random_key : 랜덤키생성
'###########################################################################################
function Random_key(Byval key_len)
dim key_str,i
Randomize
for i=1 to key_len
key_str = key_str & Int(Rnd * 9 + 1)
next
Random_key = key_str
end Function
'###########################################################################################
'Recordset 결과로 HTML 테이블 만들기
'###########################################################################################
Function makeTable(rsx)
Dim rss
Dim TableSource
Dim i
Dim item
set rss = rsx
TableSource = "<Table cellpadding=1 cellspacing=1 width=100% border=1 style='border-collapse: collapse; font-family:Tahoma; font-size:9pt'>" & vbCrlf
TableSource = TableSource & vbtab & "<tr style='font-weight: bold'>" & vbcrlf
for i=0 to rss.fields.count-1
TableSource = TableSource & vbtab & vbtab & "<td align='center'>" & rss.fields(i).name & "</td>" & vbcrlf
next
TableSource = TableSource & vbtab & "</tr>" & vbcrlf
do while not rss.eof
TableSource = TableSource & vbtab & "<tr>" & vbcrlf
for i=0 to rss.fields.count-1
item = rss(i)
If item="" Or isNull(item) Then item="&nbsp;"
If isNumeric(item) Then item="'" & item
TableSource = TableSource & vbtab & vbtab & "<td align='center'>" & item & "</td>" & vbcrlf
next
TableSource = TableSource & vbtab & "</tr>" & vbcrlf
rss.movenext
loop
TableSource = TableSource & "</Table>" & vbcrlf
makeTable = TableSource
End Function
'######################################################################
' 연도/월 출력
'######################################################################
Function Today(Tp)
Dim ReturnV,xx
ReturnV = ""
If TP = "1" Then
For xx=Year(Date) To 2011 Step -1
ReturnV = ReturnV & "<option value="""&xx&""">"&xx&"</option>" & vbCRLF
Next
Else
For xx=1 To 12
If Len(xx)=1 Then
xx = "0"&xx
End if
ReturnV = ReturnV & "<option value="""&xx&""">"&xx&"</option>" & vbCRLF
Next
End if
Today = ReturnV
End Function
Function cutStr(dat,chars)
Dim xIdx
xIdx = InStr(dat,chars)
cutStr = Left(dat,xIdx-1)
End Function
'###########################################################################################
'지정길이로 랜덤 숫자 만들기
'###########################################################################################
Function getRandomNum(ByVal rLen)
Dim idx, rndSeed, rndSeed2
If rLen>15 Then rLen =15
rndSeed = ""
rndSeed2 = "1"
For idx=1 To rLen
rndSeed = rndSeed & "1"
rndSeed2 = rndSeed2 & "0"
Next
rndSeed = Int(rndSeed)
rndSeed2 = Int(rndSeed2)
Randomize
getRandomNum = Int(Rnd(rndSeed)*rndSeed2)
End Function
'###########################################################################################
'지정길이로 랜덤 문자 만들기
'###########################################################################################
Function getRandomChar(ByVal rLen)
Dim rtnStr, idx
Randomize
For idx=1 To rLen
rtnStr = rtnStr & Chr(Int(2*Rnd)*32 + Int((90-65+1)*Rnd+65))
Next
getRandomChar = rtnStr
End Function
'###########################################################################################
'8자리 임시 비밀번호 만들기
'###########################################################################################
Function getTempPassword()
Dim strTmp1,strTmp2
strTmp1 = getRandomNum(4)
strTmp2 = getRandomChar(4)
getTempPassword = strTmp1 & strTmp2
End Function
'###########################################################################################
'랜덤 String 생성
'###########################################################################################
Function CreateRandomString(iSize)
Const VALID_TEXT = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
Dim sNewSearchTag
Dim I
For I = 0 To iSize
Randomize
sNewSearchTag = sNewSearchTag & Mid(VALID_TEXT,Round(Rnd * Len(VALID_TEXT)),1)
Next
CreateRandomString = sNewSearchTag
End Function
'#################################################################################
'#페이지 리스트 표시
'# c_page : 현재 페이지 넘버
'# p_start : start 페이지 넘버
'# p_end : end 페이지 넘버
'# p_size : 한페이지에 보여질 숫자 갯수
'# t_size : 토탈 페이지 수
'# url : 리스트 페이지 명
'#################################################################################
Function Pagenation_Coding(c_page,p_start,p_end,p_size,t_size,searchType,searchValue,IDX,url)
Dim iCnts
Dim cP
Dim rStr
rStr = ""
If searchType <>"" Then searchType = strAnsi2Unicode(Base64encode(strUnicode2Ansi(searchType)))
If searchValue <>"" Then searchValue = strAnsi2Unicode(Base64encode(strUnicode2Ansi(searchValue)))
if CLng(p_end) <= CLng(p_size) Then
rStr = rStr & "<li><a href=''><i class='icon-backward'></i></a></li>" & vbCrLf
else
' cP = c_page-10
' if cp<1 Then
' cp = 1
' End if
cP = int(((c_Page-10)-1) / P_size) * P_size + 1
rStr = rStr & "<li><a href="""& url &"?IDX="& IDX &"&G_cpage="& strAnsi2Unicode(Base64encode(strUnicode2Ansi(cP))) &"&G_pagesize="& strAnsi2Unicode(Base64encode(strUnicode2Ansi(p_size))) &"&G_searchType="& searchType &"&G_searchValue="& searchValue &"""><i class='icon-backward'></i></a></li>"
end if
if p_end="1" OR p_end="0" OR p_end="-1" Then
rStr = rStr & "<li class='active'><a href='#'>1</a></li>"
Else
for iCnts = p_start to p_end
if iCnts <> cint(c_Page) then
rStr = rStr & "<li><a href="""& url &"?IDX="& IDX &"&G_cpage="& strAnsi2Unicode(Base64encode(strUnicode2Ansi(iCnts))) &"&G_pagesize="& strAnsi2Unicode(Base64encode(strUnicode2Ansi(p_size))) &"&G_searchType="& searchType &"&G_searchValue="& searchValue &""">"& icnts &"</a></li>" & vbCrLf
else
rStr = rStr & "<li class='active'><a href='#'>"& icnts &"</a></li>" & vbCrLf
end if
next
End if
if cint(p_end) >= t_size Then
rStr = rStr & "<li><a href=''><i class='icon-forward'></i></a></li>" & vbCrLf
else
cP = int(((c_Page+10)-1) / P_size) * P_size + 1
' cP = c_page+10
' if cp>t_size Then
' cp = t_size
' End if
rStr = rStr & "<li><a href="""& url &"?IDX="& IDX &"&G_cpage="& strAnsi2Unicode(Base64encode(strUnicode2Ansi(cP))) &"&G_pagesize="& strAnsi2Unicode(Base64encode(strUnicode2Ansi(p_size))) &"&G_searchType="& searchType &"&G_searchValue="& searchValue &"""><i class='icon-forward'></i></a></li>"
End If
Pagenation_Coding = rStr
End Function
'#################################################################################
'#페이지 리스트 표시
'# c_page : 현재 페이지 넘버
'# p_start : start 페이지 넘버
'# p_end : end 페이지 넘버
'# p_size : 한페이지에 보여질 숫자 갯수
'# t_size : 토탈 페이지 수
'# url : 리스트 페이지 명
'# searchType : 검색 조건
'# searchValue : 검색 값
'# IDField : INDEX 필드명
'# IDValue : INDEX 값
'#################################################################################
Function Pagenation(c_page,p_start,p_end,p_size,t_size,url,searchType,searchValue,IDField,IDValue)
Dim iCnts
Dim cP
Dim IDSTR
Dim CU_PAGE
IDSTR = ""
If IDField<>"" And IDValue<>"" Then IDSTR="&"& IDField & "=" & IDValue
Response.Write " <div class=""text-center"">"& vbCrLf
Response.Write " <nav>"& vbCrLf
Response.Write " <ul class=""pagination pagination-sm"">"& vbCrLf
If CLng(p_end) <= CLng(p_size) Then
Response.Write " "
Response.Write "<li><a href=""#""><i class=""fa fa-caret-left""></i></a></li>"& vbCrLf
Else
cP = int(((c_page-10)-1) / p_size) * p_size + 1
Response.Write " "
Response.Write "<li><a href="""&url&"?cpage="&cp&"&searchType="&searchType&"&searchValue="&searchValue&IDSTR&"""><i class='fa fa-caret-left'></i></a></li>"& vbCrLf
End If
If p_end="1" OR p_end="0" OR p_end="-1" Then
Response.Write " "
Response.Write "<li class=""active""><a href=""#"">1</a></li>" & vbCrLf
Else
For iCnts = p_start to p_end
Response.Write " "
If iCnts <> cint(c_Page) Then
Response.Write "<li><a href="""&url&"?cpage="&icnts&"&searchType="&searchType&"&searchValue="&searchValue&IDSTR&""">"& icnts &"</a></li>" & vbCrLf
Else
Response.Write "<li class=""active""><a href=""#"">"& icnts &"</a></li>" & vbCrLf
End If
Next
End If
If cint(p_end) >= t_size Then
Response.Write " "
Response.Write "<li><a href=""#""><i class=""fa fa-caret-right""></i></a></li>" & vbCrLf
Else
cP = int(((c_page+10)-1) / p_size) * p_size + 1
Response.Write " "
Response.Write "<li><a href="""&url&"?cpage="&cp&"&searchType="&searchType&"&searchValue="&searchValue&IDSTR&"""><i class=""fa fa-caret-right""></i></a></li>" & vbCrLf
End If
Response.Write " </ul>" & vbCrLf
Response.Write " </nav>" & vbCrLf
Response.Write " </div>" & vbCrLf
End Function
'#################################################################################
'#URL Decode
'#################################################################################
Function FnURLDecode(sStr)
Dim sRet, reEncode, sChar
Dim i
If isnull(sStr) Then
sStr = ""
Else
Set reEncode = New RegExp
reEncode.IgnoreCase = True
reEncode.Pattern = "^%[0-9a-f][0-9a-f]$"
sStr = Replace(sStr, "+", " ")
sRet = ""
For i = 1 To Len(sStr)
sChar = Mid(sStr, i, 3)
If reEncode.Test(sChar) Then
If CInt("&H" & Mid(sStr, i + 1, 2)) < 128 Then
sRet = sRet & Chr(CInt("&H" & Mid(sStr, i + 1, 2)))
i = i + 2
Elseif mid(sStr, i+3, 1) ="%" Then
sRet = sRet & Chr(CInt("&H" & Mid(sStr, i + 1, 2) & Mid(sStr, i + 4, 2)))
i = i + 5
Else
sRet = sRet & Chr(CInt("&H" & Mid(sStr, i + 1, 2) & "00") + asc(mid(sStr,i+3,1)))
i = i + 3
'이부분이 중요하다.
'기존 urldecode함수가 몇 몇 글자들에서 에러를 내는 이유는 3바이트로 인코딩 되어있는 부분이 있기 때문. ascII로 변형되어 인코딩 된 부분이 존재한다.
End If
Else
sRet = sRet & Mid(sStr, i, 1)
End If
Next
End If
FnURLDecode = sRet
End Function
'#################################################################################
'#비밀번호 암호화
'#################################################################################
Function MakePassword(passwordStr)
Dim HashPassword
Dim SHAOBJ
Set SHAOBJ = New clsSHA256
HashPassword = SHAOBJ.SHA256(passwordStr&SALT)
MakePassword = HashPassword
Set SHAOBJ = Nothing
End Function
%>

82
Lib/Config.asp Normal file
View File

@@ -0,0 +1,82 @@
<% @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 SITENAME ' 사이트 URL
Dim LOGINURL ' 로그인 URL
Dim PROGRAMTITLE '페이지 타이틀
Dim MAIL_SV,MAIL_ID,MAIL_PW '메일 설정 자료
Dim SALT '암호화 도움키 *분실하거나 수정되면 안됨. - 비밀번호를 전부 재설정 해야함
Dim BASIC_COL '설문 데이터의 시스템 컬럼 갯수
Dim Local_IP : Local_IP = Request.ServerVariables("REMOTE_ADDR") '접속자 IP(사내용)
'//-------------------------------
'//-- hwkim 2020-08-19 17:28:41
Dim ip: ip = Request.ServerVariables("REMOTE_ADDR"): 'Response.Write ip
Dim DevNode: DevNode = "real"
'--or ip = "10.10.13.115"
If( ip = "10.10.13.82" or ip = "10.10.13.117" or ip = "10.10.13.118" or ip = "10.10.13.130" or ip = "10.10.13.83" )Then
DevNode = "dev"
Else
DevNode = "real"
End if
'-------------------------------//
'--
DevNode = "real"
'response.write DevNode
'#######################################################################################
'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"
DB_NAME1= "project2"
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 = "mssql-7sq2n-kr.vpc-pub-cdb.ntruss.com"
DB_NAME2= "konkiwi"
UID2 = "kadmin"
PWD2 = "it#51304"
end if
%>
<!-- #include file = "./DBConn.asp" -->
<!-- #include file = "./DBLib.asp" -->
<!-- #include file = "./FileLib.asp" -->
<!-- #include file = "./CAPICOM.asp" -->
<!-- #include file = "./Func.asp" -->
<!-- #include file = "./SiteFunc.asp" -->
<!-- #include file = "./ApiLog.asp" -->
<!-- #include file = "./sha256.asp" -->
<!-- #include file = "./md5.asp" -->
<!-- #include file = "./aspJSON1.17.asp" -->
<!-- #include file = "./JSON_2.0.4.asp" -->

68
Lib/DBConn.asp Normal file
View File

@@ -0,0 +1,68 @@
<%
'Database Connection
'DBConn : 설문 DataBase
'RSConn : List Database
Dim DBFlag,RBFlag
'###########################################################################################
'CAPI 시스템 DB 연결
'###########################################################################################
Sub DBConnect()
Set DBConn=Server.CreateObject("ADODB.Connection")
DBConn.CursorLocation = adUseClient
DBConn.CommandTimeout = 0 ' select 쿼리 시간 무제한
DBConn.Open GetDBStr()
DBFlag = True
End Sub
'###########################################################################################
'CAPI Project DB 연결
'###########################################################################################
Sub DBConnect1()
Set DBConn=Server.CreateObject("ADODB.Connection")
DBConn.CursorLocation = adUseClient
DBConn.Open GetDBStr1()
DBFlag = True
End Sub
Sub DBConnect2()
Set DBConn=Server.CreateObject("ADODB.Connection")
DBConn.Open GetDBStr2()
DBConn.CursorLocation = adUseClient
DBFlag = True
End Sub
Function GetDBStr()
GetDBStr = "Driver=SQL Server; Server=" & SV_NAME & "; Database=" & DB_NAME & "; UID=" & UID & "; PWD=" & PWD
End Function
Function GetDBStr1()
GetDBStr1 = "Driver=SQL Server; Server=" & SV_NAME1 & "; Database=" & DB_NAME1 & "; UID=" & UID1 & "; PWD=" & PWD1
'20220711 박준성 인트라넷 -> kon
'GetDBStr1 = "Provider=SQLOLEDB; Server=1.235.195.8,20022;Initial Catalog=kon; UID=kon; PWD=kon#51304"
End Function
Function GetDBStr2()
GetDBStr2 = "Provider=SQLOLEDB; Server=" & SV_NAME2 & ";Initial Catalog=" & DB_NAME2 & "; UID=" & UID2 & "; PWD=" & PWD2
End Function
'DB 끊기
Sub DBClose()
If Not DBConn Is Nothing Then
DBConn.Close
Set DBConn = Nothing
End If
DBFlag = False
End Sub
%>

456
Lib/DBHelper.asp Normal file
View File

@@ -0,0 +1,456 @@
<!--METADATA TYPE= "typelib" NAME= "ADODB Type Library"
FILE="C:\Program Files\Common Files\SYSTEM\ADO\msado15.dll" -->
<%
Class clsDBHelper
Private DefaultConnString
Private DefaultConnection
Private m_ServerIP
Private m_DBName
Private m_UserID
Private m_UserPW
Dim cmd
Dim rs
Dim inum
Private sub Class_Initialize()
'----------------------------------------------------
'SQL OLE DB ConnString
'----------------------------------------------------
'DefaultConnString = "Provider=SQLOLEDB;Data Source=" & m_ServerIP & ";Initial Catalog=" & m_DBName & ";User Id=" & m_UserID & ";Password=" & m_UserPW & ";"
'----------------------------------------------------
'MS SQL DB ConnString
'----------------------------------------------------
DefaultConnString = "Driver=SQL Server; Server=" & m_ServerIP & "; Database=" & m_DBName & "; UID=" & m_UserID & "; PWD=" & m_UserPW
Set DefaultConnection = Nothing
End Sub
'소멸자
Private Sub Class_Terminate()
Set DefaultConnection = Nothing
End Sub
'---------------------------------------------------
' 서버 설정
'---------------------------------------------------
Public Property Set Server(mServer)
m_ServerIP = mServer
End Property
Public Property Set DBName(mDBName)
m_DBName = mDBName
End Property
Public Property Set UserID(mUserID)
m_UserID = mUserID
End Property
Public Property Set UserPW(mUserPW)
m_UserPW = mUserPW
End Property
'---------------------------------------------------
' SP를 실행하고, RecordSet을 반환한다.
'---------------------------------------------------
Public Function ExecSPReturnRS(spName, params, connectionString)
If IsObject(connectionString) Then
If connectionString is Nothing Then
If DefaultConnection is Nothing Then
Set DefaultConnection = CreateObject("ADODB.Connection")
DefaultConnection.Open DefaultConnString
End If
Set connectionString = DefaultConnection
End If
End If
Set rs = CreateObject("ADODB.RecordSet")
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = connectionString
cmd.CommandText = spName
cmd.CommandType = adCmdStoredProc
Set cmd = collectParams(cmd, params)
'cmd.Parameters.Refresh
rs.CursorLocation = adUseClient
rs.Open cmd, ,adOpenStatic, adLockReadOnly
For i = 0 To cmd.Parameters.Count - 1
If cmd.Parameters(i).Direction = adParamOutput OR cmd.Parameters(i).Direction = adParamInputOutput OR cmd.Parameters(i).Direction = adParamReturnValue Then
If IsObject(params) Then
If params is Nothing Then
Exit For
End If
Else
params(i)(4) = cmd.Parameters(i).Value
End If
End If
Next
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
If rs.State = adStateClosed Then
Set rs.Source = Nothing
End If
Set rs.ActiveConnection = Nothing
Set ExecSPReturnRS = rs
End Function
'---------------------------------------------------
' SQL Query를 실행하고, RecordSet을 반환한다.
'---------------------------------------------------
Public Function ExecSQLReturnRS(strSQL, params, connectionString)
If IsObject(connectionString) Then
If connectionString is Nothing Then
If DefaultConnection is Nothing Then
Set DefaultConnection = CreateObject("ADODB.Connection")
DefaultConnection.Open DefaultConnString
End If
Set connectionString = DefaultConnection
End If
End If
Set rs = CreateObject("ADODB.RecordSet")
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = connectionString
cmd.Prepared = true
cmd.CommandText = strSQL
cmd.CommandType = adCmdText
Set cmd = collectParams(cmd, params)
' On Error Resume Next
' Response.Write strSQL & "<BR>"
rs.CursorLocation = adUseClient
rs.Open cmd, , adOpenStatic, adLockReadOnly
If Err.Number<>0 Then
ErrorLog DefaultConnection.Number, DefaultConnection.Description
End IF
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
If rs.State = adStateClosed Then
Set rs.Source = Nothing
End If
Set rs.ActiveConnection = Nothing
Set ExecSQLReturnRS = rs
End Function
'---------------------------------------------------
' SQL Query를 실행하고, RecordSet Array을 반환한다.
'---------------------------------------------------
Public Function ExecSQLReturnAR(strSQL, params, connectionString)
If IsObject(connectionString) Then
If connectionString is Nothing Then
If DefaultConnection is Nothing Then
Set DefaultConnection = CreateObject("ADODB.Connection")
DefaultConnection.Open DefaultConnString
End If
Set connectionString = DefaultConnection
End If
End If
Set rs = CreateObject("ADODB.RecordSet")
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = connectionString
cmd.Prepared = true
cmd.CommandText = strSQL
cmd.CommandType = adCmdText
Set cmd = collectParams(cmd, params)
' On Error Resume Next
'Response.Write strSQL & "<BR>"& "<BR>"& "<BR>"& "<BR>"
rs.CursorLocation = adUseClient
rs.Open cmd, , adOpenStatic, adLockReadOnly
If Err.Number<>0 Then
ErrorLog DefaultConnection.Number, DefaultConnection.Description
End IF
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
If rs.State = adStateClosed Then
Set rs.Source = Nothing
End If
Set rs.ActiveConnection = Nothing
Set ExecSQLReturnAR = rs.getRows
End Function
'---------------------------------------------------
' SQL Query를 실행하고, RecordSet String을 반환한다.
'---------------------------------------------------
Public Function ExecSQLReturnST(strSQL, params, connectionString)
If IsObject(connectionString) Then
If connectionString is Nothing Then
If DefaultConnection is Nothing Then
Set DefaultConnection = CreateObject("ADODB.Connection")
DefaultConnection.Open DefaultConnString
End If
Set connectionString = DefaultConnection
End If
End If
Set rs = CreateObject("ADODB.RecordSet")
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = connectionString
cmd.Prepared = true
cmd.CommandText = strSQL
cmd.CommandType = adCmdText
Set cmd = collectParams(cmd, params)
' On Error Resume Next
'Response.Write strSQL & "<BR>"& "<BR>"& "<BR>"& "<BR>"
rs.CursorLocation = adUseClient
rs.Open cmd, , adOpenStatic, adLockReadOnly
If Err.Number<>0 Then
ErrorLog DefaultConnection.Number, DefaultConnection.Description
End IF
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
If rs.State = adStateClosed Then
Set rs.Source = Nothing
End If
Set rs.ActiveConnection = Nothing
Set ExecSQLReturnAR = rs.getString(2)
End Function
'---------------------------------------------------
' SP를 실행한다.(RecordSet 반환없음)
'---------------------------------------------------
Public Sub ExecSP(strSP,params,connectionString)
If IsObject(connectionString) Then
If connectionString is Nothing Then
If DefaultConnection is Nothing Then
Set DefaultConnection = CreateObject("ADODB.Connection")
DefaultConnection.Open DefaultConnString
End If
Set connectionString = DefaultConnection
End If
End If
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = connectionString
cmd.CommandText = strSP
cmd.CommandType = adCmdStoredProc
Set cmd = collectParams(cmd, params)
cmd.Execute , , adExecuteNoRecords
For inum = 0 To cmd.Parameters.Count - 1
If cmd.Parameters(inum).Direction = adParamOutput OR cmd.Parameters(inum).Direction = adParamInputOutput OR cmd.Parameters(inum).Direction = adParamReturnValue Then
If IsObject(params) Then
If params is Nothing Then
Exit For
End If
Else
params(inum)(4) = cmd.Parameters(inum).Value
End If
End If
Next
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
End Sub
'---------------------------------------------------
' SQL Query를 실행한다.(RecordSet 반환없음)
'---------------------------------------------------
Public Sub ExecSQL(strSQL,params,connectionString)
If IsObject(connectionString) Then
If connectionString is Nothing Then
If DefaultConnection is Nothing Then
Set DefaultConnection = CreateObject("ADODB.Connection")
DefaultConnection.Open DefaultConnString
End If
Set connectionString = DefaultConnection
End If
End If
On Error Resume Next
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = connectionString
cmd.CommandText = strSQL
cmd.CommandType = adCmdText
Set cmd = collectParams(cmd, params)
cmd.Execute , , adExecuteNoRecords
' If DefaultConnection.Errors.Count <> 0 Then
' For each objErr in DefaultConnection.Errors
' response.write("<p>")
' response.write("Description: ")
' response.write(objErr.Description & "<br>")
' response.write("Help context: ")
' response.write(objErr.HelpContext & "<br>")
' response.write("Help file: ")
' response.write(objErr.HelpFile & "<br>")
' response.write("Native error: ")
' response.write(objErr.NativeError & "<br>")
' response.write("Error number: ")
' response.write(objErr.Number & "<br>")
' response.write("Error source: ")
' response.write(objErr.Source & "<br>")
' response.write("SQL state: ")
' response.write(objErr.SQLState & "<br>")
' response.write("</p>")
' Next
' Response.End
' End IF
if err.number <> 0 then
response.Write("<b>SQL :</B>"&strSQL&"<br>")
response.Write("<b>err.description :</B>"&err.Description&"<br>")
response.Write("<b>err.number : </b>"&err.Number&"<br>")
response.Write("<b>err.Source : </b>"&err.Source&"<br>")
Response.End
End IF
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
End Sub
'---------------------------------------------------
' 트랜잭션을 시작하고, Connetion 개체를 반환한다.
'---------------------------------------------------
Public Function BeginTrans(connectionString)
If IsObject(connectionString) Then
If connectionString is Nothing Then
connectionString = DefaultConnString
End If
End If
Set conn = CreateObject("ADODB.Connection")
conn.Open connectionString
conn.BeginTrans
Set BeginTrans = conn
End Function
'---------------------------------------------------
' 활성화된 트랜잭션을 커밋한다.
'---------------------------------------------------
Public Sub CommitTrans(connectionObj)
If Not connectionObj Is Nothing Then
connectionObj.CommitTrans
connectionObj.Close
Set ConnectionObj = Nothing
End If
End Sub
'---------------------------------------------------
' 활성화된 트랜잭션을 롤백한다.
'---------------------------------------------------
Public Sub RollbackTrans(connectionObj)
If Not connectionObj Is Nothing Then
connectionObj.RollbackTrans
connectionObj.Close
Set ConnectionObj = Nothing
End If
End Sub
'---------------------------------------------------
' 배열로 매개변수를 만든다.
'---------------------------------------------------
Public Function MakeParam(PName,PType,PDirection,PSize,PValue)
MakeParam = Array(PName, PType, PDirection, PSize, PValue)
End Function
'---------------------------------------------------
' 매개변수 배열 내에서 지정된 이름의 매개변수 값을 반환한다.
'---------------------------------------------------
Public Function GetValue(params, paramName)
For Each param in params
If param(0) = paramName Then
GetValue = param(4)
Exit Function
End If
Next
End Function
Public Sub Dispose
if (Not DefaultConnection is Nothing) Then
if (DefaultConnection.State = adStateOpen) Then DefaultConnection.Close
Set DefaultConnection = Nothing
End if
End Sub
'---------------------------------------------------------------------------
'Array로 넘겨오는 파라메터를 Parsing 하여 Parameter 객체를
'생성하여 Command 객체에 추가한다.
'---------------------------------------------------------------------------
Private Function collectParams(cmd,argparams)
Dim params
Dim i,l,u,v
If VarType(argparams) = 8192 or VarType(argparams) = 8204 or VarType(argparams) = 8209 then
params = argparams
For i = LBound(params) To UBound(params)
l = LBound(params(i))
u = UBound(params(i))
' Check for nulls.
If u - l = 4 Then
If VarType(params(i)(4)) = vbString Then
If params(i)(4) = "" Then
v = Null
Else
v = Trim(params(i)(4))
End If
Else
v = params(i)(4)
End If
' On Error Resume Next
' If err.number <> 0 then
' Response.Write params(i)(0) & ":" & params(i)(1) & ":" & params(i)(2) & ":" & params(i)(3)& ":" &v&"<BR>"
' End If
If VarType(params(i)(4)) = vbString And params(i)(4) = "" Then
Set cnParam = cmd.CreateParameter(params(i)(0))
cnParam.attributes=adParamNullable
cnParam.type = params(i)(1)
cnParam.Direction = params(i)(2)
cnParam.Size=1
cnParam.value=Null
cmd.Parameters.Append cnParam 'cmd.CreateParameter(params(i)(0), params(i)(1), params(i)(2), params(i)(3), Null)
Else
cmd.Parameters.Append cmd.CreateParameter(params(i)(0), params(i)(1), params(i)(2), params(i)(3), v)
End If
End If
Next
Set collectParams = cmd
Exit Function
Else
Set collectParams = cmd
End If
End Function
End Class
%>

292
Lib/DBLib.asp Normal file
View File

@@ -0,0 +1,292 @@
<%
'###########################################################################################
'정규식을 이용하여 문자열을 치환하는 함수
'###########################################################################################
Public Function eregi_replace(ByVal pattern, ByVal replacestr, ByVal text)
Dim eregObj
'** Create regular expression
Set eregObj = New RegExp
eregObj.Pattern = pattern '** Set Pattern(패턴 설정)
eregObj.IgnoreCase = True '** Set Case Insensitivity(대소문자 구분 여부)
eregObj.Global = True '** Set All Replace(전체 문서에서 검색)
eregi_replace = eregObj.Replace(text, replacestr) '** Replace String
End Function
'###########################################################################################
'레코드셋 JSON형식으로 변환
'###########################################################################################
Function RecordToJSON(Rcset)
Dim JSON : JSON = " [ "
Dim iCnt ,Field
IF Rcset.RecordCount > 0 THEN
while not Rcset.eof
iCnt = Rcset.Fields.Count
JSON = JSON & " { "
FOR EACH Field IN Rcset.Fields
iCnt = iCNt - 1
IF IsNull(Field.Value) THEN
JSON = JSON & Chr(34) & Field.Name & Chr(34) & " : " & Chr(34) & Chr(34) & vbcrlf
ELSE
JSON = JSON & Chr(34) & Field.Name & Chr(34) & " : " & Chr(34) & Replace(Replace(Field.Value,Chr(34), "˝"),chr(10)," ") & Chr(34) & vbcrlf
END IF
IF iCnt > 0 THEN JSON = JSON & ", "
NEXT
JSON = JSON & " } "
Rcset.movenext : IF NOT Rcset.eof THEN JSON = JSON & ","
wend
JSON = JSON & " ] "
RecordToJSON = JSON
ELSE
RecordToJSON = "[]"
END IF
END Function
'###########################################################################################
'데이터입력시 쿼리에 영향주는 문자 제거
'###########################################################################################
Public Function checkValue(inWord)
inWord = eregi_replace("'", "´", inWord)
inWord = eregi_replace(Chr(34), "˝", inWord)
inWord = eregi_replace("\\", "\\", inWord)
'inWord = eregi_replace("""", "˝", inWord)
inWord = eregi_replace(";", "", inWord)
inWord = eregi_replace(",", "¸", inWord)
inWord = eregi_replace("--", "", inWord)
inWord = eregi_replace("\@variable ", "", inWord)
inWord = eregi_replace("\@@variable ", "", inWord)
inWord = eregi_replace("\+", "", inWord)
inWord = eregi_replace("print ", "", inWord)
inWord = eregi_replace("set ", "", inWord)
inWord = eregi_replace("union ", "", inWord)
inWord = eregi_replace("insert ", "", inWord)
inWord = eregi_replace("select ", "", inWord)
inWord = eregi_replace("update ", "", inWord)
inWord = eregi_replace("create ", "", inWord)
inWord = eregi_replace("drop ", "", inWord)
inWord = eregi_replace("openrowset ", "", inWord)
inWord = eregi_replace("exec ", "", inWord)
inWord = eregi_replace("§", "", inWord)
inWord = eregi_replace("∑", "", inWord)
inWord = eregi_replace("∮", "", inWord)
inWord = eregi_replace("╫", "", inWord)
inWord = eregi_replace("╬", "", inWord)
checkValue = inWord
End Function
'###########################################################################################
' 다음 페이지 정보
'###########################################################################################
Function getNextPage(page,pcode)
Dim SQL
Dim RsField
DBConnect2()
Set RsField = Server.CreateObject("ADODB.Recordset")
IF page = "INDEX" THEN
SQL = " select Top 1 QID from KonKiwi.dbo.QUESTION WHERE [PKEY]= '" & pcode & "' order by Qorder "
ELSE
SQL = " select NPAGE from ( " &vbcrlf
SQL = SQL & " select QID,LEAD(QID,'1','END') OVER (ORDER BY Qorder) as NPAGE from KonKiwi.dbo.QUESTION WHERE [PKEY]='" & pcode & "' " &vbcrlf
SQL = SQL & " ) b where QID = '" & page & "' " &vbcrlf
END IF
RsField.Open SQL,DBConn,3,1,1
If RsField.Eof or RsField.Bof Then
getNextPage = "END"
else
getNextPage = RsField(0)
End if
RsField.Close
DBClose()
End Function
'###########################################################################################
' 다음 로테 페이지 정보
'###########################################################################################
Function getRotationEndPage (rota,pcode)
Dim SQL
Dim RsField
DBConnect2()
Set RsField = Server.CreateObject("ADODB.Recordset")
SQL = " select top 1 NPAGE from ( " &vbcrlf
SQL = SQL & " select QID,LEAD(QID,'1','END') OVER (ORDER BY Qorder) as NPAGE,JSON_VALUE(QUESTIONJSON ,'$.rota') as rota,Qorder from KonKiwi.dbo.QUESTION WHERE [PKEY]='"&pcode&"' " &vbcrlf
SQL = SQL & " ) b where rota ='"&rota&"' order by Qorder desc " &vbcrlf
RsField.Open SQL,DBConn,3,1,1
If RsField.Eof or RsField.Bof Then
getRotationEndPage = "END"
else
getRotationEndPage = RsField(0)
End if
RsField.Close
DBClose()
End Function
'###########################################################################################
' INIT DB DB 초기 세팅
'###########################################################################################
Function INITDB(DATA,PKEY,IDKEY,QID,SURVEYTYPE)
Dim SQL
Dim RsField
DBConnect2()
On Error Resume Next
SQL = "insert into KonKiwi.dbo.DATA (IDKEY,PKEY,PAGENAME,SURVEY_TYPE,Status,DATJSON,survey_date) "
SQL = SQL & " values('"&IDKEY&"','"&PKEY&"','"&QID&"','"&SURVEYTYPE&"','1', JSON_QUERY(N'{ "&CHR(34)& QID &CHR(34)&" : "& DATA &"}'), '{ """&QID&""":""' + cast(convert(varchar,getdate(),20) as varchar) + '""}' ) "
DBConn.Execute SQL
If Err.Number > 0 Then
CALL ERRSAVE(PKEY,IDKEY,QID," SAVEx ERROR ERR NUMBER " & Err.Number & " DESCRIPTION : " & Err.description )
INITDB = "ERROR"
ELSE
Call WriteFileLog(Server.MapPath("/log/" & PKEY & "/LOG/" & IDKEY & ".qry"),SQL,True)
INITDB = "SAVE"
'//-- wani
SQL = " INSERT INTO KonKiwi.dbo.DATA_SPLIT(PAGENAME, PCODE, IDKEY, SURVEY_TYPE, QNUMBER, ROTATION, DATAJSON, survey_date, DATA_IN_TYPE, DATA_IN_VAL) "
SQL = SQL & " VALUES('"&QID&"', '"& PKEY &"', '"&IDKEY&"', '"&SURVEYTYPE&"', '"&QID&"', '', JSON_QUERY(N'{ "&CHR(34)& QID &CHR(34)&" : "& DATA &"}', getdate() "
SQL = SQL & " , 'INITDB', 'SAVE'); "
DBConn.Execute SQL
END IF
RsField.Close
DBClose()
End Function
'###########################################################################################
' SAVE DB
'###########################################################################################
Function SAVEDB(DATA,PKEY,IDKEY,QID,SURVEYTYPE)
Dim SQL
Dim RsField
Dim num
On Error Resume Next
DBConnect2()
IF DATA <> "{}" THEN
SQL = "update KonKiwi.dbo.DATA set DATJSON = JSON_MODIFY(DATJSON,'$."&QID&"',JSON_QUERY(N'"& DATA &"') ) "
SQL = SQL & ", survey_date = JSON_MODIFY(survey_date,'$."&QID&"', cast(convert(varchar,getdate(),20) as varchar) ) "
SQL = SQL & " where PKEY = '"& PKEY &"' and IDKEY = '" & IDKEY & "' "
DBConn.Execute SQL,num
END IF
If Err.Number > 0 Then
CALL ERRSAVE(PKEY,IDKEY,QID," SAVEupdate ERROR ERR NUMBER " & Err.Number & " DESCRIPTION : " & Err.description )
SAVEDB = "ERROR"
Exit Function
ELSE
IF num > 1 THEN
'//-- wani
SQL = " INSERT INTO KonKiwi.dbo.DATA_SPLIT(PAGENAME, PCODE, IDKEY, SURVEY_TYPE, QNUMBER, ROTATION, DATAJSON, survey_date, DATA_IN_TYPE, DATA_IN_VAL) "
SQL = SQL & " VALUES('"&QID&"', '"& PKEY &"', '"&IDKEY&"', '"&SURVEYTYPE&"', '"&QID&"', '', JSON_QUERY(N'"& DATA &"'), getdate() "
SQL = SQL & " , 'SAVEDB', 'DOUBLE'); "
DBConn.Execute SQL
SAVEDB = "DOUBLE"
Exit Function
ELSE
Call WriteFileLog(Server.MapPath("/log/" & PKEY & "/LOG/" & IDKEY & ".qry"),SQL,False)
'//-- wani
SQL = " INSERT INTO KonKiwi.dbo.DATA_SPLIT(PAGENAME, PCODE, IDKEY, SURVEY_TYPE, QNUMBER, ROTATION, DATAJSON, survey_date, DATA_IN_TYPE, DATA_IN_VAL) "
SQL = SQL & " VALUES('"&QID&"', '"& PKEY &"', '"&IDKEY&"', '"&SURVEYTYPE&"', '"&QID&"', '', JSON_QUERY(N'"& DATA &"'), getdate() "
SQL = SQL & " , 'SAVEDB', 'SAVE'); "
DBConn.Execute SQL
SAVEDB = "SAVE"
Exit Function
END IF
END IF
DBClose()
End Function
'###########################################################################################
' SAVE DB
'###########################################################################################
Function SAVEJSON(PATH,CONTENT)
WriteUTF_File PATH, CONTENT
End Function
'###########################################################################################
' WRITE ERR 설문 진행 중 에러 저장
'###########################################################################################
SUB ERRSAVE(PKEY,IDKEY,QID,DESCRIPTION)
Dim SQL
DBConnect2()
DESCRIPTION = checkValue(DESCRIPTION)
SQL = "insert into KonKiwi.dbo.ERROR (PKEY,IDKEY,QID,DESCRIPTION) "
SQL = SQL & " values ('"&PKEY&"','"&IDKEY&"','"&QID&"','"&DESCRIPTION&"','"&Now()&"') "
DBConn.Execute SQL
DBClose()
End SUB
'###########################################################################################
'설문 종료
'###########################################################################################
SUB ENDPROCESS(PKEY,IDKEY,ENDPAGE)
Dim SQL
DBConnect2()
SQL = "update KonKiwi.dbo.DATA "
IF ENDPAGE = "END" THEN
SQL = SQL & " set Status = '10' "
ELSEIF ENDPAGE = "SCREEN" THEN
SQL = SQL & " set Status = '99' "
ELSEIF ENDPAGE = "QUOTA" THEN
SQL = SQL & " set Status = '98' "
END IF
SQL = SQL & " where PKEY = '"& PKEY &"' and IDKEY = '" & IDKEY & "' "
DBConn.Execute SQL
DBClose()
End SUB
'###########################################################################################
'데이터 가져오기
'###########################################################################################
Function getValue(fieldNm,PKEY,IDKEY)
Dim uData
Set uData = New aspJSON
Dim DAT_PATH : DAT_PATH = "/log/"&PKEY&"/JSON/"&IDKEY&".json"
Dim vData
If FileChecker(DAT_PATH) Then
uData.loadJSON(ReadUTF_File(DAT_PATH))
Else
getValue = ""
Set uData = Nothing
Exit Function
End If
getValue=uData.data(fieldNm)
Set uData = Nothing
End Function
%>

50
Lib/DBSrv.asp Normal file
View File

@@ -0,0 +1,50 @@
<%
'=======================================================================
'업 무 명 : KRI-common
'모듈기능 : 데이터베이스 서버 연결자 설정
'파 일 명 : DBSrv.asp
'작성일자 : 2004/10/09
'작 성 자 : 김홍완
'-----------------------------------------------------------------------
'변경일자 변경자 변동내역
'=======================================================================
'
'=======================================================================
'Response.Expires = -1
%>
<%
'//-------------------------------
'//-- hwkim 2020-08-19 17:28:41
Dim rs_ip: rs_ip = Request.ServerVariables("REMOTE_ADDR"): 'Response.Write ip
Dim rs_DevNode: rs_DevNode = "real"
If( rs_ip = "10.10.13.82" or rs_ip = "10.10.13.115" or rs_ip = "10.10.13.117" or rs_ip = "10.10.13.118" or rs_ip = "10.10.13.130" )Then
rs_DevNode = "dev"
'response.write "----------------"& fncRequestVariables("LOCAL_ADDR") &"<br>"
'response.write "----------------"& fncRequestVariables("REMOTE_ADDR") &"<br>"
Else
rs_DevNode = "real"
End if
'-------------------------------//
'
rs_DevNode = "real"
'서버 디비 연결자
'**************************************
Dim DBConCapi, DBConKrcSurvey, DBConKon
DBConCapi = "Provider=SQLOLEDB;User Id=sa;PWD=krco#51304;Data Source=1.235.195.34;Initial Catalog=capi;" 'capi 디비연결
DBConKrcSurvey = "Provider=SQLOLEDB;User Id=sa;PWD=krco#51304;Data Source=1.235.195.34;Initial Catalog=krc_survey;" 'krc_survey 디비연결
If( rs_DevNode = "dev" )then
DBConKon = "Provider=SQLOLEDB;User Id=kon;PWD=kon#51304;Data Source=10.10.13.177,1313;Initial Catalog=kon;" 'K-ON 개발 디비연결
else
DBConKon = "Provider=SQLOLEDB;User Id=kadmin;PWD=it#51304;Data Source=mssql-7sq2n-kr.vpc-pub-cdb.ntruss.com;Initial Catalog=konkiwi;" 'K-ON 디비연결
end if
'response.write "----------------"& DBConKon &"<br>"
%>

307
Lib/FileLib.asp Normal file
View File

@@ -0,0 +1,307 @@
<%
'###########################################################################################
'ANSI 파일 함수
'파일 관련 함수
'###########################################################################################
Function FileChecker(filePath)
Dim oFSO
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
' Response.Write filePath &" <BR>"
if oFSO.FileExists(Server.MapPath(filePath)) then
FileChecker=true
Else
FileChecker=false
End If
set oFSO = nothing
End Function
'###########################################################################################
'파일 복사
'파일 관련 함수
'###########################################################################################
Function FileCopy(source,target)
Dim oFSO
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
if oFSO.FileExists(Server.MapPath(source)) Then
oFSO.CopyFile Server.MapPath(source),Server.MapPath(target)
FileCopy=true
Else
FileCopy=false
End If
set oFSO = nothing
End Function
'###########################################################################################
'파일 복사
'파일 관련 함수
'###########################################################################################
Function FileCopyAll(source,target)
Dim oFSO
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
oFSO.CopyFile Server.MapPath(source)&"\*.*",Server.MapPath(target)
FileCopyAll=true
set oFSO = nothing
End Function
'###########################################################################################
'파일 쓰기 함수
'###########################################################################################
function WriteFile(filePath,Str)
Dim oFSO,wFile
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
Set wFile = oFSO.CreateTextFile(filePath,true)
wFile.writeLine(Str)
wFile.Close
Set oFSO = nothing
end function
'###########################################################################################
'로그파일 쓰기 함수
'###########################################################################################
function WriteFileLog(filePath,Str,Survey_Flag)
Dim Strs
If Survey_Flag = True Then
Strs = Str
Else
Strs = LoadStream(filePath) & Str
End if
Dim oFSO,wFile
Set oFSO = Server.CreateObject("ADODB.Stream")
oFSO.CharSet = "utf-8"
oFSO.Mode = 3
oFSO.Type = 2
oFSO.Open
oFSO.WriteText(Strs),1
oFSO.SaveToFile filePath,2
oFSO.Flush
oFSO.Close
Set oFSO = Nothing
End function
'###########################################################################################
'로그파일 읽어오기
'###########################################################################################
Function LoadStream(FilePath)
Dim oFSO,wFile
Set oFSO = Server.CreateObject("ADODB.Stream")
oFSO.CharSet = "utf-8"
oFSO.Mode = 3
oFSO.Type = 2
oFSO.Open
oFSO.LoadFromFile FilePath
LoadStream = oFSO.ReadText
oFSO.Close
Set oFSO = Nothing
End Function
'###########################################################################################
'CONFIG 파일 수정.
'###########################################################################################
SUB MODIFY_CONFIG_FILE(PKEY,TITLE,PCOLOR)
Dim configPath : configPath = "/projectTemplate/include/Config.asp"
configFile = ReadUTF_File(configPath)
configFile = Replace(configFile,"[@PROJECTCODE]",PKEY)
configFile = Replace(configFile,"[@PROJECTTITLE]",TITLE)
configFile = Replace(configFile,"[@PROJECTCOLOR]",PCOLOR)
Dim targetPath : targetPath = "/project/"&PKEY&"/include/Config.asp"
WriteUTF_File targetPath, configFile
END SUB
'###########################################################################################
'LOG 폴더 생성
'###########################################################################################
SUB MAKE_LOG_FOLDER(PKEY)
DIM ROOTPATH : ROOTPATH = "/log/"&PKEY
DIM LOGPATH : LOGPATH = ROOTPATH & "/LOG"
DIM JSONPATH : JSONPATH = ROOTPATH & "/JSON"
MakeFolder Server.mappath(ROOTPATH)
MakeFolder Server.mappath(LOGPATH)
MakeFolder Server.mappath(JSONPATH)
END SUB
'###########################################################################################
'폴더 관련 함수
'###########################################################################################
Function FolderChecker(filePath)
Dim oFSO
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
if oFSO.FolderExists(filePath) then
FolderChecker=true
Else
FolderChecker=false
End If
set oFSO = nothing
End Function
'###########################################################################################
'폴더 만들기
'###########################################################################################
function MakeFolder(filePath)
Dim oFSO,wFolder
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
oFSO.CreateFolder filePath
Set oFSO = nothing
end Function
'###########################################################################################
'폴더 삭제
'###########################################################################################
function deleteFolder(filePath)
Dim oFSO,wFolder
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
'oFSO.deleteFolder filePath
Set oFSO = nothing
end Function
'###########################################################################################
'폴더 카피
'###########################################################################################
function CopyFolder(targetPath,destinationPath)
Dim oFSO
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
oFSO.CopyFolder targetPath,destinationPath
Set oFSO = nothing
end Function
'###########################################################################################
'UTF-8
'파일 읽기
'###########################################################################################
Function ReadUTF_File(FileUrl)
Dim objStream
If FileChecker(fileUrl) Then
Set objStream = CreateObject("ADODB.Stream")
With objStream
.Charset = "utf-8"
.Type=2
.mode=3
.Open
.loadfromfile Server.Mappath(FileUrl)
ReadUTF_File=.readtext
.Close
End With
Set objStream = Nothing
Else
ReadUTF_File = ""
End IF
End Function
'###########################################################################################
'파일 저장
'###########################################################################################
Sub WriteUTF_File (FileUrl,ByVal Str)
'Response.Write fileUrl & "<BR>"
response.write server.MapPath(FileUrl)
Dim objStream
Set objStream=Server.CreateObject("ADODB.Stream")
With objStream
.Type=2 '1: 바이너리 2: for text type
.mode=3 '1: ReadOnly 2:WriteOnly 3:ReadWrite
.Charset="utf-8"
.Open
.WriteText str
.SaveToFile server.MapPath(FileUrl),2
.flush
.Close
End With
Set objStream=nothing
End Sub
'###########################################################################################
'파일 저장
'###########################################################################################
Sub WriteUTF_File2 (FileUrl,ByVal Str)
Dim objStream
Set objStream=Server.CreateObject("ADODB.Stream")
With objStream
.Type=1 '1: 바이너리 2: for text type
.mode=3 '1: ReadOnly 2:WriteOnly 3:ReadWrite
.Charset="utf-8"
.Open
.WriteText str
.SaveToFile server.MapPath(FileUrl),2
.flush
.Close
End With
Set objStream=nothing
End Sub
'###########################################################################################
'파일 삭제를 위한 함수
'###########################################################################################
function DeleteFile(filePath)
Dim oFSO
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
' 해당 파일이 있으면 삭제
If oFSO.FileExists(filePath) Then
oFSO.DeleteFile filePath
end if
Set oFSO = nothing
end Function
'###########################################################################################
'텍스트 파일 읽기 - 상대 경로로 읽어들여짐
'###########################################################################################
Function ReadFile(FileUrl)
Dim fsObj,fileObj
Dim readText
readText = ""
Set fsObj=Server.CreateObject("Scripting.FileSystemObject")
If FileChecker(FileUrl) Then
Set fileObj=fsObj.OpenTextFile(Server.MapPath(FileUrl), 1)
readText = fileObj.readAll
End IF
Set fileObj = Nothing
Set fsObj = Nothing
ReadFile = readText
End Function
%>

210
Lib/JSON_2.0.4.asp Normal file
View File

@@ -0,0 +1,210 @@
<%
'
' VBS JSON 2.0.3
' Copyright (c) 2009 Tu?ul Topuz
' Under the MIT (MIT-LICENSE.txt) license.
'
Const JSON_OBJECT = 0
Const JSON_ARRAY = 1
Class jsCore
Public Collection
Public Count
Public QuotedVars
Public Kind ' 0 = object, 1 = array
Private Sub Class_Initialize
Set Collection = CreateObject("Scripting.Dictionary")
QuotedVars = True
Count = 0
End Sub
Private Sub Class_Terminate
Set Collection = Nothing
End Sub
' counter
Private Property Get Counter
Counter = Count
Count = Count + 1
End Property
' - data maluplation
' -- pair
Public Property Let Pair(p, v)
If IsNull(p) Then p = Counter
Collection(p) = v
End Property
Public Property Set Pair(p, v)
If IsNull(p) Then p = Counter
If TypeName(v) <> "jsCore" Then
Err.Raise &hD, "class: class", "Incompatible types: '" & TypeName(v) & "'"
End If
Set Collection(p) = v
End Property
Public Default Property Get Pair(p)
If IsNull(p) Then p = Count - 1
If IsObject(Collection(p)) Then
Set Pair = Collection(p)
Else
Pair = Collection(p)
End If
End Property
' -- pair
Public Sub Clean
Collection.RemoveAll
End Sub
Public Sub Remove(vProp)
Collection.Remove vProp
End Sub
' data maluplation
' encoding
Function jsEncode(str)
Dim charmap(127), haystack()
charmap(8) = "\b"
charmap(9) = "\t"
charmap(10) = "\n"
charmap(12) = "\f"
charmap(13) = "\r"
charmap(34) = "\"""
charmap(47) = "\/"
charmap(92) = "\\"
Dim strlen : strlen = Len(str) - 1
ReDim haystack(strlen)
Dim i, charcode
For i = 0 To strlen
haystack(i) = Mid(str, i + 1, 1)
charcode = AscW(haystack(i)) And 65535
If charcode < 127 Then
If Not IsEmpty(charmap(charcode)) Then
haystack(i) = charmap(charcode)
ElseIf charcode < 32 Then
haystack(i) = "\u" & Right("000" & Hex(charcode), 4)
End If
Else
haystack(i) = "\u" & Right("000" & Hex(charcode), 4)
End If
Next
jsEncode = Join(haystack, "")
End Function
' converting
Public Function toJSON(vPair)
Select Case VarType(vPair)
Case 0 ' Empty
toJSON = "null"
Case 1 ' Null
toJSON = "null"
Case 7 ' Date
' toJSON = "new Date(" & (vPair - CDate(25569)) * 86400000 & ")" ' let in only utc time
toJSON = """" & CStr(vPair) & """"
Case 8 ' String
toJSON = """" & CStr(vPair) & """"
Case 9 ' Object
Dim bFI,i
bFI = True
If vPair.Kind Then toJSON = toJSON & "[" Else toJSON = toJSON & "{"
For Each i In vPair.Collection
If bFI Then bFI = False Else toJSON = toJSON & ","
If vPair.Kind Then
toJSON = toJSON & toJSON(vPair(i))
Else
If QuotedVars Then
toJSON = toJSON & """" & i & """:" & toJSON(vPair(i))
Else
toJSON = toJSON & i & ":" & toJSON(vPair(i))
End If
End If
Next
If vPair.Kind Then toJSON = toJSON & "]" Else toJSON = toJSON & "}"
Case 11
If vPair Then toJSON = "true" Else toJSON = "false"
Case 12, 8192, 8204
toJSON = RenderArray(vPair, 1, "")
Case Else
toJSON = Replace(vPair, ",", ".")
End select
End Function
Function RenderArray(arr, depth, parent)
Dim first : first = LBound(arr, depth)
Dim last : last = UBound(arr, depth)
Dim index, rendered
Dim limiter : limiter = ","
RenderArray = "["
For index = first To last
If index = last Then
limiter = ""
End If
On Error Resume Next
rendered = RenderArray(arr, depth + 1, parent & index & "," )
If Err = 9 Then
On Error GoTo 0
RenderArray = RenderArray & toJSON(Eval("arr(" & parent & index & ")")) & limiter
Else
RenderArray = RenderArray & rendered & "" & limiter
End If
Next
RenderArray = RenderArray & "]"
End Function
Public Property Get jsString
jsString = toJSON(Me)
End Property
Sub Flush
If TypeName(Response) <> "Empty" Then
Response.Write(jsString)
ElseIf WScript <> Empty Then
WScript.Echo(jsString)
End If
End Sub
Public Function Clone
Set Clone = ColClone(Me)
End Function
Private Function ColClone(core)
Dim jsc, i
Set jsc = new jsCore
jsc.Kind = core.Kind
For Each i In core.Collection
If IsObject(core(i)) Then
Set jsc(i) = ColClone(core(i))
Else
jsc(i) = core(i)
End If
Next
Set ColClone = jsc
End Function
End Class
Function jsObject
Set jsObject = new jsCore
jsObject.Kind = JSON_OBJECT
End Function
Function jsArray
Set jsArray = new jsCore
jsArray.Kind = JSON_ARRAY
End Function
Function toJSON(val)
toJSON = (new jsCore).toJSON(val)
End Function
%>

29
Lib/JSON_UTIL_0.1.1.asp Normal file
View File

@@ -0,0 +1,29 @@
<%
Function QueryToJSON(dbc, sql)
Dim rs, jsa
Set rs = dbc.Execute(sql)
Set jsa = jsArray()
While Not (rs.EOF Or rs.BOF)
Set jsa(Null) = jsObject()
For Each col In rs.Fields
jsa(Null)(col.Name) = col.Value
Next
rs.MoveNext
Wend
Set QueryToJSON = jsa
End Function
Function RecordsetToJSON(ByVal rs)
Dim jsa,col
Set jsa = jsArray()
While Not (rs.EOF Or rs.BOF)
Set jsa(Null) = jsObject()
For Each col In rs.Fields
jsa(Null)(col.Name) = col.Value
Next
rs.MoveNext
Wend
Set RecordsetToJSON = jsa
End Function
%>

59
Lib/KRConfig.asp Normal file
View File

@@ -0,0 +1,59 @@
<% @Language='vbscript' codepage='65001'%>
<!--METADATA TYPE= "typelib" NAME= "ADODB Type Library" FILE="C:\Program Files\Common Files\SYSTEM\ADO\msado15.dll" -->
<%
Option Explicit
'Survey DB 설정
Dim SV_NAME,DB_NAME,UID,PWD
Dim SV_NAME1,DB_NAME1,UID1,PWD1
Dim DBconn
Dim SITENAME ' 사이트 URL
Dim LOGINURL ' 로그인 URL
Dim PROGRAMTITLE '페이지 타이틀
Dim MAIL_SV,MAIL_ID,MAIL_PW '메일 설정 자료
Dim SALT '암호화 도움키 *분실하거나 수정되면 안됨. - 비밀번호를 전부 재설정 해야함
Dim BASIC_COL '설문 데이터의 시스템 컬럼 갯수
Dim Local_IP : Local_IP = Request.ServerVariables("REMOTE_ADDR") '접속자 IP(사내용)
SITENAME = "http://10.10.13.115:9999"
LOGINURL = "http://10.10.13.115:9999/Login.html"
SALT = "kric2016cp$@"
PROGRAMTITLE = "온라인 설문지 제작 시스템"
BASIC_COL = 14
MAIL_SV = ""
MAIL_ID = ""
MAIL_PW = ""
'#######################################################################################
'DB 설정값 Read
'#######################################################################################
SV_NAME = "10.10.13.115"
DB_NAME= "capi"
UID = "sa"
PWD = "dudgus25"
SV_NAME1 = "10.10.13.115"
DB_NAME1= "krc_survey"
UID1 = "sa"
PWD1 = "dudgus25"
%>
<!-- #include Virtual = "/Lib/DBConn.asp" -->
<!-- #include Virtual = "/Lib/DBLib.asp" -->
<!-- #include Virtual = "/Lib/DBHelper.asp" -->
<!-- #include Virtual = "/Lib/CAPICOM.asp" -->
<!-- #include Virtual = "/Lib/Func.asp" -->
<!-- #include Virtual = "/Lib/SiteFunc.asp" -->
<!-- #include Virtual = "/Lib/ComLib.asp" -->
<!-- #include Virtual = "/Lib/FileLib.asp" -->
<!-- #include Virtual = "/Lib/XMLClass.asp" -->
<!-- #include Virtual = "/Lib/freeASPUpload.asp" -->
<!-- #include Virtual = "/Lib/sha256.asp" -->
<!-- #include Virtual = "/Lib/md5.asp" -->
<!-- #include Virtual = "/Lib/aspJSON1.17.asp" -->
<!-- #include Virtual = "/Lib/JSON_2.0.4.asp" -->
<!-- #include Virtual = "/Lib/JSON_UTIL_0.1.1.asp" -->

230
Lib/RSExec.asp Normal file
View File

@@ -0,0 +1,230 @@
<%
'=======================================================================
'업 무 명 : KRI-common
'모듈기능 : 서버 디비 연결자 설정
'파 일 명 : Create RecordSet object
' 사용할 페이지 에서 call
' 사용이 끝나면 객체 반환 call RSClose(RecordSet이름)
'작성일자 : 2004/10/09
'작 성 자 : 김홍완
'-----------------------------------------------------------------------
'변경일자 변경자 변동내역
'=======================================================================
'
'=======================================================================
'Response.Expires = -1
%>
<!-- #include file="DBSrv.asp" -->
<%
'===========================================================================
'함수명 : DBexec
'INPUT : sSQL(실행할 Query 문장), DBTarget(각 데이타베이스 디바이스 접근 설정)
'기능설명 : 단일 데이터 베이스 연결 객체 생성/실행
'===========================================================================
Function DBexec(sSQL,DBTarget)
Dim DBCon, DBTgt
On Error Resume Next
If LEN(sSQL) = 0 Then
if fncRequestVariables("LOCAL_ADDR")="10.10.13.82" then
Response.Write "<br><font size=2>에러스텝 1 : 실행할 SQL문을 입력하세요.</font><br>"
else
response.Redirect "/etc/error/error.asp?"
end if
response.end
Exit function
End If
Select Case DBTarget
Case "kon" : DBTgt = DBConKon '메인 DB
'Case "kon" : DBTgt = DBConKon '메인 DB Dev
Case "capi" : DBTgt = DBConCapi 'CAPI
Case "krc_urvey": DBTgt = DBConKrcSurvey 'KRC_Survey
Case "hmcgmc" : DBTgt = DBConHmcGmc 'DBConHmcGmc
Case Else
if fncRequestVariables("LOCAL_ADDR")="10.10.13.82" then
Response.Write "<br><font size=2>에러스텝 2 : 연결할 데이타베이스의 정확한 문자열을 입력하시오!</font><br>"
else
response.Redirect "/etc/error/error.asp"
end if
Response.End
End Select
'''response.write "<br>----------------"& DBTgt
Set DBCon=Server.CreateObject("ADODB.Connection") 'DB에 연결
DBCon.CursorLocation = 3 'client cursor
'DBCon.CursorLocation = adUseClient
DBCon.CommandTimeout = 0 ' select 쿼리 시간 무제한
DBCon.Open DBTgt
if Err.number <> 0 Then
if fncRequestVariables("LOCAL_ADDR")="10.10.13.82" then
response.write "<br><font size=2>에러스텝 3 : DB Open Error!! 데이터베이스를 정상적으로 연결하지 못하였습니다.</font><br>"
Response.Write "<br>" & sSql
else
response.Redirect "/etc/error/error.asp"
end if
Response.End
Exit Function
End If
Set DBexec = DBCon.Execute(sSQL)
dim sErr
If Err.number <> 0 Then
err_source = replace(Err.Source,"'","''")
err_description = replace(Err.description,"'","''")
err_number = replace(Err.Number,"'","''")
err_page = replace(fncRequestVariables("URL"),"'","''")
if fncRequestVariables("LOCAL_ADDR")="10.10.13.82" then
sErr = "<TABLE cellSpacing=1 cellPadding=1 width='80%' border=1 align=center>"
sErr = sErr & "<TR><TD width='12%' title='"&Err.description&"'><FONT SIZE=2>에러스텝 4</FONT></TD><TD><FONT SIZE=2>개체명이나 컬럼 혹은 인수값이 잘못되었습니다.</FONT></TD></TR>"
sErr = sErr & "<TR><TD ><FONT SIZE=2>오류객체명</FONT></TD><TD><FONT SIZE=2>"&Err.Source&"</FONT></TD></TR>"
sErr = sErr & "<TR><TD><FONT SIZE=2>오류설명</FONT></TD><TD><FONT SIZE=2>"&Err.description&"</FONT></TD></TR>"
sErr = sErr & "<TR><TD><FONT SIZE=2>오류번호</FONT></TD><TD><FONT SIZE=2>"&Err.Number&"</FONT></TD></TR>"
sErr = sErr & "<TR><TD><FONT SIZE=2>QUERY</FONT></TD><TD><FONT SIZE=2>"&sSQL&"</FONT></TD></TR>"
sErr = sErr & "<TR><TD><FONT SIZE=2>에러페이지</FONT></TD><TD><FONT SIZE=2>"&err_page&"</FONT></TD></TR>"
sErr = sErr & "<TR><TD><FONT SIZE=2>DB Target</FONT></TD><TD><FONT SIZE=2>"&DBTarget&"</FONT></TD></TR>"
sErr = sErr & "</TABLE>"
Response.Write sErr
call DBExecClose(DBcon)
else
response.Redirect "/etc/error/error.asp"
end if
Response.End
Exit Function
End If
End function
'===========================================================================
'함수명 : DBExecClose
'INPUT : DBCon
'기능설명 : 단일 데이터 베이스 연결 객체 소멸
'===========================================================================
Function DBExecClose(DBCon)
If IsObject(DBCon) = True Then
DBCon.Close
Set DBCon = Nothing
end if
End Function
'===========================================================================
'함수명 : RSexec
'INPUT : rsName(RecordSet객체를위한Instance 이름),pSize(PageSize 선택)
' cType : CursorType 설정
' 0 : AdOpenForwardOnly(MoveNext만 지원)
' 1 : AdOpenKeyset(변경 데이타는 볼 수 없음)
' 2 : AdOpenDynamic(모든 방식의 커서지원)
' 3 : AdOpenStatic(데이타 검색이나 레포트 생성시에 사용)
' sSQL(실행할 Query 문장),DBTarget(각 데이타베이스 디바이스 접근 설정)
'기능설명 : 레코드셋 객체 생성/실행
'===========================================================================
Function RSexec(rsName,pSize,cType,sSQL,DBTarget)
Dim globalDBCon, DBTgt
On Error Resume Next
If LEN(sSQL) = 0 Then
if fncRequestVariables("LOCAL_ADDR")="10.10.13.82" then
Response.Write "<br><font size=2>에러스텝 1 : 실행할 SQL문을 입력하세요.</font><br>"
else
response.Redirect "/etc/error/error.asp"
end if
response.end
Exit function
End If
Select Case DBTarget
Case "kon" : DBTgt = DBConKon '메인 DB
'Case "kon" : DBTgt = DBConKon '메인 DB Dev
Case "capi" : DBTgt = DBConCapi 'CAPI
Case "krc_urvey": DBTgt = DBConKrcSurvey 'KRC_Survey
'------------------------------------------------------------------------------------------------------
Case Else
if fncRequestVariables("LOCAL_ADDR")="10.10.13.82" then
Response.Write "<br><font size=2>에러스텝 2B : 연결할 데이타베이스의 정확한 문자열을 입력하시오!</font><br>"
else
response.Redirect "/etc/error/error.asp"
end if
Response.End
End Select
If IsObject(globalDBCon) = False Then
Set globalDBCon = Server.CreateObject("ADODB.Connection")
globalDBCon.CursorLocation = 3 'client cursor
'globalDBCon.CursorLocation = adUseClient
globalDBCon.CommandTimeout = 0 ' select 쿼리 시간 무제한
globalDBCon.Open DBTgt
if Err.number <> 0 Then
if fncRequestVariables("LOCAL_ADDR")="10.10.13.82" then
response.write "<br><font size=2>에러스텝 3 : DB Open Error!! 데이터베이스를 정상적으로 연결하지 못하였습니다.</font><br>"
Response.Write "<br>" & sSql
else
response.Redirect "/etc/error/error.asp"
end if
Response.End
Exit Function
End If
End If
Set rsName = Server.CreateObject("ADODB.RecordSet")
globalDBCon.CursorLocation = 3
RSName.Open sSQL, globalDBCon, Ctype
If Err.number <> 0 Then
err_source = replace(Err.Source,"'","''")
err_description = replace(Err.description,"'","''")
err_number = replace(Err.Number,"'","''")
err_page = replace(fncRequestVariables("URL"),"'","''")
if fncRequestVariables("LOCAL_ADDR")="10.10.13.82" then
sErr = "<TABLE cellSpacing=1 cellPadding=1 width='80%' border=1 align=center>"
sErr = sErr & "<TR><TD width='12%' title='"&Err.description&"'><FONT SIZE=2>에러스텝 4B</FONT></TD><TD><FONT SIZE=2>개체명이나 컬럼 혹은 인수값이 잘못되었습니다.</FONT></TD></TR>"
sErr = sErr & "<TR><TD ><FONT SIZE=2>오류객체명</FONT></TD><TD><FONT SIZE=2>"&Err.Source&"</FONT></TD></TR>"
sErr = sErr & "<TR><TD><FONT SIZE=2>오류설명</FONT></TD><TD><FONT SIZE=2>"&Err.description&"</FONT></TD></TR>"
sErr = sErr & "<TR><TD><FONT SIZE=2>오류번호</FONT></TD><TD><FONT SIZE=2>"&Err.Number&"</FONT></TD></TR>"
sErr = sErr & "<TR><TD><FONT SIZE=2>QUERY</FONT></TD><TD><FONT SIZE=2>"&sSQL&"</FONT></TD></TR>"
sErr = sErr & "<TR><TD><FONT SIZE=2>에러페이지</FONT></TD><TD><FONT SIZE=2>"&err_page&"</FONT></TD></TR>"
sErr = sErr & "</TABLE>"
Response.Write sErr
call RSclose(rsName)
else
response.Redirect "/etc/error/error.asp"
end if
Response.End
Exit Function
End If
End Function
'===========================================================================
'함수명 : RSClose
'INPUT : rsName
'기능설명 : 레코드셋 객체 소멸
'===========================================================================
Function RSClose(rsName)
Dim globalDBCon
if IsObject(rsName) = True Then
rsName.Close
Set rsName = Nothing
end if
If IsObject(globalDBCon) = True Then
globalDBCon.Close
Set globalDBCon = Nothing
End If
End Function
%>

189
Lib/SiteFunc.asp Normal file
View File

@@ -0,0 +1,189 @@
<%
'###########################################################################################
'로그인 여부 체크 함수
'return : void
'###########################################################################################
Function Login()
If Session("name")="" Or Session("team")="" Then
Response.Redirect "/logout.asp"
End If
End Function
Function Login_Ajax()
If Session("name")="" Or Session("team")="" Then
Login_Ajax = "timeout"
End If
End Function
'###########################################################################################
'로그아웃
'return : void
'###########################################################################################
Sub Logout()
Session("ID")=""
Session("userID")=""
Session("Grade")=""
Session("userName")=""
Session.Contents.RemoveAll()
Session.Abandon
End Sub
'###########################################################################################
'URL Redirect
'return : void
'###########################################################################################
Function call_Url(url,msg)
Response.Write "<html xmlns='http://www.w3.org/1999/xhtml'>" & vbCRLF
Response.Write "<head>" & vbCrLF
Response.Write "<title>" & PROGRAMTITLE & "</title>" & vbCrlf
Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />" & vbCrlf
Response.Write "</head>" & vbCrLF
Response.Write "<body></body>" & vbCrLF
Response.Write "<script src='//code.jquery.com/jquery-1.12.0.min.js'></script>" & vbCrLF
Response.Write "<script language='javascript'>" & vbCrlf
Response.Write "<!--" & vbCrlf
Response.Write " $(document).ready(function(){" & vbCrlf
if Trim(msg)<>"" Then
Response.Write " alert('" & trim(msg) & "');" & vbCrlf
end if
Response.Write " location.replace('" & trim(url) & "');" & vbCrlf
Response.Write " });" & vbCrlf
Response.Write "//-->" & vbCrlf
Response.Write "</script>" & vbCrlf
Response.Write "</html>"
End Function
'###########################################################################################
'URL Redirect
'return : void
'###########################################################################################
Function call_msg(msg)
Response.Write "<html xmlns='http://www.w3.org/1999/xhtml'>" & vbCRLF
Response.Write "<head>" & vbCrLF
Response.Write "<title>" & SurveyTitle & "</title>" & vbCrlf
Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />" & vbCrlf
Response.Write "</head>" & vbCrLF
Response.Write "<body></body>" & vbCrLF
Response.Write "<script src='//code.jquery.com/jquery-1.12.0.min.js'></script>" & vbCrLF
Response.Write "<script language='javascript'>" & vbCrlf
Response.Write "<!--" & vbCrlf
Response.Write " $(document).ready(function(){" & vbCrlf
if Trim(msg)<>"" Then
Response.Write " alert('" & trim(msg) & "');" & vbCrlf
end if
Response.Write " history.back();" & vbCrlf
Response.Write " });" & vbCrlf
Response.Write "//-->" & vbCrlf
Response.Write "</script>" & vbCrlf
Response.Write "</html>"
End Function
'TEST ID 생성'
Function RNDKEY(types)
Dim str, strlen, r, i, ds, serialCode '사용되는 변수를 선언
Dim IDKEY
str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" '랜덤으로 사용될 문자 또는 숫자
strlen = 8 '랜덤으로 출력될 값의 자릿수 ex)해당 구문에서 10자리의 랜덤 값 출력
Randomize '랜덤 초기화
For i = 1 To strlen '위에 선언된 strlen만큼 랜덤 코드 생성
r = Int((36 - 1 + 1) * Rnd + 1) ' 36은 str의 문자갯수
serialCode = serialCode + Mid(str,r,1)
Next
IDKEY = types & "_" & serialCode
RNDKEY = IDKEY
End Function
'###########################################################################################
'데이터맵 파일 생성
'return : void
'###########################################################################################
Function createDataMap(code)
Dim PSQL
Dim params(0)
Dim dbmapFile,mapStr,sourceStr
Dim jCnt,xCnt
Dim cVar,jsonObj
dbmapFile = "/Survey/Map/"&code&".map"
mapStr = getVariableQuery(code,"")
sourceStr = "[IDX],[IDKey],[Interviewer],[StartDate],[UpdateDate],[EndDate],[Page],[OutPage],[IPName],[ResType],"
WriteUTF_File dbmapFile,sourceStr & mapStr
Set jsonOBJ = Nothing
End Function
'###########################################################################################
'" 을 ˝ 로 변경해줌 ASP 파일 아웃풋을 위해 처리
'@resText : Text
'return : String
'###########################################################################################
Function ConverTextForASP(resText)
ConverTextForASP = Replace(resText,Chr(34),"˝")
End Function
Function ConvertHtmlQuot(resText)
resText = Replace(resText,"=" & Chr(34),"='")
resText = Replace(resText,Chr(34)&">","'>")
resText = Replace(resText,Chr(34)&" ","' ")
resText = Replace(resText,Chr(34)&Chr(34),"""")
resText = Replace(resText,Chr(34),"&quot;")
resText = Replace(resText,vbCRLF,"<br>")
ConvertHtmlQuot =resText
End Function
Function ReadUTF8File(sFileName)
Dim Stream, TextBuffer
Set Stream = Server.CreateObject("ADODB.Stream")
With Stream
.Charset = "utf-8"
.Type = 2 'adTypeText
.Open
.LoadFromFile sFileName
.Position = 0
ReadUTF8File = .ReadText
.Close
End With
Set Stream = Nothing
End Function
Function WriteUTF8File(sFileName, sText)
Dim Stream
Set Stream = Server.CreateObject("ADODB.Stream")
With Stream
.Charset = "utf-8"
.Type = 2 'adTypeText
.Open
.WriteText sText
.SaveToFile sFileName, 2 'adSaveCreateOverWrite
.Close
End With
Set Stream = Nothing
End Function
%>

217
Lib/XMLClass.asp Normal file
View File

@@ -0,0 +1,217 @@
<%
Class XMLClass
Private m_DOM,nodeRoot,nodeItem,nodeMessage,nodeError,nodeAct,nodeActRet
'생성자
Private Sub Class_Initialize
Set m_DOM = Server.CreateObject("Microsoft.XMLDOM")
m_DOM.async=true'"false"
End Sub
'소멸자
Private Sub Class_Terminate
Set m_DOM = Nothing
End Sub
'노드 갯수 알아내기
Public Property Get NodeCount()
Dim objRoot
If m_DOM.ParseError.ErrorCode=0 Then
Set objRoot = m_DOM.documentElement
NodeCount = objRoot.childNodes.Length
Else
NodeCount = -1
End IF
End Property
'해당 태그 값 가져오기 중복인 경우 Index 기준으로 가져옴
Public Property Get TagText(tagName,index)
Dim Nodes
If m_DOM.ParseError.ErrorCode=0 Then
Set Nodes = m_DOM.getElementsByTagName(tagName)
If VarType(Nodes)<>0 And VarType(Nodes)<>1 Then
If Nodes.Length>0 Then
TagText = Nodes(index).Text
Else
TagText = ""
End IF
Else
TagText = ""
End IF
Set Nodes = Nothing
Else
TagText = null
End IF
End Property
'해당 태그의 제일 처음 값을 가져옴
Public Property Get TagValue(tagName)
Dim tv
tv = TagText(tagName,0)
TagValue = Replace(Replace(tv,"<![CDATA[",""),"]]>","")
End Property
'해당 노드를 가져옴
Public Property Get Nodes(tagName)
Set Nodes = m_DOM.getElemnetsByTagName(tagName)
End Property
'노드에 값 변경하기
'중복된 TAG가 있는 경우 첫번째 값만 변한다
Public Sub SetValue(tagName,tagValue)
Dim tValue
If InStr(tagValue,">")>0 Or InStr(tagValue,"<")>0 Then
tValue = ConvertHTML(tagValue)
Else
tValue = tagValue
End IF
With m_DOM
Set nodeRoot = .DocumentElement
Set nodeItem = .getElementsByTagName(tagName)
If VarType(nodeItem)<>0 And VarType(nodeItem)<>1 And nodeItem.Length<>0 Then
nodeItem(0).Text = tValue
Else
Set nodeItem = nodeRoot.AppendChild(.CreateElement(tagName))
nodeItem.Text = tValue
End If
End With
End Sub
'다른 서버의 XML 파일을 읽어옴
Public Function LoadHTTP(url)
With m_DOM
.async = False
.setProperty "ServerHTTPRequest",True
LoadHTTP = .Load(url)
End With
End Function
'현재 서버의 XML 파일을 읽어옴
Public Function Load(file)
Load = LoadHDD(Server.MapPath(file))
End Function
'현재 서버의 XML 파일을 읽어옴
Public Function LoadHDD(file)
With m_DOM
.async = False
LoadHDD = .Load(file)
End With
End Function
'현재 서버에 해당 XML 파일을 저장
Public Function Save(file)
SaveHDD Server.MapPath(file)
End Function
Public Function SaveHDD(file)
With m_DOM
.async = False
.Save file
End With
End Function
'Tag가 들어가는 HTML 내용을 추가하는 경우
'변환해서 XML에 오류를 없애주는 경우
Private Function ConvertHTML(strTxt)
ConvertHTML = "<![CDATA[" & strTxt & "]]>"
End Function
'// 받은 쿼리 데이터를 XML 형식으로 변환
Public Function XmlQuery(Ar,Field)
Dim nodeTitle,nodeName,nodeValue
Dim key,title,value
Dim i,x
With m_DOM
.async = False
.appendChild(.createProcessingInstruction("xml","version=""1.0"" encoding=""utf-8"" "))
' 루트 생성
Set nodeRoot = .CreateElement("ITEMS")
.appendChild(nodeRoot)
If IsArray(Ar) Then
For i = 0 To UBound(Ar,2)
Set nodeItem = nodeRoot.AppendChild(.CreateElement("ITEM"))
x = 0
For Each key In Split(Field,",")
Set nodeName = nodeItem.AppendChild(.CreateElement(key))
value = Ar(x,i)
If Not IsNull(value) Then
nodeName.Text = .createCDATASection(value).text
End If
x = x + 1
Next
Next
End If
End With
End Function
'빈 XML 파일 만들기
Public Function CreateXML(Ar)
Dim nTitle,nName
Dim datas,iCnt,xCnt
Dim key
With m_DOM
.async = False
.appendChild(.createProcessingInstruction("xml","version=""1.0"" encoding=""utf-8"" "))
Set nodeRoot = .CreateElement("ITEMS")
.appendChild(nodeRoot)
If IsArray(Ar) Then
For iCnt=0 To UBound(Ar)
If VarType(Ar(iCnt))<>0 And VarType(Ar(iCnt))<>1 Then
Set NodeItem = nodeRoot.AppendChild(.CreateElement(Ar(iCnt)))
End IF
Next
Else
For Each key In Split(Ar,",")
Set NodeItem = nodeRoot.AppendChild(.CreateElement(key))
Next
End IF
End With
End Function
'// 모든 에러 메세지 출력
Public Function XmlError(ErrStr)
Dim textMessage,textError
textMessage = ""
With m_DOM
.async = False
.appendChild(.createProcessingInstruction("xml","version=""1.0"" encoding=""utf-8"" "))
Set nodeRoot = .AppendChild(objXml.CreateElement("root_data"))
Set nodeItem = nodeRoot.AppendChild(objXml.CreateElement("item"))
Set nodeMessage = nodeItem.AppendChild(objXml.CreateElement("message"))
Set nodeError = nodeItem.AppendChild(objXml.CreateElement("error"))
textMessage = "에러 발생" & ErrStr
textError = 1
nodeMessage.Text = .createCDATASection(textMessage).text
nodeError.Text = textError
End With
End Function
End Class
%>

263
Lib/aspJSON1.17.asp Normal file
View File

@@ -0,0 +1,263 @@
<%
'Februari 2014 - Version 1.17 by Gerrit van Kuipers
Class aspJSON
Public data
Private p_JSONstring
private aj_in_string, aj_in_escape, aj_i_tmp, aj_char_tmp, aj_s_tmp, aj_line_tmp, aj_line, aj_lines, aj_currentlevel, aj_currentkey, aj_currentvalue, aj_newlabel, aj_XmlHttp, aj_RegExp, aj_colonfound
Private Sub Class_Initialize()
Set data = Collection()
Set aj_RegExp = new regexp
aj_RegExp.Pattern = "\s{0,}(\S{1}[\s,\S]*\S{1})\s{0,}"
aj_RegExp.Global = False
aj_RegExp.IgnoreCase = True
aj_RegExp.Multiline = True
End Sub
Private Sub Class_Terminate()
Set data = Nothing
Set aj_RegExp = Nothing
End Sub
Public Sub loadJSON(inputsource)
inputsource = aj_MultilineTrim(inputsource)
If Len(inputsource) = 0 Then Err.Raise 1, "loadJSON Error", "No data to load."
select case Left(inputsource, 1)
case "{", "["
case else
Set aj_XmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
aj_XmlHttp.open "GET", inputsource, False
aj_XmlHttp.setRequestHeader "Content-Type", "text/json"
aj_XmlHttp.setRequestHeader "CharSet", "UTF-8"
aj_XmlHttp.Send
inputsource = aj_XmlHttp.responseText
set aj_XmlHttp = Nothing
end select
p_JSONstring = CleanUpJSONstring(inputsource)
aj_lines = Split(p_JSONstring, Chr(13) & Chr(10))
Dim level(99)
aj_currentlevel = 1
Set level(aj_currentlevel) = data
For Each aj_line In aj_lines
aj_currentkey = ""
aj_currentvalue = ""
If Instr(aj_line, ":") > 0 Then
aj_in_string = False
aj_in_escape = False
aj_colonfound = False
For aj_i_tmp = 1 To Len(aj_line)
If aj_in_escape Then
aj_in_escape = False
Else
Select Case Mid(aj_line, aj_i_tmp, 1)
Case """"
aj_in_string = Not aj_in_string
Case ":"
If Not aj_in_escape And Not aj_in_string Then
aj_currentkey = Left(aj_line, aj_i_tmp - 1)
aj_currentvalue = Mid(aj_line, aj_i_tmp + 1)
aj_colonfound = True
Exit For
End If
Case "\"
aj_in_escape = True
End Select
End If
Next
if aj_colonfound then
aj_currentkey = aj_Strip(aj_JSONDecode(aj_currentkey), """")
If Not level(aj_currentlevel).exists(aj_currentkey) Then level(aj_currentlevel).Add aj_currentkey, ""
end if
End If
If right(aj_line,1) = "{" Or right(aj_line,1) = "[" Then
If Len(aj_currentkey) = 0 Then aj_currentkey = level(aj_currentlevel).Count
Set level(aj_currentlevel).Item(aj_currentkey) = Collection()
Set level(aj_currentlevel + 1) = level(aj_currentlevel).Item(aj_currentkey)
aj_currentlevel = aj_currentlevel + 1
aj_currentkey = ""
ElseIf right(aj_line,1) = "}" Or right(aj_line,1) = "]" or right(aj_line,2) = "}," Or right(aj_line,2) = "]," Then
aj_currentlevel = aj_currentlevel - 1
ElseIf Len(Trim(aj_line)) > 0 Then
if Len(aj_currentvalue) = 0 Then aj_currentvalue = aj_line
aj_currentvalue = getJSONValue(aj_currentvalue)
If Len(aj_currentkey) = 0 Then aj_currentkey = level(aj_currentlevel).Count
level(aj_currentlevel).Item(aj_currentkey) = aj_currentvalue
End If
Next
End Sub
Public Function Collection()
set Collection = Server.CreateObject("Scripting.Dictionary")
End Function
Public Function AddToCollection(dictobj)
if TypeName(dictobj) <> "Dictionary" then Err.Raise 1, "AddToCollection Error", "Not a collection."
aj_newlabel = dictobj.Count
dictobj.Add aj_newlabel, Collection()
set AddToCollection = dictobj.item(aj_newlabel)
end function
Private Function CleanUpJSONstring(aj_originalstring)
aj_originalstring = Replace(aj_originalstring, Chr(13) & Chr(10), "")
aj_originalstring = Mid(aj_originalstring, 2, Len(aj_originalstring) - 2)
aj_in_string = False : aj_in_escape = False : aj_s_tmp = ""
For aj_i_tmp = 1 To Len(aj_originalstring)
aj_char_tmp = Mid(aj_originalstring, aj_i_tmp, 1)
If aj_in_escape Then
aj_in_escape = False
aj_s_tmp = aj_s_tmp & aj_char_tmp
Else
Select Case aj_char_tmp
Case "\" : aj_s_tmp = aj_s_tmp & aj_char_tmp : aj_in_escape = True
Case """" : aj_s_tmp = aj_s_tmp & aj_char_tmp : aj_in_string = Not aj_in_string
Case "{", "["
aj_s_tmp = aj_s_tmp & aj_char_tmp & aj_InlineIf(aj_in_string, "", Chr(13) & Chr(10))
Case "}", "]"
aj_s_tmp = aj_s_tmp & aj_InlineIf(aj_in_string, "", Chr(13) & Chr(10)) & aj_char_tmp
Case "," : aj_s_tmp = aj_s_tmp & aj_char_tmp & aj_InlineIf(aj_in_string, "", Chr(13) & Chr(10))
Case Else : aj_s_tmp = aj_s_tmp & aj_char_tmp
End Select
End If
'Response.Write aj_s_tmp & "<BR>"
Next
CleanUpJSONstring = ""
aj_s_tmp = split(aj_s_tmp, Chr(13) & Chr(10))
For Each aj_line_tmp In aj_s_tmp
aj_line_tmp = replace(replace(aj_line_tmp, chr(10), ""), chr(13), "")
CleanUpJSONstring = CleanUpJSONstring & aj_Trim(aj_line_tmp) & Chr(13) & Chr(10)
Next
End Function
Private Function getJSONValue(ByVal val)
val = Trim(val)
If Left(val,1) = ":" Then val = Mid(val, 2)
If Right(val,1) = "," Then val = Left(val, Len(val) - 1)
val = Trim(val)
Select Case val
Case "true" : getJSONValue = True
Case "false" : getJSONValue = False
Case "null" : getJSONValue = Null
Case Else
If (Instr(val, """") = 0) Then
If IsNumeric(val) Then
getJSONValue = CDbl(val)
Else
getJSONValue = val
End If
Else
If Left(val,1) = """" Then val = Mid(val, 2)
If Right(val,1) = """" Then val = Left(val, Len(val) - 1)
getJSONValue = aj_JSONDecode(Trim(val))
End If
End Select
End Function
Private JSONoutput_level
Public Function JSONoutput()
dim wrap_dicttype, aj_label
JSONoutput_level = 1
wrap_dicttype = "[]"
For Each aj_label In data
If Not aj_IsInt(aj_label) Then wrap_dicttype = "{}"
Next
JSONoutput = Left(wrap_dicttype, 1) & Chr(13) & Chr(10) & GetDict(data) & Right(wrap_dicttype, 1)
End Function
Private Function GetDict(objDict)
dim aj_item, aj_keyvals, aj_label, aj_dicttype
For Each aj_item In objDict
Select Case TypeName(objDict.Item(aj_item))
Case "Dictionary"
GetDict = GetDict & Space(JSONoutput_level * 4)
aj_dicttype = "[]"
For Each aj_label In objDict.Item(aj_item).Keys
If Not aj_IsInt(aj_label) Then aj_dicttype = "{}"
Next
If aj_IsInt(aj_item) Then
GetDict = GetDict & (Left(aj_dicttype,1) & Chr(13) & Chr(10))
Else
GetDict = GetDict & ("""" & aj_JSONEncode(aj_item) & """" & ": " & Left(aj_dicttype,1) & Chr(13) & Chr(10))
End If
JSONoutput_level = JSONoutput_level + 1
aj_keyvals = objDict.Keys
GetDict = GetDict & (GetSubDict(objDict.Item(aj_item)) & Space(JSONoutput_level * 4) & Right(aj_dicttype,1) & aj_InlineIf(aj_item = aj_keyvals(objDict.Count - 1),"" , ",") & Chr(13) & Chr(10))
Case Else
aj_keyvals = objDict.Keys
GetDict = GetDict & (Space(JSONoutput_level * 4) & aj_InlineIf(aj_IsInt(aj_item), "", """" & aj_JSONEncode(aj_item) & """: ") & WriteValue(objDict.Item(aj_item)) & aj_InlineIf(aj_item = aj_keyvals(objDict.Count - 1),"" , ",") & Chr(13) & Chr(10))
End Select
Next
End Function
Private Function aj_IsInt(val)
aj_IsInt = (TypeName(val) = "Integer" Or TypeName(val) = "Long")
End Function
Private Function GetSubDict(objSubDict)
GetSubDict = GetDict(objSubDict)
JSONoutput_level= JSONoutput_level -1
End Function
Private Function WriteValue(ByVal val)
Select Case TypeName(val)
Case "Double", "Integer", "Long": WriteValue = val
Case "Null" : WriteValue = "null"
Case "Boolean" : WriteValue = aj_InlineIf(val, "true", "false")
Case Else : WriteValue = """" & aj_JSONEncode(val) & """"
End Select
End Function
Private Function aj_JSONEncode(ByVal val)
val = Replace(val, "\", "\\")
val = Replace(val, """", "\""")
'val = Replace(val, "/", "\/")
val = Replace(val, Chr(8), "\b")
val = Replace(val, Chr(12), "\f")
val = Replace(val, Chr(10), "\n")
val = Replace(val, Chr(13), "\r")
val = Replace(val, Chr(9), "\t")
aj_JSONEncode = Trim(val)
End Function
Private Function aj_JSONDecode(ByVal val)
val = Replace(val, "\""", """")
val = Replace(val, "\\", "\")
val = Replace(val, "\/", "/")
val = Replace(val, "\b", Chr(8))
val = Replace(val, "\f", Chr(12))
val = Replace(val, "\n", Chr(10))
val = Replace(val, "\r", Chr(13))
val = Replace(val, "\t", Chr(9))
aj_JSONDecode = Trim(val)
End Function
Private Function aj_InlineIf(condition, returntrue, returnfalse)
If condition Then aj_InlineIf = returntrue Else aj_InlineIf = returnfalse
End Function
Private Function aj_Strip(ByVal val, stripper)
If Left(val, 1) = stripper Then val = Mid(val, 2)
If Right(val, 1) = stripper Then val = Left(val, Len(val) - 1)
aj_Strip = val
End Function
Private Function aj_MultilineTrim(TextData)
aj_MultilineTrim = aj_RegExp.Replace(TextData, "$1")
End Function
private function aj_Trim(val)
aj_Trim = Trim(val)
Do While Left(aj_Trim, 1) = Chr(9) : aj_Trim = Mid(aj_Trim, 2) : Loop
Do While Right(aj_Trim, 1) = Chr(9) : aj_Trim = Left(aj_Trim, Len(aj_Trim) - 1) : Loop
aj_Trim = Trim(aj_Trim)
end function
End Class
%>

412
Lib/freeASPUpload.asp Normal file
View File

@@ -0,0 +1,412 @@
<%
' For examples, documentation, and your own free copy, go to:
' http://www.freeaspupload.net
' Note: You can copy and use this script for free and you can make changes
' to the code, but you cannot remove the above comment.
'Changes:
'Aug 2, 2005: Add support for checkboxes and other input elements with multiple values
'Jan 6, 2009: Lars added ASP_CHUNK_SIZE
'Sep 3, 2010: Enforce UTF-8 everywhere; new function to convert byte array to unicode string
'const DEFAULT_ASP_CHUNK_SIZE = 200000
'const adModeReadWrite = 3
'const adTypeBinary = 1
'const adTypeText = 2
'const adSaveCreateOverWrite = 2
Class FreeASPUpload
Public UploadedFiles
Public FormElements
Private VarArrayBinRequest
Private StreamRequest
Private uploadedYet
Private internalChunkSize
Private adModeReadWrite
Private adTypeBinary
Private adTypeText
Private adSaveCreateOverWrite
Private Sub Class_Initialize()
Set UploadedFiles = Server.CreateObject("Scripting.Dictionary")
Set FormElements = Server.CreateObject("Scripting.Dictionary")
Set StreamRequest = Server.CreateObject("ADODB.Stream")
StreamRequest.Type = 2'adTypeText
StreamRequest.Open
uploadedYet = false
internalChunkSize = 304857600
adModeReadWrite = 3
adTypeBinary = 1
adTypeText = 2
adSaveCreateOverWrite = 2
End Sub
Private Sub Class_Terminate()
If IsObject(UploadedFiles) Then
UploadedFiles.RemoveAll()
Set UploadedFiles = Nothing
End If
If IsObject(FormElements) Then
FormElements.RemoveAll()
Set FormElements = Nothing
End If
StreamRequest.Close
Set StreamRequest = Nothing
End Sub
Public Property Get Form(sIndex)
Form = ""
If FormElements.Exists(LCase(sIndex)) Then Form = FormElements.Item(LCase(sIndex))
End Property
Public Property Get Files()
Files = UploadedFiles.Items
End Property
Public Property Get Exists(sIndex)
Exists = false
If FormElements.Exists(LCase(sIndex)) Then Exists = true
End Property
Public Property Get FileExists(sIndex)
FileExists = false
if UploadedFiles.Exists(LCase(sIndex)) then FileExists = true
End Property
Public Property Get chunkSize()
chunkSize = internalChunkSize
End Property
Public Property Let chunkSize(sz)
internalChunkSize = sz
End Property
'Calls Upload to extract the data from the binary request and then saves the uploaded files
Public Sub Save(path)
Dim streamFile, fileItem, filePath
if Right(path, 1) <> "\" then path = path & "\"
if not uploadedYet then Upload
For Each fileItem In UploadedFiles.Items
filePath = path & fileItem.FileName
Set streamFile = Server.CreateObject("ADODB.Stream")
streamFile.Type = adTypeBinary
streamFile.Open
StreamRequest.Position=fileItem.Start
StreamRequest.CopyTo streamFile, fileItem.Length
streamFile.SaveToFile filePath, adSaveCreateOverWrite
streamFile.close
Set streamFile = Nothing
fileItem.Path = filePath
Next
End Sub
public sub SaveOne(path, num, byref outFileName, byref outLocalFileName)
Dim streamFile, fileItems, fileItem, fs
set fs = Server.CreateObject("Scripting.FileSystemObject")
if Right(path, 1) <> "\" then path = path & "\"
if not uploadedYet then Upload
if UploadedFiles.Count > 0 then
fileItems = UploadedFiles.Items
set fileItem = fileItems(num)
outFileName = fileItem.FileName
outLocalFileName = GetFileName(path, outFileName)
Set streamFile = Server.CreateObject("ADODB.Stream")
streamFile.Type = adTypeBinary
streamFile.Open
StreamRequest.Position = fileItem.Start
StreamRequest.CopyTo streamFile, fileItem.Length
streamFile.SaveToFile path & outLocalFileName, adSaveCreateOverWrite
streamFile.close
Set streamFile = Nothing
fileItem.Path = path & filename
end if
end sub
Public Function SaveBinRequest(path) ' For debugging purposes
StreamRequest.SaveToFile path & "\debugStream.bin", 2
End Function
Public Sub DumpData() 'only works if files are plain text
Dim i, aKeys, f
response.write "Form Items:<br>"
aKeys = FormElements.Keys
For i = 0 To FormElements.Count -1 ' Iterate the array
response.write aKeys(i) & " = " & FormElements.Item(aKeys(i)) & "<BR>"
Next
response.write "Uploaded Files:<br>"
For Each f In UploadedFiles.Items
response.write "Name: " & f.FileName & "<br>"
response.write "Type: " & f.ContentType & "<br>"
response.write "Start: " & f.Start & "<br>"
response.write "Size: " & f.Length & "<br>"
Next
End Sub
Public Sub Upload()
Dim nCurPos, nDataBoundPos, nLastSepPos
Dim nPosFile, nPosBound
Dim sFieldName, osPathSep, auxStr
Dim readBytes, readLoop, tmpBinRequest
'RFC1867 Tokens
Dim vDataSep
Dim tNewLine, tDoubleQuotes, tTerm, tFilename, tName, tContentDisp, tContentType
tNewLine = String2Byte(Chr(13))
tDoubleQuotes = String2Byte(Chr(34))
tTerm = String2Byte("--")
tFilename = String2Byte("filename=""")
tName = String2Byte("name=""")
tContentDisp = String2Byte("Content-Disposition")
tContentType = String2Byte("Content-Type:")
uploadedYet = true
on error resume next
' Copy binary request to a byte array, on which functions like InstrB and others can be used to search for separation tokens
readBytes = internalChunkSize
VarArrayBinRequest = Request.BinaryRead(readBytes)
VarArrayBinRequest = midb(VarArrayBinRequest, 1, lenb(VarArrayBinRequest))
Do Until readBytes < 1
tmpBinRequest = Request.BinaryRead(readBytes)
if readBytes > 0 then
VarArrayBinRequest = VarArrayBinRequest & midb(tmpBinRequest, 1, lenb(tmpBinRequest))
end if
Loop
StreamRequest.WriteText(VarArrayBinRequest)
StreamRequest.Flush()
if Err.Number <> 0 then
response.write "<br><br><B>System reported this error:</B><p>"
response.write Err.Description & "<p>"
response.write "The most likely cause for this error is the incorrect setup of AspMaxRequestEntityAllowed in IIS MetaBase. Please see instructions in the <A HREF='http://www.freeaspupload.net/freeaspupload/requirements.asp'>requirements page of freeaspupload.net</A>.<p>"
Exit Sub
end if
on error goto 0 'reset error handling
nCurPos = FindToken(tNewLine,1) 'Note: nCurPos is 1-based (and so is InstrB, MidB, etc)
If nCurPos <= 1 Then Exit Sub
'vDataSep is a separator like -----------------------------21763138716045
vDataSep = MidB(VarArrayBinRequest, 1, nCurPos-1)
'Start of current separator
nDataBoundPos = 1
'Beginning of last line
nLastSepPos = FindToken(vDataSep & tTerm, 1)
Do Until nDataBoundPos = nLastSepPos
nCurPos = SkipToken(tContentDisp, nDataBoundPos)
nCurPos = SkipToken(tName, nCurPos)
sFieldName = ExtractField(tDoubleQuotes, nCurPos)
nPosFile = FindToken(tFilename, nCurPos)
nPosBound = FindToken(vDataSep, nCurPos)
If nPosFile <> 0 And nPosFile < nPosBound Then
Dim oUploadFile
Set oUploadFile = New UploadedFile
nCurPos = SkipToken(tFilename, nCurPos)
auxStr = ExtractField(tDoubleQuotes, nCurPos)
' We are interested only in the name of the file, not the whole path
' Path separator is \ in windows, / in UNIX
' While IE seems to put the whole pathname in the stream, Mozilla seem to
' only put the actual file name, so UNIX paths may be rare. But not impossible.
osPathSep = "\"
if InStr(auxStr, osPathSep) = 0 then osPathSep = "/"
oUploadFile.FileName = Right(auxStr, Len(auxStr)-InStrRev(auxStr, osPathSep))
if (Len(oUploadFile.FileName) > 0) then 'File field not left empty
nCurPos = SkipToken(tContentType, nCurPos)
auxStr = ExtractField(tNewLine, nCurPos)
' NN on UNIX puts things like this in the stream:
' ?? python py type=?? python application/x-python
oUploadFile.ContentType = Right(auxStr, Len(auxStr)-InStrRev(auxStr, " "))
nCurPos = FindToken(tNewLine, nCurPos) + 4 'skip empty line
oUploadFile.Start = nCurPos+1
oUploadFile.Length = FindToken(vDataSep, nCurPos) - 2 - nCurPos
If oUploadFile.Length > 0 Then UploadedFiles.Add LCase(sFieldName), oUploadFile
End If
Else
Dim nEndOfData, fieldValueUniStr
nCurPos = FindToken(tNewLine, nCurPos) + 4 'skip empty line
nEndOfData = FindToken(vDataSep, nCurPos) - 2
fieldValueuniStr = ConvertUtf8BytesToString(nCurPos, nEndOfData-nCurPos)
If Not FormElements.Exists(LCase(sFieldName)) Then
FormElements.Add LCase(sFieldName), fieldValueuniStr
else
FormElements.Item(LCase(sFieldName))= FormElements.Item(LCase(sFieldName)) & ", " & fieldValueuniStr
end if
End If
'Advance to next separator
nDataBoundPos = FindToken(vDataSep, nCurPos)
Loop
End Sub
Private Function SkipToken(sToken, nStart)
SkipToken = InstrB(nStart, VarArrayBinRequest, sToken)
If SkipToken = 0 then
Response.write "Error in parsing uploaded binary request. The most likely cause for this error is the incorrect setup of AspMaxRequestEntityAllowed in IIS MetaBase. Please see instructions in the <A HREF='http://www.freeaspupload.net/freeaspupload/requirements.asp'>requirements page of freeaspupload.net</A>.<p>"
Response.End
end if
SkipToken = SkipToken + LenB(sToken)
End Function
Private Function FindToken(sToken, nStart)
FindToken = InstrB(nStart, VarArrayBinRequest, sToken)
End Function
Private Function ExtractField(sToken, nStart)
Dim nEnd
nEnd = InstrB(nStart, VarArrayBinRequest, sToken)
If nEnd = 0 then
Response.write "Error in parsing uploaded binary request."
Response.End
end if
ExtractField = ConvertUtf8BytesToString(nStart, nEnd-nStart)
End Function
'String to byte string conversion
Private Function String2Byte(sString)
Dim i
For i = 1 to Len(sString)
String2Byte = String2Byte & ChrB(AscB(Mid(sString,i,1)))
Next
End Function
Private Function ConvertUtf8BytesToString(start, length)
StreamRequest.Position = 0
Dim objStream
Dim strTmp
' init stream
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Charset = "utf-8"
objStream.Mode = adModeReadWrite
objStream.Type = adTypeBinary
objStream.Open
' write bytes into stream
StreamRequest.Position = start+1
StreamRequest.CopyTo objStream, length
objStream.Flush
' rewind stream and read text
objStream.Position = 0
objStream.Type = adTypeText
strTmp = objStream.ReadText
' close up and return
objStream.Close
Set objStream = Nothing
ConvertUtf8BytesToString = strTmp
End Function
End Class
Class UploadedFile
Public ContentType
Public Start
Public Length
Public Path
Private nameOfFile
' Need to remove characters that are valid in UNIX, but not in Windows
Public Property Let FileName(fN)
nameOfFile = fN
nameOfFile = SubstNoReg(nameOfFile, "\", "_")
nameOfFile = SubstNoReg(nameOfFile, "/", "_")
nameOfFile = SubstNoReg(nameOfFile, ":", "_")
nameOfFile = SubstNoReg(nameOfFile, "*", "_")
nameOfFile = SubstNoReg(nameOfFile, "?", "_")
nameOfFile = SubstNoReg(nameOfFile, """", "_")
nameOfFile = SubstNoReg(nameOfFile, "<", "_")
nameOfFile = SubstNoReg(nameOfFile, ">", "_")
nameOfFile = SubstNoReg(nameOfFile, "|", "_")
End Property
Public Property Get FileName()
FileName = nameOfFile
End Property
'Public Property Get FileN()ame
End Class
' Does not depend on RegEx, which is not available on older VBScript
' Is not recursive, which means it will not run out of stack space
Function SubstNoReg(initialStr, oldStr, newStr)
Dim currentPos, oldStrPos, skip
If IsNull(initialStr) Or Len(initialStr) = 0 Then
SubstNoReg = ""
ElseIf IsNull(oldStr) Or Len(oldStr) = 0 Then
SubstNoReg = initialStr
Else
If IsNull(newStr) Then newStr = ""
currentPos = 1
oldStrPos = 0
SubstNoReg = ""
skip = Len(oldStr)
Do While currentPos <= Len(initialStr)
oldStrPos = InStr(currentPos, initialStr, oldStr)
If oldStrPos = 0 Then
SubstNoReg = SubstNoReg & Mid(initialStr, currentPos, Len(initialStr) - currentPos + 1)
currentPos = Len(initialStr) + 1
Else
SubstNoReg = SubstNoReg & Mid(initialStr, currentPos, oldStrPos - currentPos) & newStr
currentPos = oldStrPos + skip
End If
Loop
End If
End Function
Function GetFileName(strSaveToPath, FileName)
'This function is used when saving a file to check there is not already a file with the same name so that you don't overwrite it.
'It adds numbers to the filename e.g. file.gif becomes file1.gif becomes file2.gif and so on.
'It keeps going until it returns a filename that does not exist.
'You could just create a filename from the ID field but that means writing the record - and it still might exist!
'N.B. Requires strSaveToPath variable to be available - and containing the path to save to
Dim Counter
Dim Flag
Dim strTempFileName
Dim FileExt
Dim NewFullPath
dim objFSO, p
Set objFSO = CreateObject("Scripting.FileSystemObject")
Counter = 0
p = instrrev(FileName, ".")
FileExt = mid(FileName, p+1)
strTempFileName = left(FileName, p-1)
NewFullPath = strSaveToPath & "\" & FileName
Flag = False
Do Until Flag = True
If objFSO.FileExists(NewFullPath) = False Then
Flag = True
GetFileName = Mid(NewFullPath, InstrRev(NewFullPath, "\") + 1)
Else
Counter = Counter + 1
NewFullPath = strSaveToPath & "\" & strTempFileName & Counter & "." & FileExt
End If
Loop
End Function
%>

539
Lib/func.asp Normal file
View File

@@ -0,0 +1,539 @@
<%
'=======================================================================
'업 무 명 : K-ON common
'모듈기능 : 공통 함수 정의
'파 일 명 : Func.asp
'작성일자 : 2020-08-24
'작 성 자 : 김홍완
'-----------------------------------------------------------------------
'변경일자 변경자 변동내역
'=======================================================================
'2020-08-24 김홍완 date_db(), date_time() 추가
'=======================================================================
'Response.Expires = -1
%>
<%
'//-- date_db(), date_time()
dim v_datetime, v_day, v_hour, v_minute, v_month, v_second, v_year, mLen, dLen
'###########################################################################################
'URL Redirect
'###########################################################################################
Function call_Url(url,msg)
Response.Write "<html xmlns='http://www.w3.org/1999/xhtml'>" & vbCRLF
Response.Write "<head>" & vbCrLF
Response.Write "<title></title>" & vbCrlf
Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />" & vbCrlf
Response.Write "</head>" & vbCrLF
Response.Write "<script language='javascript'>" & vbCrlf
Response.Write "<!--" & vbCrlf
if Trim(msg)<>"" Then
Response.Write " alert('" & trim(msg) & "');" & vbCrlf
end if
Response.Write " location.replace('" & trim(url) & "');" & vbCrlf
Response.Write "//-->" & vbCrlf
Response.Write "</script>" & vbCrlf
Response.Write "</html>"
End Function
Function LoadSkin(fnName)
Dim objStream
Set objStream = CreateObject("ADODB.Stream")
With objStream
.Charset = "utf-8"
.Type=2
.mode=3
.Open
.loadfromfile Server.Mappath(fnName)
LoadSkin=.readtext
.Close
End With
Set objStream = Nothing
End Function
'###########################################################################################
'메일 발송
'###########################################################################################
Function MailSend(FromStr,ToStr,Subject,BodyStr)
Dim objMail,iConf
Set objMail=server.CreateObject("CDO.Message")
Set iConf = objMail.Configuration
With iConf.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =MAIL_SV
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =25
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") =1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") =MAIL_ID
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") =MAIL_PW
.Update
End with
objMail.To = ToStr
objMail.From = FromStr
objmail.Subject = Subject
objmail.htmlBody = BodyStr
objMail.BodyPart.Charset="utf-8"
objMail.Send
Set objMail = Nothing
End Function
'###########################################################################################
'CDO 메일 발송
'###########################################################################################
Function CMailSend(FromStr,ToStr,Subject,BodyStr)
Dim objMail,iConf
Set objMail=server.CreateObject("CDO.Message")
Set iConf = objMail.Configuration
With iConf.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="localhost"
.item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\inetpub\mailroot\pickup"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =25
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
.Update
End with
objMail.To = ToStr
objMail.From = FromStr
objmail.Subject = Subject
objmail.htmlBody = BodyStr
objMail.BodyPart.Charset="utf-8"
objMail.Send
Set objMail = Nothing
End Function
'###########################################################################################
'랜덤 난수 발생
'###########################################################################################
Function RandomNum(start,limit)
Dim Val,MyValue
if Not IsNumeric(start) Or Not IsNumeric(limit) then
RandomNum = 0
Exit Function
end if
Randomize
MyValue = Int(limit * Rnd) + start
RandomNum=MyValue
End Function
'###########################################################################################
'에러 메일 발송
'###########################################################################################
Private Sub ErrorMail(er)
Dim ErrBody
ErrBody = LoadSkin("./SKIN/Error.htm")
ErrBody = Replace(ErrBody,"##PROJECTTITLE##",SURVEYTITLE)
ErrBody = Replace(ErrBody,"##PROJECTCODE##",PROJECTCODE)
ErrBody = Replace(ErrBody,"##PAGE##",Request.Form("PageName"))
ErrBody = Replace(ErrBody,"##ERKEY##",Request.Form("IDKey"))
ErrBody = Replace(ErrBody,"##CODE##",er.Description)
ErrBody = Replace(ErrBody,"##NUMBER##",er.Number)
MailSend "system@survey.kr","wmkim@trendmr.com;ehlee@trendmr.com;" & ERROREMAIL ,"Error Message",ErrBody
End Sub
'###########################################################################################
'makeItem
'###########################################################################################
'사용방법
'Call QuestionMultiCNT(VARS,CODES,QUESTION,3,2,HTMLSCRIPT,JSCRIPT)
'HTMLSCRIPT = Replace(HTMLSCRIPT,"[$_STITEM_$]",makeItem("Front_1_A.jpg,Front_1_B.jpg,Front_1_C.jpg,Front_1_D.jpg",getXValue("MQ1"),"LIKE"))
Function makeItem(IMAGES,SELNUM,TEXT)
Dim TableBody,ImageArray,tCount,Twidth
TableBody = ""
ImageArray = Split(IMAGES,",")
TWidth = FormatNumber(CDbl(100/(UBound(ImageArray)+1)),2)
TableBody = TableBody & "<table id='V_table' class='attab01' cellpadding='0' cellspacing='0' border='0'>" & vbCrLF
TableBody = TableBody & "<colgroup>" & vbCrLF
For tCount=0 To UBound(ImageArray)
TableBody = TableBody & " <col width="""&TWidth&"%""/>" & vbCrLF
Next
TableBody = TableBody & "</colgroup>" & vbCrLF
TableBody = TableBody & "<tr>" & vbCrLF
For tCount=0 To UBound(ImageArray)
TableBody = TableBody & "<th style='text-align:center;background:#fff;'>"&vbCrLF
TableBody = TableBody & " <img src=""./media/"&ImageArray(tCount)&""" alt=''/>"&vbCrLF
TableBody = TableBody & "</th>"&vbCrLF
Next
TableBody = TableBody & "</tr>" & vbCrLF
TableBody = TableBody & "<tr>" & vbCrLF
For tCount=0 To UBound(ImageArray)
TableBody = TableBody & "<td style='text-align:center;background:#fff;'>"&vbCrLF
If (tCount+1)=CInt(SELNUM) Then
TableBody = TableBody & " <b><font color='red'>" & TEXT & "</font></b>"&vbCrLF
Else
TableBody = TableBody & "&nbsp;" & vbCrLF
End IF
TableBody = TableBody & "</td>"&vbCrLF
Next
TableBody = TableBody & "</tr>" & vbCrLF
TableBody = TableBody & "</table>"&vbCrLF
makeItem = TableBody
End Function
Function makeItem2(IMAGES,SELNUM,TEXT,COL)
Dim TableBody,ImageArray,tCount,Twidth
Dim EStr,DStr,XStr,mxCOL,colCnt
mxCOL = CLng(COL)
colCnt=1
TableBody = ""
ImageArray = Split(IMAGES,",")
TWidth = FormatNumber(CDbl(100/CLng(COL)),2)
TableBody = TableBody & "<table id='V_table' class='attab01' cellpadding='0' cellspacing='0' border='0'>" & vbCrLF
TableBody = TableBody & "<colgroup>" & vbCrLF
For tCount=1 To CLng(COL)
TableBody = TableBody & " <col width="""&TWidth&"%""/>" & vbCrLF
Next
TableBody = TableBody & "</colgroup>" & vbCrLF
' TableBody = TableBody & "<tr>" & vbCrLF
DStr = ""
EStr = ""
For tCount=0 To UBound(ImageArray)
EStr = EStr & "<th style='text-align:center;background:#fff;'>"&vbCrLF
EStr = EStr & " <img src=""./media/"&ImageArray(tCount)&""" alt=''/>"&vbCrLF
EStr = EStr & "</th>"&vbCrLF
DStr = DStr & "<td style='text-align:center;background:#fff;'>"&vbCrLF
If (tCount+1)=CInt(SELNUM) Then
DStr = DStr & " <b><font color='red'>" & TEXT & "</font></b>"&vbCrLF
Else
DStr = DStr & "&nbsp;" & vbCrLF
End IF
DStr = DStr & "</td>"&vbCrLF
If colCnt=mxCOL Then
XSTR = XSTR & " <tr>" & vbCRLF
XSTR = XSTR & EStr
XSTR = XSTR & " </tr>" & vbCRLF
XSTR = XSTR & " <tr>" & vbCRLF
XSTR = XSTR & DStr
XSTR = XSTR & " </tr>" & vbCRLF
ESTR = ""
DSTR = ""
colCnt=1
Else
colCnt=colCnt+1
End If
Next
If ESTR<>"" AND DSTR<>"" Then
XSTR = XSTR & " <tr>" & vbCRLF
XSTR = XSTR & EStr & DSTR
XSTR = XSTR & " </tr>" & vbCRLF
End If
TableBody = TableBody & XStr
TableBody = TableBody & "<tr>" & vbCrLF
For tCount=0 To UBound(ImageArray)
Next
' TableBody = TableBody & "</tr>" & vbCrLF
TableBody = TableBody & "</table>"&vbCrLF
makeItem2 = TableBody
End Function
'##############################################################################
'#http:체크
'##############################################################################
Function checkHTTP(linkStr)
If Left(linkStr,7)="http://" Then
checkHTTP = linkStr
Else
checkHTTP = "http://" & linkStr
End If
End Function
'###########################################################################################
'DB 날짜 형식대로 ASP로 출력하기
'###########################################################################################
Function ConvertDBDate(dates)
Dim yy,mm,dd,hh,mi,se
yy = year(dates)
mm = right("0" & month(dates),2)
dd = right("0" & day(dates),2)
hh = right("0" & hour(dates),2)
mi = right("0" & minute(dates),2)
se = right("0" & second(dates),2)
ConvertDBDate = yy & "-" & mm & "-" & dd & " " & hh & ":" & mi & ":" & se
End Function
'###########################################################################################
'ADODB Recordset to CSV
'###########################################################################################
Sub Write_CSV_From_Recordset(RS)
'
' Export Recordset to CSV
' http://salman-w.blogspot.com/2009/07/export-recordset-data-to-csv-using.html
'
' This sub-routine Response.Writes the content of an ADODB.RECORDSET in CSV format
' The function closely follows the recommendations described in RFC 4180:
' Common Format and MIME Type for Comma-Separated Values (CSV) Files
' http://tools.ietf.org/html/rfc4180
'
' @RS: A reference to an open ADODB.RECORDSET object
'
if RS.EOF then
'
' There is no data to be written
'
exit sub
end if
dim RX
set RX = new RegExp
RX.Pattern = "\r|\n|,|"""
dim i
dim Field
dim Separator
'
' Writing the header row (header row contains field names)
'
Separator = ""
for i = 0 to RS.Fields.Count - 1
Field = RS.Fields(i).Name
if RX.Test(Field) then
'
' According to recommendations:
' - Fields that contain CR/LF, Comma or Double-quote should be enclosed in double-quotes
' - Double-quote itself must be escaped by preceeding with another double-quote
'
Field = """" & Replace(Field, """", """""") & """"
end if
Response.Write Separator & Field
Separator = ","
next
Response.Write vbNewLine
'
' Writing the data rows
'
do until RS.EOF
Separator = ""
for i = 0 to RS.Fields.Count - 1
'
' Note the concatenation with empty string below
' This assures that NULL values are converted to empty string
'
Field = RS.Fields(i).Value & ""
if RX.Test(Field) then
Field = """" & Replace(Field, """", """""") & """"
Field = Replace(Field,vbCrLF," ")
end If
If isNumeric(Field) Then
'Response.Write Separator & Chr(34) & "'" & Field & Chr(34)
Response.Write Separator & Chr(34) & Field & Chr(34)
Else
Response.Write Separator & Chr(34) & Field & Chr(34)
End IF
Separator = ","
next
Response.Write vbNewLine
RS.MoveNext
loop
End Sub
Function URLDecode(Expression)
Dim strSource, strTemp, strResult, strchr
Dim lngPos, AddNum, IFKor
strSource = Replace(Expression, "+", " ")
For lngPos = 1 To Len(strSource)
AddNum = 2
strTemp = Mid(strSource, lngPos, 1)
If strTemp = "%" Then
If lngPos + AddNum < Len(strSource) + 1 Then
strchr = CInt("&H" & Mid(strSource, lngPos + 1, AddNum))
If strchr > 130 Then
AddNum = 5
IFKor = Mid(strSource, lngPos + 1, AddNum)
IFKor = Replace(IFKor, "%", "")
strchr = CInt("&H" & IFKor )
End If
strResult = strResult & Chr(strchr)
lngPos = lngPos + AddNum
End If
Else
strResult = strResult & strTemp
End If
Next
URLDecode = strResult
End Function
'======================================================
' 사용할때,, getRefererPage 함수를 호출하면 이전 페이지 이름만 리턴합니다.
' Response.Write("refererValue : " & getRefererPage & "<br>")
'======================================================
Function getRefererPage
Dim refererValue, chkPos
' 호출한 페이지값을 받습니다.
refererValue = Request.ServerVariables("HTTP_REFERER")
' 호출한 페이지 값이 없을 경우
IF Len(refererValue) = 0 Then
getRefererPage = ""
Exit Function
End IF
' 문자열에서 마지막 '/'값의 위치를 찾습니다. Text비교
chkPos = InstrRev(refererValue, "/", -1, 1)
' 마지막 '/'값을 찾은 위치에서 마지막까지의 문자열만 추출합니다.
refererValue = Right( refererValue, Len(refererValue) - chkPos )
' 추출한 페이지이름을 리턴합니다.
getRefererPage = refererValue
End Function
'===========================================================================
'함수명 : date_db
'INPUT :
'기능설명 : System DATE -> yyyy-mm-dd
'===========================================================================
Function date_db()
v_year = year(now())
mLen = Len(month(now()))
If mLen <> 2 Then
v_month = "0" + Cstr(month(now()))
Else
v_month = Cstr(month(now()))
End If
dLen = Len(day(now()))
If dLen <> 2 Then
v_day = "0" + Cstr(day(now()))
Else
v_day = Cstr(day(now()))
End If
date_db = Cstr(v_year) + "-" + Cstr(v_month) + "-" + Cstr(v_day)
End Function
'===========================================================================
'함수명 : date_time
'INPUT :
'기능설명 : System DATE -> yyyymmddhhmmss
'===========================================================================
Function date_time()
v_year = year(date)
v_month = month(date)
if v_month < 10 then v_month = "0" & v_month
v_day = day(date)
if v_day < 10 then v_day = "0" & v_day
v_hour = hour(time)
if v_hour < 10 then v_hour = "0" & v_hour
v_minute = minute(time)
if v_minute < 10 then v_minute = "0" & v_minute
v_second = second(time)
if v_second < 10 then v_second = "0" & v_second
v_datetime = v_year&v_month&v_day&v_hour&v_minute&v_second
date_time = v_datetime
End Function
'===========================================================================
'함수명 : fncRequestVariables
'INPUT : Request명
'기능설명 :
'===========================================================================
function fncRequestVariables(varParam)
Dim p
p = ""
if ucase(varParam) = "REMOTE_ADDR" then '리모트 ip 가져와서리
p = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
if p = "" then
p = Request.ServerVariables("HTTP_CLIENT_IP")
if p = "" then '암것도 없으면 ......
p = Request.ServerVariables(varParam) 'REMOTE_ADDR 다시 받고
end if
else
'if p = "119.67.93.000" then
' p = "211.58.239.000"
'end if
end if
else
p = Request.ServerVariables(varParam) '나머지 서버 변수는 그냥사용
end if
fncRequestVariables = p
end function
'===========================================================================
'함수명 : fncRandom_str
'INPUT : Request명
'기능설명 : 난수발생
'===========================================================================
Function fncRandom_str()
Dim str_rnd, strlen_rnd, rnd_r, rnd_i, rnd_ds, serialCode, nLength '--사용되는 변수를 선언
str_rnd = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" '--랜덤으로 사용될 문자 또는 숫자
strlen_rnd = 7 '--랜덤으로 출력될 값의 자릿수 ex)해당 구문에서 10자리의 랜덤 값 출력
nLength = Len( str_rnd )
Randomize '--랜덤 초기화
For rnd_i = 1 To strlen_rnd '--위에 선언된 strlen_rnd 랜덤 코드 생성
rnd_r = Int((nLength - 1 + 1) * Rnd + 1) '--36은 str의 문자갯수
serialCode = serialCode + Mid(str_rnd,rnd_r,1)
Next
fncRandom_str = serialCode
'Response.Write random_str()
End Function
%>

View File

@@ -0,0 +1,21 @@
<%
Option ExPlicit
Dim SV_NAME : SV_NAME = "10.10.11.6"
Dim DB_NAME : DB_NAME = "new_cati"
Dim UID : UID = "sa"
Dim PWD : PWD = "krco#51304"
Dim SV_NAME1 : SV_NAME1 = "10.10.11.6"
Dim DB_NAME1 : DB_NAME1 = "krc_survey"
Dim UID1 : UID1 = "sa"
Dim PWD1 : PWD1 = "krco#51304"
dim ksurvey, ksurvey2, DBopener
'ksurvey = "Provider=SQLOLEDB;Server=10.10.11.6;Initial Catalog="&DB_NAME1&";uid="&UID1&";pwd="&PWD1&";" 'krc_survey db
ksurvey2 = "Provider=SQLOLEDB;Server="&SV_NAME1&";Initial Catalog="&DB_NAME1&";uid="&UID1&";pwd="&PWD1&";" 'report db
ksurvey = "Provider=SQLOLEDB;Server="&SV_NAME&";Initial Catalog="&DB_NAME&";uid="&UID&";pwd="&PWD&";" 'cati db
'ksurvey = "Provider=SQLOLEDB;Server="&SV_NAME1&";Initial Catalog="&DB_NAME1&";uid=sa;pwd=dudgus25;" 'krc_survey db
%>

75
Lib/infiles/basic.css Normal file
View File

@@ -0,0 +1,75 @@
body,td,tr,input {
font-family: '맑은 고딕', 'Malgun Gothic', verdana;
font-size: 12px;
line-height: 140%;
}
.body {
font-family: '맑은 고딕', 'Malgun Gothic', verdana;
font-size: 12px;
border: 0px;
margin-left: 0px;
line-height: 140%;
}
.td {
font-family: '맑은 고딕', 'Malgun Gothic', verdana;
font-size: 12px;
line-height: 140%;
}
.input,textarea {
font-family: '맑은 고딕', 'Malgun Gothic', verdana;
font-size: 12px;
border-width:1px;
background-color:#F0F3F5;
color:black;
border-color:black;
}
.tableWline {
background-image: url(http://sendmail.randr.co.kr/img/etc/table_point1.gif);
background-attachment:fixed;
background-repeat: repeat-x;
}
.tableHline {
background-image: url(http://sendmail.randr.co.kr/img/etc/table_point2.gif);
background-attachment: fixed;
background-repeat: repeat-y;
}
a:link {color:blue; text-decoration:none}
a:visited {text-decoration : none; COLOR: #0000ff}
a:active text-decoration : none; COLOR: #0000ff}
a:hover {text-decoration : underline:none; COLOR: #CC0000}
.stTable {font-family: '맑은 고딕', 'Malgun Gothic', verdana;font-size:12px;line-height:120%;border-style: ridge; padding-left: 1; padding-right: 1; padding-top: 1;
padding-bottom: 1 }
.tinput { font-family: '맑은 고딕', 'Malgun Gothic', verdana; font-size:12px; background-color: #ECE1F7; border: 1px solid #8484FF;margin-left:2px; }
.tnuminput { font-family: '맑은 고딕', 'Malgun Gothic', verdana; font-size:12px; background-color: #ECE1F7; border: 1px solid #8484FF;margin-left:2px;text-align:right;margin-right:2px; }
.tbutton { font-family: '맑은 고딕', 'Malgun Gothic', verdana;font-size:12px;boder:1px; border-color:gray; height:20px;border-width:1px;
background-color:#000000;color:white;
}
.trightvline {border-right-style:solid;border-right-color:white;border-right-width:1px; }
.tbbottomline {border-bottom-style:dotted;border-bottom-color:#e2e2e2;border-bottom-width:1px;line-height:120%; }
.tbbottomline2 {border-bottom-color:#120000;border-left-width:1px;border-right-width:1px;border-top-width:1px; border-bottom-style:dashed;border-bottom-width:1px;}
/* ------- */
.post_write {padding-left: 5px; }
#id_background {background:#fff url(http://static.naver.com/common/login/bg_login_id_main_4.gif) no-repeat 0px 0px;}
#pwd_background {background:#fff url(/mainimages/loginpwd.gif) no-repeat 0px 0px;}
.input_text{display:block; position:relative; border:1px solid #bebebe; width:98px; height:16px; color:#F0F3F5; *margin:-1px 0; padding:4px 2px 0 2px; font-size:12px; vertical-align:top;}
.uid {background:#fff url(http://static.naver.com/common/login/bg_login_id_main_4.gif) no-repeat 0px 0px;}
.upw {background:#fff url(http://static.naver.com/common/login/bg_login_pw_main_4.gif) no-repeat 0px 0px;}

108
Lib/infiles/basic_table.css Normal file
View File

@@ -0,0 +1,108 @@
html, body, form, fieldset, h1, h2, h3, h4, h5, h6, p, pre, blockquote, ul, ol, dl, address {
margin:0;
padding:0;
}
body {
font:80%/150% "Trebuchet MS",Verdana,Arial,Helvetica,sans-serif;
}
p {
text-align:center;
}
a:link {
color:#d42945;
text-decoration:none;
border-bottom:1px dotted #ffbac8;
}
a:visited {
color:#d42945;
border-bottom:none;
text-decoration:none;
}
a:hover,
a:focus {
color:#f03b58;
border-bottom:1px solid #f03b58;
text-decoration:none;
}
table a,
table a:link,
table a:visited {
border:none;
}
img {
border:0;
margin-top:.5em;
}
table {
/*width:95%;*/
border-top:1px solid #e5eff8;
border-right:1px solid #e5eff8;
margin:1em auto;
border-collapse:collapse;
}
caption {
color: #9ba9b4;
font-size:.94em;
letter-spacing:.1em;
margin:1em 0 0 0;
padding:0;
caption-side:top;
text-align:center;
}
tr.odd td {
background:#f7fbff
/*background:#CDECFA*/
}
tr.odd .column1{
background:#f4f9fe;
}
.column1 {
background:#f9fcfe;
}
td {
color:#678197;
border-bottom:1px solid #e5eff8;
border-left:1px solid #e5eff8;
padding:.3em 1em;
/*text-align:center;*/
}
th {
font-weight:normal;
color: #678197;
/*text-align:left;*/
border-bottom: 1px solid #e5eff8;
border-left:1px solid #e5eff8;
padding:.3em 1em;
}
thead th {
/*background:#f4f9fe;*/
background:#E3EDF8;
/*text-align:center;*/
/*font:bold 1.0em/2em "Century Gothic","Trebuchet MS",Arial,Helvetica,sans-serif;*/
font: 1.0em "Century Gothic","Trebuchet MS",Arial,Helvetica,sans-serif;
color:#66a3d3
}
thead td {
}
tfoot th {
/*text-align:center;*/
background:#f4f9fe;
}
tfoot th strong {
font:bold 1.2em "Century Gothic","Trebuchet MS",Arial,Helvetica,sans-serif;
margin:.5em .5em .5em 0;
color:#66a3d3;
}
tfoot th em {
color:#f03b58;
font-weight: bold;
font-size: 1.1em;
font-style: normal;
}
.bt{ font-face:????u;font-size:12px;boder:1px; border-color:gray; height:20px;border-width:1px; background-color:#5a5a5a;color:white;}

208
Lib/infiles/db_comm.asp Normal file
View File

@@ -0,0 +1,208 @@
<!--METADATA TYPE= "typelib" NAME= "ADODB Type Library" FILE="C:\Program Files\Common Files\SYSTEM\ADO\msado15.dll" -->
<%
Class clsDBcomm
Private DefaultConnection
private sub Class_Initialize()
Set DefaultConnection = Nothing
End Sub
'===================================
' SQL Query를 실행하고, RecordSet을 반환한다.
'===================================
Public Function ExecSQLReturnRS(strSQL, params, connectionString, dbstr)
If IsObject(connectionString) Then
If connectionString is Nothing Then
If DefaultConnection is Nothing Then
Set DefaultConnection = CreateObject("ADODB.Connection")
DefaultConnection.Open dbstr
End If
Set connectionString = DefaultConnection
End If
End If
dim rs, cmd
Set rs = CreateObject("ADODB.RecordSet")
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = connectionString
cmd.CommandText = strSQL
cmd.CommandType = adCmdText
Set cmd = collectParams(cmd, params)
rs.CursorLocation = adUseClient
'response.Write strSQL & vbcrlf
' READ ONLY
rs.Open cmd, , adOpenStatic, adLockReadOnly
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
Set rs.ActiveConnection = Nothing
Set ExecSQLReturnRS = rs
End Function
'===================================
' SQL Query를 실행하고 UPDATE 실행
'===================================
Public Function ExecSQLReturnRS2(strSQL, params, connectionString, dbstr)
If IsObject(connectionString) Then
If connectionString is Nothing Then
If DefaultConnection is Nothing Then
Set DefaultConnection = CreateObject("ADODB.Connection")
DefaultConnection.Open dbstr
End If
Set connectionString = DefaultConnection
End If
End If
dim rs
Set rs = CreateObject("ADODB.RecordSet")
' Set cmd = CreateObject("ADODB.Command")
'
' cmd.ActiveConnection = connectionString
' cmd.CommandText = strSQL
' cmd.CommandType = adCmdText
' Set cmd = collectParams(cmd, params)
'
rs.CursorLocation = adUseClient
' READ UPATE
rs.Open strSQL, connectionString, adOpenStatic, adLockPessimistic
' Set cmd.ActiveConnection = Nothing
' Set cmd = Nothing
' Set rs.ActiveConnection = Nothing
Set ExecSQLReturnRS2 = rs
End Function
'===================================
' SQL Query를 실행 (Rs 반환없음)
'===================================
Public Sub ExecSQL(strSQL,params,connectionString, dbstr)
If IsObject(connectionString) Then
If connectionString is Nothing Then
If DefaultConnection is Nothing Then
Set DefaultConnection = CreateObject("ADODB.Connection")
DefaultConnection.Open dbstr
End If
Set connectionString = DefaultConnection
End If
End If
dim cmd
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = connectionString
cmd.CommandText = strSQL
cmd.CommandType = adCmdText
Set cmd = collectParams(cmd, params)
cmd.Execute , , adExecuteNoRecords
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
End Sub
'+++++++++++++++++++
'---------------------------------------------------
' 트랜잭션을 시작하고, Connetion 개체를 반환한다.
'---------------------------------------------------
Public Function BeginTrans(connectionString)
If IsObject(connectionString) Then
If connectionString is Nothing Then
connectionString = DefaultConnString
End If
End If
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connectionString
conn.BeginTrans
Set BeginTrans = conn
End Function
'---------------------------------------------------
' 활성화된 트랜잭션을 커밋한다.
'---------------------------------------------------
Public Sub CommitTrans(connectionObj)
If Not connectionObj Is Nothing Then
connectionObj.CommitTrans
connectionObj.Close
Set ConnectionObj = Nothing
End If
End Sub
'---------------------------------------------------
' 활성화된 트랜잭션을 롤백한다.
'---------------------------------------------------
Public Sub RollbackTrans(connectionObj)
If Not connectionObj Is Nothing Then
connectionObj.RollbackTrans
connectionObj.Close
Set ConnectionObj = Nothing
End If
End Sub
'+++++++++++++++++++
'---------------------------
' -- Nothing
'---------------------------
Public Sub Dispose
if (Not DefaultConnection is Nothing) Then
if (DefaultConnection.State = adStateOpen) Then DefaultConnection.Close
Set DefaultConnection = Nothing
End if
End Sub
'---------------------------------------------------------------------------
'Array로 넘겨오는 파라메터를 Parsing 하여 Parameter 객체를
'생성하여 Command 객체에 추가한다.
'---------------------------------------------------------------------------
Private Function collectParams(cmd,argparams)
If VarType(argparams) = 8192 or VarType(argparams) = 8204 or VarType(argparams) = 8209 then
params = argparams
For i = LBound(params) To UBound(params)
l = LBound(params(i))
u = UBound(params(i))
' Check for nulls.
If u - l = 4 Then
If VarType(params(i)(4)) = vbString Then
If params(i)(4) = "" Then
v = Null
Else
v = params(i)(4)
End If
Else
v = params(i)(4)
End If
cmd.Parameters.Append cmd.CreateParameter(params(i)(0), params(i)(1), params(i)(2), params(i)(3), v)
End If
Next
Set collectParams = cmd
Exit Function
Else
Set collectParams = cmd
End If
End Function
End Class
%>

119
Lib/infiles/fun_module.asp Normal file
View File

@@ -0,0 +1,119 @@
<%
' 히든값 넘기기
Sub f_hiddenNext()
Dim x
For Each x in xform
if left(x,2)="ff" Then
If Trim(x)<>"ffnextpage" Then
response.write "<input type='hidden' name='"&x&"' value='"&xform(x)&"' >"&vbCrLf
End If
end if
next
end Sub
' ----------------------------------------------------------------------------------
'값 가져오기
function fy_GetQue(mo_field)
dim mo_DBopener,mo_objdb,mo_sql
Call ClsOpen(mo_DBopener) : Dim mo_openDB : mo_openDB=ksurvey
mo_sql="select "&mo_field&" from "&xTable
mo_sql=mo_sql&" where ffid='"&request.item("ffid")&"' "
Call RsSQL(mo_DBopener,mo_openDB,mo_sql,mo_objdb)
fy_GetQue=""
if not mo_objdb.Eof then
fy_GetQue=mo_objdb(0)
end if
Call CloseSQL(mo_objdb)
Call CloseCls(mo_DBopener)
end function
' ----------------------------------------------------------------------------------
' 입력값 치환..
Function f_replace(mo,t)
Select Case t
Case 1
mo=Replace(mo,"'","")
mo=Replace(mo,"""","")
mo=Replace(mo," ","")
mo=Replace(mo,"<","")
mo=Replace(mo,">","")
Case 2 ' 설문조사용
mo=Replace(mo,"""","'")
' mo=Replace(mo,"""","")
' mo=Replace(mo," ","")
mo=Replace(mo,"<","(")
mo=Replace(mo,">",")")
Case 3
' 변환없음..
Case 4 ' 숫자 ""시 --> 0: 리턴..
mo=Replace(mo,"'","")
mo=Replace(mo,"""","")
mo=Replace(mo," ","")
mo=Replace(mo,"<","")
mo=Replace(mo,">","")
If Trim(mo)="" Then mo=0
Case 5 ' textarea: 입력값 보여주기..
mo=Replace(mo,"'","")
mo=Replace(mo,"""","")
' mo=Replace(mo," ","")
mo=Replace(mo,"<","")
mo=Replace(mo,">","")
mo=Replace(mo,"<","&lt;")
mo=Replace(mo,">","&gt;")
mo=Replace(mo,vbCrLf,"<br>")
Case 6 ' html 적용시..
mo=Replace(mo,"'","")
mo=Replace(mo,"""","")
' mo=Replace(mo," ","")
' mo=Replace(mo,"<","")
' mo=Replace(mo,">","")
' mo=Replace(mo,"<","&lt;")
' mo=Replace(mo,">","&gt;")
mo=Replace(mo,vbCrLf,"<br>")
End Select
mo=fncRegularReplace(mo, "select", "[select]")
mo=fncRegularReplace(mo, "update", "[update]")
mo=fncRegularReplace(mo, "insert", "[insert]")
mo=fncRegularReplace(mo, "drop", "[drop]")
mo=fncRegularReplace(mo, "delete", "[delete]")
mo=fncRegularReplace(mo, "create", "[create]")
mo=fncRegularReplace(mo, "alert", "[alert]")
f_replace=mo
End Function
'// Regular Expression으로 문자열 교체..
Function fncRegularReplace( pOrgString, pPatternString, pReplaceString)
Dim objRegExp : Set objRegExp = New RegExp
objRegExp.Pattern = pPatternString
objRegExp.IgnoreCase = True
objRegExp.Global = True
fncRegularReplace = objRegExp.Replace( pOrgString, pReplaceString)
End Function
%>

183
Lib/infiles/fun_save.asp Normal file
View File

@@ -0,0 +1,183 @@
<!-- #include file="ini.asp" -->
<%
' 페이지 체크
function f_pageCk(xado, xopenDB, xTable)
dim x, xsql, ysql, usql, xobjdb
xsql=" select ffpagelog, ffpage from "&xTable
xsql=xsql&" where ffid='"&f_replace(request.form("ffid"),2)&"' "
xsql=xsql&" and fftype='"&f_replace(request.form("fftype"),2)&"' "
Call RsSQL(xado, xopenDB, xsql,xobjdb)
If xobjdb.eof Then
Call CloseCls(DBopener)
response.write "<br> 정상적인 접근이 아닙니다. 처음부터 다시 진행하여 주시기 바랍니다. "
response.end
end if
dim xNum : xNum=split(xobjdb(0),"#")
dim xNumYN : xNumYN="Y"
dim xNumPage : xNumPage=""
for i=0 to ubound(xNum)
if trim(xNum(i))<>"" then
if trim(ffnextpage)=trim(xNum(i)) then
xNumYN="N"
exit for
end if
end if
next
select case xNumYN
case "Y" : xNumPage=""
case "N" : xNumPage=xobjdb(1)
end select
Call CloseSQL(xobjdb)
f_pageCk=xNumPage
end function
'#######################
'데이터 저장
Sub f_dataSave(xado, xopenDB, xTable) '-- xado:ADO클레스 , xopenDB:연결정보, xTable : 저장테이블명
dim x, xsql, ysql, usql, xobjdb
usql=""
' 구분별..
For Each x in request.form
x_field=mid(x,3,len(x)) ' 저장필드명.
select case Lcase(left(x,2))
Case "s_" ' 단일
usql=usql&","&x_field&"='"&f_replace(request.form(x),2)&"'"
Case "t_" ' text
usql=usql&","&x_field&"='"&f_replace(request.form(x),2)&"'"
Case "m_" ' 멀티
for j=1 to request.form(x).count
usql=usql&","&x_field&"__"&request.form(x)(j)&"='"&f_replace(request.form(x)(j),2)&"'"
next
Case "g_" ' 시간등록
usql=usql&","&x_field&"=getdate() "
End Select
Next
' 업데이트 쿼리.
xsql=" update "&xTable&" set "
' 업데이트 기준
If request.form("ffid")="" Then '-- Error
Call CloseCls(DBopener)
response.write "<br> 정상적인 접근이 아닙니다. 처음부터 다시 진행하여 주시기 바랍니다. "
response.end
else ' 업데이트 기준
ysql=" ffid='"&f_replace(request.form("ffid"),2)&"' "
ysql=ysql&" and fftype='"&f_replace(request.form("fftype"),2)&"' "
end if
' SQL 생성.
xsql=xsql&" fftype='"&f_replace(request.form("fftype"),2)&"' "
xsql=xsql&usql&" where "&ysql
' response.write xsql
' response.End
Call ExSQL(xado, xopenDB, xsql)
'########## 진행상태 업데이트 ###################
if not isnull(request.form("ffing")) then
xsql=" update "&xTable&" set "
xsql=xsql&" ffing='"&f_replace(request.form("ffing"),2)&"' "
xsql=xsql&usql&" where "&ysql
Call ExSQL(xado, xopenDB, xsql)
end if
'########## ffend(완료시간) 저장 ###################
if not request.form("ffend")="0" then
xsql=" update "&xTable&" set "
xsql=xsql&" ffend=getdate() "
xsql=xsql&usql&" where "&ysql
Call ExSQL(xado, xopenDB, xsql)
end if
End Sub
'#######################
' 페이지 정보 저장
sub f_pageSave(xado, xopenDB, xTable)
dim x, xsql, ysql, usql, xobjdb
xsql=" update "&xTable&" set "
xsql=xsql&" ffpage='"&ffnextpage&"' "
xsql=xsql&",ffpagelog=ffpagelog+'#'+'"&ffnextpage&"' " '-- 분리자(#)
xsql=xsql&",ffpagecount=ffpagecount+1 "
xsql=xsql&" where ffid='"&f_replace(request.form("ffid"),2)&"' "
xsql=xsql&" and fftype='"&f_replace(request.form("fftype"),2)&"' "
Call ExSQL(xado, xopenDB, xsql)
end sub
'#######################
' ----------------------------------------------------------------------------------
' ----------------------------------------------------------------------------------
' 클레스 생성
Sub clsOpen(mo)
Set mo = new clsDBcomm
End Sub
' select 실행 : read only
Sub RsSQL(clsN, mo_openDB, mo_sql, moobj)
Set moobj = clsN.ExecSQLReturnRS(mo_sql, Nothing, Nothing,mo_openDB)
End Sub
' select 실행. : read update
Sub RsSQL2(clsN, mo_openDB, mo_sql, moobj)
Set moobj = clsN.ExecSQLReturnRS2(mo_sql, Nothing, Nothing,mo_openDB)
End Sub
' SQL 실행. : 리턴없음
Sub ExSQL(clsN, mo_openDB, mo_sql)
Call clsN.ExecSQL(mo_sql, Nothing, Nothing,mo_openDB)
End Sub
'연결종료
Sub CloseSQL(mo)
mo.Close
Set mo = Nothing
End Sub
' 클레스 종료
Sub CloseCls(mo)
mo.Dispose
Set mo = Nothing
End Sub
' ----------------------------------------------------------------------------------
' ----------------------------------------------------------------------------------
%>

View File

@@ -0,0 +1,183 @@
<!-- #include file="ini_copy.asp" -->
<%
' 페이지 체크
function f_pageCk(xado, xopenDB, xTable)
dim x, xsql, ysql, usql, xobjdb
xsql=" select ffpagelog, ffpage from "&xTable
xsql=xsql&" where ffid='"&f_replace(request.form("ffid"),2)&"' "
xsql=xsql&" and fftype='"&f_replace(request.form("fftype"),2)&"' "
Call RsSQL(xado, xopenDB, xsql,xobjdb)
If xobjdb.eof Then
Call CloseCls(DBopener)
response.write "<br> 정상적인 접근이 아닙니다. 처음부터 다시 진행하여 주시기 바랍니다. "
response.end
end if
dim xNum : xNum=split(xobjdb(0),"#")
dim xNumYN : xNumYN="Y"
dim xNumPage : xNumPage=""
for i=0 to ubound(xNum)
if trim(xNum(i))<>"" then
if trim(ffnextpage)=trim(xNum(i)) then
xNumYN="N"
exit for
end if
end if
next
select case xNumYN
case "Y" : xNumPage=""
case "N" : xNumPage=xobjdb(1)
end select
Call CloseSQL(xobjdb)
f_pageCk=xNumPage
end function
'#######################
'데이터 저장
Sub f_dataSave(xado, xopenDB, xTable) '-- xado:ADO클레스 , xopenDB:연결정보, xTable : 저장테이블명
dim x, xsql, ysql, usql, xobjdb
usql=""
' 구분별..
For Each x in request.form
x_field=mid(x,3,len(x)) ' 저장필드명.
select case Lcase(left(x,2))
Case "s_" ' 단일
usql=usql&","&x_field&"='"&f_replace(request.form(x),2)&"'"
Case "t_" ' text
usql=usql&","&x_field&"='"&f_replace(request.form(x),2)&"'"
Case "m_" ' 멀티
for j=1 to request.form(x).count
usql=usql&","&x_field&"__"&request.form(x)(j)&"='"&f_replace(request.form(x)(j),2)&"'"
next
Case "g_" ' 시간등록
usql=usql&","&x_field&"=getdate() "
End Select
Next
' 업데이트 쿼리.
xsql=" update "&xTable&" set "
' 업데이트 기준
If request.form("ffid")="" Then '-- Error
Call CloseCls(DBopener)
response.write "<br> 정상적인 접근이 아닙니다. 처음부터 다시 진행하여 주시기 바랍니다. "
response.end
else ' 업데이트 기준
ysql=" ffid='"&f_replace(request.form("ffid"),2)&"' "
ysql=ysql&" and fftype='"&f_replace(request.form("fftype"),2)&"' "
end if
' SQL 생성.
xsql=xsql&" fftype='"&f_replace(request.form("fftype"),2)&"' "
xsql=xsql&usql&" where "&ysql
' response.write xsql
' response.End
Call ExSQL(xado, xopenDB, xsql)
'########## 진행상태 업데이트 ###################
if not isnull(request.form("ffing")) then
xsql=" update "&xTable&" set "
xsql=xsql&" ffing='"&f_replace(request.form("ffing"),2)&"' "
xsql=xsql&usql&" where "&ysql
Call ExSQL(xado, xopenDB, xsql)
end if
'########## ffend(완료시간) 저장 ###################
if not request.form("ffend")="0" then
xsql=" update "&xTable&" set "
xsql=xsql&" ffend=getdate() "
xsql=xsql&usql&" where "&ysql
Call ExSQL(xado, xopenDB, xsql)
end if
End Sub
'#######################
' 페이지 정보 저장
sub f_pageSave(xado, xopenDB, xTable)
dim x, xsql, ysql, usql, xobjdb
xsql=" update "&xTable&" set "
xsql=xsql&" ffpage='"&ffnextpage&"' "
xsql=xsql&",ffpagelog=ffpagelog+'#'+'"&ffnextpage&"' " '-- 분리자(#)
xsql=xsql&",ffpagecount=ffpagecount+1 "
xsql=xsql&" where ffid='"&f_replace(request.form("ffid"),2)&"' "
xsql=xsql&" and fftype='"&f_replace(request.form("fftype"),2)&"' "
Call ExSQL(xado, xopenDB, xsql)
end sub
'#######################
' ----------------------------------------------------------------------------------
' ----------------------------------------------------------------------------------
' 클레스 생성
Sub clsOpen(mo)
Set mo = new clsDBcomm
End Sub
' select 실행 : read only
Sub RsSQL(clsN, mo_openDB, mo_sql, moobj)
Set moobj = clsN.ExecSQLReturnRS(mo_sql, Nothing, Nothing,mo_openDB)
End Sub
' select 실행. : read update
Sub RsSQL2(clsN, mo_openDB, mo_sql, moobj)
Set moobj = clsN.ExecSQLReturnRS2(mo_sql, Nothing, Nothing,mo_openDB)
End Sub
' SQL 실행. : 리턴없음
Sub ExSQL(clsN, mo_openDB, mo_sql)
Call clsN.ExecSQL(mo_sql, Nothing, Nothing,mo_openDB)
End Sub
'연결종료
Sub CloseSQL(mo)
mo.Close
Set mo = Nothing
End Sub
' 클레스 종료
Sub CloseCls(mo)
mo.Dispose
Set mo = Nothing
End Sub
' ----------------------------------------------------------------------------------
' ----------------------------------------------------------------------------------
%>

18
Lib/infiles/ini.asp Normal file
View File

@@ -0,0 +1,18 @@
<!-- #include file="../Config.asp" -->
<%
' ---------- 연 결 -------------------------------------------------------------------
' ----------------------------------------------------------------------------------
dim ksurvey, ksurvey2,ksurvey3, DBopener
ksurvey = "Provider=SQLOLEDB;Server=10.10.11.6;Initial Catalog="&DB_NAME1&";uid="&UID1&";pwd="&PWD1&";" 'krc_survey db
ksurvey2 = "Provider=SQLOLEDB;Server=10.10.11.6;Initial Catalog="&DB_NAME&";uid="&UID&";pwd="&PWD&";" 'capi db
'ksurvey3 = "Provider=SQLOLEDB; Server=" & SV_NAME2 & ";Initial Catalog=" & DB_NAME2 & "; UID=" & UID2 & "; PWD=" & PWD2 ' ep_reruit
'ksurvey2 = "Provider=SQLOLEDB;Server=10.10.13.115;Initial Catalog="&DB_NAME&";uid="&UID1&";pwd="&PWD1&";" 'krc_survey db
'ksurvey = "Provider=SQLOLEDB;Server=10.10.13.115;Initial Catalog="&DB_NAME1&";uid="&UID1&";pwd="&PWD1&";" 'krc_survey db
'ksurvey2 = "Provider=SQLOLEDB;Server="&SV_NAME&";Initial Catalog="&DB_NAME&";uid=sa;pwd=dudgus25;" 'capi db
'ksurvey = "Provider=SQLOLEDB;Server="&SV_NAME1&";Initial Catalog="&DB_NAME1&";uid=sa;pwd=dudgus25;" 'krc_survey db
' ----------------------------------------------------------------------------------
' ----------------------------------------------------------------------------------
%>

19
Lib/infiles/ini_Copy.asp Normal file
View File

@@ -0,0 +1,19 @@
<!-- #include file="../Config.asp" -->
<%
' ---------- 연 결 -------------------------------------------------------------------
' ----------------------------------------------------------------------------------
dim ksurvey, ksurvey2,ksurvey3, DBopener
'ksurvey = "Provider=SQLOLEDB;Server=10.10.11.6;Initial Catalog="&DB_NAME1&";uid="&UID1&";pwd="&PWD1&";" 'krc_survey db
ksurvey2 = "Provider=SQLOLEDB;Server=10.10.11.6;Initial Catalog="&DB_NAME&";uid="&UID&";pwd="&PWD&";" 'capi db
ksurvey3 = "Provider=SQLOLEDB; Server=" & SV_NAME2 & ";Initial Catalog=" & DB_NAME2 & "; UID=" & UID2 & "; PWD=" & PWD2 ' ep_reruit
'ksurvey2 = "Provider=SQLOLEDB;Server="&SV_NAME&";Initial Catalog="&DB_NAME&";uid=sa;pwd=dudgus25;" 'capi db
ksurvey = "Provider=SQLOLEDB;Server=10.10.13.115;Initial Catalog="&DB_NAME1&";uid=sa;pwd=dudgus25;" 'krc_survey db
'ksurvey2 = "Provider=SQLOLEDB;Server="&SV_NAME&";Initial Catalog="&DB_NAME&";uid=sa;pwd=dudgus25;" 'capi db
'ksurvey = "Provider=SQLOLEDB;Server=10.10.13;Initial Catalog="&DB_NAME1&";uid=sa;pwd=dudgus25;" 'krc_survey db
' ----------------------------------------------------------------------------------
' ----------------------------------------------------------------------------------
%>

91
Lib/infiles/krc_css.css Normal file
View File

@@ -0,0 +1,91 @@
#topMenu
{/*topMenu<6E><75> ID<49><44> <20><><EFBFBD><EFBFBD> <20>±<EFBFBD><C2B1><EFBFBD> <20><>Ÿ<EFBFBD><C5B8> <20><><EFBFBD><EFBFBD>*/
height: 30px;/*topMenu<6E><75> <20><><EFBFBD≯<EFBFBD> 30px<70><78> <20><><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ϸ<EFBFBD> <20>Ʒ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>)*/
display:inline-block;
}
#topMenu ul
{
display:inline-block;
border-radius : 5px;
}
#topMenu ul li
{/* topMenu<6E><75> ID<49><44> <20><><EFBFBD><EFBFBD> <20>±<EFBFBD> <20>ȿ<EFBFBD> <ul> <20>±<EFBFBD> <20>ȿ<EFBFBD> <li> <20>±<EFBFBD><C2B1><EFBFBD> <20><>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> */
list-style: none;/*<li> <20>±״<C2B1> <20><><EFBFBD><EFBFBD> <20>̹<EFBFBD><CCB9><EFBFBD>ó<EFBFBD><C3B3> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ش<EFBFBD> */
color: black;/*<2A>۾<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> */
background-color: #f8f8f8;/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ȸ<><C8B8>(RGB(2D,2D,2D)<29><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> */
float: left;/* <li><3E>±׵<C2B1><D7B5><EFBFBD> <20><><EFBFBD>ʿ<EFBFBD> <20>帣<EFBFBD><E5B8A3> <20><><EFBFBD><EFBFBD>(<28>׷<EFBFBD><D7B7><EFBFBD> <20>Ʒ<EFBFBD><C6B7>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>)*/
line-height: 30px;/* <20>۾<EFBFBD><DBBE><EFBFBD> <20><><EFBFBD><EFBFBD><EEB5A5> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD≯<EFBFBD> 30px<70><78> <20><><EFBFBD><EFBFBD>*/
vertical-align: middle;/*<2A><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EEB5A5> <20><><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD> line-height<68><74> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʿ<EFBFBD><CABF><EFBFBD>) */
text-align: center;/* <20>۾<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EEB5A5> <20><><EFBFBD><EFBFBD>*/
border-radius : 5px;
}
#topMenu .menuLink
{/* topMenu <20><><EFBFBD>̵<EFBFBD><CCB5><EFBFBD> <20><><EFBFBD><EFBFBD> <20>±<EFBFBD> <20>ȿ<EFBFBD> <20>ִ<EFBFBD> menuLink Ŭ<><C5AC><EFBFBD><EFBFBD> <20>±׵<C2B1><D7B5><EFBFBD> <20><>Ÿ<EFBFBD><C5B8> <20><><EFBFBD><EFBFBD>*/
text-decoration:none;/*<2A><>ũ(<a> <20>±<EFBFBD>)<29><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⺻ <20>ٹ<EFBFBD> ȿ<><C8BF>(<28><><EFBFBD><EFBFBD> <20><>)<29><> <20><><EFBFBD><EFBFBD> */
color: black;/*<2A><>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> */
display: inline-block;/*<2A><>ũ<EFBFBD><C5A9> <20>۾<EFBFBD><DBBE><EFBFBD> <20>ִ<EFBFBD> <20>κ<EFBFBD> <20>Ӹ<EFBFBD><D3B8>ƴ϶<C6B4> <20><>ü <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD>ص<EFBFBD> <20><>ũ<EFBFBD><C5A9> <20>ɸ<EFBFBD><C9B8><EFBFBD> <20><><EFBFBD><EFBFBD> */
width: 180px;/* <20>޴<EFBFBD><DEB4><EFBFBD>ũ<EFBFBD><C5A9> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>*/
font-family: Helvetica Neue,Helvetica,Arial,sans-serif;
font-size: 17px;/*<2A><>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 12px<70><78> <20><><EFBFBD><EFBFBD> */
font-weight: bold;/*<2A><>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD>*/
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;/*<2A>⺻ <20><>Ʈ <20><><EFBFBD><EFBFBD>, <20>ý<EFBFBD><C3BD><EFBFBD> <20><>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
border-radius : 5px;
cursor:pointer;
}
#topMenu .menuLink:hover
{/*topMenu <20><><EFBFBD>̵<EFBFBD><CCB5><EFBFBD> <20><><EFBFBD><EFBFBD> <20>±<EFBFBD> <20>ȿ<EFBFBD> menuLinkŬ<6B><C5AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>±׿<C2B1> <20><><EFBFBD>콺<EFBFBD><ECBDBA> over<65>Ǹ<EFBFBD> <20><>Ÿ<EFBFBD><C5B8> <20><><EFBFBD><EFBFBD> */
color: White;/*<2A>۾<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> */
background-color: #D9D9D9;/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> ȸ<><C8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> */
border-radius : 5px;
}
/*
div#menubar
{
text-align:center;
padding: 24px;border:0px;
}
div#menubar > button{
font-family: Malgun Gothic,Gulim,Arial,Helvetica,sans-serif;
font-size: 18px;
border:0px;
font-weight:bold;
background: #CCCCCC;
padding: 12px 20px;
color: #FFFFFF;
margin-right: 10px;
text-decoration: none;
border-radius:5px;
}
div#menubar > button > i{
font-weight:bold;
}
div#menubar > button:hover{
background: #FFFFFF;
color: #AAA9A9;
}
*/

486
Lib/infiles/valueck.js Normal file
View File

@@ -0,0 +1,486 @@
function form_check(form, fields) {
var lah = new ckForm(form);
if (fields) lah.setCheckFields(fields);
var wmf = lah.go();
if (wmf == false) alert(lah.getErrorMessage());
return wmf;
}
ckForm = function(form) {
this.FUNC_MAP = {
// 특정응답값 로직체크..
email : "this.func_email",
hangul : "this.func_hangul",
engonly : "this.func_engonly",
number : "this.func_number"
/*
residentno: "this.func_residentno", // 주민번호 체크 미사용
jumin : "this.func_jumin", // 주민번호 체크 미사용
foreignerno:"this.func_foreignerno",
bizno : "this.func_bizno",
phone : "this.func_phone",
homephone : "this.func_homephone",
handphone : "this.func_handphone"
*/
}
this.ERR_MSG = {
// 에러메세지..
system : "ckForm Error: ",
ck : "응답하지 않은 문항이 있습니다 ",
ckuirenum:"이 항목들 중에 {ckuirenum}개 이상의 항목이 입력되어야 합니다.",
notequal : "입력된 내용이 일치하지 않습니다.",
invalid : "입력된 내용이 형식에 어긋납니다.",
minbyte : "입력된 내용의 길이가 {minbyte}Byte 이상이어야 합니다.",
maxbyte : "입력된 내용의 길이가 {maxbyte}Byte를 초과할 수 없습니다.",
mincheck : "{mincheck}개의 항목이상으로 선택하세요.",
maxcheck : "{maxcheck}개의 항목이하로 선택하세요.",
minselect: "{minselect}개의 항목이상으로 선택하세요.",
maxselect: "{maxselect}개의 항목이하로 선택하세요.",
imageonly: "이미지 파일만 첨부할 수 있습니다."
}
this.ERR_DO = {
// 포커스 구분...
text : "select focus",
select : "focus",
check : "focus",
radio : "focus",
file : "focus",
hidden : ""
}
this.ERR_SYS = '_SYSERR_';
this.fields = form.elements;
this.form = form;
this.errMsg = "";
}
ckForm.prototype.setForm = function(form) {
this.form = form;
}
ckForm.prototype.setFunc = function(map, func) {
if (typeof(this.FUNC_MAP[map]) == "string") return;
this.FUNC_MAP[map] = func;
}
ckForm.prototype.setCheckFields = function(fields) {
this.fields = [];
if(typeof(fields) == 'string')
// 단일
if(this.form.elements[fields].disabled=="false"){
this.fields = [this.form.elements[fields]];
}
else
//멀티
for(var i=0, s=fields.length; i<s; i++){
if(this.form.elements[fields[i]].disabled=="false"){
this.fields[this.fields.length] = this.form.elements[fields[i]];
}
}
}
ckForm.prototype.setUnCheckFields = function(fields) {
this.fields = [];
var _isUnCheckEl;
if(typeof(fields) == 'string')
fields = [fields];
for (var i=0, s=this.form.elements.length; i<s; i++) {
_isUnCheckEl = false;
for (var j=0, t=fields.length; j<t; j++) {
if (this.form.elements[i] == this.form.elements[fields[j]]) {
_isUnCheckEl = true;
break;
}
}
if (!_isUnCheckEl) this.fields[this.fields.length] = this.form.elements[i];
}
}
ckForm.prototype.setParam = function(el, name, value) {
el.setAttribute(name, value);
}
ckForm.prototype.delParam = function(el, name) {
el.removeAttribute(name);
}
ckForm.prototype.go = function() {
for (var i=0,s=this.fields.length; i<s; i++) {
var el = this.fields[i];
if (!this.isValidElement(el)) continue;
var elType = this.getType(el);
var trim = el.getAttribute("TRIM");
var ck = el.getAttribute("ck");
var ckuirenum = el.getAttribute("ckUIRENUM");
var minbyte = parseInt(el.getAttribute("MINBYTE"),10);
var maxbyte = parseInt(el.getAttribute("MAXBYTE"),10);
var mincheck = parseInt(el.getAttribute("MINCHECK"),10);
var maxcheck = parseInt(el.getAttribute("MAXCHECK"),10);
var minselect = parseInt(el.getAttribute("MINSELECT"),10);
var maxselect = parseInt(el.getAttribute("MAXSELECT"),10);
var option = el.getAttribute("OPTION");
var match = el.getAttribute("MATCH");
var span = el.getAttribute("SPAN");
var glue = el.getAttribute("GLUE");
var pattern = el.getAttribute("PATTERN");
var imageonly = el.getAttribute("IMAGEONLY");
if (trim != null && (elType == "text" || elType == "hidden")) {
switch (trim) {
case "trim":
el.value = el.value.replace(/^\s+/, "").replace(/\s+$/, "");
break;
case "compress":
el.value = el.value.replace(/\s+/, "");
break;
case "ltrim":
el.value = el.value.replace(/^\s+/, "");
break;
case "rtrim":
el.value = el.value.replace(/\s+$/, "");
break;
}
}
var elEmpty = this.isEmpty(el, elType);
if (ck != null) {
if (ck == "ck") {
if (elEmpty) return this.raiseError(el, "ck");
} else {
ckuirenum = parseInt(ckuirenum, 10);
var _num = 0;
var _name = [];
if (ckuirenum > 0) {
for (var j=0; j<this.form.elements.length; j++) {
var _el = this.form.elements[j];
if (ck == _el.getAttribute("ck")) {
if(!this.isEmpty(_el, this.getType(_el))) _num++;
_name[_name.length] = this.getName(_el);
}
}
if(_num < ckuirenum)
return this.raiseError(el, "ckuirenum", _name.join(", "));
}
}
}
if ((minbyte > 0 || maxbyte > 0) && (elType == "text" || elType == "hidden")) {
var _tmp = el.value;
var _len = el.value.length;
for (j=0; j<_tmp.length; j++) {
if (_tmp.charCodeAt(j) > 128) _len++;
}
if (minbyte > 0 && _len < minbyte) return this.raiseError(el, "minbyte");
if (maxbyte > 0 && _len > maxbyte) return this.raiseError(el, "maxbyte");
}
if (match != null && elType != "file") {
if (typeof this.form.elements[match] == "undefined")
return this.raiseError(this.ERR_SYS, "Element '"+ match +"' is not found.");
else if (el.value != this.form.elements[match].value)
return this.raiseError(el, "notequal");
}
if (option != null && !elEmpty && elType != "file") {
var _options = option.split(" ");
for (var j in _options) {
var _func = eval(this.FUNC_MAP[_options[j]]);
if (span != null) {
var _value = [];
for (var k=0; k<parseInt(span,10); k++) {
try {
_value[k] = this.fields[i+k].value;
} catch (e) {
return this.raiseError(this.ERR_SYS, (i+k) +"th Element is not found.");
}
}
try {
var _result = _func(el, _value.join(glue == null ? "" : glue));
} catch (e) {
return this.raiseError(this.ERR_SYS, "function map '"+ _options[j] +"' is not exist.");
}
if (_result !== true) return this.raiseError(el, _result);
} else {
try {
var _result = _func(el);
} catch (e) {
return this.raiseError(this.ERR_SYS, "function map '"+ _options[j] +"' is not exist.");
}
if (_result !== true) return this.raiseError(el, _result);
}
}
}
if (pattern != null && !elEmpty && elType != "file") {
try {
pattern = new RegExp(pattern);
} catch (e) {
return this.raiseError(this.ERR_SYS, "Invalid Regular Expression '"+ pattern +"'");
}
if (!pattern.test(el.value)) return this.raiseError(el, "invalid");
}
if ((mincheck > 0 || maxcheck > 0) && elType == "check") {
var _checks = this.form.elements[el.name];
var _num = 0;
if (typeof _checks.length != "undefined") {
for (var j=0; j<_checks.length; j++) {
if (_checks[j].checked) _num++;
}
} else {
if (_checks.checked) _num++;
}
if (mincheck > 0 && _num < mincheck) return this.raiseError(el, "mincheck");
if (maxcheck > 0 && _num > maxcheck) return this.raiseError(el, "maxcheck");
}
if ((minselect > 0 || maxselect > 0) && elType == "multiselect") {
var _num = 0;
for (var j=0; j<el.options.length; j++) {
if (el.options[j].selected) _num++;
}
if (minselect > 0 && _num < minselect) return this.raiseError(el, "minselect");
if (maxselect > 0 && _num > maxselect) return this.raiseError(el, "maxselect");
}
if (imageonly != null && elType == "file") {
var fn = el.value;
if (fn != "") {
var dotIndex = fn.lastIndexOf(".");
var ext = fn.substring(dotIndex+1).toLowerCase();
if(ext != "jpg" && ext != "jpeg" && ext != "gif" && ext != "png")
return this.raiseError(el, "imageonly");
}
}
}
return true;
}
ckForm.prototype.isValidElement = function(el) {
return el.name && el.tagName.match(/^input|select|textarea$/i) && !el.disabled;
}
ckForm.prototype.isEmpty = function(el, type) {
switch (type) {
case "file": case "text": case "hidden":
if (el.value == null || el.value == "") return true;
break;
case "select": case "multiselect":
if (el.selectedIndex == -1 || el[el.selectedIndex].value == null ||
el[el.selectedIndex].value == "")
return true;
break;
case "check": case "radio":
var elCheck = this.form.elements[el.name];
var elChecked = false;
if (typeof elCheck.length != "undefined") {
for (var j=0; j<elCheck.length; j++) {
if (elCheck[j].checked == true) elChecked = true;
}
} else {
if (elCheck.checked == true) elChecked = true;
}
if (elChecked == false) return true;
break;
}
return false;
}
ckForm.prototype.getType = function(el) {
switch (el.tagName.toLowerCase()) {
case "select":
return el.multiple == true ? "multiselect" : "select";
case "textarea": return "text";
case "input":
switch (el.type.toLowerCase()) {
case "radio": return "radio";
case "checkbox": return "check";
case "file": return "file";
case "text": case "password": return "text";
case "hidden": return "hidden";
}
break;
}
}
ckForm.prototype.raiseError = function(el, type, elName) {
if (el == this.ERR_SYS) {
this.errMsg = this.ERR_MSG["system"] + type;
return false;
}
var pattern = /\{([a-zA-Z0-9_]+)\}/i;
var msg = this.ERR_MSG[type] ? this.ERR_MSG[type] : type;
var elType = this.getType(el);
var elName = elName ? elName : this.getName(el);
var errDo = el.getAttribute("ERRDO") ? el.getAttribute("ERRDO") : this.ERR_DO[elType];
var _errDos = errDo ? errDo.split(" ") : [];
if (el.getAttribute("ERRMSG") != null) msg = el.getAttribute("ERRMSG");
if (pattern.test(msg) == true) {
while (pattern.exec(msg)) msg = msg.replace(pattern, el.getAttribute(RegExp.$1));
}
for (var i in _errDos) {
switch (_errDos[i]) {
case "delete": el.value = ""; break;
case "select": el.select(); break;
case "focus": el.focus(); break;
}
}
//----------------- h
// 경고문(alert) 등록시. ex( halt="체크박스 버튼을 체크해 주세요" )
if(!(el.getAttribute("HALT") == null || el.getAttribute("HALT") == "")){
this.errMsg = ""+el.getAttribute("HALT") +"\n";
return false;
}
// nname 인자가 없는경우 메세지 ex(nname="" : 메세지 --> this.ERR_MSG )
if(el.getAttribute("rname") == null || el.getAttribute("rname") == ""){
this.errMsg = ""+msg +"\n";
return false;
}else{
// this.errMsg = "["+ elName +"]\n\n- "+ msg +"\n";
this.errMsg = ""+msg +"\n";
return false;
}
//------------------- h
}
ckForm.prototype.getErrorMessage = function() {
return this.errMsg;
}
ckForm.prototype.getName = function(el) {
return el.getAttribute("rname") == null || el.getAttribute("rname") == ""
? el.name : el.getAttribute("rname");
}
/**
* validate functions
*/
ckForm.prototype.func_email = function(el,value) {
var value = value ? value : el.value;
var pattern = /^[_a-zA-Z0-9-\.]+@[\.a-zA-Z0-9-]+\.[a-zA-Z]+$/;
return pattern.test(value) ? true : "invalid";
}
ckForm.prototype.func_hangul = function(el) {
var pattern = /[가-힝]/;
return pattern.test(el.value) ? true : "반드시 한글을 포함해야 합니다";
}
ckForm.prototype.func_engonly = function(el) {
var pattern = /^[a-zA-Z]+$/;
return pattern.test(el.value) ? true : "invalid";
}
ckForm.prototype.func_number = function(el) {
var pattern = /^[0-9]+$/;
return pattern.test(el.value) ? true : "반드시 숫자로만 입력해야 합니다";
}
/*
ckForm.prototype.func_residentno = function(el,value) {
var pattern = /^(\d{6})-?(\d{5}(\d{1})\d{1})$/;
var num = value ? value : el.value;
if (!pattern.test(num)) return "invalid";
num = RegExp.$1 + RegExp.$2;
if (RegExp.$3 == 7 || RegExp.$3 == 8 || RegExp.$4 == 9)
if ((num[7]*10 + num[8]) %2) return "invalid";
var sum = 0;
var last = num.charCodeAt(12) - 0x30;
var bases = "234567892345";
for (var i=0; i<12; i++) {
if (isNaN(num.substring(i,i+1))) return "invalid";
sum += (num.charCodeAt(i) - 0x30) * (bases.charCodeAt(i) - 0x30);
}
var mod = sum % 11;
if(RegExp.$3 == 7 || RegExp.$3 == 8 || RegExp.$4 == 9)
return (11 - mod + 2) % 10 == last ? true : "invalid";
else
return (11 - mod) % 10 == last ? true : "invalid";
}
*/
/*
ckForm.prototype.func_jumin = function(el,value) {
var pattern = /^([0-9]{6})-?([0-9]{7})$/;
var num = value ? value : el.value;
if (!pattern.test(num)) return "invalid";
num = RegExp.$1 + RegExp.$2;
var sum = 0;
var last = num.charCodeAt(12) - 0x30;
var bases = "234567892345";
for (var i=0; i<12; i++) {
if (isNaN(num.substring(i,i+1))) return "invalid";
sum += (num.charCodeAt(i) - 0x30) * (bases.charCodeAt(i) - 0x30);
}
var mod = sum % 11;
return (11 - mod) % 10 == last ? true : "invalid";
}
*/
/*
ckForm.prototype.func_foreignerno = function(el,value) {
var pattern = /^(\d{6})-?(\d{5}[7-9]\d{1})$/;
var num = value ? value : el.value;
if (!pattern.test(num)) return "invalid";
num = RegExp.$1 + RegExp.$2;
if ((num[7]*10 + num[8]) %2) return "invalid";
var sum = 0;
var last = num.charCodeAt(12) - 0x30;
var bases = "234567892345";
for (var i=0; i<12; i++) {
if (isNaN(num.substring(i,i+1))) return "invalid";
sum += (num.charCodeAt(i) - 0x30) * (bases.charCodeAt(i) - 0x30);
}
var mod = sum % 11;
return (11 - mod + 2) % 10 == last ? true : "invalid";
}
*/
/*
ckForm.prototype.func_bizno = function(el,value) {
var pattern = /([0-9]{3})-?([0-9]{2})-?([0-9]{5})/;
var num = value ? value : el.value;
if (!pattern.test(num)) return "invalid";
num = RegExp.$1 + RegExp.$2 + RegExp.$3;
var cVal = 0;
for (var i=0; i<8; i++) {
var cKeyNum = parseInt(((_tmp = i % 3) == 0) ? 1 : ( _tmp == 1 ) ? 3 : 7);
cVal += (parseFloat(num.substring(i,i+1)) * cKeyNum) % 10;
}
var li_temp = parseFloat(num.substring(i,i+1)) * 5 + "0";
cVal += parseFloat(li_temp.substring(0,1)) + parseFloat(li_temp.substring(1,2));
return parseInt(num.substring(9,10)) == 10-(cVal % 10)%10 ? true : "invalid";
}
*/
/*
ckForm.prototype.func_phone = function(el,value) {
var pattern = /^(0[2-8][0-5]?|01[01346-9])-?([1-9]{1}[0-9]{2,3})-?([0-9]{4})$/;
var pattern15xx = /^(1544|1566|1577|1588|1644|1688)-?([0-9]{4})$/;
var num = value ? value : el.value;
return pattern.exec(num) || pattern15xx.exec(num) ? true : "invalid";
}
ckForm.prototype.func_homephone = function(el,value) {
var pattern = /^(0[2-8][0-5]?)-?([1-9]{1}[0-9]{2,3})-?([0-9]{4})$/;
var pattern15xx = /^(1544|1566|1577|1588|1644|1688)-?([0-9]{4})$/;
var num = value ? value : el.value;
return pattern.exec(num) || pattern15xx.exec(num) ? true : "invalid";
}
ckForm.prototype.func_handphone = function(el,value) {
var pattern = /^(01[01346-9])-?([1-9]{1}[0-9]{2,3})-?([0-9]{4})$/;
var num = value ? value : el.value;
return pattern.exec(num) ? true : "invalid";
}
*/

869
Lib/json2.asp Normal file
View File

@@ -0,0 +1,869 @@
<script language="Javascript" runat="server">
/*
File: json2.asp
AXE(ASP Xtreme Evolution) JSON parser based on Douglas Crockford json2.js.
This class is the result of Classic ASP JSON topic revisited by Fabio Zendhi
Nagao (nagaozen). JSON2.ASP is a better option over JSON.ASP because it embraces
the AXE philosophy of real collaboration over the languages. It works under the
original json parser, so this class is strict in the standard rules, it also
brings more of the Javascript json feeling to other ASP languages (eg. no more
oJson.getElement("foo") stuff, just oJson.foo and you get it).
License:
This file is part of ASP Xtreme Evolution.
Copyright (C) 2007-2012 Fabio Zendhi Nagao
ASP Xtreme Evolution is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ASP Xtreme Evolution is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with ASP Xtreme Evolution. If not, see <http://www.gnu.org/licenses/>.
Class: JSON
JSON (Javascript Object Notation) is a lightweight data-interchange format. It
is easy for humans to read and write. It is easy for machines to parse and
generate. It is based on a subset of the Javascript Programming Language,
Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is
completely language independent but uses conventions that are familiar to
programmers of the C-family of languages, including C, C++, C#, Java,
Javascript, Perl, Python, and many others. These properties make JSON an ideal
data-interchange language.
Notes:
- Javascript extensions concept inspired by Troy Foster JSON2.ASP work <http://tforster.wik.is/ASP_Classic_Practices_For_The_21st_Century/JSON4ASP>.
- Javascript JSON parser is the Douglas Crockford json2.js <http://www.JSON.org/json2.js>, without the first line alert(...) and fixing "this.JSON = {};" to "JSON = {};" to make it JScript compatible.
- Javascript JSON.toXML is based on the Prof. Stefan Gössner "Converting Between XML and JSON" pragmatic approach <http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html>.
About:
- Written by Fabio Zendhi Nagao <http://zend.lojcomm.com.br/> @ August 2010
Function: parse
This method parses a JSON text to produce an object or array. It can throw a SyntaxError exception.
Parameters:
(string) - Valid JSON text.
Returns:
(mixed) - a Javascript value, usually an object or array.
Example:
(start code)
dim Info : set Info = JSON.parse(join(array( _
"{", _
" ""firstname"": ""Fabio"",", _
" ""lastname"": ""長尾"",", _
" ""alive"": true,", _
" ""age"": 27,", _
" ""nickname"": ""nagaozen"",", _
" ""fruits"": [", _
" ""banana"",", _
" ""orange"",", _
" ""apple"",", _
" ""papaya"",", _
" ""pineapple""", _
" ],", _
" ""complex"": {", _
" ""real"": 1,", _
" ""imaginary"": 2", _
" }", _
"}" _
)))
Response.write(Info.firstname & vbNewline) ' prints Fabio
Response.write(Info.alive & vbNewline) ' prints True
Response.write(Info.age & vbNewline) ' prints 27
Response.write(Info.fruits.get(0) & vbNewline) ' prints banana
Response.write(Info.fruits.get(1) & vbNewline) ' prints orange
Response.write(Info.complex.real & vbNewline) ' prints 1
Response.write(Info.complex.imaginary & vbNewline) ' prints 2
' You can also enumerate object properties ...
dim key : for each key in Info.keys()
Response.write( key & vbNewline )
next
' which prints:
' firstname
' lastname
' alive
' age
' nickname
' fruits
' complex
set Info = nothing
(end code)
Function: stringify
This method produces a JSON text from a Javascript value.
Parameters:
(mixed) - any Javascript value, usually an object or array.
(mixed) - an optional parameter that determines how object values are stringified for objects. It can be a function or an array of strings.
(mixed) - an optional parameter that specifies the indentation of nested structures. If it is omitted, the text will be packed without extra whitespace. If it is a number, it will specify the number of spaces to indent at each level. If it is a string (such as '\t' or '&nbsp;'), it contains the characters used to indent at each level.
Returns:
(string) - a string that contains the serialized JSON text.
Example:
(start code)
dim Info : set Info = JSON.parse("{""firstname"":""Fabio"", ""lastname"":""長尾""}")
Info.set "alive", true
Info.set "age", 27
Info.set "nickname", "nagaozen"
Info.set "fruits", array("banana","orange","apple","papaya","pineapple")
Info.set "complex", JSON.parse("{""real"":1, ""imaginary"":1}")
Response.write( JSON.stringify(Info, null, 2) & vbNewline ) ' prints the text below:
'{
' "firstname": "Fabio",
' "lastname": "長尾",
' "alive": true,
' "age": 27,
' "nickname": "nagaozen",
' "fruits": [
' "banana",
' "orange",
' "apple",
' "papaya",
' "pineapple"
' ],
' "complex": {
' "real": 1,
' "imaginary": 1
' }
'}
set Info = nothing
(end code)
Function: toXML
This method produces a XML text from a Javascript value.
Parameters:
(mixed) - any Javascript value, usually an object or array.
(string) - an optional parameter that determines what tag should be used as a container for the output. Defaults to none.
Returns:
(string) - a string that contains the serialized XML text.
Example:
(start code)
dim Info : set Info = JSON.parse("{""firstname"":""Fabio"", ""lastname"":""長尾""}")
Info.set "alive", true
Info.set "age", 27
Info.set "nickname", "nagaozen"
Info.set "fruits", array("banana","orange","apple","papaya","pineapple")
Info.set "complex", JSON.parse("{""real"":1, ""imaginary"":1}")
Response.write( JSON.toXML(Info) & vbNewline ) ' prints the text below:
'<firstname>Fabio</firstname>
'<lastname>長尾</lastname>
'<alive>true</alive>
'<age>27</age>
'<nickname>nagaozen</nickname>
'<fruits>banana</fruits>
'<fruits>orange</fruits>
'<fruits>apple</fruits>
'<fruits>papaya</fruits>
'<fruits>pineapple</fruits>
'<complex>
' <real>1</real>
' <imaginary>1</imaginary>
'</complex>
set Info = nothing
(end code)
*/
if(!Object.prototype.get) {
Object.prototype.get = function(k) {
return this[k];
}
}
if(!Object.prototype.set) {
Object.prototype.set = function(k,v) {
if(typeof(v) == "unknown") {
try {
v = (new VBArray(v)).toArray();
} catch(e) {
return;
}
}
this[k] = v;
}
}
if(!Object.prototype.purge) {
Object.prototype.purge = function(k) {
delete this[k];
}
}
if(!Object.prototype.keys) {
Object.prototype.keys = function() {
var d = new ActiveXObject("Scripting.Dictionary");
for(var key in this) {
if(this.hasOwnProperty(key)) {
d.add(key, null);
}
}
return d.keys();
}
}
if(!String.prototype.sanitize) {
String.prototype.sanitize = function(a, b) {
var len = a.length,
s = this;
if(len !== b.length) throw new TypeError('Invalid procedure call. Both arrays should have the same size.');
for(var i = 0; i < len; i++) {
var re = new RegExp(a[i],'g');
s = s.replace(re, b[i]);
}
return s;
}
}
if(!String.prototype.substitute) {
String.prototype.substitute = function(object, regexp){
return this.replace(regexp || (/\\?\{([^{}]+)\}/g), function(match, name){
if (match.charAt(0) == '\\') return match.slice(1);
return (object[name] != undefined) ? object[name] : '';
});
}
}
/*
json2.js
2011-10-19
Public Domain.
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
See http://www.JSON.org/js.html
This code should be minified before deployment.
See http://javascript.crockford.com/jsmin.html
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
NOT CONTROL.
This file creates a global JSON object containing two methods: stringify
and parse.
JSON.stringify(value, replacer, space)
value any JavaScript value, usually an object or array.
replacer an optional parameter that determines how object
values are stringified for objects. It can be a
function or an array of strings.
space an optional parameter that specifies the indentation
of nested structures. If it is omitted, the text will
be packed without extra whitespace. If it is a number,
it will specify the number of spaces to indent at each
level. If it is a string (such as '\t' or '&nbsp;'),
it contains the characters used to indent at each level.
This method produces a JSON text from a JavaScript value.
When an object value is found, if the object contains a toJSON
method, its toJSON method will be called and the result will be
stringified. A toJSON method does not serialize: it returns the
value represented by the name/value pair that should be serialized,
or undefined if nothing should be serialized. The toJSON method
will be passed the key associated with the value, and this will be
bound to the value
For example, this would serialize Dates as ISO strings.
Date.prototype.toJSON = function (key) {
function f(n) {
// Format integers to have at least two digits.
return n < 10 ? '0' + n : n;
}
return this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z';
};
You can provide an optional replacer method. It will be passed the
key and value of each member, with this bound to the containing
object. The value that is returned from your method will be
serialized. If your method returns undefined, then the member will
be excluded from the serialization.
If the replacer parameter is an array of strings, then it will be
used to select the members to be serialized. It filters the results
such that only members with keys listed in the replacer array are
stringified.
Values that do not have JSON representations, such as undefined or
functions, will not be serialized. Such values in objects will be
dropped; in arrays they will be replaced with null. You can use
a replacer function to replace those with JSON values.
JSON.stringify(undefined) returns undefined.
The optional space parameter produces a stringification of the
value that is filled with line breaks and indentation to make it
easier to read.
If the space parameter is a non-empty string, then that string will
be used for indentation. If the space parameter is a number, then
the indentation will be that many spaces.
Example:
text = JSON.stringify(['e', {pluribus: 'unum'}]);
// text is '["e",{"pluribus":"unum"}]'
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
text = JSON.stringify([new Date()], function (key, value) {
return this[key] instanceof Date ?
'Date(' + this[key] + ')' : value;
});
// text is '["Date(---current time---)"]'
JSON.parse(text, reviver)
This method parses a JSON text to produce an object or array.
It can throw a SyntaxError exception.
The optional reviver parameter is a function that can filter and
transform the results. It receives each of the keys and values,
and its return value is used instead of the original value.
If it returns what it received, then the structure is not modified.
If it returns undefined then the member is deleted.
Example:
// Parse the text. Values that look like ISO date strings will
// be converted to Date objects.
myData = JSON.parse(text, function (key, value) {
var a;
if (typeof value === 'string') {
a =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
if (a) {
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+a[5], +a[6]));
}
}
return value;
});
myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
var d;
if (typeof value === 'string' &&
value.slice(0, 5) === 'Date(' &&
value.slice(-1) === ')') {
d = new Date(value.slice(5, -1));
if (d) {
return d;
}
}
return value;
});
This is a reference implementation. You are free to copy, modify, or
redistribute.
*/
/*jslint evil: true, regexp: true */
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
lastIndex, length, parse, prototype, push, replace, slice, stringify,
test, toJSON, toString, valueOf
*/
// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.
var JSON;
if (!JSON) {
JSON = {};
}
(function () {
'use strict';
function f(n) {
// Format integers to have at least two digits.
return n < 10 ? '0' + n : n;
}
if (typeof Date.prototype.toJSON !== 'function') {
Date.prototype.toJSON = function (key) {
return isFinite(this.valueOf())
? this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z'
: null;
};
String.prototype.toJSON =
Number.prototype.toJSON =
Boolean.prototype.toJSON = function (key) {
return this.valueOf();
};
}
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
gap,
indent,
meta = { // table of character substitutions
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
},
rep;
function quote(string) {
// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.
escapable.lastIndex = 0;
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
var c = meta[a];
return typeof c === 'string'
? c
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"' : '"' + string + '"';
}
function str(key, holder) {
// Produce a string from holder[key].
var i, // The loop counter.
k, // The member key.
v, // The member value.
length,
mind = gap,
partial,
value = holder[key];
// If the value has a toJSON method, call it to obtain a replacement value.
if (value && typeof value === 'object' &&
typeof value.toJSON === 'function') {
value = value.toJSON(key);
}
// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.
if (typeof rep === 'function') {
value = rep.call(holder, key, value);
}
// What happens next depends on the value's type.
switch (typeof value) {
case 'string':
return quote(value);
case 'number':
// JSON numbers must be finite. Encode non-finite numbers as null.
return isFinite(value) ? String(value) : 'null';
case 'boolean':
case 'null':
// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce 'null'. The case is included here in
// the remote chance that this gets fixed someday.
return String(value);
// If the type is 'object', we might be dealing with an object or an array or
// null.
case 'object':
// Due to a specification blunder in ECMAScript, typeof null is 'object',
// so watch out for that case.
if (!value) {
return 'null';
}
// Make an array to hold the partial results of stringifying this object value.
gap += indent;
partial = [];
// Is the value an array?
if (Object.prototype.toString.apply(value) === '[object Array]') {
// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.
length = value.length;
for (i = 0; i < length; i += 1) {
partial[i] = str(i, value) || 'null';
}
// Join all of the elements together, separated with commas, and wrap them in
// brackets.
v = partial.length === 0
? '[]'
: gap
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
: '[' + partial.join(',') + ']';
gap = mind;
return v;
}
// If the replacer is an array, use it to select the members to be stringified.
if (rep && typeof rep === 'object') {
length = rep.length;
for (i = 0; i < length; i += 1) {
if (typeof rep[i] === 'string') {
k = rep[i];
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
} else {
// Otherwise, iterate through all of the keys in the object.
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
}
// Join all of the member texts together, separated with commas,
// and wrap them in braces.
v = partial.length === 0
? '{}'
: gap
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
: '{' + partial.join(',') + '}';
gap = mind;
return v;
}
}
// If the JSON object does not yet have a stringify method, give it one.
if (typeof JSON.stringify !== 'function') {
JSON.stringify = function (value, replacer, space) {
// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.
var i;
gap = '';
indent = '';
// If the space parameter is a number, make an indent string containing that
// many spaces.
if (typeof space === 'number') {
for (i = 0; i < space; i += 1) {
indent += ' ';
}
// If the space parameter is a string, it will be used as the indent string.
} else if (typeof space === 'string') {
indent = space;
}
// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.
rep = replacer;
if (replacer && typeof replacer !== 'function' &&
(typeof replacer !== 'object' ||
typeof replacer.length !== 'number')) {
throw new Error('JSON.stringify');
}
// Make a fake root object containing our value under the key of ''.
// Return the result of stringifying the value.
return str('', {'': value});
};
}
// If the JSON object does not yet have a parse method, give it one.
if (typeof JSON.parse !== 'function') {
JSON.parse = function (text, reviver) {
// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.
var j;
function walk(holder, key) {
// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.
var k, v, value = holder[key];
if (value && typeof value === 'object') {
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = walk(value, k);
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
}
}
}
return reviver.call(holder, key, value);
}
// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.
text = String(text);
cx.lastIndex = 0;
if (cx.test(text)) {
text = text.replace(cx, function (a) {
return '\\u' +
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
});
}
// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with '()' and 'new'
// because they can cause invocation, and '=' because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.
// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
if (/^[\],:{}\s]*$/
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.
j = eval('(' + text + ')');
// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.
return typeof reviver === 'function'
? walk({'': j}, '')
: j;
}
// If the text is not JSON parseable, then a SyntaxError is thrown.
throw new SyntaxError('JSON.parse');
};
}
}());
(function(){
function __sanitize(value) {
return value.sanitize(
['&', '<', '>', '\'', '"'],
['&amp;','&lt;','&gt;', '&apos;','&quot;']
);
};
function __toXML(o, t) {
var xml = [];
switch( typeof o ) {
case "object":
if(o.length) {
var a = o;
if(a.length === 0) {
xml.push("<{tag}/>".substitute({"tag":t}));
} else {
for(var i = 0, len = a.length; i < len; i++) {
xml.push(__toXML(a[i], t));
}
}
} else {
xml.push("<{tag}".substitute({"tag":t}));
var childs = [];
for(var p in o) {
if(o.hasOwnProperty(p)) {
if(p.charAt(0) === "@") xml.push(" {param}='{content}'".substitute({"param":p.substr(1), "content":__sanitize(o[p].toString())}));
else childs.push(p);
}
}
if(childs.length === 0) {
xml.push("/>");
} else {
xml.push(">");
for(var i = 0, len = childs.length; i < len; i++) {
if(p === "#text") { xml.push(__sanitize(o[childs[i]])); }
else if(p === "#cdata") { xml.push("<![CDATA[{code}]]>".substitute({"code": o[childs[i]].toString()})); }
else if(p.charAt(0) !== "@") { xml.push(__toXML(o[childs[i]], childs[i])); }
}
xml.push("</{tag}>".substitute({"tag":t}));
}
}
break;
default:
var s = String(o);
if(s.length === 0) {
xml.push("<{tag}/>".substitute({"tag":t}));
} else {
xml.push("<{tag}>{value}</{tag}>".substitute({"tag":t, "value":__sanitize(s)}));
}
}
return xml.join('');
}
if (typeof JSON.toXML !== 'function') {
JSON.toXML = function(json, container){
//container = container || "";
var xml = [];
if(container) xml.push("<{tag}>".substitute({"tag":container}));
for(var p in json) {
if(json.hasOwnProperty(p)) {
xml.push(__toXML(json[p], p));
}
}
if(container) xml.push("</{tag}>".substitute({"tag":container}));
return xml.join('');
}
}
})();
</script>

357
Lib/md5.asp Normal file
View File

@@ -0,0 +1,357 @@
<%
Private Const BITS_TO_A_BYTE = 8
Private Const BYTES_TO_A_WORD = 4
Private Const BITS_TO_A_WORD = 32
Private m_lOnBits(30)
Private m_l2Power(30)
m_lOnBits(0) = CLng(1)
m_lOnBits(1) = CLng(3)
m_lOnBits(2) = CLng(7)
m_lOnBits(3) = CLng(15)
m_lOnBits(4) = CLng(31)
m_lOnBits(5) = CLng(63)
m_lOnBits(6) = CLng(127)
m_lOnBits(7) = CLng(255)
m_lOnBits(8) = CLng(511)
m_lOnBits(9) = CLng(1023)
m_lOnBits(10) = CLng(2047)
m_lOnBits(11) = CLng(4095)
m_lOnBits(12) = CLng(8191)
m_lOnBits(13) = CLng(16383)
m_lOnBits(14) = CLng(32767)
m_lOnBits(15) = CLng(65535)
m_lOnBits(16) = CLng(131071)
m_lOnBits(17) = CLng(262143)
m_lOnBits(18) = CLng(524287)
m_lOnBits(19) = CLng(1048575)
m_lOnBits(20) = CLng(2097151)
m_lOnBits(21) = CLng(4194303)
m_lOnBits(22) = CLng(8388607)
m_lOnBits(23) = CLng(16777215)
m_lOnBits(24) = CLng(33554431)
m_lOnBits(25) = CLng(67108863)
m_lOnBits(26) = CLng(134217727)
m_lOnBits(27) = CLng(268435455)
m_lOnBits(28) = CLng(536870911)
m_lOnBits(29) = CLng(1073741823)
m_lOnBits(30) = CLng(2147483647)
m_l2Power(0) = CLng(1)
m_l2Power(1) = CLng(2)
m_l2Power(2) = CLng(4)
m_l2Power(3) = CLng(8)
m_l2Power(4) = CLng(16)
m_l2Power(5) = CLng(32)
m_l2Power(6) = CLng(64)
m_l2Power(7) = CLng(128)
m_l2Power(8) = CLng(256)
m_l2Power(9) = CLng(512)
m_l2Power(10) = CLng(1024)
m_l2Power(11) = CLng(2048)
m_l2Power(12) = CLng(4096)
m_l2Power(13) = CLng(8192)
m_l2Power(14) = CLng(16384)
m_l2Power(15) = CLng(32768)
m_l2Power(16) = CLng(65536)
m_l2Power(17) = CLng(131072)
m_l2Power(18) = CLng(262144)
m_l2Power(19) = CLng(524288)
m_l2Power(20) = CLng(1048576)
m_l2Power(21) = CLng(2097152)
m_l2Power(22) = CLng(4194304)
m_l2Power(23) = CLng(8388608)
m_l2Power(24) = CLng(16777216)
m_l2Power(25) = CLng(33554432)
m_l2Power(26) = CLng(67108864)
m_l2Power(27) = CLng(134217728)
m_l2Power(28) = CLng(268435456)
m_l2Power(29) = CLng(536870912)
m_l2Power(30) = CLng(1073741824)
Private Function LShift(lValue, iShiftBits)
If iShiftBits = 0 Then
LShift = lValue
Exit Function
ElseIf iShiftBits = 31 Then
If lValue And 1 Then
LShift = &H80000000
Else
LShift = 0
End If
Exit Function
ElseIf iShiftBits < 0 Or iShiftBits > 31 Then
Err.Raise 6
End If
If (lValue And m_l2Power(31 - iShiftBits)) Then
LShift = ((lValue And m_lOnBits(31 - (iShiftBits + 1))) * m_l2Power(iShiftBits)) Or &H80000000
Else
LShift = ((lValue And m_lOnBits(31 - iShiftBits)) * m_l2Power(iShiftBits))
End If
End Function
Private Function RShift(lValue, iShiftBits)
If iShiftBits = 0 Then
RShift = lValue
Exit Function
ElseIf iShiftBits = 31 Then
If lValue And &H80000000 Then
RShift = 1
Else
RShift = 0
End If
Exit Function
ElseIf iShiftBits < 0 Or iShiftBits > 31 Then
Err.Raise 6
End If
RShift = (lValue And &H7FFFFFFE) \ m_l2Power(iShiftBits)
If (lValue And &H80000000) Then
RShift = (RShift Or (&H40000000 \ m_l2Power(iShiftBits - 1)))
End If
End Function
Private Function RotateLeft(lValue, iShiftBits)
RotateLeft = LShift(lValue, iShiftBits) Or RShift(lValue, (32 - iShiftBits))
End Function
Private Function AddUnsigned(lX, lY)
Dim lX4
Dim lY4
Dim lX8
Dim lY8
Dim lResult
lX8 = lX And &H80000000
lY8 = lY And &H80000000
lX4 = lX And &H40000000
lY4 = lY And &H40000000
lResult = (lX And &H3FFFFFFF) + (lY And &H3FFFFFFF)
If lX4 And lY4 Then
lResult = lResult Xor &H80000000 Xor lX8 Xor lY8
ElseIf lX4 Or lY4 Then
If lResult And &H40000000 Then
lResult = lResult Xor &HC0000000 Xor lX8 Xor lY8
Else
lResult = lResult Xor &H40000000 Xor lX8 Xor lY8
End If
Else
lResult = lResult Xor lX8 Xor lY8
End If
AddUnsigned = lResult
End Function
Private Function F(x, y, z)
F = (x And y) Or ((Not x) And z)
End Function
Private Function G(x, y, z)
G = (x And z) Or (y And (Not z))
End Function
Private Function H(x, y, z)
H = (x Xor y Xor z)
End Function
Private Function I(x, y, z)
I = (y Xor (x Or (Not z)))
End Function
Private Sub FF(a, b, c, d, x, s, ac)
a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac))
a = RotateLeft(a, s)
a = AddUnsigned(a, b)
End Sub
Private Sub GG(a, b, c, d, x, s, ac)
a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac))
a = RotateLeft(a, s)
a = AddUnsigned(a, b)
End Sub
Private Sub HH(a, b, c, d, x, s, ac)
a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac))
a = RotateLeft(a, s)
a = AddUnsigned(a, b)
End Sub
Private Sub II(a, b, c, d, x, s, ac)
a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac))
a = RotateLeft(a, s)
a = AddUnsigned(a, b)
End Sub
Private Function ConvertToWordArray(sMessage)
Dim lMessageLength
Dim lNumberOfWords
Dim lWordArray()
Dim lBytePosition
Dim lByteCount
Dim lWordCount
Const MODULUS_BITS = 512
Const CONGRUENT_BITS = 448
lMessageLength = Len(sMessage)
lNumberOfWords = (((lMessageLength + ((MODULUS_BITS - CONGRUENT_BITS) \ BITS_TO_A_BYTE)) \ (MODULUS_BITS \ BITS_TO_A_BYTE)) + 1) * (MODULUS_BITS \ BITS_TO_A_WORD)
ReDim lWordArray(lNumberOfWords - 1)
lBytePosition = 0
lByteCount = 0
Do Until lByteCount >= lMessageLength
lWordCount = lByteCount \ BYTES_TO_A_WORD
lBytePosition = (lByteCount Mod BYTES_TO_A_WORD) * BITS_TO_A_BYTE
lWordArray(lWordCount) = lWordArray(lWordCount) Or LShift(Asc(Mid(sMessage, lByteCount + 1, 1)), lBytePosition)
lByteCount = lByteCount + 1
Loop
lWordCount = lByteCount \ BYTES_TO_A_WORD
lBytePosition = (lByteCount Mod BYTES_TO_A_WORD) * BITS_TO_A_BYTE
lWordArray(lWordCount) = lWordArray(lWordCount) Or LShift(&H80, lBytePosition)
lWordArray(lNumberOfWords - 2) = LShift(lMessageLength, 3)
lWordArray(lNumberOfWords - 1) = RShift(lMessageLength, 29)
ConvertToWordArray = lWordArray
End Function
Private Function WordToHex(lValue)
Dim lByte
Dim lCount
For lCount = 0 To 3
lByte = RShift(lValue, lCount * BITS_TO_A_BYTE) And m_lOnBits(BITS_TO_A_BYTE - 1)
WordToHex = WordToHex & Right("0" & Hex(lByte), 2)
Next
End Function
Public Function MD5(sMessage)
Dim x
Dim k
Dim AA
Dim BB
Dim CC
Dim DD
Dim a
Dim b
Dim c
Dim d
Const S11 = 7
Const S12 = 12
Const S13 = 17
Const S14 = 22
Const S21 = 5
Const S22 = 9
Const S23 = 14
Const S24 = 20
Const S31 = 4
Const S32 = 11
Const S33 = 16
Const S34 = 23
Const S41 = 6
Const S42 = 10
Const S43 = 15
Const S44 = 21
x = ConvertToWordArray(sMessage)
a = &H67452301
b = &HEFCDAB89
c = &H98BADCFE
d = &H10325476
For k = 0 To UBound(x) Step 16
AA = a
BB = b
CC = c
DD = d
FF a, b, c, d, x(k + 0), S11, &HD76AA478
FF d, a, b, c, x(k + 1), S12, &HE8C7B756
FF c, d, a, b, x(k + 2), S13, &H242070DB
FF b, c, d, a, x(k + 3), S14, &HC1BDCEEE
FF a, b, c, d, x(k + 4), S11, &HF57C0FAF
FF d, a, b, c, x(k + 5), S12, &H4787C62A
FF c, d, a, b, x(k + 6), S13, &HA8304613
FF b, c, d, a, x(k + 7), S14, &HFD469501
FF a, b, c, d, x(k + 8), S11, &H698098D8
FF d, a, b, c, x(k + 9), S12, &H8B44F7AF
FF c, d, a, b, x(k + 10), S13, &HFFFF5BB1
FF b, c, d, a, x(k + 11), S14, &H895CD7BE
FF a, b, c, d, x(k + 12), S11, &H6B901122
FF d, a, b, c, x(k + 13), S12, &HFD987193
FF c, d, a, b, x(k + 14), S13, &HA679438E
FF b, c, d, a, x(k + 15), S14, &H49B40821
GG a, b, c, d, x(k + 1), S21, &HF61E2562
GG d, a, b, c, x(k + 6), S22, &HC040B340
GG c, d, a, b, x(k + 11), S23, &H265E5A51
GG b, c, d, a, x(k + 0), S24, &HE9B6C7AA
GG a, b, c, d, x(k + 5), S21, &HD62F105D
GG d, a, b, c, x(k + 10), S22, &H2441453
GG c, d, a, b, x(k + 15), S23, &HD8A1E681
GG b, c, d, a, x(k + 4), S24, &HE7D3FBC8
GG a, b, c, d, x(k + 9), S21, &H21E1CDE6
GG d, a, b, c, x(k + 14), S22, &HC33707D6
GG c, d, a, b, x(k + 3), S23, &HF4D50D87
GG b, c, d, a, x(k + 8), S24, &H455A14ED
GG a, b, c, d, x(k + 13), S21, &HA9E3E905
GG d, a, b, c, x(k + 2), S22, &HFCEFA3F8
GG c, d, a, b, x(k + 7), S23, &H676F02D9
GG b, c, d, a, x(k + 12), S24, &H8D2A4C8A
HH a, b, c, d, x(k + 5), S31, &HFFFA3942
HH d, a, b, c, x(k + 8), S32, &H8771F681
HH c, d, a, b, x(k + 11), S33, &H6D9D6122
HH b, c, d, a, x(k + 14), S34, &HFDE5380C
HH a, b, c, d, x(k + 1), S31, &HA4BEEA44
HH d, a, b, c, x(k + 4), S32, &H4BDECFA9
HH c, d, a, b, x(k + 7), S33, &HF6BB4B60
HH b, c, d, a, x(k + 10), S34, &HBEBFBC70
HH a, b, c, d, x(k + 13), S31, &H289B7EC6
HH d, a, b, c, x(k + 0), S32, &HEAA127FA
HH c, d, a, b, x(k + 3), S33, &HD4EF3085
HH b, c, d, a, x(k + 6), S34, &H4881D05
HH a, b, c, d, x(k + 9), S31, &HD9D4D039
HH d, a, b, c, x(k + 12), S32, &HE6DB99E5
HH c, d, a, b, x(k + 15), S33, &H1FA27CF8
HH b, c, d, a, x(k + 2), S34, &HC4AC5665
II a, b, c, d, x(k + 0), S41, &HF4292244
II d, a, b, c, x(k + 7), S42, &H432AFF97
II c, d, a, b, x(k + 14), S43, &HAB9423A7
II b, c, d, a, x(k + 5), S44, &HFC93A039
II a, b, c, d, x(k + 12), S41, &H655B59C3
II d, a, b, c, x(k + 3), S42, &H8F0CCC92
II c, d, a, b, x(k + 10), S43, &HFFEFF47D
II b, c, d, a, x(k + 1), S44, &H85845DD1
II a, b, c, d, x(k + 8), S41, &H6FA87E4F
II d, a, b, c, x(k + 15), S42, &HFE2CE6E0
II c, d, a, b, x(k + 6), S43, &HA3014314
II b, c, d, a, x(k + 13), S44, &H4E0811A1
II a, b, c, d, x(k + 4), S41, &HF7537E82
II d, a, b, c, x(k + 11), S42, &HBD3AF235
II c, d, a, b, x(k + 2), S43, &H2AD7D2BB
II b, c, d, a, x(k + 9), S44, &HEB86D391
a = AddUnsigned(a, AA)
b = AddUnsigned(b, BB)
c = AddUnsigned(c, CC)
d = AddUnsigned(d, DD)
Next
MD5 = LCase(WordToHex(a) & WordToHex(b) & WordToHex(c) & WordToHex(d))
End Function
%>

417
Lib/sha256.asp Normal file
View File

@@ -0,0 +1,417 @@
<%
' See the VB6 project that accompanies this sample for full code comments on how
' it works.
'
' ASP VBScript code for generating a SHA256 'digest' or 'signature' of a string. The
' MD5 algorithm is one of the industry standard methods for generating digital
' signatures. It is generically known as a digest, digital signature, one-way
' encryption, hash or checksum algorithm. A common use for SHA256 is for password
' encryption as it is one-way in nature, that does not mean that your passwords
' are not free from a dictionary attack.
'
' If you are using the routine for passwords, you can make it a little more secure
' by concatenating some known random characters to the password before you generate
' the signature and on subsequent tests, so even if a hacker knows you are using
' SHA-256 for your passwords, the random characters will make it harder to dictionary
' attack.
'
' NOTE: Due to the way in which the string is processed the routine assumes a
' single byte character set. VB passes unicode (2-byte) character strings, the
' ConvertToWordArray function uses on the first byte for each character. This
' has been done this way for ease of use, to make the routine truely portable
' you could accept a byte array instead, it would then be up to the calling
' routine to make sure that the byte array is generated from their string in
' a manner consistent with the string type.
'
' This is 'free' software with the following restrictions:
'
' You may not redistribute this code as a 'sample' or 'demo'. However, you are free
' to use the source code in your own code, but you may not claim that you created
' the sample code. It is expressly forbidden to sell or profit from this source code
' other than by the knowledge gained or the enhanced value added by your own code.
'
' Use of this software is also done so at your own risk. The code is supplied as
' is without warranty or guarantee of any kind.
'
' Should you wish to commission some derivative work based on this code provided
' here, or any consultancy work, please do not hesitate to contact us.
'
' Web Site: http://www.frez.co.uk
' E-mail: sales@frez.co.uk
Class clsSHA256
Private m_lOnBits(30)
Private m_l2Power(30)
Private K(63)
'Const BITS_TO_A_BYTE = 8
'Const BYTES_TO_A_WORD = 4
'Const BITS_TO_A_WORD = 32
Private BITS_TO_A_BYTE
Private BYTES_TO_A_WORD
Private BITS_TO_A_WORD
Private sub Class_Initialize()
BITS_TO_A_BYTE = 8
BYTES_TO_A_WORD = 4
BITS_TO_A_WORD = 32
m_lOnBits(0) = CLng(1)
m_lOnBits(1) = CLng(3)
m_lOnBits(2) = CLng(7)
m_lOnBits(3) = CLng(15)
m_lOnBits(4) = CLng(31)
m_lOnBits(5) = CLng(63)
m_lOnBits(6) = CLng(127)
m_lOnBits(7) = CLng(255)
m_lOnBits(8) = CLng(511)
m_lOnBits(9) = CLng(1023)
m_lOnBits(10) = CLng(2047)
m_lOnBits(11) = CLng(4095)
m_lOnBits(12) = CLng(8191)
m_lOnBits(13) = CLng(16383)
m_lOnBits(14) = CLng(32767)
m_lOnBits(15) = CLng(65535)
m_lOnBits(16) = CLng(131071)
m_lOnBits(17) = CLng(262143)
m_lOnBits(18) = CLng(524287)
m_lOnBits(19) = CLng(1048575)
m_lOnBits(20) = CLng(2097151)
m_lOnBits(21) = CLng(4194303)
m_lOnBits(22) = CLng(8388607)
m_lOnBits(23) = CLng(16777215)
m_lOnBits(24) = CLng(33554431)
m_lOnBits(25) = CLng(67108863)
m_lOnBits(26) = CLng(134217727)
m_lOnBits(27) = CLng(268435455)
m_lOnBits(28) = CLng(536870911)
m_lOnBits(29) = CLng(1073741823)
m_lOnBits(30) = CLng(2147483647)
m_l2Power(0) = CLng(1)
m_l2Power(1) = CLng(2)
m_l2Power(2) = CLng(4)
m_l2Power(3) = CLng(8)
m_l2Power(4) = CLng(16)
m_l2Power(5) = CLng(32)
m_l2Power(6) = CLng(64)
m_l2Power(7) = CLng(128)
m_l2Power(8) = CLng(256)
m_l2Power(9) = CLng(512)
m_l2Power(10) = CLng(1024)
m_l2Power(11) = CLng(2048)
m_l2Power(12) = CLng(4096)
m_l2Power(13) = CLng(8192)
m_l2Power(14) = CLng(16384)
m_l2Power(15) = CLng(32768)
m_l2Power(16) = CLng(65536)
m_l2Power(17) = CLng(131072)
m_l2Power(18) = CLng(262144)
m_l2Power(19) = CLng(524288)
m_l2Power(20) = CLng(1048576)
m_l2Power(21) = CLng(2097152)
m_l2Power(22) = CLng(4194304)
m_l2Power(23) = CLng(8388608)
m_l2Power(24) = CLng(16777216)
m_l2Power(25) = CLng(33554432)
m_l2Power(26) = CLng(67108864)
m_l2Power(27) = CLng(134217728)
m_l2Power(28) = CLng(268435456)
m_l2Power(29) = CLng(536870912)
m_l2Power(30) = CLng(1073741824)
K(0) = &H428A2F98
K(1) = &H71374491
K(2) = &HB5C0FBCF
K(3) = &HE9B5DBA5
K(4) = &H3956C25B
K(5) = &H59F111F1
K(6) = &H923F82A4
K(7) = &HAB1C5ED5
K(8) = &HD807AA98
K(9) = &H12835B01
K(10) = &H243185BE
K(11) = &H550C7DC3
K(12) = &H72BE5D74
K(13) = &H80DEB1FE
K(14) = &H9BDC06A7
K(15) = &HC19BF174
K(16) = &HE49B69C1
K(17) = &HEFBE4786
K(18) = &HFC19DC6
K(19) = &H240CA1CC
K(20) = &H2DE92C6F
K(21) = &H4A7484AA
K(22) = &H5CB0A9DC
K(23) = &H76F988DA
K(24) = &H983E5152
K(25) = &HA831C66D
K(26) = &HB00327C8
K(27) = &HBF597FC7
K(28) = &HC6E00BF3
K(29) = &HD5A79147
K(30) = &H6CA6351
K(31) = &H14292967
K(32) = &H27B70A85
K(33) = &H2E1B2138
K(34) = &H4D2C6DFC
K(35) = &H53380D13
K(36) = &H650A7354
K(37) = &H766A0ABB
K(38) = &H81C2C92E
K(39) = &H92722C85
K(40) = &HA2BFE8A1
K(41) = &HA81A664B
K(42) = &HC24B8B70
K(43) = &HC76C51A3
K(44) = &HD192E819
K(45) = &HD6990624
K(46) = &HF40E3585
K(47) = &H106AA070
K(48) = &H19A4C116
K(49) = &H1E376C08
K(50) = &H2748774C
K(51) = &H34B0BCB5
K(52) = &H391C0CB3
K(53) = &H4ED8AA4A
K(54) = &H5B9CCA4F
K(55) = &H682E6FF3
K(56) = &H748F82EE
K(57) = &H78A5636F
K(58) = &H84C87814
K(59) = &H8CC70208
K(60) = &H90BEFFFA
K(61) = &HA4506CEB
K(62) = &HBEF9A3F7
K(63) = &HC67178F2
End Sub
'<27>Ҹ<EFBFBD><D2B8><EFBFBD>
Private Sub Class_Terminate()
End Sub
Private Function LShift(lValue, iShiftBits)
If iShiftBits = 0 Then
LShift = lValue
Exit Function
ElseIf iShiftBits = 31 Then
If lValue And 1 Then
LShift = &H80000000
Else
LShift = 0
End If
Exit Function
ElseIf iShiftBits < 0 Or iShiftBits > 31 Then
Err.Raise 6
End If
If (lValue And m_l2Power(31 - iShiftBits)) Then
LShift = ((lValue And m_lOnBits(31 - (iShiftBits + 1))) * m_l2Power(iShiftBits)) Or &H80000000
Else
LShift = ((lValue And m_lOnBits(31 - iShiftBits)) * m_l2Power(iShiftBits))
End If
End Function
Private Function RShift(lValue, iShiftBits)
If iShiftBits = 0 Then
RShift = lValue
Exit Function
ElseIf iShiftBits = 31 Then
If lValue And &H80000000 Then
RShift = 1
Else
RShift = 0
End If
Exit Function
ElseIf iShiftBits < 0 Or iShiftBits > 31 Then
Err.Raise 6
End If
RShift = (lValue And &H7FFFFFFE) \ m_l2Power(iShiftBits)
If (lValue And &H80000000) Then
RShift = (RShift Or (&H40000000 \ m_l2Power(iShiftBits - 1)))
End If
End Function
Private Function AddUnsigned(lX, lY)
Dim lX4
Dim lY4
Dim lX8
Dim lY8
Dim lResult
lX8 = lX And &H80000000
lY8 = lY And &H80000000
lX4 = lX And &H40000000
lY4 = lY And &H40000000
lResult = (lX And &H3FFFFFFF) + (lY And &H3FFFFFFF)
If lX4 And lY4 Then
lResult = lResult Xor &H80000000 Xor lX8 Xor lY8
ElseIf lX4 Or lY4 Then
If lResult And &H40000000 Then
lResult = lResult Xor &HC0000000 Xor lX8 Xor lY8
Else
lResult = lResult Xor &H40000000 Xor lX8 Xor lY8
End If
Else
lResult = lResult Xor lX8 Xor lY8
End If
AddUnsigned = lResult
End Function
Private Function Ch(x, y, z)
Ch = ((x And y) Xor ((Not x) And z))
End Function
Private Function Maj(x, y, z)
Maj = ((x And y) Xor (x And z) Xor (y And z))
End Function
Private Function S(x, n)
S = (RShift(x, (n And m_lOnBits(4))) Or LShift(x, (32 - (n And m_lOnBits(4)))))
End Function
Private Function R(x, n)
R = RShift(x, CInt(n And m_lOnBits(4)))
End Function
Private Function Sigma0(x)
Sigma0 = (S(x, 2) Xor S(x, 13) Xor S(x, 22))
End Function
Private Function Sigma1(x)
Sigma1 = (S(x, 6) Xor S(x, 11) Xor S(x, 25))
End Function
Private Function Gamma0(x)
Gamma0 = (S(x, 7) Xor S(x, 18) Xor R(x, 3))
End Function
Private Function Gamma1(x)
Gamma1 = (S(x, 17) Xor S(x, 19) Xor R(x, 10))
End Function
Private Function ConvertToWordArray(sMessage)
Dim lMessageLength
Dim lNumberOfWords
Dim lWordArray()
Dim lBytePosition
Dim lByteCount
Dim lWordCount
Dim lByte
Const MODULUS_BITS = 512
Const CONGRUENT_BITS = 448
lMessageLength = Len(sMessage)
lNumberOfWords = (((lMessageLength + ((MODULUS_BITS - CONGRUENT_BITS) \ BITS_TO_A_BYTE)) \ (MODULUS_BITS \ BITS_TO_A_BYTE)) + 1) * (MODULUS_BITS \ BITS_TO_A_WORD)
ReDim lWordArray(lNumberOfWords - 1)
lBytePosition = 0
lByteCount = 0
Do Until lByteCount >= lMessageLength
lWordCount = lByteCount \ BYTES_TO_A_WORD
lBytePosition = (3 - (lByteCount Mod BYTES_TO_A_WORD)) * BITS_TO_A_BYTE
lByte = AscB(Mid(sMessage, lByteCount + 1, 1))
lWordArray(lWordCount) = lWordArray(lWordCount) Or LShift(lByte, lBytePosition)
lByteCount = lByteCount + 1
Loop
lWordCount = lByteCount \ BYTES_TO_A_WORD
lBytePosition = (3 - (lByteCount Mod BYTES_TO_A_WORD)) * BITS_TO_A_BYTE
lWordArray(lWordCount) = lWordArray(lWordCount) Or LShift(&H80, lBytePosition)
lWordArray(lNumberOfWords - 1) = LShift(lMessageLength, 3)
lWordArray(lNumberOfWords - 2) = RShift(lMessageLength, 29)
ConvertToWordArray = lWordArray
End Function
Public Function SHA256(sMessage)
Dim HASH(7)
Dim M
Dim W(63)
Dim a
Dim b
Dim c
Dim d
Dim e
Dim f
Dim g
Dim h
Dim i
Dim j
Dim T1
Dim T2
HASH(0) = &H6A09E667
HASH(1) = &HBB67AE85
HASH(2) = &H3C6EF372
HASH(3) = &HA54FF53A
HASH(4) = &H510E527F
HASH(5) = &H9B05688C
HASH(6) = &H1F83D9AB
HASH(7) = &H5BE0CD19
M = ConvertToWordArray(sMessage)
For i = 0 To UBound(M) Step 16
a = HASH(0)
b = HASH(1)
c = HASH(2)
d = HASH(3)
e = HASH(4)
f = HASH(5)
g = HASH(6)
h = HASH(7)
For j = 0 To 63
If j < 16 Then
W(j) = M(j + i)
Else
W(j) = AddUnsigned(AddUnsigned(AddUnsigned(Gamma1(W(j - 2)), W(j - 7)), Gamma0(W(j - 15))), W(j - 16))
End If
T1 = AddUnsigned(AddUnsigned(AddUnsigned(AddUnsigned(h, Sigma1(e)), Ch(e, f, g)), K(j)), W(j))
T2 = AddUnsigned(Sigma0(a), Maj(a, b, c))
h = g
g = f
f = e
e = AddUnsigned(d, T1)
d = c
c = b
b = a
a = AddUnsigned(T1, T2)
Next
HASH(0) = AddUnsigned(a, HASH(0))
HASH(1) = AddUnsigned(b, HASH(1))
HASH(2) = AddUnsigned(c, HASH(2))
HASH(3) = AddUnsigned(d, HASH(3))
HASH(4) = AddUnsigned(e, HASH(4))
HASH(5) = AddUnsigned(f, HASH(5))
HASH(6) = AddUnsigned(g, HASH(6))
HASH(7) = AddUnsigned(h, HASH(7))
Next
SHA256 = LCase(Right("00000000" & Hex(HASH(0)), 8) & Right("00000000" & Hex(HASH(1)), 8) & Right("00000000" & Hex(HASH(2)), 8) & Right("00000000" & Hex(HASH(3)), 8) & Right("00000000" & Hex(HASH(4)), 8) & Right("00000000" & Hex(HASH(5)), 8) & Right("00000000" & Hex(HASH(6)), 8) & Right("00000000" & Hex(HASH(7)), 8))
End Function
End Class
%>

104
Lib/visit_click_log.asp Normal file
View File

@@ -0,0 +1,104 @@
<!--#include file="../project/2105012_C/include/Header.asp" -->
<%
'모바일인지 pc인지 체크하기
Dim mobileYN, mob_id, mob, splitmo, agent, sUserAgent, iNo, osVal, l_host, l_referer, l_ip_reg, l_now_page
Dim data_pkey, data_idkey, data_surveytype
Dim etc_1, etc_2, etc_3
'dim PRJCODE, IDKEY, SURVEYTY
On Error Resume Next
Dim CID : CID = Request("CID")
Dim ISCAPI : ISCAPI = "999"
PRJCODE = request("PRJCODE")
IDKEY = request("IDKEY")
SURVEYTY = request("SURVEYTYPE")
etc_1 = request("etc_1")
etc_2 = request("etc_2")
etc_3 = request("etc_3")
if CID = "wi11u215oh" then
ISCAPI = "ALL"
elseif CID = "83ex9w1qe2" then
ISCAPI = "0"
elseif CID = "85089yodxm" then
ISCAPI = "1"
elseif CID = "9xno5431w7" then
ISCAPI = "2"
elseif CID = "d66u9c5w0" then
ISCAPI = "3"
elseif CID = "E40caw63qg4" then
ISCAPI = "4"
elseif CID = "h6yubq8a2me" then
ISCAPI = "5"
end if
if iscapi = "999" then
response.write "유효하지 않은 링크입니다. 관리자에게 문의하세요."
response.end
end if
data_pkey = PRJCODE
data_idkey = IDKEY
data_surveytype = SURVEYTYPE
mobileYN = "pc"
mob_id = ""
'mob = "iPad|iPod|iPhone|Android|BlackBerry|SymbianOS|SCH-M\d+|Opera Mini|Windows CE|Nokia|SonyEricsson|webOS|PalmOS"
mob = "iPad|iPhone|iPod|Android|Windows CE|BlackBerry|SymbianOS|Symbian|SCH-M\d+|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson|PalmOS|LG|SAMSUNG|Samsung"
splitmo = split(mob,"|")
agent = Request.ServerVariables("HTTP_USER_AGENT")
For iNo = 0 to UBound(splitmo )
If InStr(agent,splitmo (iNo)) > 0 Then
mobileYN = "mobile"
mob_id = splitmo (iNo)
Exit For
End If
Next
sUserAgent = UCase(Request.ServerVariables("HTTP_USER_AGENT"))
if Instr(sUserAgent,"ANDROID") > 0 then
osVal = "ANDROID"
elseif Instr(sUserAgent,"IPAD") > 0 or Instr(sUserAgent,"IPHONE") > 0 then
osVal = "IOS"
else
osVal = "ETC"
end if
l_host = Request.ServerVariables("HTTP_HOST") //호스트 정보 추출
l_referer = Request.ServerVariables("HTTP_REFERER") //이전 페이지 정보(url 입력으로 접근은 값 없음)
l_ip_reg = Request.ServerVariables("REMOTE_ADDR") // IP 주소 추출
l_now_page = request.servervariables("HTTP_HOST") & request.servervariables("HTTP_url")
Dim strSQL_log
'//-- strSQL_log = "INSERT INTO KonKiwi.dbo.visit_log (user_agent, osVal, mob_id, mobileYN, host, referer, logdate, ip, etc_1, DATA_IDKEY, DATA_PKEY, now_page) VALUES( "
strSQL_log = "INSERT INTO KonKiwi.dbo.visit_click_log(DATA_IDKEY, DATA_PKEY, mobileYN, host, now_page, logdate, ip, etc_1, etc_2, etc_3) VALUES( "
strSQL_log = strSQL_log & "'" & data_idkey & "', "
strSQL_log = strSQL_log & "'" & data_pkey & "', "
strSQL_log = strSQL_log & "'" & mobileYN & "', "
strSQL_log = strSQL_log & "'" & l_host & "', "
strSQL_log = strSQL_log & "'" & l_now_page & "', "
strSQL_log = strSQL_log & " getdate(), "
strSQL_log = strSQL_log & "'" & l_ip_reg & "', "
strSQL_log = strSQL_log & "'" & etc_1 & "', "
strSQL_log = strSQL_log & "'" & etc_2 & "', "
strSQL_log = strSQL_log & "'" & etc_3 & "' "
strSQL_log = strSQL_log & " )"
'response.write strSQL_log
response.write "{""result"":""0000""}"
Call DBConnect2()
DBConn.Execute strSQL_log
call DBClose()
%>

85
Lib/visit_log.asp Normal file
View File

@@ -0,0 +1,85 @@
<%
'모바일인지 pc인지 체크하기
Dim mobileYN, mob_id, mob, splitmo, agent, sUserAgent, iNo, osVal, l_host, l_referer, l_ip_reg, l_now_page
Dim data_pkey, data_idkey, data_surveytype
On Error Resume Next
data_pkey = PRJCODE
data_idkey = IDKEY
data_surveytype = SURVEYTYPE
mobileYN = "pc"
mob_id = ""
'mob = "iPad|iPod|iPhone|Android|BlackBerry|SymbianOS|SCH-M\d+|Opera Mini|Windows CE|Nokia|SonyEricsson|webOS|PalmOS"
mob = "iPad|iPhone|iPod|Android|Windows CE|BlackBerry|SymbianOS|Symbian|SCH-M\d+|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson|PalmOS|LG|SAMSUNG|Samsung"
splitmo = split(mob,"|")
agent = Request.ServerVariables("HTTP_USER_AGENT")
For iNo = 0 to UBound(splitmo )
If InStr(agent,splitmo (iNo)) > 0 Then
mobileYN = "mobile"
mob_id = splitmo (iNo)
Exit For
End If
Next
sUserAgent = UCase(Request.ServerVariables("HTTP_USER_AGENT"))
if Instr(sUserAgent,"ANDROID") > 0 then
osVal = "ANDROID"
elseif Instr(sUserAgent,"IPAD") > 0 or Instr(sUserAgent,"IPHONE") > 0 then
osVal = "IOS"
else
osVal = "ETC"
end if
l_host = Request.ServerVariables("HTTP_HOST") //호스트 정보 추출
l_referer = Request.ServerVariables("HTTP_REFERER") //이전 페이지 정보(url 입력으로 접근은 값 없음)
l_ip_reg = Request.ServerVariables("REMOTE_ADDR") // IP 주소 추출
l_now_page = request.servervariables("HTTP_HOST") & request.servervariables("HTTP_url")
%>
<!--
<%'=sUserAgent %> -----
<%'=osVal %> -----
<%'=mob_id %> -----
<%'=mobileYN %> -----
<%'=agent %>
<%'=l_host %>
<%'=l_referer %>
<%'=l_ip_reg %>
<%'=l_now_page %>
-->
<%
Dim strSQL_log
strSQL_log = "INSERT INTO KonKiwi.dbo.visit_log (user_agent, osVal, mob_id, mobileYN, host, referer, logdate, ip, etc_1, DATA_IDKEY, DATA_PKEY, now_page) VALUES( "
strSQL_log = strSQL_log & "'" & agent & "', "
strSQL_log = strSQL_log & "'" & osVal & "', "
strSQL_log = strSQL_log & "'" & mob_id & "', "
strSQL_log = strSQL_log & "'" & mobileYN & "', "
strSQL_log = strSQL_log & "'" & l_host & "', "
strSQL_log = strSQL_log & "'" & l_referer & "', "
strSQL_log = strSQL_log & " getdate(), "
strSQL_log = strSQL_log & "'" & l_ip_reg & "', "
strSQL_log = strSQL_log & "'" & data_surveytype & "', "
strSQL_log = strSQL_log & "'" & data_idkey & "', "
strSQL_log = strSQL_log & "'" & data_pkey & "', "
strSQL_log = strSQL_log & "'" & l_now_page & "'"
strSQL_log = strSQL_log & " )"
'response.write strSQL_log
Call DBConnect2()
DBConn.Execute strSQL_log
call DBClose()
%>

View File

@@ -0,0 +1,450 @@
<!--METADATA TYPE= "typelib" NAME= "ADODB Type Library"
FILE="C:\Program Files\Common Files\SYSTEM\ADO\msado15.dll" -->
<%
Class clsDBHelper
Private DefaultConnString
Private DefaultConnection
Private m_ServerIP
Private m_DBName
Private m_UserID
Private m_UserPW
Dim cmd
Dim rs
Private sub Class_Initialize()
'----------------------------------------------------
'SQL OLE DB ConnString
'----------------------------------------------------
'DefaultConnString = "Provider=SQLOLEDB;Data Source=" & m_ServerIP & ";Initial Catalog=" & m_DBName & ";User Id=" & m_UserID & ";Password=" & m_UserPW & ";"
'----------------------------------------------------
'MS SQL DB ConnString
'----------------------------------------------------
DefaultConnString = "Driver=SQL Server; Server=" & m_ServerIP & "; Database=" & m_DBName & "; UID=" & m_UserID & "; PWD=" & m_UserPW
Set DefaultConnection = Nothing
End Sub
'소멸자
Private Sub Class_Terminate()
Set DefaultConnection = Nothing
End Sub
'---------------------------------------------------
' 서버 설정
'---------------------------------------------------
Public Property Set Server(mServer)
m_ServerIP = mServer
End Property
Public Property Set DBName(mDBName)
m_DBName = mDBName
End Property
Public Property Set UserID(mUserID)
m_UserID = mUserID
End Property
Public Property Set UserPW(mUserPW)
m_UserPW = mUserPW
End Property
'---------------------------------------------------
' SP를 실행하고, RecordSet을 반환한다.
'---------------------------------------------------
Public Function ExecSPReturnRS(spName, params, connectionString)
If IsObject(connectionString) Then
If connectionString is Nothing Then
If DefaultConnection is Nothing Then
Set DefaultConnection = CreateObject("ADODB.Connection")
DefaultConnection.Open DefaultConnString
End If
Set connectionString = DefaultConnection
End If
End If
Set rs = CreateObject("ADODB.RecordSet")
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = connectionString
cmd.CommandText = spName
cmd.CommandType = adCmdStoredProc
Set cmd = collectParams(cmd, params)
'cmd.Parameters.Refresh
rs.CursorLocation = adUseClient
rs.Open cmd, ,adOpenStatic, adLockReadOnly
For i = 0 To cmd.Parameters.Count - 1
If cmd.Parameters(i).Direction = adParamOutput OR cmd.Parameters(i).Direction = adParamInputOutput OR cmd.Parameters(i).Direction = adParamReturnValue Then
If IsObject(params) Then
If params is Nothing Then
Exit For
End If
Else
params(i)(4) = cmd.Parameters(i).Value
End If
End If
Next
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
If rs.State = adStateClosed Then
Set rs.Source = Nothing
End If
Set rs.ActiveConnection = Nothing
Set ExecSPReturnRS = rs
End Function
'---------------------------------------------------
' SQL Query를 실행하고, RecordSet을 반환한다.
'---------------------------------------------------
Public Function ExecSQLReturnRS(strSQL, params, connectionString)
If IsObject(connectionString) Then
If connectionString is Nothing Then
If DefaultConnection is Nothing Then
Set DefaultConnection = CreateObject("ADODB.Connection")
DefaultConnection.Open DefaultConnString
End If
Set connectionString = DefaultConnection
End If
End If
Set rs = CreateObject("ADODB.RecordSet")
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = connectionString
cmd.Prepared = true
cmd.CommandText = strSQL
cmd.CommandType = adCmdText
Set cmd = collectParams(cmd, params)
' On Error Resume Next
' Response.Write strSQL & "<BR>"
rs.CursorLocation = adUseClient
rs.Open cmd, , adOpenStatic, adLockReadOnly
If Err.Number<>0 Then
ErrorLog DefaultConnection.Number, DefaultConnection.Description
End IF
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
If rs.State = adStateClosed Then
Set rs.Source = Nothing
End If
Set rs.ActiveConnection = Nothing
Set ExecSQLReturnRS = rs
End Function
'---------------------------------------------------
' SQL Query를 실행하고, RecordSet Array을 반환한다.
'---------------------------------------------------
Public Function ExecSQLReturnAR(strSQL, params, connectionString)
If IsObject(connectionString) Then
If connectionString is Nothing Then
If DefaultConnection is Nothing Then
Set DefaultConnection = CreateObject("ADODB.Connection")
DefaultConnection.Open DefaultConnString
End If
Set connectionString = DefaultConnection
End If
End If
Set rs = CreateObject("ADODB.RecordSet")
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = connectionString
cmd.Prepared = true
cmd.CommandText = strSQL
cmd.CommandType = adCmdText
Set cmd = collectParams(cmd, params)
' On Error Resume Next
'Response.Write strSQL & "<BR>"& "<BR>"& "<BR>"& "<BR>"
rs.CursorLocation = adUseClient
rs.Open cmd, , adOpenStatic, adLockReadOnly
If Err.Number<>0 Then
ErrorLog DefaultConnection.Number, DefaultConnection.Description
End IF
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
If rs.State = adStateClosed Then
Set rs.Source = Nothing
End If
Set rs.ActiveConnection = Nothing
Set ExecSQLReturnAR = rs.getRows
End Function
'---------------------------------------------------
' SQL Query를 실행하고, RecordSet String을 반환한다.
'---------------------------------------------------
Public Function ExecSQLReturnST(strSQL, params, connectionString)
If IsObject(connectionString) Then
If connectionString is Nothing Then
If DefaultConnection is Nothing Then
Set DefaultConnection = CreateObject("ADODB.Connection")
DefaultConnection.Open DefaultConnString
End If
Set connectionString = DefaultConnection
End If
End If
Set rs = CreateObject("ADODB.RecordSet")
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = connectionString
cmd.Prepared = true
cmd.CommandText = strSQL
cmd.CommandType = adCmdText
Set cmd = collectParams(cmd, params)
' On Error Resume Next
'Response.Write strSQL & "<BR>"& "<BR>"& "<BR>"& "<BR>"
rs.CursorLocation = adUseClient
rs.Open cmd, , adOpenStatic, adLockReadOnly
If Err.Number<>0 Then
ErrorLog DefaultConnection.Number, DefaultConnection.Description
End IF
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
If rs.State = adStateClosed Then
Set rs.Source = Nothing
End If
Set rs.ActiveConnection = Nothing
Set ExecSQLReturnAR = rs.getString(2)
End Function
'---------------------------------------------------
' SP를 실행한다.(RecordSet 반환없음)
'---------------------------------------------------
Public Sub ExecSP(strSP,params,connectionString)
If IsObject(connectionString) Then
If connectionString is Nothing Then
If DefaultConnection is Nothing Then
Set DefaultConnection = CreateObject("ADODB.Connection")
DefaultConnection.Open DefaultConnString
End If
Set connectionString = DefaultConnection
End If
End If
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = connectionString
cmd.CommandText = strSP
cmd.CommandType = adCmdStoredProc
Set cmd = collectParams(cmd, params)
cmd.Execute , , adExecuteNoRecords
For i = 0 To cmd.Parameters.Count - 1
If cmd.Parameters(i).Direction = adParamOutput OR cmd.Parameters(i).Direction = adParamInputOutput OR cmd.Parameters(i).Direction = adParamReturnValue Then
If IsObject(params) Then
If params is Nothing Then
Exit For
End If
Else
params(i)(4) = cmd.Parameters(i).Value
End If
End If
Next
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
End Sub
'---------------------------------------------------
' SQL Query를 실행한다.(RecordSet 반환없음)
'---------------------------------------------------
Public Sub ExecSQL(strSQL,params,connectionString)
If IsObject(connectionString) Then
If connectionString is Nothing Then
If DefaultConnection is Nothing Then
Set DefaultConnection = CreateObject("ADODB.Connection")
DefaultConnection.Open DefaultConnString
End If
Set connectionString = DefaultConnection
End If
End If
On Error Resume Next
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = connectionString
cmd.CommandText = strSQL
cmd.CommandType = adCmdText
Set cmd = collectParams(cmd, params)
cmd.Execute , , adExecuteNoRecords
' If DefaultConnection.Errors.Count <> 0 Then
' For each objErr in DefaultConnection.Errors
' response.write("<p>")
' response.write("Description: ")
' response.write(objErr.Description & "<br>")
' response.write("Help context: ")
' response.write(objErr.HelpContext & "<br>")
' response.write("Help file: ")
' response.write(objErr.HelpFile & "<br>")
' response.write("Native error: ")
' response.write(objErr.NativeError & "<br>")
' response.write("Error number: ")
' response.write(objErr.Number & "<br>")
' response.write("Error source: ")
' response.write(objErr.Source & "<br>")
' response.write("SQL state: ")
' response.write(objErr.SQLState & "<br>")
' response.write("</p>")
' Next
' Response.End
' End IF
if err.number <> 0 then
response.Write("<b>SQL :</B>"&strSQL&"<br>")
response.Write("<b>err.description :</B>"&err.Description&"<br>")
response.Write("<b>err.number : </b>"&err.Number&"<br>")
response.Write("<b>err.Source : </b>"&err.Source&"<br>")
Response.End
End IF
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
End Sub
'---------------------------------------------------
' 트랜잭션을 시작하고, Connetion 개체를 반환한다.
'---------------------------------------------------
Public Function BeginTrans(connectionString)
If IsObject(connectionString) Then
If connectionString is Nothing Then
connectionString = DefaultConnString
End If
End If
Set conn = CreateObject("ADODB.Connection")
conn.Open connectionString
conn.BeginTrans
Set BeginTrans = conn
End Function
'---------------------------------------------------
' 활성화된 트랜잭션을 커밋한다.
'---------------------------------------------------
Public Sub CommitTrans(connectionObj)
If Not connectionObj Is Nothing Then
connectionObj.CommitTrans
connectionObj.Close
Set ConnectionObj = Nothing
End If
End Sub
'---------------------------------------------------
' 활성화된 트랜잭션을 롤백한다.
'---------------------------------------------------
Public Sub RollbackTrans(connectionObj)
If Not connectionObj Is Nothing Then
connectionObj.RollbackTrans
connectionObj.Close
Set ConnectionObj = Nothing
End If
End Sub
'---------------------------------------------------
' 배열로 매개변수를 만든다.
'---------------------------------------------------
Public Function MakeParam(PName,PType,PDirection,PSize,PValue)
MakeParam = Array(PName, PType, PDirection, PSize, PValue)
End Function
'---------------------------------------------------
' 매개변수 배열 내에서 지정된 이름의 매개변수 값을 반환한다.
'---------------------------------------------------
Public Function GetValue(params, paramName)
For Each param in params
If param(0) = paramName Then
GetValue = param(4)
Exit Function
End If
Next
End Function
Public Sub Dispose
if (Not DefaultConnection is Nothing) Then
if (DefaultConnection.State = adStateOpen) Then DefaultConnection.Close
Set DefaultConnection = Nothing
End if
End Sub
'---------------------------------------------------------------------------
'Array로 넘겨오는 파라메터를 Parsing 하여 Parameter 객체를
'생성하여 Command 객체에 추가한다.
'---------------------------------------------------------------------------
Private Function collectParams(cmd,argparams)
Dim params
Dim i,l,u,v
If VarType(argparams) = 8192 or VarType(argparams) = 8204 or VarType(argparams) = 8209 then
params = argparams
For i = LBound(params) To UBound(params)
l = LBound(params(i))
u = UBound(params(i))
' Check for nulls.
If u - l = 4 Then
If VarType(params(i)(4)) = vbString Then
If params(i)(4) = "" Then
v = Null
Else
v = Trim(params(i)(4))
End If
Else
v = params(i)(4)
End If
' On Error Resume Next
' If err.number <> 0 then
' Response.Write params(i)(0) & ":" & params(i)(1) & ":" & params(i)(2) & ":" & params(i)(3)& ":" &v&"<BR>"
' End If
If VarType(params(i)(4)) = vbString And params(i)(4) = "" Then
Set cnParam = cmd.CreateParameter(params(i)(0))
cnParam.attributes=adParamNullable
cnParam.type = params(i)(1)
cnParam.Direction = params(i)(2)
cnParam.Size=1
cnParam.value=Null
cmd.Parameters.Append cnParam 'cmd.CreateParameter(params(i)(0), params(i)(1), params(i)(2), params(i)(3), Null)
Else
cmd.Parameters.Append cmd.CreateParameter(params(i)(0), params(i)(1), params(i)(2), params(i)(3), v)
End If
End If
Next
Set collectParams = cmd
Exit Function
Else
Set collectParams = cmd
End If
End Function
End Class
%>

File diff suppressed because it is too large Load Diff

1
Project/.gitkeep Normal file
View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,484 @@
<!--#include file="./include/Header.asp" -->
<%
Dim PAGENAME : PAGENAME = request("NEXTPAGE")
Dim IDKEY : IDKEY = request("IDKEY")
Dim SURVEYTYPE : SURVEYTYPE = request("SURVEYTYPE")
Dim QNUMBER : QNUMBER = request("QNUMBER")
Dim ROTATION : ROTATION = request("ROTATION")
Dim GLOBALSURVEY : GLOBALSURVEY = request("GLOBALSURVEY")
Dim GLOBALVARIABLE : GLOBALVARIABLE = request("GLOBALVARIABLE")
Dim CAMPAIGNID : CAMPAIGNID = Request("CAMPAIGNID")
Dim SPRINGID : SPRINGID = Request("SPRINGID")
Dim KABANGID : KABANGID = Request.Form("KABANGID")
Dim CONTACTPID : CONTACTPID = Request("CONTACTPID")
Dim TK : TK = Request("TK")
IF PCOLOR = "" THEN PCOLOR = "#ffffff"
%>
<script>
function noBack(){
window.history.forward();
}
noBack();
</script>
<% Response.Flush %>
<style>
</style>
<body>
<!-- 로딩 바 -->
<div id="loader" class="overlay lds-dual-ring"></div>
<form style="opacity: 0;" name="survey" action="Question.asp" method="POST" onsubmit="return false">
<div class="container-fluid">
<div class="row justify-content-center h-100">
<div class="col-12 p-0 pb-5 shadow-sm h-100 position-relative" id="qmain-box">
<div class="col-12 p-1 bg-white text-center" id='logo-box'>
<% IF CAMPAIGNID = "" and SPRINGID = "" THEN %> <!-- jelee 패널로 들어왔을때 로고 숨김 -->
<img src="../../img/<%=h_companytype_logo %>">
<% END IF %>
</div>
<div class="col-sm-12 col-lg-6 text-center mt-3 mb-3 mx-auto">
<div id="project-name"></div>
</div>
<div class="col-sm-12 col-lg-6 text-center my-2 px-2 mx-auto">
<div id='kiwi_progress' class="d-flex flex-row"></div>
</div>
<div class="col-sm-12 col-lg-6 text-left mb-2 mt-3 p-0 pl-2 mx-auto">
<div class="border d-inline-block p-1 px-2" id="qtitle"></div>
</div>
<div class="col-sm-12 col-lg-6 text-center text-dark px-2 mx-auto">
<div class="mb-5" id="question_body"></div>
</div>
<div class="col-sm-12 col-lg-6 p-0 mt-2 position-fixed text-center mx-auto d-inline-flex" id="btn-box">
<% IF SURVEYTYPE <> "TEST" THEN %>
<button type="button" id="next" class="btn d-inline-block w-100 m-0 p-2 px-4 text-right">NEXT <i class="fa fa-chevron-right ml-2"></i></button>
<% ELSE %>
<button type="button" id="prev" class="btn d-inline-block w-50 m-0 p-2 px-4 text-left"><i class="fa fa-chevron-left mr-2"></i> PREV</button>
<button type="button" id="next" class="btn d-inline-block w-50 m-0 p-2 px-4 text-right">NEXT <i class="fa fa-chevron-right ml-2"></i></button>
<% END IF %>
</div>
</div>
</div>
</div>
<input name="USEPREV" type="hidden" value="<%=PAGENAME%>">
<input name="PAGENAME" type="hidden" value="<%=PAGENAME%>">
<input name="NEXTPAGE" type="hidden" value="">
<input name="PCODE" type="hidden" value="<%=PRJCODE%>">
<input name="IDKEY" type="hidden" value="<%=IDKEY%>">
<input name="SURVEYTYPE" type="hidden" value="<%=SURVEYTYPE%>">
<input name="QNUMBER" type="hidden" value="<%=QNUMBER%>">
<input name="PCOLOR" type="hidden" value="<%=PCOLOR%>">
<input name="ROTATION" type="hidden" value="<%=ROTATION%>">
<input name="GLOBALSURVEY" type="hidden" value="<%=GLOBALSURVEY%>">
<input name="GLOBALVARIABLE" type="hidden" value="<%=GLOBALVARIABLE%>">
<input name="CAMPAIGNID" type="hidden" value="<%=CAMPAIGNID%>">
<input name="SPRINGID" type="hidden" value="<%=SPRINGID%>">
<input name="KABANGID" type="hidden" value="<%=KABANGID%>">
<input name="CONTACTPID" type="hidden" value="<%=CONTACTPID%>">
<input name="TK" type="hidden" value="<%=TK%>">
</form>
</body>
<script src="./js/hard_func.js?dt=<%=date_time() %>"></script>
<script>
var src = "/module/Qmodule/"
var ajaxurl = "./include/ajax.asp"
var qinfo
var qx
var jx
var g
var defaultdesign = {
"single": "SM1",
"multi": "MM1",
"com": "CM1",
"scale": "SCM1",
"rank": "RM1",
"open": "OM1",
"attr": "AM1"
}
var defaultjs = {
"single": "SJ1",
"multi": "MJ1",
"com": "CJ1",
"scale": "SCJ1",
"rank": "RJ1",
"open": "OJ1",
"attr": "AJ1"
}
var error_to_end = function(){
go_post("./SurveyEnd.asp", { "IDKEY": "<%=IDKEY%>", "NEXTPAGE": "ERROR" })
}
var progressFunc = function(percent){
var tmpProgClass = "progAct";
for(var i=0; i<10; i++){
$("#kiwi_progress").append("<div class='d-flex flex-column flex-fill progDiv "+tmpProgClass+"'></div>");
if(Math.floor(percent / 10) <= i+1){
tmpProgClass = "";
}
}
}
var page_logic = "";
var match_language = ""
function initQuestion(form) {
kon.survey.PKEY = "<%=PRJCODE%>"
kon.survey.IDKEY = "<%=IDKEY%>"
/* 뒤로가기로 인한 로직 꼬임 문제 수정 2025-12-19 10:10:00 박준성*/
/* 사파리 뒤로가기는 이전 페이지 최종 결과 값을 캐싱하고 있기 때문에 초기화 필요 */
if(form == "bfcache"){
$("#kiwi_progress").html("")
$("#question_body").html("");
$("input[name=USEPREV]").val("<%=PAGENAME%>");
$("input[name=PAGENAME]").val("<%=PAGENAME%>");
$("input[name=NEXTPAGE]").val("");
$("input[name=PCODE]").val("<%=PRJCODE%>");
$("input[name=IDKEY]").val("<%=IDKEY%>");
$("input[name=SURVEYTYPE]").val("<%=SURVEYTYPE%>");
$("input[name=QNUMBER]").val("<%=QNUMBER%>");
$("input[name=PCOLOR]").val("<%=PCOLOR%>");
$("input[name=ROTATION]").val("<%=ROTATION%>");
$("input[name=GLOBALSURVEY]").val("<%=GLOBALSURVEY%>");
$("input[name=GLOBALVARIABLE]").val("<%=GLOBALVARIABLE%>");
$("input[name=CAMPAIGNID]").val("<%=CAMPAIGNID%>");
$("input[name=SPRINGID]").val("<%=SPRINGID%>");
$("input[name=KABANGID]").val("<%=KABANGID%>");
$("input[name=CONTACTPID]").val("<%=CONTACTPID%>");
$("input[name=TK]").val("<%=TK%>");
}
/* 뒤로가기로 인한 로직 꼬임 문제 수정 2025-12-19 10:10:00 박준성*/
$.when(
$.getJSON("./include/var_qid.json"), /* 문항 ID - 문번 */
$.getJSON("../../store/hard_language.json"), /* Alert 창 */
ajax_returnData(ajaxurl, { "COMMAND": "GETDATA", "CODE": kon.survey.PKEY, "IDKEY": kon.survey.IDKEY }), /* 데이터 */
ajax_returnData(ajaxurl, { "COMMAND": "QINFO", "CODE": "<%=PRJCODE%>", "QCODE": "<%=PAGENAME%>", "IDKEY": "<%=IDKEY%>" }) /* 문항 정보 */
).done(function (variable_qid, language_pack,kondata,qinfo) {
qinfo = qinfo[0] /* 문항 정보 */
language_pack = language_pack[0] /* 언어 팩 */
variable_qid = variable_qid[0] /* 문항명과 QID 매칭 */
$("#qtitle").html(qinfo.qx.variable);
try { /* 설문 데이터 가져오기 - 전체 입력 데이터 */
kon.survey.userdata = kondata
kon.survey.userdata = JSON.parse(kon.survey.userdata || "{}");
} catch (error) {
error_param["ERRSTRING"] = String(error) + "[설문 데이터 가져오기(전체)]" + "[B]" + browername;
ajax_call(ajaxurl, error_param, error_to_end)
}
/* JSON파일 누락 시 DB에서 직접 가져오기 2023-07-27 18:13:00 박준성 */
try{
if(Object.keys(kon.survey.userdata).length === 0){
var tempData = ajax_returnData(ajaxurl, { "COMMAND": "GETDATA_DB", "CODE": kon.survey.PKEY, "IDKEY": kon.survey.IDKEY }); /* 데이터 */
if(tempData.length > 0){
kon.survey.userdata = tempData[0];
}
}
} catch (error) {
error_param["ERRSTRING"] = String(error) + "[설문 데이터 가져오기(DB)]" + "[B]" + browername;
ajax_call(ajaxurl, error_param, error_to_end)
}
/* JSON파일 누락 시 DB에서 직접 가져오기 2023-07-27 18:13:00 박준성 */
try {
/* 사전 로직 */
kon.survey.tv = kon.survey.userdata
var plogicpage = kon.survey.logic_chk(qinfo.jx, "<%=PAGENAME%>", "p");
if (plogicpage !== "<%=PAGENAME%>") {
$("input[name=NEXTPAGE]").val(plogicpage);
if(plogicpage==="END" || plogicpage==="SCREEN" || plogicpage === "QUOTA") {
$("form[name=survey]").attr("action", "SurveyEnd.asp").attr("onsubmit", "").submit();
} else {
/* 뒤로가기로 인한 로직 꼬임 문제 수정 2025-12-19 10:10:00 박준성*/
//의미 없는 세션스토리지 주석
//sessionStorage.setItem("N_PAGE_"+kon.survey.IDKEY, plogicpage);
/* 뒤로가기로 인한 로직 꼬임 문제 수정 2025-12-19 10:10:00 박준성*/
$("form[name=survey]").attr("onsubmit", "").submit();
}
}
} catch (error) {
error_param["ERRSTRING"] = String(error) + "[설문 데이터 가져오기(자기 페이지 제외)]" + "[B]" + browername;
ajax_call(ajaxurl, error_param, error_to_end)
}
var group_flag = false;
var browername = isBrowerCheck();
var error_param = { "COMMAND": "ERROR_REPORT", "IDKEY": "<%=IDKEY%>", "QCODE": "<%=PAGENAME%>", "CODE": "<%=PRJCODE%>" };
kon.survey.global_flag = $("input[name=GLOBALSURVEY]").val();
kon.survey.global_variable =$("input[name=GLOBALVARIABLE]").val();
$("#project-name").html("<h4><%=PRJNAME%></h4>");
try {
if (qinfo.qx.rota) {
var rotapage = $("input[name=ROTATION]").val().trim()
var rotanext
if (rotapage === "") { /* 로테 시작 */
rotapage = ajax_returnData(ajaxurl, { "COMMAND": "ROTA", "CODE": "<%=PRJCODE%>", "ROTA": qinfo.qx.rota });
rotapage = rotapage.split(",")
if (rotapage[0] !== "<%=PAGENAME%>") {
$("input[name=NEXTPAGE]").val(rotapage[0])
$("input[name=ROTATION]").val(rotapage.slice(1, rotapage.length).join(","));
/* 뒤로가기로 인한 로직 꼬임 문제 수정 2025-12-19 10:10:00 박준성*/
//의미 없는 세션스토리지 주석
//sessionStorage.setItem("N_PAGE_"+kon.survey.IDKEY, rotapage[0]);
/* 뒤로가기로 인한 로직 꼬임 문제 수정 2025-12-19 10:10:00 박준성*/
$("form[name=survey]").attr("onsubmit", "").submit();
} else {
$("input[name=ROTATION]").val(rotapage.slice(2, rotapage.length).join(","));
$("input[name=NEXTPAGE]").val(rotapage[1]);
}
} else if(rotapage==="END") { /* 로테 끝 */
$("input[name=ROTATION]").val("");
rotanext = ajax_returnData(ajaxurl, { "COMMAND": "GETROTAPAGE", "CODE": "<%=PRJCODE%>", "ROTA": qinfo.qx.rota });
$("input[name=NEXTPAGE]").val(rotanext);
} else { /* 로테 중간 */
rotapage = rotapage.split(",");
if (rotapage.length === 1)
$("input[name=ROTATION]").val("END");
else
$("input[name=ROTATION]").val(rotapage.slice(1, rotapage.length).join(","));
rotanext = rotapage[0];
$("input[name=NEXTPAGE]").val(rotanext);
}
} else {
$("input[name=NEXTPAGE]").val("");
}
} catch (error) {
error_param["ERRSTRING"] = String(error) + "[로테이션 오류]" + "[B]" + browername;
ajax_call(ajaxurl, error_param, error_to_end)
}
try { /* 언어 변환 */
if (kon.survey.global_flag === "1") {
var language_value = kon.survey.tv[kon.survey.global_variable]
if (language_value) {
if(match_language) /* hard_language의 언어와 KON 언어 보기가 다를 경우 matching */
language_pack = language_pack[match_language[language_value]].alert;
else if(language_pack[language_value] != undefined) //20220124 박준성
language_pack = language_pack[language_value].alert;
else
language_pack = language_pack["1"].alert; //20220124 박준성 alert가 없으면 ["1"]의 alert사용
kon.qmake.setAlert(language_pack); /* 경고창 설정 */
kon.survey.translation_info("<%=PAGENAME%>",language_value,qinfo)
} else {
kon.qmake.setAlert(language_pack["1"].alert); /* 경고창 설정 */
}
} else {
kon.qmake.setAlert(language_pack["1"].alert); /* 경고창 설정 */
}
} catch (error) {
error_param["ERRSTRING"] = String(error) + "[언어팩 오류]" + "[B]" + browername;
ajax_call(ajaxurl, error_param, error_to_end)
}
if (qinfo.qx.qgroup) group_flag = true;
if (!group_flag) { /* 그룹 문항이 아닌 경우 */
qx = qinfo["qx"]; // 문항 정보
jx = qinfo["jx"] || false; // 로직
/* 설문 데이터 가져오기 - 현재 페이지 데이터 제외 */
kon.survey.tv = {};
Object.keys(kon.survey.userdata).forEach(function (v, i) {
if (v.split("_")[0] !== "<%=PAGENAME%>")
kon.survey.tv[v] = kon.survey.userdata[v]
});
try { /* 라벨 치환 */
if (regex_test(global.pattern.datalabel, qx.title) || regex_test(global.pattern.datalabel, qx.description))
kon.survey.replace_responed_label(qx, variable_qid);
} catch (error) {
error_param["ERRSTRING"] = String(error) + "[라벨 치환]" + "[B]" + browername;
ajax_call(ajaxurl, error_param, error_to_end);
}
try { /* 페이지에 타이틀, 안내문, 페이지 이름, 데이터, 데이터 그룹 포함시킴 */
kon.qmake.setTitle(qx.title, "<%=PAGENAME%>")
kon.qmake.setDescription(qx.description, "<%=PAGENAME%>")
kon.qmake.setPageName("<%=PAGENAME%>")
kon.qmake.setData(qx.dataset);
kon.qmake.setGroup(qx.datagroup[qx.qtype] || "");
} catch (error) {
error_param["ERRSTRING"] = String(error) + "[설문 데이터 세팅]" + "[B]" + browername;
ajax_call(ajaxurl, error_param, error_to_end);
}
try { /* 페이지에 문항 타입 바탕으로 함수 선언, 디자인 타입 설정 */
var a = kon.qmake[qx.qtype]();
var designtype = qx.stype || defaultdesign[qx.qtype];
} catch (error) {
error_param["ERRSTRING"] = String(error) + "[문항 타입의 함수 선언 및 디자인 타입]" + "[B]" + browername;
ajax_call(ajaxurl, error_param, error_to_end);
}
try { /* 페이지에 데이터 바탕으로 print */
page_logic = a[designtype](qx.option || "-");
} catch (error) {
console.log(error)
error_param["ERRSTRING"] = String(error) + "[페이지에 설문 print]" + "[B]" + browername;
ajax_call(ajaxurl, error_param, error_to_end)
}
/* 문항 진행 정도 => % */
var LengthPage = (+$("input[name=QNUMBER]").val() + 1)
var percent = parseInt(+(qinfo["Qorder"] || 1) / LengthPage * 100);
progressFunc(percent);
} else {
/* 그룹 문항 */
var qgroup = qinfo.qx.qgroup;
g = kon.qmake["group"]();
var order = ""
var setg = {
"title": [],
"description": [],
"datagroup": [],
"dataset": [],
"variable": [],
"qtype": [],
"stype": [],
"option": []
}
try {
qinfo = ajax_returnData(ajaxurl, { "COMMAND": "GROUP", "CODE": "<%=PRJCODE%>", "GROUP": qgroup });
jx = qinfo.var[0].jx /* 그룹문항 로직 - 첫번째가 기준 */
var varlist = qinfo.var.map(function(v) { return "'" +v.QID+ "'" } ).join(",");
kon.survey.translation_info(varlist, kon.survey.tv[kon.survey.global_variable] ,qinfo, true)
qinfo.var.forEach(function (e, id) {
if (regex_test(global.pattern.datalabel, e.qx.title) || regex_test(global.pattern.datalabel, e.qx.description))
kon.survey.replace_responed_label(e.qx, variable_qid);
setg["title"].push(e.qx.title)
setg["description"].push(e.qx.description)
setg["datagroup"].push(e.qx.datagroup.attr)
setg["dataset"].push(e.qx.dataset)
setg["variable"].push(e.QID)
setg["qtype"].push(e.qx.qtype);
setg["stype"].push(e.qx.stype);
setg["option"].push(e.qx.option);
if (id === qinfo.var.length - 1) {
$("input[name=PAGENAME]").val(e.QID);
order = e.Qorder;
}
})
/* 설문 데이터 가져오기 - 현재 페이지 데이터 제외 */
kon.survey.tv = {};
Object.keys(kon.survey.userdata).forEach(function (v, i) {
if ( !setg["variable"].includes(v.split("_")[0]) )
kon.survey.tv[v] = kon.survey.userdata[v]
});
} catch (error) {
error_param["ERRSTRING"] = String(error) + "[그룹 문항 데이터 불러오기]" + "[B]" + browername;
ajax_call(ajaxurl, error_param, error_to_end)
}
try {
g.setVariable(setg["variable"])
g.setData(setg["dataset"])
g.setDatagroup(setg["datagroup"])
g.setQtype(setg["qtype"])
g.setStype(setg["stype"]);
g.setTitle(setg["title"])
g.setDescription(setg["description"])
g.setOption(setg["option"])
page_logic = g[qinfo.stype](qinfo.option || "");
/* 문항 진행 정도 => % */
var LengthPage = (+$("input[name=QNUMBER]").val() + 1)
var percent = parseInt(+(order || 1) / LengthPage * 100);
progressFunc(percent);
} catch (error) {
error_param["ERRSTRING"] = String(error) + "[문항에 데이터 세팅 및 그리기 그룹]" + "[B]" + browername;
ajax_call(ajaxurl, error_param, error_to_end);
}
}
/* 뒤로가기로 인한 로직 꼬임 문제 수정 2025-12-19 10:10:00 박준성*/
/* 오히려 이부분 때문에 로직이 꼬임
if($("input[name=NEXTPAGE]").val() == "" && (sessionStorage.getItem("N_PAGE_"+kon.survey.IDKEY) || "") != ""){
//주석을 푸는 경우 PAGENAME ASP 코드로 변경 필요
if( "PAGENAME" != sessionStorage.getItem("N_PAGE_"+kon.survey.IDKEY) ){
$("input[name=NEXTPAGE]").val(sessionStorage.getItem("N_PAGE_"+kon.survey.IDKEY));
}
}
*/
/* 뒤로가기로 인한 로직 꼬임 문제 수정 2025-12-19 10:10:00 박준성*/
$("#next").off("click").click(function () { /* 다음 버튼 */
let timer;
let timeout = 1000;
if (!timer) {
clearTimeout(timer);
timer = setTimeout(() => {
timer = undefined;
}, timeout);
try {
if (!page_logic()) return false;
$("#loading_circle").css("display","block")
var form = $("form[name=survey]");
var data = kon.survey.serializeform(form);
kon.survey.save(data, form, jx);
} catch (error) {
error_param["ERRSTRING"] = String(error) + "[다음 버튼 누르기]" + "[B]" + browername;
ajax_call(ajaxurl, error_param, error_to_end);
}
}
});
$("#prev").click(function () {
var p_page_arr = JSON.parse(sessionStorage.getItem("P_PAGE_"+kon.survey.IDKEY) || []);
var p_page = p_page_arr.pop();
$("input[name=NEXTPAGE]").val(p_page);
sessionStorage.setItem("P_PAGE_"+kon.survey.IDKEY, JSON.stringify(p_page_arr));
/* 뒤로가기로 인한 로직 꼬임 문제 수정 2025-12-19 10:10:00 박준성*/
//의미없는 세션스토리지 주석
//sessionStorage.setItem("N_PAGE_"+kon.survey.IDKEY, p_page);
/* 뒤로가기로 인한 로직 꼬임 문제 수정 2025-12-19 10:10:00 박준성*/
if(p_page == "INDEX"){
/*
TEST가 아닐 시 INDEX로 못 가게 INDEX는 IDEKY, SURVEYTYPE등 일부 파라미터가 다름
2025-12-19 10:10:00 박준성
*/
<%IF SURVEYTYPE = "TEST" THEN%>
$(location).attr("href", "./INDEX.asp?ST=TEST");
<%ELSE%>
alert("더 이상 뒤로갈 수 있는 문항이 없습니다.");
return;
<%END IF%>
/*
TEST가 아닐 시 INDEX로 못 가게 INDEX는 IDEKY, SURVEYTYPE등 일부 파라미터가 다름
2025-12-19 10:10:00 박준성
*/
}else{
$("form[name=survey]").attr("onsubmit", "").submit();
}
})
try { /* 강제 이벤트 트리거 문항 하드코딩 */
efunc("ALL");
efunc("<%=PAGENAME%>");
$("input").attr("autocomplete","off");
$("textarea").attr("autocomplete","off");
} catch (error) {
error_param["ERRSTRING"] = String(error) + "[페이지 별 하드코딩 실행]" + "[B]" + browername;
ajax_call(ajaxurl, error_param, error_to_end);
}
$('#loader').addClass('hidden');
$("form[name=survey]").animate({"opacity":"1"},200)
}) /* when.done */
}
/* 뒤로가기로 인한 로직 꼬임 문제 수정 2025-12-19 10:10:00 박준성*/
$(function () {
initQuestion("ready");
}); /* document.ready */
window.addEventListener('pageshow', function(e){
if (e.persisted) {
// BFCache 복원으로 돌아온 케이스 (주로 사파리에서의 뒤로가기)
$('#loader').removeClass('hidden');
//페이지를 다시 세팅하기 보다는 앞으로 보내기
window.history.forward();
//initQuestion("bfcache")
$('#loader').addClass('hidden');
}
});
/* 뒤로가기로 인한 로직 꼬임 문제 수정 2025-12-19 10:10:00 박준성*/
</script>
<!-- #include Virtual="/include/footer.asp" -->

View File

@@ -0,0 +1,61 @@
<!--#include File="./include/Config.asp"-->
<%
Server.ScriptTimeOut = 60 * 5
Dim SQL,Rcset
Dim JSON
Dim iCnt,cCnt
Dim PKEY : PKEY = Request("PCODE")
Dim IDKEY : IDKEY = Request("IDKEY")
Dim SURVEYTYPE : SURVEYTYPE = Request("SURVEYTYPE")
Dim QID : QID = Request("PAGENAME")
Dim NEXTPAGE : NEXTPAGE = getNextPage(QID,PKEY)
Dim DATA : DATA = Request("DATA")
Set Rcset = Server.CreateObject("ADODB.RecordSet")
Dim SAVERESULT
IF IDKEY = "" THEN
SAVERESULT = "NONE"
ELSE
Call DBConnect2()
Set Rcset = Server.CreateObject("ADODB.Recordset")
SQL = "select PAGENAME,Status,SURVEY_TYPE from KonKiwi.dbo.DATA with(nolock) WHERE [PKEY]= '" & PKEY & "' and IDKEY = '"& IDKEY &"' "
Rcset.Open SQL,DBConn,3,1,1
If Rcset.RecordCount > 0 Then
IF Rcset("Status") = "10" THEN
SAVERESULT = "PREV"
ELSEIF Rcset("Status") = "99" THEN
SAVERESULT = "SCREEN"
ELSEIF Rcset("Status") = "98" THEN
SAVERESULT = "QUOTA"
ELSEIF Rcset("Status") = "1" AND QID = "INDEX" THEN '진행 상태인데 index 면 해당 페이지로 이동'
SAVERESULT = Rcset("PAGENAME")
IF SAVERESULT = "INDEX" THEN
SAVERESULT = getNextPage("INDEX",PKEY)
END IF
ELSE
SAVERESULT = SAVEDB(DATA,PKEY,IDKEY,QID,SURVEYTYPE)
END IF
ELSE
SAVERESULT = INITDB(DATA,PKEY,IDKEY,QID,SURVEYTYPE)
END IF
END IF
IF SAVERESULT = "SAVE" THEN
response.write NEXTPAGE
response.end
ELSE
'SAVERESULT = "PREV" or SAVERESULT = "DOUBLE" or SAVERESULT = "NONE" or SAVERESULT = "SCREEN" or SAVERESULT = "QUOTA" or SAVERESULT = "ERROR"'
response.write SAVERESULT
response.end
END IF
%>
<!-- #include Virtual="/include/footer.asp" -->

View File

@@ -0,0 +1,195 @@
<!--#include file="./include/Header.asp" -->
<!--#include Virtual="/Lib/md5.asp" -->
<%
Dim PAGENAME : PAGENAME = request("NEXTPAGE")
Dim LASTQID : LASTQID = request("PAGENAME")
Dim IDKEY : IDKEY = request("IDKEY")
Dim SURVEYTYPE : SURVEYTYPE = request("SURVEYTYPE")
Dim CAMPAIGNID : CAMPAIGNID = request("CAMPAIGNID")
Dim KABANGID : KABANGID = Request.Form("KABANGID")
Dim SPRINGID : SPRINGID = request("SPRINGID")
Dim CONTACTPID : CONTACTPID = request("CONTACTPID")
Dim TK : TK = request("TK")
Dim KIWIURL : KIWIURL = "https://kiwisurvey.kr/survey/complete"
IF PAGENAME = "END" or PAGENAME = "SCREEN" or PAGENAME = "QUOTA" THEN
CALL ENDPROCESS(PRJCODE,IDKEY,PAGENAME)
IF CONTACTPID <> "" AND SURVEYTYPE <> "TEST" THEN
Dim CONTACT_URL
Dim SURVEY_PARAM
Dim SURVEY_STATUS
Dim API_URL
CONTACT_URL = "https://contact.kric.com/api/external/"
SURVEY_STATUS = "complete"
IF PAGENAME = "QUOTA" THEN
SURVEY_STATUS = "quota"
ELSEIF PAGENAME = "SCREEN" THEN
SURVEY_STATUS = "screen"
END IF
SURVEY_PARAM = "?psidx=" & Server.URLEncode(CONTACTPID) _
& "&sid=" & Server.URLEncode(IDKEY)
API_URL = CONTACT_URL & SURVEY_STATUS & SURVEY_PARAM
END IF
'''''''''클라우드 패널'''''''''''''
IF CAMPAIGNID <> "" AND SURVEYTYPE <> "TEST" THEN
Dim CLOUDP : CLOUDP = "1"
Dim CLOUDURL : CLOUDURL = "https://join.cloudpanel.co.kr/join/result"
Dim COLUDKEY : COLUDKEY = "FCBE24DF-9E69-4BE4-966A-ACEF39D47534"
IF PAGENAME = "QUOTA" THEN
CLOUDP = "2"
ELSEIF PAGENAME = "SCREEN" THEN
CLOUDP = "3"
END IF
Response.Redirect CLOUDURL & "?CAMPAIGN_ID=" & CAMPAIGNID & "&PANEL_SEQ=" & IDKEY &"&RESULT=" & CLOUDP & "&CHECKSUM=" & MD5(COLUDKEY & IDKEY & CAMPAIGNID & CLOUDP)
END IF
'''''''''클라우드 패널'''''''''''''
'''''''''DATA SPRING 패널'''''''''''''
IF SPRINGID <> "" AND SURVEYTYPE <> "TEST" THEN
Dim SPRING_CODE : SPRING_CODE = "comp"
Dim SPRINGURL : SPRINGURL = "https://d8aspring.post-survey.com/ans/back/"
IF PAGENAME = "QUOTA" THEN
SPRING_CODE = "quotafull"
ELSEIF PAGENAME = "SCREEN" THEN
SPRING_CODE = "scrout"
END IF
Response.Redirect SPRINGURL & "?key=" & SPRINGID & "&status=" & SPRING_CODE &"&uid=" & IDKEY
END IF
'''''''''DATA SPRING 패널'''''''''''''
'''''''''카카오뱅크 패널'''''''''''''
IF KABANGID <> "" AND SURVEYTYPE <> "TEST" THEN
Dim KABANG_STATUS : KABANG_STATUS = "complete"
IF PAGENAME = "QUOTA" THEN
KABANG_STATUS = "quota_out"
ELSEIF PAGENAME = "SCREEN" THEN
KABANG_STATUS = "screen_out"
END IF
Response.Redirect KABANGID & "?uuid=" & IDKEY & "&status=" & KABANG_STATUS
END IF
'''''''''카카오뱅크 패널'''''''''''''
'''''''''KIWI 패널'''''''''''''
IF TK <> "" THEN
Dim KIWI_STATUS : KIWI_STATUS = "1"
IF PAGENAME = "QUOTA" THEN
KIWI_STATUS = "4"
ELSEIF PAGENAME = "SCREEN" THEN
KIWI_STATUS = "2"
END IF
Response.Redirect KIWIURL & "?TK=" & TK & "&SID=" & IDKEY & "&completionStatus=" & KIWI_STATUS & "&questionItemNumber=" & LASTQID
END IF
'''''''''KIWI 패널'''''''''''''
END IF
IF TK <> "" AND (PAGENAME = "CLOSE" OR PAGENAME = "PREPARE") THEN
Response.Redirect KIWIURL & "?TK=" & TK & "&SID=" & IDKEY & "&completionStatus=5&questionItemNumber=" & LASTQID
END IF
IF PCOLOR = "" THEN PCOLOR = "#ffffff"
%>
<style>
</style>
<body>
<form name="survey" method="POST">
<div id="wrapper" class="container-fluid">
<div class="row justify-content-center h-100">
<div class="col-12 p-0 pb-5 shadow-sm h-100 position-relative" id="qmain-box">
<div class="col-12 p-1 bg-white text-center" id='logo-box'>
<% IF CAMPAIGNID = "" and SPRINGID = "" THEN %> <!-- jelee 202410 패널로 들어왔을때 로고 숨김 -->
<img src="../../img/<%=h_companytype_logo %>">
<% END IF %>
</div>
<div class="col-sm-12 col-lg-6 text-center mt-3 mb-3 mx-auto">
<div id="project-name"></div>
</div>
<div class="col-sm-12 col-lg-6 text-center my-2 px-2 mx-auto">
<div id='kiwi_progress' class="d-flex flex-row"></div>
</div>
<div class="col-sm-12 col-lg-6 text-center text-dark px-2 mx-auto">
<div class="my-5" id="question_body">
<%IF PAGENAME = "END" THEN%>
<img src="../../img/survey_end_2x.svg" class="mt-5 mb-3" style="width:50px;">
<div class='sEndStr mb-2'>설문조사가<br>완료되었습니다.</div>
<div class='sEndSubStr'>설문에 참여해주셔서 감사합니다.</div>
<%ELSEIF PAGENAME = "CLOSE" THEN%>
<div class='sEndStr mb-2'>설문조사가<br>마감되었습니다.</div>
<div class='sEndSubStr'>설문에 참여해주셔서 감사합니다.</div>
<%ELSEIF PAGENAME = "PREPARE" THEN%>
<div class='sEndStr mb-2'>설문조사가<br>준비중입니다.</div>
<div class='sEndSubStr'></div>
<%ELSEIF PAGENAME = "SCREEN" THEN%>
<div class='sEndStr mb-2'>죄송합니다.<br>조사 대상자가 아닙니다.</div>
<div class='sEndSubStr'>설문에 참여해주셔서 감사합니다.</div>
<%ELSEIF PAGENAME = "QUOTA" THEN%>
<div class='sEndStr mb-2'>죄송합니다.<br>설문이 마감되었습니다.</div>
<div class='sEndSubStr'>설문에 참여해주셔서 감사합니다.</div>
<%ELSEIF PAGENAME = "PREV" THEN%>
<div class='sEndStr mb-2'>이미 참여해주신<br>설문입니다.</div>
<div class='sEndSubStr'>설문에 참여해주셔서 감사합니다.</div>
<%ELSEIF PAGENAME = "DOUBLE" THEN%>
<div class='sEndStr mb-2'>비 정상적인 ID 입니다.</div>
<div class='sEndSubStr'></div>
<%ELSEIF PAGENAME = "NONE" THEN%>
<div class='sEndStr mb-2'>비 정상적인 ID 입니다.</div>
<div class='sEndSubStr'></div>
<%ELSEIF PAGENAME = "ERROR" THEN%>
<div class='sEndStr mb-2'>설문 진행중 오류가 발생하였습니다.</div>
<div class='sEndSubStr'>설문 재 진행을 원하실 경우 아래 <mark style="background-color: yellow;">'설문 페이지로 이동'</mark>을 클릭해주세요</div>
<a href="./INDEX.asp?SID=<%=IDKEY%>&TK=<%=TK%>">설문 페이지로 이동</a><br>
<small style="color:red"> 재 진행시 진행하셨던 페이지부터 진행하실 수 있으며 같은 오류가 나는 경우 잠시 대기해주세요.</small>
<%END IF%>
</div>
</div>
<% IF CAMPAIGNID = "" and SPRINGID = "" THEN %> <!-- mskwon 2025/05/07 제휴 패널로 들어 왔을 때 키위서베이로 돌아가기 숨김 -->
<div class="col-sm-12 col-lg-6 p-0 mt-4 position-fixed text-center mx-auto d-inline-flex" id="btn-box">
<button type="button" id="r_kiwi_btn" class="btn w-100 m-0 p-2 text-center">키위서베이로 돌아가기</button>
</div>
<% END IF %>
</div>
</div>
</div>
<input name="PAGENAME" type="hidden" value="<%=PAGENAME%>">
<input name="NEXTPAGE" type="hidden" value="">
<input name="pcode" type="hidden" value="<%=PRJCODE%>">
<input name="IDKEY" type="hidden" value="<%=IDKEY%>">
<input name="SURVEYTYPE" type="hidden" value="<%=SURVEYTYPE%>">
</form>
</body>
<script>
fetch("<%= API_URL %>")
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
</script>
<script src="./js/hard_func.js?dt=<%=date_time() %>"></script>
<script>
$("document").ready(function () {
for(var i=0; i<10; i++){
$("#kiwi_progress").append("<div class='d-flex flex-column flex-fill progDiv progAct'></div>");
}
$("#project-name").html("<h4><%=PRJNAME%></h4>");
$("#r_kiwi_btn").on("click", function(){
location.href="https://kiwisurvey.kr/";
});
efunc("ALL");
efunc("END");
});
</script>
<!-- #include Virtual="/include/footer.asp" -->

View File

@@ -0,0 +1,466 @@
.imgHighQ{
image-rendering: -webkit-optimize-contrast;
transform: translateZ(0);
backface-visibility: hidden;
}
html,
body,
.container-fluid,
form {
height: 100%;
background-color: #fff;
}
.rptext {
/* 2025-09-02 권민서 자동 치환되는 변수 style 중 앞에 띄어쓰기 기능 주석 처리 */
/* margin-left: 5px; */
padding: 2px;
background-color: rgba(255, 255, 0, 0.5);
}
@media all and (min-width: 960px) {
table td,
table th {
font-size: 15px !important;
}
.scale_label {
word-break: keep-all;
}
#start, #next, #prev, #r_kiwi_btn{
border-radius:3px !important;
}
}
.col-xl-9 {
max-width: 1000px !important;
}
#qmain-box {
overflow-y: auto;
background-color: #F7F7F7;
}
#qmain-box::-webkit-scrollbar {
width: 6px
}
#qmain-box::-webkit-scrollbar-thumb {
background-color: rgb(179, 179, 179);
border-radius: 15px;
background-clip: padding-box;
border: 1px solid transparent;
}
#logo-box{
box-shadow: 0 4px 6px rgba(0,0,0,.15);
}
#logo-box > img{
height:35px;
}
#project-name h4{
color:#1cae81;
font-size:18px !important;
}
#kiwi_progress{
height: 7px;
}
#prj-title{
word-break:keep-all;
font-size:15px !important;
color:#444;
padding-top:12px !important;
padding-bottom:12px !important;
border-radius: 3px;
}
.progDiv{
background-color:#E8E8E8;
border-radius:4px;
height: 4px;
}
.progDiv.progAct{
background-color:#1cae81;
}
.progDiv:not(first-child){
margin-left:2px;
}
#qtitle{
color:#99D4CE;
border-color:#99D4CE !important;
font-size:14px !important;
border-radius: 20px;
}
#btn-box{
bottom:0;
z-index: 100;
}
#start, #next, #prev, #r_kiwi_btn{
font-size:14px;
color:#e8e8e8;
background-color:#1cae81;
border-radius: initial;
height: 56px;
}
i{
font-family: "fontawesome" !important;
}
.question-title{
font-size:16px;
color:#1c1c1c;
}
.lds-dual-ring.hidden {
display: none;
}
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,.1);
z-index: 999;
opacity: 1;
transition: all 0.5s;
}
/*Spinner Styles*/
.lds-dual-ring {
/* display: inline-block;
width: 80px;
height: 80px; */
}
.lds-dual-ring:after {
position: absolute;
top: 50%;
left: 50%;
content: " ";
display: block;
width: 50px;
height: 50px;
margin: -25px 0 0 -25px;
/* margin: 50% auto;
border-radius: 50%;
border: 6px solid #fff;
border-color: #fff transparent #fff transparent; */
background-color: transparent;
background-image:url('/img/kiwi_loading.png');
background-size: 50px;
background-repeat:no-repeat;
background-position:center;
object-fit: fill;
opacity: 1;
filter: alpha(opacity=100);
animation: lds-dual-ring 1.2s linear infinite;
}
@keyframes lds-dual-ring {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.list-group-item{
margin-bottom: 8px;
padding: 6px 15px;
border-radius: 3px !important;
border: none;
}
.list-group-item-action{
border-radius: 3px !important;
}
.custom-control {
display: inline-block;
padding-left: 26px;
position: relative;
min-height: 20px;
margin: 9px 33px 9px 0;
}
.custom-control input {
opacity: 0;
position: absolute;
left: -99999px;
font-size: 0;
}
.custom-control b, .custom-control span {
color: #444;
font-size: 15px;
vertical-align: text-top;
}
.custom-control i {
display: block;
width: 14px;
height: 14px;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
border: 1px solid #7d7d7d;
border-radius: 50%;
}
.custom-control i.centerIcon{
position: absolute;
display: inline-block;
left: auto;
}
.custom-control i.centerIcon+span{
margin-left:18px;
}
.custom-control-radio input:checked ~ i::before {
content: '';
display: block;
width: 8px;
height: 8px;
border-radius: 50%;
background: #1cae81;
position: absolute;
left: 50%;
top: 50%;
margin: -4px 0 0 -4px;
}
.custom-control input:checked ~ i {
background-color: #fff;
border-color: #1cae81;
}
.custom-control-checkbox-square input:checked ~ i {
background: #1cae81 url(/img/icon-ckck-light.svg) no-repeat center;
}
.custom-control-checkbox-square i {
border-radius: 0;
}
.cusInput-active{
border:1px solid #1cae81;
}
.list-group-item+.list-group-item.cusInput-active{
border-top-width: 1px;
}
.form-control:focus{
border-color: #1cae81;
box-shadow:none;
}
input:-webkit-autofill, input:focus:-webkit-autofill {
-webkit-box-shadow: 0 0 0 100px #fff inset;
}
.custom-control input:disabled:not(:checked) ~ i{
background-color: #f0f0f0;
border-color: #ccc;
}
.custom-control-checkbox-square input:disabled:checked ~ i{
background-color: #9bdbc8;
border-color: #9bdbc8;
}
.custom-control-radio input:disabled:checked ~ i{
border-color: #ccc;
}
.custom-control-radio input:disabled:checked ~ i::before{
background-color: #9bdbc8;
}
.sEndStr{
font-size:20px;
color:#1c1c1c;
font-weight: 600;
}
.sEndSubStr{
font-size:16px;
color:#7d7d7d;
}
.scaleTb {
border: none;
border-collapse: separate;
border-spacing: 5px;
}
.scaleTb td{
border: none;
margin: 5px;
height: 24px;
border-radius: 3px;
}
.scaleBtn {
cursor:pointer;
display:table-cell;
position:relative;
}
.scaleBtn.cusInput-active{
border:1px solid #1cae81;
color:#1cae81;
}
.scaleBtn i.centerIcon{
margin-right: auto;
margin-bottom: -7px;
left:calc(50% - 7px);
}
.singleTb {
border: none;
border-collapse: separate;
border-spacing: 0 8px;
}
.singleTb td, .singleTb th{
border: none;
margin: 5px;
min-width: 30px;
font-size: 15px;
}
.singleTb tr[id^=row_]{
cursor:pointer;
}
.singleTb tr > td:first-child, .singleTb tr > th:first-child{
border-radius: 3px 0 0 3px;
}
.singleTb tr > td:last-child, .singleTb tr > th:last-child{
border-radius: 0 3px 3px 0;
}
.singleBtn {
cursor:pointer;
display:table-cell;
position:relative;
}
.singleBtn i.centerIcon{
margin-right: auto;
right:7px;
margin-bottom: -7px;
}
tr.cusInput-active > td:first-child{
border-left:1px solid #1cae81;
}
tr.cusInput-active > td:last-child{
border-right:1px solid #1cae81;
}
tr.cusInput-active > td{
border-top:1px solid #1cae81;
border-bottom:1px solid #1cae81;
}
div[id^=attr_label_]{
background-color: #e8e8e8;
color: #7d7d7d;
font-weight: 400;
font-size: 14px;
min-height: 26px;
padding: 8px;
margin-bottom: 12px;
border-radius: 3px;
text-align: center !important;
}
a[id^=attr_][aria-expanded=true] > div[id^=attr_label_]{
background-color: #ffffff;
color: #444;
font-weight: 800;
border: #aaaaaa 1px solid;
text-align: center !important;
}
div[id^=attr_label_]:before {
border: solid #7d7d7d;
border-width: 0 1px 1px 0;
display: block;
padding: 4px;
content: '';
float:right;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
transform: rotate(45deg);
transition: all 0.5s;
margin-top: 4px;
margin-right: 3px;
}
a[id^=attr_][aria-expanded=true] > div[id^=attr_label_]:before {
-webkit-transform: rotate(225deg);
-moz-transform: rotate(225deg);
transform: rotate(225deg);
margin-top: 8px;
}
a[id^=attr_]:hover{
text-decoration:none;
}
div[id^=qus_] .custom-control span {
font-size:14px;
vertical-align: baseline;
}
div[id^=qus_] .list-group-item {
margin-bottom: 5px;
padding: 3px 15px;
}
@media all and (min-width: 960px) {
div[id^=qus_] td{
font-size:14px !important;
}
}
div:not(.container-fluid)[id$='_BOX'] > .container-fluid[id$=_box]:hover{
border:1px solid #1cae81 !important;
}
.delete-btn{
cursor:pointer;
}
.custom-control-checkbox-square input.rankCheckbox[data-rank]:checked ~ i{
background: none;
background-color: #1cae81;
}
.custom-control-checkbox-square input.rankCheckbox[data-rank]:checked ~ i::before{
/*20260313 박준성 랭크 숫자 가변 적용*/
content: attr(data-rank);
position: absolute;
top: 0px;
left: 50%;
transform: translateX(-50%);
/*20260313 박준성 랭크 숫자 가변 적용*/
font-size: 12px;
font-weight: 400;
font-family: "Spoqa Han Sans Neo", sans-serif !important;
color: #fff;
font-style: normal;
line-height: 1;
white-space: nowrap;
}
/*20260313 박준성 랭크 숫자 가변 적용*/
.cusInput-disabled{
background-color: #e8e8e8 !important;
color: #a7a7a7;
}

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 = "mssql-7sq2n-kr.vpc-pub-cdb.ntruss.com"
DB_NAME2= "konkiwi"
UID2 = "kadmin"
PWD2 = "it#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,158 @@
<!--#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 http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
<link rel="shortcut icon" type="image/x-icon" href="../../img/favicon-16x16.png" />
<title>키위서베이</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>
<link href="/css/jquery.alert.css" rel="stylesheet" />
<script src="/js/jquery.alert.min.js"></script>
<!-- js 기능 모듈화 -->
<script src="/js/kfunc.js?ver=4.1"></script>
<script src="/js/knode.js?ver=3.1"></script>
<script src="/js/polyfill.js?ver=3.1"></script>
<script src="/js/bluebird.min.js"></script>
<script src="/module/survey.js?dt=<%=date_time() %>"></script>
<script src="/store/store_.js?ver=3.1"></script>
<script src="/module/ToastrCustom.js?ver=3.1"></script>
<!-- 그리는 js -->
<script src="/module/Qmodule/attr.js?ver=3.1"></script>
<script src="/module/Qmodule/single.js?ver=3.1"></script>
<script src="/module/Qmodule/com.js?ver=3.1"></script>
<script src="/module/Qmodule/open.js?ver=3.1"></script>
<script src="/module/Qmodule/multi.js?ver=3.1"></script>
<script src="/module/Qmodule/rank.js?ver=3.1"></script>
<script src="/module/Qmodule/scale.js?ver=3.1"></script>
<script src="/module/Qmodule/group.js?ver=3.1"></script>
<script src="/module/Qmodule/description.js?ver=3.1"></script>
<!-- 문항 생성 및 문항 내부 로직 모듈화 -->
<script src="/module/CreateQuestion.js?ver=3.1"></script>
<!-- 자그마한 이미지 -->
<link href="/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- 폰트 -->
<link href='//spoqa.github.io/spoqa-han-sans/css/SpoqaHanSansNeo.css' rel='stylesheet' type='text/css'>
<!-- <script type="text/javascript" src="//dapi.kakao.com/v2/maps/sdk.js?appkey=404907026ac1b7b457ea280d42a8cb8e&libraries=services"></script> -->
<link rel="stylesheet" href="./css/style.css?ver=4.1">
<style>
*{ font-family: "Spoqa Han Sans Neo", "sans-serif" !important;}
</style>
<script>
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(e){
$(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");
}
})
e.stopPropagation();
});
$(document).on("click", ".singleBtn", function(e){
$(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");
}
});
e.stopPropagation();
});
$(document).on("click", "tr[id^='row_']", function(e){
if($(this).children(".singleBtn").length > 0){
$(this).children(".singleBtn").click();
}
e.stopPropagation();
});
});
</script>
</head>
<!--#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
h_companytype_logo = "kiwi_logo_2.svg"
%>

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 konkiwi.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 = "konkiwi.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 konkiwi.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 = "konkiwi.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 konkiwi.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 konkiwi.dbo.LANGUAGE with(nolock) where PKEY = '"&CODE&"' and QID in (" & REQUEST("QLIST")& ") and CCODE = '"& REQUEST("LANGUAGE") &"' and LTYPE in ('single','multi') 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 konkiwi.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 konkiwi.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 = "konkiwi.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 konkiwi.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 konkiwi.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(cnt) as [cnt], sum(COM) as [com]" & vbcrlf
QSQL = QSQL & " from (" & vbcrlf
QSQL = QSQL & " SELECT QUOTAJSON, CNT,COUNT(DT.IDKEY) AS [com] " & 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" & 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"}

190
ProjectTemplate/index.asp Normal file
View File

@@ -0,0 +1,190 @@
<!--#include file="./include/Header.asp" -->
<%
Dim SURVEYTYPE : SURVEYTYPE = Request("ST")
Dim IDKEY : IDKEY = Request("SID")
Dim CAMPAIGNID : CAMPAIGNID = Request("CAMPAIGNID")
Dim SPRINGID : SPRINGID = Request("SPRINGID")
Dim KABANGID : KABANGID = Request("redirect_url")
Dim CONTACTPID : CONTACTPID = Request("psidx")
Dim UUIDKEY : UUIDKEY = request("uuid")
Dim TK : TK = Request("TK")
DIM SQL : SQL = ""
Dim CONTACT_URL
Dim SURVEY_PARAM
Dim API_URL
CONTACT_URL = "https://contact.kric.com/api/external/start"
SURVEY_PARAM = "?psidx=" & Server.URLEncode(CONTACTPID) _
& "&sid=" & Server.URLEncode(IDKEY)
API_URL = CONTACT_URL & SURVEY_PARAM
' 카카오뱅크 URL에서 KABANGID 추출
If KABANGID <> "" Then
KABANGID = Request("redirect_url")
End If
'카카오뱅크 패널로 들어온 id 인지 확인 uuid 로 체크 2024-09-25
If UUIDKEY <> "" Then
IDKEY = Trim(Request("uuid"))
End If
'//-- 20220222 hwkim ms second로 변경
SQL = " SELECT konkiwi.dbo.UNIX_TIMESTAMP(GETDATE()) "
Dim Rcset : set Rcset = Server.CreateObject("ADODB.RecordSet")
Dim ms_second_val
DBConnect2()
Rcset.Open SQL,DBConn,3,1,1
ms_second_val = Rcset(0)
IF SURVEYTYPE = "" and IDKEY = "" THEN
SURVEYTYPE = "BANNER"
ELSEIF IDKEY <> "" and SURVEYTYPE <> "CAPI" THEN
SURVEYTYPE = "LIST"
END IF
IF SURVEYTYPE = "TEST" THEN
IDKEY = RNDKEY("TEST") & "_" & ms_second_val
ELSEIF SURVEYTYPE = "BANNER" THEN
Randomize
'''IDKEY = Split(Cstr(Rnd * 10000),".")(0) & RNDKEY("") '//-- 20210716 hwkim edit
'''IDKEY = Split(Cstr(Rnd * 10000),".")(0) & RNDKEY("") & right(date_time(),6) '//-- 20220222 hwkim edit
IDKEY = Split(Cstr(Rnd * 10000),".")(0) & RNDKEY("") & ms_second_val
ELSEIF SURVEYTYPE = "CAPI" THEN
IF IDKEY = "" THEN
Dim MKEY : MKEY = request("MKEY")
IF MKEY = "" THEN
call_Url "/capi/user.asp","면접원 키가 존재하지 않습니다."
ELSE
IDKEY = MKEY & "_" & ms_second_val
'//-- SQL = " select top 1 IDKEY from [DATA] a WHERE PKEY = '"& PRJCODE &"' and LEFT(IDKEY,9) = '"& MKEY &"' order by id desc "
''SQL = " select max(cast(substring(IDKEY ,charindex('_', IDKEY) + 1, len(idkey)-(charindex('_', IDKEY))) AS INT)) from [DATA] a WHERE PKEY = '"& PRJCODE &"' and LEFT(IDKEY,9) = '"& MKEY &"'"
''Dim Rcset : set Rcset = Server.CreateObject("ADODB.RecordSet")
''DBConnect2()
''Rcset.Open SQL,DBConn,3,1,1
''IF Rcset.eof THEN
'' IDKEY = MKEY &"_1"
''ELSE
'' IF IsNull(Rcset(0)) THEN
'' IDKEY = MKEY &"_1"
'' ELSE
'' IDKEY = MKEY & "_" & Cint(Rcset(0)) + 1
'' END IF
''END IF
END IF
END IF
END IF
%>
<style>
</style>
<body>
<form name="survey" action="Question.asp" method="POST">
<div id="wrapper" class="container-fluid">
<div class="row justify-content-center h-100">
<div class="col-12 p-0 pb-5 shadow-sm h-100 position-relative" id="qmain-box">
<div class="col-12 p-1 bg-white text-center" id='logo-box'>
<% IF CAMPAIGNID = "" and SPRINGID = "" THEN %> <!-- jelee 패널로 들어왔을때 로고 숨김 -->
<img src="../../img/<%=h_companytype_logo %>">
<% END IF %>
</div>
<div class="col-sm-12 col-lg-6 text-center mt-3 mb-3 mx-auto">
<div id="project-name"></div>
</div>
<div class="col-sm-12 col-lg-6 text-center my-2 px-2 mx-auto">
<div id='kiwi_progress' class="d-flex flex-row"></div>
</div>
<div class="col-sm-12 col-lg-6 mx-auto" style="padding:12px;">
<div class="p-2 bg-white" id="prj-title"></div>
</div>
<div class="col-sm-12 col-lg-6 p-0 mt-2 position-fixed text-center mx-auto d-inline-flex" id="btn-box">
<button type="button" id="start" class="btn w-100 m-0 p-2 px-4 text-right">NEXT <i class="fa fa-chevron-right ml-2"></i></button>
</div>
</div>
</div>
</div>
<input name="USEPREV" type="hidden" value="INDEX">
<input name="PAGENAME" type="hidden" value="INDEX">
<input name="NEXTPAGE" type="hidden" value="">
<input name="PCODE" type="hidden" value="<%=PRJCODE%>">
<input name="IDKEY" type="hidden" value="<%=IDKEY%>">
<input name="SURVEYTYPE" type="hidden" value="<%=SURVEYTYPE%>">
<input name="CAMPAIGNID" type="hidden" value="<%=CAMPAIGNID%>">
<input name="SPRINGID" type="hidden" value="<%=SPRINGID%>">
<input name="KABANGID" type="hidden" value="<%=KABANGID%>">
<input name="CONTACTPID" type="hidden" value="<%=CONTACTPID%>">
<input name="TK" type="hidden" value="<%=TK%>">
<input name="GLOBALSURVEY" type="hidden" value="">
<input name="GLOBALVARIABLE" type="hidden" value="">
<input name="QNUMBER" type="hidden" value="">
<input name="USERAGENT" type="hidden" value="<%=User_Agent%>">
<input name="USERIP" type="hidden" value="<%=ip%>">
</form>
</body>
<script>
fetch("<%= API_URL %>")
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
</script>
<script src="./js/hard_func.js?dt=<%=date_time() %>"></script>
<script>
var login_chk = true;
$("document").ready(function () {
var ajaxurl = "./include/ajax.asp"
var pinfo = ajax_returnData(ajaxurl, { "COMMAND": "PRJINFO", "CODE": "<%=PRJCODE%>" });
$("#project-name").html("<h4>" + pinfo.title + "</h4>");
$("#prj-title").html(pinfo.description);
$("input[name=QNUMBER]").val(pinfo.QNUMBER);
$("input[name=GLOBALSURVEY]").val(pinfo.global || "");
$("input[name=GLOBALVARIABLE]").val(pinfo.globalValue || "");
kon.survey.PKEY = "<%=PRJCODE%>"
kon.survey.IDKEY = "<%=IDKEY%>"
for(var i=0; i<10; i++){
$("#kiwi_progress").append("<div class='d-flex flex-column flex-fill progDiv'></div>");
}
<% IF SURVEYTYPE <> "TEST" THEN %>
if (pinfo.status !== "2") {
$("input[name=NEXTPAGE]").val(pinfo.status === "3" ? "CLOSE" : "PREPARE");
$("form[name=survey]").attr("action", "SURVEYEND.asp")
$("form[name=survey]").submit();
}
<% END IF %>
$("#start").click(function () {
/* 재접속 시 */
$.getJSON("/log/<%=PRJCODE%>/JSON/" + kon.survey.IDKEY + ".json", function (pdata) {
var $form = $("form[name=survey]");
$form.append("<input type='hidden' name='restart' value='yes' />")
Object.keys(pdata).forEach(function (v, i) {
kon.survey.tv[v] = pdata[v]
});
})
.fail(function (err) {
/* 처음 들어온 사람일경우 파일 없음 수 있음 */
})
.always(function () {
if (!login_chk && pinfo.surveytype === "3") {
alert("로그인 정보를 확인해주세요.");
return false;
}
var form = $("form[name=survey]");
var data = kon.survey.serializeform(form);
kon.survey.save(data, form);
})
})
efunc("ALL");
efunc("INDEX");
});
</script>
<!-- #include Virtual="/include/footer.asp" -->

View File

@@ -0,0 +1,41 @@
function efunc(qid) {
if(qid === "ALL"){
var isAnimete = true;
$(".scaleBtn, label > span, .question-title").css("word-break", "break-word");
$("button[id^=refresh_]").css("background", "#1cae81");
if(kon.attr.variable != undefined){ //kon 코드에 미리 정의해놓으면 됨
$("a[id^=attr_]:gt(0)").hide();
$(".custom-control-radio, .scaleBtn, .custom-control-checkbox-square, .d-inline-block").on("click", function(){
var tmpNextA = $(this).parents("div[id^=qus_]").next();
if($(tmpNextA).length > 0){
$(tmpNextA).show();
//console.log($(tmpNextA).attr("aria-expanded"));//밑에 나올게있음 true
if($(tmpNextA).attr("aria-expanded").toLowerCase() == "false"){
$(tmpNextA).click();
};
if(isAnimete){
var location = $(tmpNextA).position().top;
$("#qmain-box").animate({scrollTop : location + 148}, 400);
}
}
});
$(".custom-control-checkbox-square").on("click", function () {
var $chk = $(this).find("input[type=checkbox]");
var tId = "#T" + $chk.attr("id");
if ($(tId).length > 0) {
if ($chk.prop("checked")) $(tId).prop("disabled", false);
else $(tId).prop("disabled", true).val("");
}
});
}
}// ALL
switch(qid){
}
}

1
ProjectUpload/.gitkeep Normal file
View File

@@ -0,0 +1 @@

2173
Question.asp Normal file

File diff suppressed because it is too large Load Diff

1298
QuotaSet.asp Normal file

File diff suppressed because it is too large Load Diff

161
QuotaSet_ajax.asp Normal file
View File

@@ -0,0 +1,161 @@
<!-- #include File="./Lib/Config.asp"-->
<%
Dim SQL,Rcset
Dim icnt
Dim QSJSON, QSORDER, QUOTAJSON
DIM qids, qid
Dim flag
Set Rcset = Server.CreateObject("ADODB.RecordSet")
Rcset.CursorLocation = adUseClient
Dim COMMAND : COMMAND = request("COMMAND")
Dim pkey : pkey = request("pkey")
Call DBConnect2()
SELECT CASE COMMAND
CASE "GET_QUESTION"
Response.ContentType = "application/json"
SQL = ""
SQL = SQL & " SELECT "
SQL = SQL & " QID, "
SQL = SQL & " json_value(QUESTIONJSON,'$.variable') as variable, "
SQL = SQL & " json_value(QUESTIONJSON,'$.title') as title, "
SQL = SQL & " json_value(QUESTIONJSON,'$.explain') as explain "
SQL = SQL & " from QUESTION as Qu "
SQL = SQL & " WHERE PKEY = '" & pkey & "' "
SQL = SQL & " AND json_value(QUESTIONJSON,'$.qtype') in ('single') "
SQL = SQL & " ORDER BY Qorder "
Rcset.Open SQL,DBConn,3,1,1
Response.Write RecordToJSON(Rcset)
Response.End
CASE "GET_QUOTASET"
Response.ContentType = "application/json"
SQL = ""
SQL = SQL & " select QSORDER, JSON_QUERY(QSJSON, '$.COL') as COL,JSON_QUERY(QSJSON, '$.ROW') as ROW "
SQL = SQL & " from konkiwi.dbo.QUOTASET where pkey = '" & pkey & "' "
SQL = SQL & " order by QSORDER "
Rcset.Open SQL,DBConn,3,1,1
Response.Write RecordToJSON(Rcset)
Response.End
CASE "INSERT_QUOTASET"
QSORDER = request("QSORDER")
QSJSON = request("QSJSON")
SQL = ""
SQL = SQL & " DELETE FROM QUOTASET WHERE PKEY = '"+pkey+"' AND QSORDER = '"&QSORDER&"'"
SQL = SQL & " DELETE FROM QUOTA WHERE PKEY = '"+pkey+"' AND QSORDER = '"&QSORDER&"'"
SQL = SQL & " INSERT INTO konkiwi.dbo.QUOTASET(PKEY, QSORDER, QSJSON, EXPLAINS) "
SQL = SQL & " VALUES('"+pkey+"','"&QSORDER&"','"&QSJSON&"', '') "
DBConn.Execute SQL
response.write "Quota "&QSORDER&" 로 등록되었습니다."
CASE "INSERT_QUOTACELL"
QSORDER = request("QSORDER")
QUOTAJSON = request("QUOTAJSON")
SQL = ""
SQL = SQL & " INSERT INTO konkiwi.dbo.QUOTA(PKEY, QSORDER, cnt, ori_cnt, QUOTAJSON) "
SQL = SQL & " VALUES('"+pkey+"','"&QSORDER&"', 0, 0,'"&QUOTAJSON&"') "
'response.write SQL
DBConn.Execute SQL
CASE "PREVIEW_JSON"
Response.ContentType = "application/json"
qids = request("QIDS")
qid = split(qids, ",")
flag = request("flag")
SQL = ""
SQL = SQL & " DECLARE @JSON nvarchar(max) "
SQL = SQL & " SET @JSON = ( "
SQL = SQL & " SELECT QID, flag, json, variable "
SQL = SQL & " FROM ( "
for icnt = 0 to UBound(qid)
If icnt > 0 Then
SQL = SQL & " UNION ALL"
END IF
SQL = SQL & " SELECT QID, '" & flag & "' as flag, JSON_QUERY(QUESTIONJSON, '$.dataset.single') AS json, JSON_VALUE(QuestionJson, '$.variable') as variable FROM konkiwi.dbo.QUESTION "
SQL = SQL & " WHERE PKEY = '" & pkey & "' AND JSON_VALUE(QuestionJson, '$.qtype') = 'single' AND QID = '" & qid(icnt) & "' "
next
SQL = SQL & " ) R "
SQL = SQL & " FOR JSON AUTO "
SQL = SQL & " ) "
SQL = SQL & " SELECT @JSON as json "
Rcset.Open SQL, DBConn,3,1,1
Response.write Rcset(0)
Response.End
CASE "SEL_QUOTATABLE"
Response.ContentType = "application/json"
QSORDER = request("QSORDER")
SQL = ""
SQL = SQL & " SET NOCOUNT ON; "
SQL = SQL & " DECLARE @data nvarchar(MAX) = ( "
SQL = SQL & " SELECT top 1 QSJSON FROM konkiwi.dbo.QUOTASET "
SQL = SQL & " WHERE PKEY = '" & pkey & "' and QSORDER = '" & QSORDER & "' "
SQL = SQL & " ) "
SQL = SQL & " SELECT 'col' as gubun, '1' AS TYPE, value FROM OPENJSON(@data,'$.COL') UNION ALL "
SQL = SQL & " SELECT 'row' as gubun, '1' AS TYPE, value FROM OPENJSON(@data,'$.ROW') "
SQL = SQL & " SET NOCOUNT OFF; "
Rcset.Open SQL, DBConn,3,1,1
Response.Write RecordToJSON(Rcset)
'Response.write SQL
Response.End
CASE "GET_QUOTA_CNT"
Response.ContentType = "application/json"
QSORDER = request("QSORDER")
SQL = ""
SQL = SQL & " SELECT [id], [cnt], [ori_cnt], [QUOTAJSON] "
SQL = SQL & " FROM [QUOTA] "
SQL = SQL & " where pkey = '" & pkey & "' and qsorder = "&QSORDER
SQL = SQL & " order by id "
Rcset.Open SQL, DBConn,3,1,1
Response.Write RecordToJSON(Rcset)
'Response.write SQL
Response.End
CASE "UPDATE_QUOTA_CELL"
Dim jsonObj
Dim ONLYCNT : ONLYCNT = request("ONLYCNT")
QSORDER = request("QSORDER")
QUOTAJSON = request("QUOTAJSON")
Set jsonObj = New aspJSON
jsonObj.loadJSON(QUOTAJSON)
For Each icnt In jsonOBJ.data
SQL = ""
SQL = SQL & " update a set a.cnt = " & jsonOBJ.data(icnt).item("cnt")
IF ONLYCNT = "0" THEN
SQL = SQL & ", a.ori_cnt = " & jsonOBJ.data(icnt).item("cnt")
END IF
SQL = SQL & " from [QUOTA] a "
SQL = SQL & " where pkey = '" & pkey & "' and qsorder = " & QSORDER & " and [id] = " & jsonOBJ.data(icnt).item("quotaid")
DBConn.Execute SQL
Next
response.write "저장됐습니다."
' mskwon 2025-07-21 추가
' CASE "UNSETQUOTA"
' Response.ContentType = "application/json"
' SQL = ""
' SQL = SQL & " SELECT QINFO " & vbCrLf
' SQL = SQL & " FROM [STRUCTURE] WHERE PKEY = '" & pkey & "' " & vbCrLf
' Rcset.Open SQL, DBConn, 3, 1, 1
' Response.Write RecordToJSON(Rcset)
' Response.End
CASE Else
END SELECT
Call DBClose()
%>

1
WebProject/.gitkeep Normal file
View File

@@ -0,0 +1 @@

1
_ServerLog/.gitkeep Normal file
View File

@@ -0,0 +1 @@

3899
bootstrap-4.4.1/css/bootstrap-grid.css vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

327
bootstrap-4.4.1/css/bootstrap-reboot.css vendored Normal file
View File

@@ -0,0 +1,327 @@
/*!
* Bootstrap Reboot v4.4.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
html {
font-family: sans-serif;
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
display: block;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
text-align: left;
background-color: #fff;
}
[tabindex="-1"]:focus:not(:focus-visible) {
outline: 0 !important;
}
hr {
box-sizing: content-box;
height: 0;
overflow: visible;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 0;
margin-bottom: 0.5rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title],
abbr[data-original-title] {
text-decoration: underline;
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
border-bottom: 0;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: .5rem;
margin-left: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 80%;
}
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -.25em;
}
sup {
top: -.5em;
}
a {
color: #007bff;
text-decoration: none;
background-color: transparent;
}
a:hover {
color: #0056b3;
text-decoration: underline;
}
a:not([href]) {
color: inherit;
text-decoration: none;
}
a:not([href]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: 1em;
}
pre {
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
}
figure {
margin: 0 0 1rem;
}
img {
vertical-align: middle;
border-style: none;
}
svg {
overflow: hidden;
vertical-align: middle;
}
table {
border-collapse: collapse;
}
caption {
padding-top: 0.75rem;
padding-bottom: 0.75rem;
color: #6c757d;
text-align: left;
caption-side: bottom;
}
th {
text-align: inherit;
}
label {
display: inline-block;
margin-bottom: 0.5rem;
}
button {
border-radius: 0;
}
button:focus {
outline: 1px dotted;
outline: 5px auto -webkit-focus-ring-color;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
input {
overflow: visible;
}
button,
select {
text-transform: none;
}
select {
word-wrap: normal;
}
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
button:not(:disabled),
[type="button"]:not(:disabled),
[type="reset"]:not(:disabled),
[type="submit"]:not(:disabled) {
cursor: pointer;
}
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
padding: 0;
border-style: none;
}
input[type="radio"],
input[type="checkbox"] {
box-sizing: border-box;
padding: 0;
}
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"] {
-webkit-appearance: listbox;
}
textarea {
overflow: auto;
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
display: block;
width: 100%;
max-width: 100%;
padding: 0;
margin-bottom: .5rem;
font-size: 1.5rem;
line-height: inherit;
color: inherit;
white-space: normal;
}
progress {
vertical-align: baseline;
}
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
[type="search"] {
outline-offset: -2px;
-webkit-appearance: none;
}
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
summary {
display: list-item;
cursor: pointer;
}
template {
display: none;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.css.map */

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
/*!
* Bootstrap Reboot v4.4.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]){color:inherit;text-decoration:none}a:not([href]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
/*# sourceMappingURL=bootstrap-reboot.min.css.map */

File diff suppressed because one or more lines are too long

10224
bootstrap-4.4.1/css/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

7
bootstrap-4.4.1/css/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

7134
bootstrap-4.4.1/js/bootstrap.bundle.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4521
bootstrap-4.4.1/js/bootstrap.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

7
bootstrap-4.4.1/js/bootstrap.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

258
capi/adminUser.asp Normal file
View File

@@ -0,0 +1,258 @@
<!-- #include Virtual="/include/Header.asp"-->
<style>
@keyframes fadein {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes fadeintransY {
0% {
transform: translateY(-15%);
opacity: 0.5;
}
100% {
transform: translateY(0);
opacity: 1;
}
}
body,
html {
height: 100%;
}
.box-btn {
font-weight: bold;
background-color: white;
padding: .25rem;
margin: .25rem;
cursor: pointer;
transition-duration: .8s;
}
.box-btn:hover {
padding-left: 15px
}
#main_box {
animation: .8s ease-out fadein;
}
#view_prj_box {
height:100%;
overflow-y:scroll;
position: relative;
}
</style>
<%
Dim USERNAME : USERNAME = SESSION("MYUNNAME")
Dim IDKEY : IDKEY = SESSION("MYUNID")
IF USERNAME = "" OR IDKEY ="" THEN
response.redirect "./logout.asp"
END IF
Dim SQL
SQL = " SELECT PKEY,JSON_VALUE(PROJECTJSON,'$.must.title_inner') as title, ISNULL(JSON_VALUE(PROJECTJSON,'$.must.report'),'') as link, JSON_VALUE(PROJECTJSON,'$.must.status') as status "&vbcrlf
SQL = SQL + " FROM PROJECT "&vbcrlf
SQL = SQL + " WHERE LOWER(JSON_VALUE(PROJECTJSON,'$.must.title')) not like '%test%' "&vbcrlf
SQL = SQL + " AND LOWER(PKEY) not like '%test%' "&vbcrlf
SQL = SQL + " AND LOWER(JSON_VALUE(PROJECTJSON,'$.must.title')) not like '%테스트%' "&vbcrlf
SQL = SQL + " AND JSON_VALUE(PROJECTJSON,'$.must.status') != '3' "&vbcrlf '1준비 2진행 3완료
SQL = SQL + " AND JSON_VALUE(PROJECTJSON,'$.must.surveytype') = '2' "&vbcrlf '1온라인 2CAPI 3GANG
'''''''' KON-KIWI에는 IS_DELETE가 없음
'SQL = SQL + " AND IS_DELETE = '0' "&vbcrlf
SQL = SQL + " ORDER BY JSON_VALUE(PROJECTJSON,'$.must.title_inner') "&vbcrlf
'SQL = " select distinct a.PKEY, title, ISNULL(link,'') as link from KON_CAPI_ASSIGN_TB a left join ( select PKEY,JSON_VALUE(PROJECTJSON,'$.must.title') as title, JSON_VALUE(PROJECTJSON,'$.must.report') as link, JSON_VALUE(PROJECTJSON,'$.must.status') as status from PROJECT) b on a.PKEY = b.PKEY WHERE 1=1 "&vbcrlf
'SQL = SQL + " AND b.status != '3'" &vbcrlf
Dim Rcset
Set Rcset = Server.CreateObject("ADODB.RecordSet")
Call DBConnect2()
Rcset.Open SQL,DBConn, 3,1,1
IF Rcset.RecordCount > 0 THEN IDKEY = Rcset(0)
%>
<body>
<div class="container-fluid h-100">
<div class="row h-100" style="font-size: .7rem;">
<div class="col-xl-2 col-3 h-100 bg-light border-right">
<div class="d-flex flex-column p-2">
<div class="m-1"><img src="/img/konlogo_blue.png" style="max-width:80px;width:100%" /></div>
<div class="border-bottom m-1"><i class="fa fa-user" aria-hidden="true"></i> <%=USERNAME%></div>
<div class="box-btn text-danger border" onclick="window.location.href = './logout.asp' "> 로그 아웃 </div>
</div>
</div>
<%IF Rcset.eof or Rcset.bof THEN%>
<div class="col-xl-10 col-sm-9 h-100 text-center d-flex align-items-center justify-content-center">
<b class="h4">프로젝트가 없습니다. </b>
</div>
<%ELSE%>
<div class="col-xl-10 col-9 h-100" id="main_box">
<div class="d-flex flex-column p-2">
<div class="pb-1">
<div class="d-inline-block">
<i class="fa fa-tags" aria-hidden="true"></i> 프로젝트 목록
<select name="prj_list" class="form-control form-control-sm">
<option value="">선택</option>
<%While not Rcset.eof%>
<option data-link="<%=Rcset("link")%>" value="<%=Rcset("PKEY")%>" ><%=Rcset("title")%></option>
<% Rcset.movenext : wend %>
</select>
</div>
<div class="d-inline-block">
<input class="form-control form-control-sm hard-code-search" placeholder="면접원이름" name="username" type="text" value="">
</div>
<div class="d-inline-block">
<input type='button' class="form-control form-control-sm btn-primary" id="btnSearch" value="검색"/>
</div>
</div>
<div class="border-bottom pb-1">
<div class="p-2 font-weight-bold mb-1 bg-light border">
<i class="fa fa-pencil-square-o" aria-hidden="true"></i> 설문 현황
<div id="view_box" style="width:100%;height:100%"></div>
</div>
<div id="view_prj_box">
</div>
</div>
</div>
</div>
<%END IF%>
</div>
</div>
</body>
<!-- css -->
<link rel="stylesheet" href="/js/jquery-ui/jquery-ui.min.css">
<script>
function view_prj_list(value, link, username) {
if (value !== "") {
var param = setparam("s", "MYUN_PROJECT_DATA", { "PKEY": value, "IDKEY": "<%=IDKEY%>" , "USERNAME": username});
var data = ajax_returnData("/include/ajax_crud.asp", param);
console.log(data, param, value, "<%=IDKEY%>", username)
$("#view_prj_box").html("");
$("#view_box").html("");
var prj_box_header = createnode("div","",{"class":"border mb-1 p-1 position-sticky bg-white","style":"top:0px;z-index:10"})
var survey_btn = createnode("button", "신규 진행", { "class": "btn btn-sm btn-outline-success", "id": "survey_btn","type":"button" });
prj_box_header.appendChild(survey_btn)
if (data.length > 0) {
var stat = array_filter_to_group(data, "Status");
var label_title = "총 : " + data.length + "부 / 완료 : " + (stat["10"] ? stat["10"].length : "0") + "부 / 미완료 : " + (stat["1"] ? stat["1"].length : "0") + "부"
var label = createnode("label", label_title, { "class": "text-danger font-weight-bold p-2 " });
prj_box_header.appendChild(label)
var table = createnode("TABLE", "", { "class": "table table-sm table-bordered text-center" });
var head_tr = createnode("TR", "", { "class": "font-weight-bold bg-light" });
var td = ["면접원 이름", "응답 ID", "조사 상태", "진행 문항", "최종 입력 시점","쿼터", "설문 재진행", "응답 취소"].map(function (txt) {
return createnode("TD", txt);
})
head_tr.appendM(td);
table.appendChild(head_tr);
data.forEach(function (item) {
var tr = createnode("TR", "");
var sbtn = createnode("TD", "", { "class": "align-middle" });
var cancel_btn = createnode("TD", [createnode("BUTTON", "취소", { "class": "btn btn-outline-danger cancel_btn btn-sm", "data-idkey": item["IDKEY"], "data-pkey": value })], { "class": "align-middle" });
var field_order = ["USERNAME", "IDKEY", "Status", "PAGENAME", "end_date", "QUOTA_VALUE"];
var td = field_order.map(function (key) {
if (key === "Status") {
if (item[key] === "1") {
$(sbtn).append(createnode("BUTTON", "재진행", { "class": "btn btn-sm re_survey btn-outline-primary", "data-idkey": item["IDKEY"], "data-pkey": value }));
return createnode("TD", "진행중", { "class": "align-middle" });
} else {
var stat_text = "";
switch(item[key]){
case "10" : stat_text = "완료"; break;
case "99" : stat_text = "대상자아님"; break;
case "98" : stat_text = "할당초과"; break;
case "999" : stat_text = "삭제"; break;
}
$(sbtn).append(createnode("BUTTON", stat_text, { "class": "btn btn-sm btn-success", "disabled": true }));
return createnode("TD", stat_text, { "class": "align-middle" });
}
} else {
console.log(key)
return createnode("TD", item[key], { "class": "align-middle" });
}
});
td.push(sbtn);
td.push(cancel_btn)
tr.appendM(td);
table.appendChild(tr);
})
$("#view_prj_box").append(table);
}
$("#view_prj_box").prepend(prj_box_header)
}
}
$(document).ready(function () {
$(document).on('keypress', function(e) {
if (e.which === 13) {
e.preventDefault(); // 혹시 모를 기본 제출 막기
$('#btnSearch').click(); // 검색 버튼 클릭
}
});
$("#view_prj_box").css("max-height", ((+$("#main_box").css("height").replace("px","")) - 150) + "px" );
<%IF request("PRJCODE") <> "" THEN%>
$("select[name=prj_list]").val("<%=request("PRJCODE")%>")
var link = $("select[name=prj_list] option[value=<%=request("PRJCODE")%>]").attr("data-link") || ""
view_prj_list("<%=request("PRJCODE")%>", link,"");
<%END IF%>
$("select[name=prj_list]").change(function (e) {
$('input[name="username"]').val("");
var value = e.target.value;
var link = $(e.target).find("option:selected").attr("data-link") || "";
console.log(link)
view_prj_list(value, link,"")
})
$("#btnSearch").on("click", function(){
var select = document.querySelector('select[name="prj_list"]');
// 선택된 옵션
var selectedOption = select.options[select.selectedIndex];
// 선택된 옵션 값
var selectedValue = selectedOption.value;
var username = document.querySelector('input[name="username"]').value;
if( selectedValue === "" ) {
alert("프로젝트를 먼저 선택해주세요.");
$('select[name="prj_list"]').focus(); // 포커스 이동
return false;
}
view_prj_list(selectedValue, "", username);
});
$("body").on("click", "#survey_btn", function () {
window.location.href = "/project/" + $("select[name=prj_list]").val() + "/index.asp?ST=CAPI&MKEY=<%=IDKEY%>"
});
$("body").on("click", ".re_survey", function (e) {
var idkey = e.target.getAttribute("data-idkey");
var pkey = e.target.getAttribute("data-pkey");
window.location.href = "/project/" + pkey + "/index.asp?SID=" + idkey + "&ST=CAPI";
});
$("body").on("click", ".cancel_btn", function (e) {
var pkey = e.target.getAttribute("data-pkey");
var idkey = e.target.getAttribute("data-idkey");
var param = setparam("u", "CANCEL_MYUN_DATA", { "PKEY": pkey, "IDKEY": idkey });
if (confirm("해당 응답을 취소하시겠습니까?")) {
ajax_call("/include/ajax_crud.asp", param, function () {
alert("해당 응답을 취소처리 하였습니다.");
$(e.target).closest("TR").remove();
});
}
});
});
</script>

BIN
capi/bg-img/1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 MiB

BIN
capi/bg-img/2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

BIN
capi/bg-img/3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 MiB

BIN
capi/bg-img/4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

41
capi/login_chk.asp Normal file
View File

@@ -0,0 +1,41 @@
<!-- #include Virtual="/include/Header.asp"-->
<!--#include virtual = "/Lib/RSExec.asp" -->
<%
Dim userid : userid = Request.Form("userid") '로그인 ID
Dim userpw : userpw = Request.Form("userpw") '로그인 PW
Dim UNAME
dim SQL, rs
DBConnect2()
SQL = " select USERNAME, USERID from KonKiwi.dbo.KON_CAPI_TB where USERNAME = '"& userid &"' and USERPHONE = '" & userpw & "' "
Set rs = DBExec(SQL,"kon")
If Not rs.EOF Then
UNAME = rs(0)
USERID = rs(1)
Call DBExecClose(rs)
session("MYUNID") = USERID
session("MYUNNAME") = UNAME
''''''' 관리자의 경우 면접원명 표시, 검색 추가 '''''''
If USERID = "P00000015" Then
Response.Redirect "./adminUser.asp"
Else
Response.Redirect "./user.asp"
End If
Else
Call DBExecClose(rs)
Response.Write "<script type='text/javascript'>alert('입력하신 정보가 정확하지 않습니다.\n다시 한번 정확히 입력해 주시기 바랍니다'); window.history.go(-1);</script>"
End If
Response.End
%>

4
capi/logout.asp Normal file
View File

@@ -0,0 +1,4 @@
<%
Session.Abandon
response.redirect "./user_login.asp"
%>

556
capi/management_capi.asp Normal file
View File

@@ -0,0 +1,556 @@
<!-- #include Virtual="/include/Header.asp"-->
<style>
@keyframes fadein {
0% {
opacity: 0.5;
}
100% {
opacity: 1;
}
}
@keyframes fadeintransY {
0% {
transform: translateY(-15%);
opacity: 0.5;
}
100% {
transform: translateY(0);
opacity: 1;
}
}
#menu_bar>span,
#homebutton {
cursor: pointer;
border-bottom: 2px solid #dee2e6;
}
#menu_bar>span:hover {
border-bottom: 2px solid #3c60e2;
}
#upload_box {
display: none;
animation: 0.3s ease-out fadeintransY;
}
.Active {
color: #3c60e2;
font-weight: bold;
}
.div_btn,
#assign_title {
cursor: pointer;
font-size: .7rem;
overflow: hidden;
}
.div_btn:hover {
background-color: aliceblue;
}
#assign_inner_box>p {
border-left: 3px solid #3c60e2;
}
.selected_myun {
background-color: #f8f9fa !important;
color: #dc3545;
}
.selected_myun>label {
cursor: pointer;
}
.selected_myun>label::after {
content: "배정 완료";
color: black;
margin: 10px
}
.selected_myun:hover>label::after {
content: "클릭 시 배정 취소";
color: red;
margin: 10px;
}
</style>
<%
Call Login()
%>
<body>
<header class="navbar p-2 sticky-top navbar-expand-lg navbar-light bg-light border-bottom">
<img src="./krc.png" height="30" class="d-inline-block align-top" alt="" loading="lazy">
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav h6 font-weight-bold ml-2">
<span class="p-2 m-1 rounded" id="homebutton">
<i class="fa fa-home" aria-hidden="true"></i>
</span>
</div>
</div>
</header>
<div class="container-fluid">
<div class="row">
<div class="col-lg-12 col-xl-12 d-flex align-items-stretch" id="menu_bar">
<span id="myun_register" class="d-inline-flex p-2 border-right border-left mr-1">면접원 등록</span>
<span id="myun_assign" class="d-inline-flex p-2 border-right border-left mr-1">면접원 배정</span>
<span id="project_state" class="d-inline-flex p-2 border-right border-left mr-1">프로젝트[CAPI] 현황</span>
<span id="upload_box" class="p-2 border-right border-left mr-1"> <i class="fa fa-file"
aria-hidden="true"></i> Upload</span>
</div>
</div>
<div class="row">
</div>
<div class="row justify-content-center mt-1">
<div class="col-lg-7 col-md-12 p-1 text-center">
<div class="d-flex flex-wrap" id="main_box">
</div>
</div>
</div>
</div>
<!-- 면접원 입력 모달 -->
<div class="modal fade bd-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content p-3">
<button type="button" class="close text-right" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h5 class="border-bottom p-1">면접원 입력란</h5>
<label>○ 면접원 성함</label>
<input type="text" name="myun_name" class="form-control form-control-sm" />
<label>○ 면접원 휴대폰</label>
<input type="number" name="myun_phone" onkeyup="value = value.replace(/[^0-9]/g,'')"
onchange="value = value.replace(/[^0-9]/g,'')" class="form-control form-control-sm" />
<button id="save_myun" class="btn bnt-sm btn-outline-success w-100 mt-1">저장</button>
</div>
</div>
</div>
<!-- 면접원 확인 모달 -->
<div class="modal fade myModal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content p-2 " style="max-height: 600px;overflow-y:auto">
<div class="text-right">
<button class="close btn btn-sm border-0" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<b class="m-1">○ 업로드된 면접원</b>
<table class="table table-sm table-bordered text-center" id="upload_table">
<tr class="bg-light" id="uploaded_head">
<td>이름</td>
<td>휴대폰</td>
<td>삭제</td>
</tr>
</table>
<button type="button" class="btn btn-sm btn-outline-primary" id="save_myun_bundle">
저장
</button>
</div>
</div>
</div>
<!-- 면접원 관리 모달 -->
<div class="modal fade admin-modal" id="admin-modal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content p-2 " style="max-height: 600px;overflow-y:auto">
<div class="text-right">
<button class="close btn btn-sm border-0" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<b class="m-1">○ 면접원 관리 <button class="btn btn-sm btn-danger" name="myun-delete" type="button"> 삭제
</button></b>
<div class="border p-1 rounded m-1">
<div class="text-primary"> 성함 </div>
<div class="manage-input m-1 p-1 border rounded" data-type="name"></div>
<div class="text-primary"> 휴대폰 </div>
<div class="manage-input m-1 p-1 border rounded" data-type="phone"></div>
</div>
<div class="border p-1 rounded m-1">
<button type="button" class="btn btn-sm btn-outline-primary" name="manage-modify">수정</button>
<button type="button" class="btn btn-sm btn-outline-primary" name="manage-save">저장</button>
</div>
</div>
</div>
</div>
<input type="file" style="display:none;" name="file_name" />
</body>
<!-- css -->
<link rel="stylesheet" href="/js/jquery-ui/jquery-ui.min.css">
<script src="/eachPageModule/capi.js"></script>
<script src="/js/xlsx.min.js"></script>
<script src="/js/Array_.js"></script>
<script src="/module/ToastrCustom.js?ver=1"></script>
<script>
var attend_list = new ArrayTo([])
/* 하드코딩 테이블 그리는 거 */
attend_list.MakePagingContent = function (page_list) {
var plist = page_list.map(function (element) {
var btn = [createnode("BUTTON","관리",{"class":"btn btn-sm btn-outline-primary w-100 manage_btn ","data-key":element["USERID"]})]
var td_list = [element["USERID"],element["USERNAME"], element["USERPHONE"],btn]
td_list = td_list.map(function(ele){ return createnode("TD",ele) });
return createnode("TR", td_list, { "class": "content-tr" });
});
return plist;
}
const read_excel_fn = function (e) {
var files = e.target.files; //input file 객체를 가져온다.
var target = e.target
var i, f;
$("#upload_table").find("tr:gt(0)").remove()
const fn_read_file = function (file) {
return new Promise(function (resolve, reject) {
var reader = new FileReader(); //FileReader를 생성한다.
//성공적으로 읽기 동작이 완료된 경우 실행되는 이벤트 핸들러를 설정한다.
reader.readAsBinaryString(file);
reader.onload = function (e) {
var data = e.target.result; //FileReader 결과 데이터(컨텐츠)를 가져온다.
//바이너리 형태로 엑셀파일을 읽는다.
var workbook = XLSX.read(data, { type: "binary" });
var EXCEL_JSON = ""
//엑셀파일의 시트 정보를 읽어서 JSON 형태로 변환한다.
//defval를 적용해줘야 빈 값을 읽어옴.
workbook.SheetNames.forEach(function (item, index, array) {
EXCEL_JSON = XLSX.utils.sheet_to_json(workbook.Sheets[item], { defval: "" });
});//end. forEach
if (EXCEL_JSON.length > 0) {
kon.capi.upload_list = EXCEL_JSON.map(function (item) {
Object.keys(item).forEach(function (key) {
item[key] = String(item[key]).replace(/[,_-]/g, "")
});
return item;
});
target.value = ""
return resolve("a");
} else {
tAlert("데이터를 읽어드리지 못했습니다.", "error", "", 1000);
return reject("b");
}
}
})
}
forEachPromise(Array.from(files), fn_read_file).then(function () {
kon.capi.upload_list.forEach(function (item, id) {
var duplication = false
var td = Object.keys(item).map(function (key) {
return createnode("TD", item[key]);
})
$.each(kon.capi.myun_list, function (i, ori_item) {
if (ori_item["USERNAME"] === item["이름"] && ori_item["USERPHONE"] === item["휴대폰"]) {
duplication = true;
return false;
}
});
var tr = createnode("TR", "", duplication ? { "class": "bg-danger text-light" } : {});
if (duplication) {
td.push(createnode("TD", "중복"));
item["del_flag"] = "1";
} else {
var btn = createnode("BUTTON", "삭제", { "class": "btn btn-sm btn-outline-danger w-100 upload_delete", "data-name": item["이름"], "data-phone": item["휴대폰"] });
td.push(btn);
}
tr.appendM(td)
$("#uploaded_head").after(tr);
})
$("#myModal").modal("show")
})
}
function show_myun_table() {
var label = createnode("label", "면접원 개별 추가", { "style": "cursor:pointer", "data-toggle": "modal", "data-target": ".bd-example-modal-sm", "class": "m-1 p-2 border text-primary" })
var down_link = createnode("a", "업로드 양식 다운로드", { "style": "", "class": "m-1 p-2 border text-primary", "href": "/Files/list.xlsx" })
var i = createnode("i", "", { "class": "fa fa-plus mr-1", "aria-hidden": "true" });
$(label).prepend(i)
$("#main_box").html("")
$("#main_box").append(label)
.append(down_link)
.append(attend_list.getTabletarget())
}
$(document).ready(function () {
kon.capi.get_list();/* 리스트 가져오기 */
var header = createnode("TR","",{"class":"bg-light"});
var head_td = ["ID","면접원","휴대폰 번호","관리"]
head_td = head_td.map(function(txt, i){return createnode("TD",txt,{"class":"text-center" })});
header.appendM(head_td);
attend_list.setArr(kon.capi.myun_list);
attend_list.MakePagingTable({ "class": "table table-sm table-bordered table-hover", "style": "table-layout:fixed" }, header, kon.capi.myun_list.length, 10, 10);
$("#myun_register").click(function (e) { /* 면접원 등록 메뉴 */
kon.capi.get_list();/* 리스트 가져오기 */
$("#upload_box").css("display", "block")
$(".Active").removeClass("Active");
$(e.target).addClass("Active");
show_myun_table();
});
$("#myun_register").trigger("click");
$("#save_myun").click(function () { /* 면접원 개별 추가 */
var name = $("input[name=myun_name]").val();
var phone = $("input[name=myun_phone]").val();
if (name === "" || phone === "") {
tAlert("정보를 모두 입력해주세요.", "success", "", 1000);
return false;
}
var param = setparam("i", "MYUN", { "name": name, "phone": phone, "LOGINCHK": "Y" });
ajax_call(kon.capi.ajaxUrl, param, function (response) {
if (response === "0") {
tAlert("중복된 면접원이 있습니다.", "error", "", 1000);
return false;
} else {
tAlert("저장에 성공했습니다.", "success", "", 1000);
$("input[name=myun_name]").val("");
$("input[name=myun_phone]").val("");
}
});
});
$("#save_myun_bundle").click(function () { /* 면접원 Excel 업로드 */
if (confirm("화면에 보이는 면접원을 업로드 하시겠습니까?")) {
forEachPromise(kon.capi.upload_list, function (item) {
if (item["del_flag"] === "1") {
return Promise.resolve("");
} else {
var param = setparam("i", "MYUN", { "name": item["이름"], "phone": item["휴대폰"], "LOGINCHK": "Y" });
ajax_call(kon.capi.ajaxUrl, param);
return Promise.resolve("");
}
}).then(function () {
tAlert("면접원 등록을 완료하였습니다.", "success", "", 1000);
$("#myModal .close").trigger("click");
$("#myun_table").remove();
kon.capi.get_list();
kon.capi.set_page_list(1);
$("#page_box").before(kon.capi.make_myun_table());
})
}
})
$("#upload_box").click(function () {
$("input[name=file_name]").trigger("click");
})
$("input[name=file_name]").change(read_excel_fn)
$("body").on("click", ".prj_list", function (e) {
var id = e.target.getAttribute("data-id");
var text = e.target.innerHTML
var param = setparam("s", "MYUN_TO_CAPI", { "PKEY": id, "LOGINCHK": "Y" });
var selected_list = ajax_returnData(kon.capi.ajaxUrl, param);
$("#assign_inner_box").remove();
$("#assign_save").remove();
$("#assign_box").removeClass("bg-light");
$("#assign_title").html(text + "<br><p class='text-right m-0 text-success'>" + selected_list.length + "명 등록됨</p>")
$(".selected_myun").removeClass("selected_myun")
kon.capi.prj_target = id;
$("input[type=checkbox]").prop("disabled", false).prop("checked", false);
var btn = createnode("button", "저장", { "class": "btn btn-sm btn-outline-primary w-100", "id": "assign_save" })
$("#assign_box").append(btn);
selected_list.forEach(function (v) {
$("#" + v["USERID"]).prop("disabled", true);
$("#" + v["USERID"]).closest("div").addClass("selected_myun")
});
var inner_box = createnode("div", "", { "id": "assign_inner_box", "class": "m-1 rounded border p-1" });
$("#assign_box").append(inner_box);
})
/* 면접원 선택 */
$("body").on("click", ".myun_input", function (e) {
var id = e.target.id;
if (e.target.checked) {
var name = $("label[for=" + id + "]").text();
var myun_list = createnode("p", name, { "class": "m-1 text-left p-1", "data-id": e.target.value });
$("#assign_inner_box").append(myun_list);
} else {
$("#assign_inner_box").find("p[data-id=" + e.target.value + "]").remove();
}
})
$("body").on("click", ".manage_btn", function (e) {
$("#admin-modal").modal("show");
var mkey = $(e.target).attr("data-key");
$.each(kon.capi.myun_list, function (id, item) {
if (item.USERID === mkey) {
$("button[name=myun-delete]").attr("data-mkey", mkey);
$("button[name=manage-save]").attr("data-mkey", mkey);
$(".manage-input[data-type=name]").text(item.USERNAME)
$(".manage-input[data-type=phone]").text(item.USERPHONE)
}
})
})
/* 리스트 저장 */
$("body").on("click", "#assign_save", function (e) {
var text = $("#assign_inner_box").find("p").get().map(function (ele) { return ele.getAttribute("data-id") }).join(",")
if (text === "") {
tAlert("선택한 면접원이 없습니다.", "error", "", 1000)
return false;
} else {
var param = setparam("i", "MYUN_TO_CAPI", { "LIST": text, "PKEY": kon.capi.prj_target, "LOGINCHK": "Y" });
ajax_call(kon.capi.ajaxUrl, param, function () {
tAlert("선택하신 면접원을 프로젝트에 할당하였습니다.", "success", "", 1000)
$("#assign_inner_box").remove();
$("#assign_save").remove();
kon.capi.make_myun_assign_frame();
})
}
})
$("body").on("click", ".selected_myun", function (e) {
if (e.target.tagName === "LABEL") {
var id = $(e.target).attr("for")
var param = setparam("d", "MYUN_TO_CAPI", { "PKEY": kon.capi.prj_target, "USERID": id, "LOGINCHK": "Y" });
if (confirm("선택하신 면접원을 배정 취소하시겠습니까?")) {
ajax_call(kon.capi.ajaxUrl, param, function () {
$(".prj_list[data-id=" + kon.capi.prj_target + "]").trigger("click");
tAlert("배정을 취소하였습니다.", "success", "", 1000)
e.preventDefault();
})
}
}
})
$("#myun_assign").click(function (e) { /* 면접원 할당 */
var param = setparam("s", "MYUN_PROJECT", { "LOGINCHK": "Y" });
var prj_list = ajax_returnData(kon.capi.ajaxUrl, param);
kon.capi.project_list = prj_list;
$("#upload_box").css("display", "none")
$(".Active").removeClass("Active")
$(e.target).addClass("Active")
kon.capi.make_myun_assign_frame();
})
$("body").on("click", ".upload_delete", function (e) {
var name = e.target.getAttribute("data-name");
var phone = e.target.getAttribute("data-phone");
$(e.target).closest("TR").remove();
kon.capi.upload_list = kon.capi.upload_list.filter(function (item) {
if (item["이름"] === name && item["휴대폰"] === phone) {
return false;
}
return true;
})
})
$("body").on("click", "button[name=manage-modify]", function (e) {
$(".manage-input").prop("contenteditable", true).addClass("bg-light");
$(".manage-input").blur(function (e) {
e.target.innerText = e.target.innerText.replace(/[^0-9가-힣]/g, "");
})
})
$("body").on("click", "button[name=manage-save]", function (e) {
$(".manage-input").prop("contenteditable", false).removeClass("bg-light");
var id = e.target.getAttribute("data-mkey")
var name = $(".manage-input[data-type=name]").text();
var phone = $(".manage-input[data-type=phone]").text();
var param = setparam("u", "MYUN", {
"USERNAME": name,
"USERPHONE": phone,
"USERID": id
})
ajax_call(kon.capi.ajaxUrl, param, function () {
tAlert("면접원 정보를 수정했습니다.", "success", "", 1000)
$("#myun_table").remove();
kon.capi.get_list();
kon.capi.set_page_list(parseInt($(".active").text()));
$("#page_box").before(kon.capi.make_myun_table());
})
})
$("body").on("click", "button[name=myun-delete]", function (e) {
if (confirm("면접원을 삭제하시겠습니까?")) {
var id = e.target.getAttribute("data-mkey");
var param = setparam("d", "MYUN", { "USERID": id })
ajax_call(kon.capi.ajaxUrl, param, function () {
tAlert("면접원을 삭제했습니다.", "success", "", 1000);
$("#myun_table").remove();
kon.capi.get_list();
kon.capi.set_page_list(parseInt($(".active").text()));
$("#page_box").before(kon.capi.make_myun_table());
$("#admin-modal").modal("hide");
})
}
})
$("body").on("keyup", "#myun-search", function (e) {
if (e.keyCode === 13) {
e.target.innerText = e.target.innerText.replace(/[^가-힣]/g, "");
return false;
}
var value = e.target.innerText;
if (value.trim() === "") {
$("#myun_box .div_btn").removeClass("d-none");
} else {
$("#myun_box .div_btn").each(function (i, ele) {
var username = ele.getAttribute("data-username");
regex_test(value, username) ? $(ele).removeClass("d-none") : $(ele).addClass("d-none")
})
}
})
$("#homebutton").click(function () {
window.location.href = "/index.asp"
})
$("#project_state").click(function (e) {
$("#upload_box").css("display", "none")
$(".Active").removeClass("Active")
$(e.target).addClass("Active")
$("#main_box").html("")
})
})
</script>

276
capi/user.asp Normal file
View File

@@ -0,0 +1,276 @@
<!-- #include Virtual="/include/Header.asp"-->
<style>
@keyframes fadein {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes fadeintransY {
0% {
transform: translateY(-15%);
opacity: 0.5;
}
100% {
transform: translateY(0);
opacity: 1;
}
}
body,
html {
height: 100%;
}
.box-btn {
font-weight: bold;
background-color: white;
padding: .25rem;
margin: .25rem;
cursor: pointer;
transition-duration: .8s;
}
.box-btn:hover {
padding-left: 15px
}
#main_box {
animation: .8s ease-out fadein;
}
#view_prj_box {
height:100%;
overflow-y:scroll;
position: relative;
}
</style>
<%
Dim USERNAME : USERNAME = SESSION("MYUNNAME")
Dim IDKEY : IDKEY = SESSION("MYUNID")
IF USERNAME = "" OR IDKEY ="" THEN
response.redirect "./logout.asp"
END IF
Dim SQL
SQL = " select USERID, a.PKEY, title, ISNULL(link,'') as link from KON_CAPI_ASSIGN_TB a left join ( select PKEY,JSON_VALUE(PROJECTJSON,'$.must.title') as title, JSON_VALUE(PROJECTJSON,'$.must.report') as link from PROJECT ) b on a.PKEY = b.PKEY WHERE a.USERID = '" & IDKEY & "' " &vbcrlf
Dim Rcset
Set Rcset = Server.CreateObject("ADODB.RecordSet")
Call DBConnect2()
Rcset.Open SQL,DBConn, 3,1,1
IF Rcset.RecordCount > 0 THEN IDKEY = Rcset(0)
%>
<body>
<div class="container-fluid h-100">
<div class="row h-100" style="font-size: .7rem;">
<div class="col-xl-2 col-3 h-100 bg-light border-right">
<div class="d-flex flex-column p-2">
<div class="m-1"><img src="/img/konlogo_blue.png" style="max-width:80px;width:100%" /></div>
<div class="border-bottom m-1"><i class="fa fa-user" aria-hidden="true"></i> <%=USERNAME%></div>
<div class="box-btn text-danger border" onclick="window.location.href = './logout.asp' "> 로그 아웃 </div>
</div>
</div>
<%IF Rcset.eof or Rcset.bof THEN%>
<div class="col-xl-10 col-sm-9 h-100 text-center d-flex align-items-center justify-content-center">
<b class="h4">배정 받은 프로젝트가 없습니다. </b>
</div>
<%ELSE%>
<div class="col-xl-10 col-9 h-100" id="main_box">
<div class="d-flex flex-column p-2">
<div class="pb-1">
<div class="d-inline-block">
<i class="fa fa-tags" aria-hidden="true"></i> 배정받은 프로젝트 목록
<select name="prj_list" class="form-control form-control-sm">
<option value="">선택</option>
<%While not Rcset.eof%>
<option data-link="<%=Rcset("link")%>" value="<%=Rcset("PKEY")%>" ><%=Rcset("title")%></option>
<% Rcset.movenext : wend %>
</select>
</div>
</div>
<div class="border-bottom pb-1">
<div class="p-2 font-weight-bold mb-1 bg-light border">
<i class="fa fa-pencil-square-o" aria-hidden="true"></i> 설문 현황
</div>
<div id="view_prj_box">
</div>
</div>
</div>
</div>
<%END IF%>
</div>
</div>
</body>
<!-- css -->
<link rel="stylesheet" href="/js/jquery-ui/jquery-ui.min.css">
<script>
function view_prj_list(value, link) {
if (value !== "") {
var param = setparam("s", "MYUN_PROJECT_DATA", { "PKEY": value, "IDKEY": "<%=IDKEY%>" });
var data = ajax_returnData("/include/ajax_crud.asp", param);
$("#view_prj_box").html("");
var prj_box_header = createnode("div","",{"class":"border mb-1 p-1 position-sticky bg-white","style":"top:0px;z-index:10"})
var survey_btn = createnode("button", "신규 진행", { "class": "btn btn-sm btn-outline-success", "id": "survey_btn","type":"button" });
prj_box_header.appendChild(survey_btn)
/*
//-- Kon > report 링크. 개별 면접원을 mkey로 구분해서 보여줄수 있도록.
if(link !== ""){
var linkbtn = createnode("button","진행 현황",{"class":"btn btn-sm btn-outline-primary ml-1","type":"button","onclick":"window.open('"+link+"?mkey=<%=IDKEY%>')"})
prj_box_header.appendChild(linkbtn)
}
*/
/* 면접원 View
- 면접원 본인이 수행한 수행량 확인용 테이블
- 프로젝트 코드로 예외처리
*/
if(value == "2103007_A"){
var hard_data = ajax_returnData("/include/ajax_crud.asp", setparam("s", "HARD_QUOTA_DATA_2103007_A", { "IDKEY": "<%=IDKEY%>" }));
console.log(hard_data)
//table 2
var table = createnode("table", "", {"class" : "table table-sm table-bordered col-11 text-center" , "id" : "quota_table_b", "style" : "table-layout:fixed;margin: 0 auto; margin-top:15px;margin-bottom:15px;"})
prj_box_header.appendChild(table)
var tr = [];
tr.push(createnode("th", "구분", {"rowspan" : "2"}))
tr.push(createnode("th", "남성", {"colspan" : "5"}))
tr.push(createnode("th", "여성", {"colspan" : "5"}))
tr.push(createnode("th", "합계", {"rowspan" : "2"}))
table.appendChild(createnode("tr", tr , {"class" : "table-info"}))
var tr = [];
tr.push(createnode("th", "20대"))
tr.push(createnode("th", "30대"))
tr.push(createnode("th", "40대"))
tr.push(createnode("th", "50대"))
tr.push(createnode("th", "60대"))
tr.push(createnode("th", "20대"))
tr.push(createnode("th", "30대"))
tr.push(createnode("th", "40대"))
tr.push(createnode("th", "50대"))
tr.push(createnode("th", "60대"))
table.appendChild(createnode("tr", tr , {"class" : "table-info"}))
var tr = [];
tr.push(createnode("td", hard_data[0].USERNAME))
$.each($.grep(hard_data , function(o, i){ return o.GENDER == "1";}), function(i, o ){
tr.push(createnode("td", o.CNT))
})
$.each($.grep(hard_data , function(o, i){ return o.GENDER == "2";}), function(i, o ){
tr.push(createnode("td", o.CNT))
})
tr.push(createnode("td", "0"))
table.appendChild(createnode("tr", tr))
$("#quota_table_b").find("tr").each(function(i, o){
var sum = 0
$(o).find("td:gt(0)").each(function(idx, obj){
sum += parseInt(obj.innerText)
if(idx == ($(o).find("td:gt(0)").length - 1) ){
obj.innerText = sum
}
})
})
}
/* 여기까지 */
if (data.length > 0) {
var stat = array_filter_to_group(data, "Status");
var label_title = "총 : " + data.length + "부 / 완료 : " + (stat["10"] ? stat["10"].length : "0") + "부 / 미완료 : " + (stat["1"] ? stat["1"].length : "0") + "부"
var label = createnode("label", label_title, { "class": "text-danger font-weight-bold p-2 " });
prj_box_header.appendChild(label)
var table = createnode("TABLE", "", { "class": "table table-sm table-bordered text-center" });
var head_tr = createnode("TR", "", { "class": "font-weight-bold bg-light" });
var td = ["응답 ID", "조사 상태", "진행 문항", "최종 입력 시점", "설문 재진행", "응답 취소"].map(function (txt) {
return createnode("TD", txt);
})
head_tr.appendM(td);
table.appendChild(head_tr);
data.forEach(function (item) {
var tr = createnode("TR", "");
var sbtn = createnode("TD", "", { "class": "align-middle" });
var cancel_btn = createnode("TD", [createnode("BUTTON", "취소", { "class": "btn btn-outline-danger cancel_btn btn-sm", "data-idkey": item["IDKEY"], "data-pkey": value })], { "class": "align-middle" });
var td = Object.keys(item).map(function (key) {
if (key === "Status") {
if (item[key] === "1") {
$(sbtn).append(createnode("BUTTON", "재진행", { "class": "btn btn-sm re_survey btn-outline-primary", "data-idkey": item["IDKEY"], "data-pkey": value }));
return createnode("TD", "진행중", { "class": "align-middle" });
} else {
var stat_text = "";
switch(item[key]){
case "10" : stat_text = "완료"; break;
case "99" : stat_text = "대상자아님"; break;
case "98" : stat_text = "할당초과"; break;
case "999" : stat_text = "삭제"; break;
}
$(sbtn).append(createnode("BUTTON", stat_text, { "class": "btn btn-sm btn-success", "disabled": true }));
return createnode("TD", stat_text, { "class": "align-middle" });
}
} else {
return createnode("TD", item[key], { "class": "align-middle" });
}
});
td.push(sbtn);
td.push(cancel_btn)
tr.appendM(td);
table.appendChild(tr);
})
$("#view_prj_box").append(table);
}
$("#view_prj_box").prepend(prj_box_header)
}
}
$(document).ready(function () {
$("#view_prj_box").css("max-height", ((+$("#main_box").css("height").replace("px","")) - 150) + "px" );
<%IF request("PRJCODE") <> "" THEN%>
$("select[name=prj_list]").val("<%=request("PRJCODE")%>")
var link = $("select[name=prj_list] option[value=<%=request("PRJCODE")%>]").attr("data-link") || ""
view_prj_list("<%=request("PRJCODE")%>", link);
<%END IF%>
$("select[name=prj_list]").change(function (e) {
var value = e.target.value;
var link = $(e.target).find("option:selected").attr("data-link") || "";
console.log(link)
view_prj_list(value, link)
})
$("body").on("click", "#survey_btn", function () {
window.location.href = "/project/" + $("select[name=prj_list]").val() + "/index.asp?ST=CAPI&MKEY=<%=IDKEY%>"
});
$("body").on("click", ".re_survey", function (e) {
var idkey = e.target.getAttribute("data-idkey");
var pkey = e.target.getAttribute("data-pkey");
window.location.href = "/project/" + pkey + "/index.asp?SID=" + idkey + "&ST=CAPI";
});
$("body").on("click", ".cancel_btn", function (e) {
var pkey = e.target.getAttribute("data-pkey");
var idkey = e.target.getAttribute("data-idkey");
var param = setparam("u", "CANCEL_MYUN_DATA", { "PKEY": pkey, "IDKEY": idkey });
if (confirm("해당 응답을 취소하시겠습니까?")) {
ajax_call("/include/ajax_crud.asp", param, function () {
alert("해당 응답을 취소처리 하였습니다.");
$(e.target).closest("TR").remove();
});
}
});
});
</script>

58
capi/user_login.asp Normal file
View File

@@ -0,0 +1,58 @@
<!-- #include Virtual="/include/Header.asp"-->
<style>
body, html {
height: 100%;
}
body{
background-image:
linear-gradient(to bottom, rgba(245, 246, 252, 0.52), rgba(12, 25, 97, 0.73)),
url("/capi/bg-img/3.jpg");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.login_input{
background-color: rgba(255, 255, 255, 0);
border:1px solid gray !important;
}
.login_input:focus{
background-color: rgba(255, 255, 255, 0);
}
</style>
<body style="padding-bottom: 80px;">
<div class="container">
<div class="row justify-content-md-center ">
<div class="p-2 shadow-sm border" style="width:350px;background-color: #ffffff60;height:250px;position: absolute;top:calc(40% - 125px);left:calc(50% - 175px)">
<div class="login-panel panel panel-default">
<div class="panel-body p-2">
<img src="/img/konlogo_blue.png" style='height:20px' class="m-1">
<div class="p-2 border-bottom text-left h5">
CAPI 면접원 로그인
</div>
<form role="form" method="post" action="login_chk.asp">
<input type="hidden" name="Command" value="LOGIN">
<fieldset>
<div class="form-group">
<input class="form-control mb-2 mt-1 login_input" placeholder="아이디" name="userid" type="text" value="" autofocus required>
<input class="form-control mb-2 login_input" placeholder="패스워드" name="userpw" type="password" value="" required>
</div>
<button type="submit" class="btn btn-sm btn-dark btn-block">로그인</button>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
<footer>
<nav class="navbar navbar-expand-lg fixed-bottom navbar-light p-4 " style="background-color: #ffffff50;">
© 2020. Korea Research Center Inc. all right reserved.
</nav>
</footer>
</body>
</html>

41
css/jquery.alert.css Normal file
View File

@@ -0,0 +1,41 @@
/* **************************** popup area start ***************************** */
/*reset*/
/* html, body, div, span, applet, object, iframe,h1, h2, h3, h4, h5, h6, p, blockquote, pre,a, abbr, acronym, address, big, cite, code,del, dfn, em, img, ins, kbd, q, s, samp,small, strike, strong, sub, sup, tt, var,b, u, i, center,dl, dt, dd, ol, ul, li,fieldset, form, label, legend,table, caption, tbody, tfoot, thead, tr, th, td,article, aside, canvas, details, embed,figure, figcaption, footer, header, hgroup,menu, nav, output, ruby, section, summary,time, mark, audio, video
{margin:0;padding: 0;border: 0;font: inherit;vertical-align: baseline;} */
/* HTML5 display-role reset for older browsers */
/* article, aside, details, figcaption, figure,footer, header, hgroup, menu, nav, section {display: block;}
body {line-height: 1;}
ol, ul, li, ol, menu {list-style: none;}
blockquote, q {quotes: none;}
blockquote:before, blockquote:after,q:before, q:after {content: '';content: none;}
table {border-collapse: collapse;border-spacing: 0;}
a{text-decoration: none}
button:focus,input:focus {outline:none;} */
/* body에 class .popup_open를 붙이면 활성화됨. */
.popup{ position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 999999; display: none; }
body.popup_open .popup{ display: block; }
.popup .popup-wrap{ position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: auto; height: auto; border-radius: 10px; background-color: #fff; border-radius: 10px; z-index: 2;max-width: 90%;}
.popup .popup-title{ width: 100%; padding: 15px 20px; background-color: #1cae81; border-radius: 10px 10px 0 0; color: #fff; font-size: 15px; letter-spacing: -0.05em; font-weight: 600; box-sizing: border-box; }
.popup .popup-content{ width: 100%; height: auto; padding: 20px 40px; box-sizing: border-box; min-width: 300px;}
.popup .popup-wrap .popup-content .text-box p{ font-size: 13px; letter-spacing: -0.05em; line-height: 20px; font-weight: 400; margin-bottom: 15px; word-break: keep-all; text-align: left;}
.popup .popup-wrap .popup-content .text-box strong{ display: block; color: #1cae81; font-size: 13px; font-weight: 600; margin-bottom: 15px; }
.popup .popup-wrap .popup-content .popup-btn ul{ display: flex; justify-content: center; }
.popup .popup-wrap .popup-content .popup-btn ul li{ width: 170px; height: auto; margin-right: 20px; box-sizing: border-box; }
.popup .popup-wrap .popup-content .popup-btn ul li:last-child{margin-right: 0;}
.popup .popup-wrap .popup-content .popup-btn ul li a{ display: block; width: 100%; height: 100%; padding: 13px 0; text-align: center; font-size: 13px; letter-spacing: -0.05em; font-weight: 600; box-sizing: border-box; border-radius: 5px; background-color: #1cae81; color: #fff;}
/* 인풋박스 스타일 */
.popup .popup-wrap .popup-content .input-box{width: 100%; height: auto; margin-bottom: 30px;}
.popup .popup-wrap .popup-content input{ width: 100%; height: 6rem; border: 1px solid #c8c8c8; border-radius: 5px; box-sizing: border-box; font-size: 1.3rem; color: #4d4d4d;padding-left: 1rem;}
/* *********** 뒷배경 검정색 딤 처리 박스 *********** */
body.popup_open .dimmed{width: 100%; height: 100%; position: fixed; left: 0; top: 0; background: rgba(0,0,0,0.3); overflow: hidden; z-index: 1;}
/* body 태그에 연결할 클래스 */
body.popup_open{overflow: hidden}

1887
eachPageModule/Question_.js Normal file

File diff suppressed because it is too large Load Diff

1723
eachPageModule/_Question_.js Normal file

File diff suppressed because it is too large Load Diff

82
eachPageModule/bundle.js Normal file
View File

@@ -0,0 +1,82 @@
/*
* 일괄 등록
* bundle 함수 정의
*
*/
window.kon = window.kon || {}
kon.bundle = (function () {
function make_bundle_frame(){
var param = setparam("s","BUNDLEVARIABLE",{"PKEY":code});
var bundle_variable, bundle_code
if(!bundle_variable) bundle_variable = ajax_returnData(ajaxUrl, param);
param = setparam("s","BUNDLECODE",{"PKEY":code});
if(!bundle_code) bundle_code = ajax_returnData(ajaxUrl, param);
var div = createnode("div","",{"class":"col-2"});
var div2 = createnode("div","이 공간에 붙여넣기 해주세요.",{"class":"col-10 p-2 shadow-sm bordered bg-light", "id":"bundle_logic" ,"style":"overflow-y:scroll;max-height: 860px;border: 1px solid #b5b5b5;"});
$(div2).prop("contentEditable",true);
var table = createnode("TABLE","",{"class":gstyle.stable.sm + " shadow-sm"});
/* 1 row */
var td = [createnode("TD","패턴 설정",{"colspan":"2"})];
var tr = createnode("TR",td);
table.appendChild(tr);
/* 2 row */
td = [createnode("TD","변수"),createnode("TD",[createnode("INPUT","",{"type":"text", "class":"border-primary" , "id":"b_variable"})] )];
tr = createnode("TR",td);
table.appendChild(tr);
/* 3 row */
td = [createnode("TD","보기"),createnode("TD",[createnode("INPUT","",{"type":"text" , "class":"border-primary" ,"id":"b_code"})] )];
tr = createnode("TR",td);
table.appendChild(tr);
/* 4 row */
td = [createnode("TD","삭제")];
var del_td = createnode("TD",[createnode("INPUT","",{"type":"text", "class":"border-danger" , "id":"b_delete"})] );
var del_btn = createnode("BUTTON","삭제",{"id":"bundle_delete_btn","class":"btn btn-sm btn-outline-danger d-block mt-1 w-100"});
del_td.appendChild(del_btn);
td.push(del_td);
tr = createnode("TR",td);
table.appendChild(tr);
/* 5 row */
td = [createnode("TD",[createnode("BUTTON","구조 최적화",{"class":gstyle.btn.primary,"id":"optimize_question" })],{"colspan":"2"})];
tr = createnode("TR",td);
table.appendChild(tr);
/* 6 row */
td = [createnode("TD",[createnode("DIV","설문 구조",{"class":"p-1 m-1 text-primary text-center"}),createnode("DIV","",{"class":"m-1 p-1 border rounded text-left","id":"question_legend"}) ],{"colspan":"2","style":"color:red"})];
tr = createnode("TR",td);
table.appendChild(tr);
/* 7 row */
td = [createnode("TD",[createnode("BUTTON","설문 생성",{"class":gstyle.btn.primary,"id":"create_question" })],{"colspan":"2"})];
tr = createnode("TR",td);
table.appendChild(tr);
/* 8 row */
td = [createnode("TD",[form_inline_input("checkbox","reset_checkbox","문항 전체 초기화")],{"colspan":"2","style":"color:red"})];
tr = createnode("TR",td);
table.appendChild(tr);
div.appendChild(table);
$("#mcontent").append(div).append(div2);
$(table).addClass("position-sticky").css("top","50px")
}
var module = {
make_bundle_frame:make_bundle_frame
}
return module
})();

89
eachPageModule/capi.js Normal file
View File

@@ -0,0 +1,89 @@
/*
* logic 함수 정의
*
*
*
*/
window.kon = window.kon || {}
kon.capi = (function () {
var ajaxUrl = "/include/ajax_crud.asp";
var target = ""
var selected_myun = []
var myun_list = []
var page_list = [];
var page_cnt = 10;
var filter_list = [];
var upload_list = []
var project_list = []
var prj_target = ""
/* 리스트 가져오기 */
function get_list() {
var param = setparam("s", "MYUN");
kon.capi.myun_list = ajax_returnData(ajaxUrl, param);
}
/* 면접원 배정 프레임 */
function make_myun_assign_frame(){
$("#main_box").html("")
/* 박스 선언 */
var prj_box = createnode("div","",{"id":"prj_box" ,"class":"p-1 border rounded m-1 ","style":"height:600px;width:30%;overflow-y:auto"});
var prj_assign_box = createnode("div","",{"id":"assign_box" ,"class":"p-1 border rounded m-1 bg-light ","style":"height:600px;width:30%;overflow-y:auto"});
var myun_box = createnode("div","",{"id":"myun_box" ,"class":"p-1 border rounded m-1 ","style":"height:600px;width:30%;overflow-y:auto"});
/* 박스 상단 */
$(prj_box).append("<p class='text-left m-1'><i class='fa fa-list' aria-hidden='true'></i> 프로젝트 목록</p>")
$(prj_assign_box).append("<p id='assign_title' class='text-left m-1' style='cursor:default;border-bottom:2px solid #2196f3'>프로젝트를 선택해주세요</p>")
$(myun_box).append("<div class='text-left m-1'><i class='fa fa-user' aria-hidden='true'></i> 면접원 목록</p>")
$(myun_box).append("<div class='text-left text-primary'><small>* 면접원 성함으로 검색</small></div><div><div contenteditable class='m-1 border bg-light' id='myun-search' /> </div>")
/* 프로젝트 삽입 */
var prj_btn_list = kon.capi.project_list.map(function(v){
return createnode("div", v["title"], {"title":v["PKEY"],"data-id":v["PKEY"] ,"class": "m-1 p-1 border text-left div_btn prj_list" })
})
prj_box.appendM(prj_btn_list)
/* 면접원 삽입 */
var myun_btn_list = kon.capi.myun_list.map(function(v){
var label = createnode("label",v["USERNAME"] + "-" + v["USERPHONE"],{"for":v["USERID"],"class":"w-100 m-0 h-100"});
var chkbox = createnode("input","",{"type":"checkbox","id":v["USERID"],"value":v["USERID"],"class":"myun_input"});
label.appendChild(chkbox);
$(chkbox).prop("disabled",true);
return createnode("div", [label] , {"data-id":v["USERID"] ,"class": "m-1 p-1 border text-left div_btn","style":"cursor:default","data-username":v["USERNAME"] });
})
myun_box.appendM(myun_btn_list)
/* 메인 프레임에 삽입 */
$("#main_box").append(prj_box)
$("#main_box").append(prj_assign_box)
$("#main_box").append(myun_box)
}
var module = {
/* function */
get_list: get_list,
make_myun_assign_frame:make_myun_assign_frame,
/* variable */
ajaxUrl: ajaxUrl,
myun_list: myun_list,
target:target,
selected_myun: selected_myun,
filter_list: filter_list,
page_cnt:page_cnt,
upload_list:upload_list,
project_list:project_list,
prj_target:prj_target
}
return module
}
)();

Some files were not shown because too many files have changed in this diff Show More