Files
KON/msa_gps.asp
2026-08-07 12:53:18 +09:00

635 lines
25 KiB
Plaintext

<!-- #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;
}
.filter-box .post-it {
font-size: .9rem;
background-color: white;
position: relative;
border-right:4px solid #1A1A3A;
margin-bottom: 2px;
text-align: right;
padding-right:5px;
cursor: pointer;
transition: .5s;
}
.filter-box .post-it::before {
content:'';
position:absolute;
left:0px;
top:0px;
height:100%;
width:0%;
background-color:yellow;
transition: .5s;
z-index: -1;
}
.target-tr {
background-color: #2196f3;
color:white;
}
.target-tr button {
border:1px solid transparent;
background-color: black;
color:white;
}
tr button {
border:1px solid transparent;
background-color: #2196f3;
color:white;
}
.photo-box img {
transition: .5s ease-in;
}
.photo-box img:hover {
transform: scale(1.5);
}
.filter-td {
cursor: pointer;
position:relative;
}
.filter-option{
position: absolute;
width: 100%;
background-color: #626782;
box-shadow: 0px 0px 2px 0px rgb(185, 176, 176);
left:0px;
top:calc(100%)
}
.filter-option p {
margin:1px 0px 1px 0px;
border:1px solid rgb(116, 116, 116);
padding:.2rem;
}
.filter-option p:hover {
background-color: yellowgreen;
}
.tr-none {
display: none;
}
.filter_photo, .filter_model {
margin-right: 10px;
cursor: pointer;
}
.filter_photo::before{
content: '사진 : ';
}
.filter_model::before{
content: '모델 : ';
}
.filter_prev::before{
content: '사전 조사 : ';
}
.filter-model:hover{
cursor: pointer;
}
.filter-model:hover::after{
content: '해제';
color:red;
font-size: .5rem;
margin-left: 5px;
}
#h-list {
cursor: pointer;
transition:all .5s;
position: relative;
padding:.7rem;
color:white;
text-decoration: none;
}
#h-list::after {
display: block;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: auto;
width: 100%;
height: 5px;
content: ' ';
color: transparent;
background: rgba(255, 255, 255, 0.432);
visibility: none;
opacity: 0;
z-index: -1;
transition: all .5s
}
#h-list:hover {
color:#1A1A3A;
visibility: visible;
height: 100%;
}
#h-list:hover:after {
opacity: 1;
visibility: visible;
height: 100%;
}
#search-box {
z-index: 1030;
}
#h-list-item{
display: block;
position: absolute;
background-color: #f6f6f6;
border-radius: .5rem;
left:100%;
top:0px;
box-shadow: 0px 0px 4px 1px black;
cursor: default;
width:200px;
padding:.1rem;
transition: ease .5s;
overflow-y: auto;
}
#h-list-item[data-visible=true]{
height:350px;
visibility: visible;
}
#h-list-item[data-visible=false]{
height:0px;
visibility: hidden;
}
.hlist-item {
cursor: pointer;
}
.hlist-item[data-flag="1"]{
background-color: lightblue !important;
}
.hlist-item[data-flag="0"]{
background-color: #e6adad !important;
}
.alink{
padding: 3px 5px;
border: 1px solid #fff;
border-radius: 2px;
cursor: pointer;
color:#fff!important;
}
#gps_btn:hover{
background: #354365;
color: #fff;
}
.wrap {position: absolute;left: 0;bottom: 40px;width: 288px;margin-left: -144px;text-align: left;overflow: hidden;font-size: 12px;font-family: 'Malgun Gothic', dotum, '돋움', sans-serif;line-height: 1.5;}
.wrap * {padding: 0;margin: 0;}
.wrap .info {width: 286px;border-radius: 5px;border-bottom: 2px solid #ccc;border-right: 1px solid #ccc;overflow: hidden;background: #fff;margin-bottom: 35px;}
.wrap .info:nth-child(1) {border: 0;box-shadow: 0px 1px 2px #888;}
.info .title {padding: 5px 0 0 10px;height: 30px;background: #eee;border-bottom: 1px solid #ddd;font-size: 18px;font-weight: bold;}
.info .close {position: absolute;top: 10px;right: 10px;color: #888;width: 17px;height: 17px;background: url('https://t1.daumcdn.net/localimg/localimages/07/mapapidoc/overlay_close.png');}
.info .close:hover {cursor: pointer;}
.info .body {position: relative;overflow: hidden;}
.desc .ellipsis {overflow: hidden;text-overflow: ellipsis;white-space: nowrap;font-size: 15px;font-weight: bold;}
.desc .jibun {font-size: 11px;color: #888;margin-top: -2px;}
.info .img {position: absolute;top: 6px;left: 5px;width: 73px;height: 71px;border: 1px solid #ddd;color: #888;overflow: hidden;}
.info .link {color: #5085BB;}
</style>
<!-- 카카오맵 appkey 바꿔야할수도 있음. dapi.kakao.com 회사계정 들어가서 앱키 > JavaScript 키 복사해서 넣으면 됩. jelee -->
<body style="padding-top: 55px;">
<script type="text/javascript" src="//dapi.kakao.com/v2/maps/sdk.js?appkey=404907026ac1b7b457ea280d42a8cb8e&libraries=services&autoload=false"></script>
<div class="fixed-top p-3 bg-white text-center h5 shadow-lg" style="font-weight: bold">
<i class="fa fa-television" aria-hidden="true"></i> 휴게소 GPS 검증 시스템
</div>
<div class="container-fluid h-100" >
<div class="row h-100">
<div class="col-lg-12 pt-1 h-100 d-flex flex-column bg-navy-2 pb-2">
<div class="p-2 text-white d-flex flex-row" id="search-box" >
<div onclick="window.location.reload()" style="cursor: pointer;" class=" text-right"><i class="fa fa-refresh" aria-hidden="true"></i> 새로고침</div>
</div>
<div class="p-2 main-box rounded bg-light h-100 d-flex flex-row shadow-sm" style="overflow-x: auto;">
<div class="p-2 d-flex flex-column flex-fill border bg-white rounded shadow-sm">
<div id="list-box" class="d-flex flex-row p-2 flex-fill" style="height:1px">
<div class="p-2 m-1 border shadow-sm rounded" style="min-width:700px; overflow-y: auto;">
<div class="d-flex flex-row align-items-center mb-1">
<!-- 검색조건 시작 -->
<select id="apt_id" class="form-control" style="width: 23%; margin-right: 1%;">
<option value="">휴게소 ID 선택</option>
<option value="1">덕평(통합)</option>
<option value="2">행담도</option>
<option value="3">시흥하늘</option>
<option value="4">안성(부산)</option>
<option value="5">평택</option>
<option value="6">여주(강릉)</option>
<option value="7">안성맞춤(제천)</option>
<option value="8">금산인삼랜드(대전)</option>
<option value="9">속리산(청주)</option>
<option value="10">청주(서울)</option>
<option value="11">옥산(부산)</option>
<option value="12">오창(남이)</option>
<option value="13">문의청남대(청주)</option>
<option value="14">외동(부산)</option>
<option value="15">예산(당진)</option>
<option value="16">동해(삼척)</option>
<option value="17">춘향(완주)</option>
<option value="18">강릉(인천)</option>
</select>
<input id="myun_nm" type="text" class="form-control" placeholder="면접원 이름" style="width: 20%; margin-right: 1%;">
<button id='gps_btn' class='form-control' style='width: 10%;'>검증</button>
<!-- 검색조건 종료 -->
</div>
<table id="list-table" class="table table-sm table-bordered" style="font-size: .7rem;">
<colgroup>
<col width="10%">
<col width="10%">
<col width="30%">
<col width="13%">
<col width="8%">
<col width="8%">
</colgroup>
<thead>
<tr class="text-white text-center bg-navy-3">
<td>아이디키</td>
<td>면접원명</td>
<td>휴게소명</td>
<td>설문 종료 시간</td>
<td>검증상태</td>
<td>검증</td>
</tr>
</thead>
<tbody>
<tr>
<td colspan=7 class='text-center'><h5>검색 조건을 입력하세요.</h5></td>
</tr>
</tbody>
</table>
</div>
<!-- 중간 FLEX -->
<div class="p-1 flex-fill d-flex flex-row align-items-center justify-content-center">
<div class="p-1 border d-flex flex-column shadow-sm rounded bg-white h-100 w-100 overflow-auto" id="answerTable" style="font-size: .8rem;">
<div class="p-1 border-bottom d-flex flex-row align-items-center">
<div>
<i class="fa fa-photo" aria-hidden="true"></i> 세부 사항
</div>
</div>
<div id="gpsDiv" style="width: 100%; height:800px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<script>
var list = ""; //기본 리스트 정보
var filterlist = ""; // 응답/미응답 필터링 한 리스트정보
var ajaxUrl = "./quota-ajax.asp";
let pkey = "2506016_A"; // 페이지 키값
var gpsInfo = [
[
["1-37.2413521679738-127.388409061801"]
,["2-36.9451430591607-126.807129050488"]
,["3-37.3839075388746-126.855573348211"]
,["4-37.0135818447457-127.144715602331"]
,["5-37.0447491800391-126.944568137167"]
,["6-37.2377222002659-127.568314638079"]
,["7-36.9680275424659-127.274537320445"]
,["8-36.1548549162108-127.497541586294"]
,["9-36.4477116230233-127.869016872118"]
,["10-36.7161452643045-127.349262657777"]
,["11-36.6576324870606-127.369837074757"]
,["12-36.7584846684236-127.4817571519"]
,["13-36.5442631108379-127.483494078618"]
,["14-35.6714707014981-129.285494190928"]
,["15-36.6206878618066-126.844120131519"]
,["16-37.6018198637942-129.074191082614"]
,["17-35.3365436035759-127.354629399213"]
,["18-37.7596506483259-128.805018692732"]
]
]
function getList(){
let found = false;
const aptId = $('#apt_id').val();;
const myunNm = $('#myun_nm').val();;
if(aptId == "") {
alert("휴게소ID를 입력하세요.");
$('#apt_id').focus();
return false;
}
var gps_x = "", gps_y = "";
gpsInfo[0].forEach(item => {
const [id, lat, lng] = item[0].split('-'); // item[0]은 "101-..." 형태의 문자열
if (id === aptId) {
found = true;
gps_x = lat;
gps_y = lng;
}
});
if (!found) {
alert("일치하는 휴게소 ID가 없습니다.");
$('#apt_id').focus();
return false;
}
if(gps_x == undefined || gps_y == undefined){
alert("GPS좌표가 없습니다.");
return false;
}
//설문 완료된 리스트
console.log(gpsList,pkey,aptId,myunNm)
var gpsList = ajax_returnData('quota-ajax.asp', {"COMMAND": "MSA_GPS_LIST", "PKEY": pkey, "APT_ID": aptId, "MYUN_NM": myunNm});
if(gpsList.length == 0){
$("#list-table tbody").html('');
$("#list-table tbody").append("<tr><td colspan=7 class='text-center'><h5>데이터가 없습니다.</h5></td></tr>");
}
// 카카오 맵 API 로드 후 불러와야함.
kakao.maps.load(function() {
//카카오맵 설정
var mapContainer = document.getElementById('gpsDiv'), // 지도를 표시할 div
mapOption = {
center: new kakao.maps.LatLng(gps_x, gps_y), // 지도의 중심좌표
level: 5 // 지도의 확대 레벨
};
var map = new kakao.maps.Map(mapContainer, mapOption), // 지도를 생성합니다
customOverlay = new kakao.maps.CustomOverlay({}),
infowindow = new kakao.maps.InfoWindow({removable: true});
var circle = new kakao.maps.Circle({
center : new kakao.maps.LatLng(gps_x, gps_y), // 원의 중심좌표 입니다
radius: 1000, // 미터 단위의 원의 반지름입니다
strokeWeight: 5, // 선의 두께입니다
strokeColor: '#75B8FA', // 선의 색깔입니다
strokeOpacity: 1, // 선의 불투명도 입니다 1에서 0 사이의 값이며 0에 가까울수록 투명합니다
strokeStyle: 'dashed', // 선의 스타일 입니다
fillColor: '#CFE7FF', // 채우기 색깔입니다
fillOpacity: 0.7 // 채우기 불투명도 입니다
});
circle.setMap(map)
//gps 검증
if(gpsList.length == 0){
alert("검증할 리스트가 없습니다.");
return false;
}
$.each(gpsList, function(i, e){
// 지도의 중심을 결과값으로 받은 위치로 이동시킵니다
var coords = new kakao.maps.LatLng(gps_x, gps_y);
var imageSrc = 'https://kon.kric.com/WebProject/PSBU1/E_GOV/image/location_false.png', // 마커이미지의 주소입니다
imageSize = new kakao.maps.Size(44, 49), // 마커이미지의 크기입니다
imageOption = {offset: new kakao.maps.Point(27, 69)};
var markerImage = new kakao.maps.MarkerImage(imageSrc, imageSize, imageOption);
// 결과값으로 받은 위치를 마커로 표시합니다
var marker = new kakao.maps.Marker({
map: map,
position: coords,
image: markerImage
});
// 지도의 중심을 결과값으로 받은 위치로 이동시킵니다
var coords2 = new kakao.maps.LatLng(e.gps_x, e.gps_y);
// 결과값으로 받은 위치를 마커로 표시합니다
var marker2 = new kakao.maps.Marker({
map: map,
position: coords2
});
map.setCenter(coords);
var linepath = [coords, coords2];
var line = new kakao.maps.Polyline();
line.setPath(linepath);
// console.log(line.getLength(), e.IDKEY);
if(Math.round(line.getLength()) < 1000){
e.gps_verfiy = "Y"
}else{
e.gps_verfiy = "N"
}
marker.setMap(null);
marker2.setMap(null);
})
if(gpsList.length == 0){
$("#list-table tbody").html('')
$("#list-table tbody").append("<tr><td colspan=7 class='text-center'><h5>데이터가 없습니다.</h5></td></tr>")
}else{
$("#list-table tbody").html('')
// console.log(gpsList)
$.each(gpsList, function(i,e){
var status = "";
var buttonText = "";
if(e.gps_flag == "Y"){
status = "검증완료"
}else{
if(e.gps_verfiy == "Y") status = "검증완료"
else {
status = "검증에러"
buttonText = "<input type='button' class='btnVerify' data-idkey='"+e.IDKEY+"' value='검증' />";
}
}
var tr = "";
if(e.gps_flag == "Y"){
tr += "<tr style='background: #dcffd9;'>";
}else{
if(e.gps_verfiy == "Y") tr += "<tr style='background: #dcffd9;'>";
else if(e.gps_verfiy == "N") tr += "<tr style='background: #ffbdbd;'>";
else tr += "<tr>";
}
tr += "<td>"+e.IDKEY+"</td>";
tr += "<td>"+e.username+"</td>";
tr += "<td>"+e.apt_nm+"</td>";
tr += "<td>"+e.S_DATE+"</td>";
tr += "<td>"+status+"</td>";
tr += "<td>"+buttonText+"</td>";
tr += "</tr>";
$("#list-table tbody").append(tr)
var coords = new kakao.maps.LatLng(e.gps_x, e.gps_y);
var imageSrc = "",
imageSize = new kakao.maps.Size(34, 39), // 마커이미지의 크기입니다
imageOption = {offset: new kakao.maps.Point(27, 69)};
if(e.gps_flag == "Y"){
imageSrc = 'http://kon.kric.com/WebProject/PSBU1/E_GOV/image/location_true.png';
}else{
if(e.gps_verfiy == "Y") imageSrc = 'http://kon.kric.com/WebProject/PSBU1/E_GOV/image/location_true.png';
else imageSrc = 'http://kon.kric.com/WebProject/PSBU1/E_GOV/image/location_false.png'; // 마커이미지의 주소입니다
}
var markerImage = new kakao.maps.MarkerImage(imageSrc, imageSize, imageOption);
// console.log(markerImage);
// 결과값으로 받은 위치를 마커로 표시합니다
var marker = new kakao.maps.Marker({
map: map,
position: coords,
// title : e.IDKEY + " - " + e.username,
image: markerImage
});
var content = '<div class="wrap">' +
' <div class="info">' +
' <div class="title">' +
' '+e.IDKEY+
' <div class="close" id="overlay-'+e.IDKEY+'" title="닫기"></div>' +
' </div>' +
' <div class="body">' +
' <div class="desc">' +
' <div class="ellipsis">면접원명: '+e.username+'</div>' +
' </div>' +
' </div>' +
' </div>' +
'</div>';
// 마커 위에 커스텀오버레이를 표시합니다
// 마커를 중심으로 커스텀 오버레이를 표시하기위해 CSS를 이용해 위치를 설정했습니다
var overlay = new kakao.maps.CustomOverlay({
content: content,
map: map,
position: marker.getPosition(),
yAnchor: -100
});
$(document).on("click", '#overlay-'+e.IDKEY, function(){
if(e.gps_flag != "Y" && e.gps_verfiy != "Y"){
if(confirm($(this).attr("id").substring(8)+" 검증완료 처리하시겠습니까????")){
var idkey = $(this).attr("id").substring(8); // 24년도에 idkey 넣음
ajax_returnData('quota-ajax.asp', {"COMMAND": "MSA_GPS_UPDATE", "IDKEY":idkey, "CATEGORY1": pkey});
alert("수정되었습니다.");
marker.setMap(null);
overlay.setMap(null);
getList();
}
}else{
marker.setMap(null);
overlay.setMap(null);
}
});
overlay.setMap(map);
})
}
$("td").addClass("align-middle text-center");
$("input[class=btnVerify]").on("click", function(){
if(confirm($(this).data("idkey")+" 검증완료 처리하시겠습니까?")){
var idkey = $(this).data("idkey") // 24년도에 idkey 넣음
ajax_returnData('quota-ajax.asp', {"COMMAND": "MSA_GPS_UPDATE", "IDKEY":idkey, "CATEGORY1": pkey});
alert("수정되었습니다.");
// marker.setMap(null);
// overlay.setMap(null);
getList();
}
})
}); // kakao.maps.load() 함수 종료
}
$(document).ready(function(){
$(document).on("keydown", function (e) {
if (e.key === "Enter") {
getList();
}
});
$("body").on("click","#gps_btn",function(e){
getList();
})
// 휴게소 선택 변경 시 getList 실행
$("body").on("change", "#apt_id", function(e) {
const aptId = $(this).val();
getList();
});
})
</script>