Files
KIN/other/view.asp
2025-09-29 17:55:08 +09:00

282 lines
9.4 KiB
Plaintext

<!-- #include virtual = "include/header.asp" -->
<!-- #include virtual = "include/left.asp" -->
<!-- #include file="srp_config.asp" -->
<%
if request("workit") = "" then
workit = 1
else
workit = request("workit")
end if
setYear_srp = Request("setYear_srp")
setMonth_srp = request("setMonth_srp")
p_rdate = request("condate")
%>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<h1>시설 예약</h1>
</div>
<!-- /.content-header -->
<!-- Main content -->
<div class="content-body">
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<form name="srp" method="post">
<input type="hidden" name="workit" value="<%=workit%>">
<input type="hidden" name="p_rdate" value="<%=p_rdate%>">
<input type="hidden" name="tmp_scode" value="<%=tmp_scode%>">
<input type="hidden" name="st_posi">
<input type="hidden" name="ed_posi">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class='font-weight-bold' style='font-size:16px;'>날짜 : <%=p_rdate%></td>
</tr>
<tr>
<td class='font-weight-bold' style='font-size:16px;'>장소 : <%=tmp_workit(workit,1)%> 예약현황입니다.</td>
</tr>
<tr>
<td class='font-weight-bold' style='font-size:16px;'>위치 : <%=tmp_workit(workit,2)%></td>
</tr>
<tr>
<td>* 하단 탭을 이용하시면, 각 장소에 대한 예약 현황을 보실 수 있습니다. 주간현황으로 돌아가시려면, 주간현황 탭을 클릭해주세요.</td>
</tr>
<tr>
<td>
<ul class="nav nav-tabs mb-0">
<li class="nav-item"><button onclick="subit('2')" class="nav-link p-2" type="button">주간현황</button></li>
<% for i = 1 to ubound(tmp_workit_sort) %>
<li class="nav-item"><button onclick="subit('3', '<%=tmp_workit_sort(i)%>')" class="nav-link p-2 <%= iif(cint(tmp_workit_sort(i)) = cint(workit), "active", "")%>" type="button"><%=tmp_workit(tmp_workit_sort(i),1)%></button></li>
<% next %>
</ul>
</td>
</tr>
<tr>
<td align="center">
<table class="table table-sm table-sm2 table-bordered table-head tr-colors">
<tr>
<td width="15%" align="center" >시간</td>
<td width="5%" align="center" >시작</td>
<td width="5%" align="center" >종료</td>
<td width="75%" align="center" >내용</td>
</tr>
<%
Dim tmp_min(2)
tmp_scode = 1
tmp_code = 0
tmp_min(0) = "00"
tmp_min(1) = "30"
for i = 9 to 22
for j = 1 to 2
if i <> 22 or j <> 2 then
if tmp_code = 0 then
query = "SELECT * "
query = query & "FROM [srp] "
query = query & "WHERE p_rdate='" & p_rdate & "' "
query = query & "AND p_type='" & workit & "' "
query = query & "AND p_delok='N' "
query = query & "ORDER BY CAST(p_rstimecode AS int) "
'Response.Write query
Adors.Open query, adoConn, 1
if Adors.RecordCount > 0 then
tmp_code = 0
for Adors_cnt = 1 to Adors.RecordCount
if tmp_scode >= int(Adors("p_rstimecode")) AND tmp_scode <= int(Adors("p_retimecode")) then
p_retimecode = int(Adors("p_retimecode"))
tmp_code = int(Adors("p_codegap"))
tmp_comment = Adors("p_comment")
tmp_depart = Adors("p_depart")
tmp_name = Adors("p_name")
tmp_namecode = Adors("p_namecode")
tmp_sn = Adors("p_sn")
tmp_chk = 1
exit for
end if
Adors.MoveNext
next
end if
Adors.Close
end if
%>
<tr>
<td align="center">
<%=right("0" & i, 2)%>:<%=tmp_min(j - 1)%> ~ <%=right("0" & i + int(1 - (j mod 2)), 2)%>:<%=tmp_min(j mod 2)%>
</td>
<td align="center">
<input type="radio" name="p_rstimecode" value="<%=tmp_scode%>" onClick="autofnc('1','<%=tmp_scode%>')" <% if tmp_code > 0 then %> disabled <% end if %>>
</td>
<td align="center">
<input type="radio" name="p_retimecode" value="<%=tmp_scode%>" onClick="autofnc('2','<%=tmp_scode%>')" disabled>
</td>
<%
if tmp_code = 0 then
%>
<td id="tmp_<%=tmp_scode%>" align="left" class='p-0'>
<input type="text" name="p_comment_<%=tmp_scode%>" style="display:none;width:100%" onKeyPress="subit('4',this)" onKeyUp="chrchk('<%=tmp_scode%>')">
</td>
<%
else
if tmp_chk = 1 then
%>
<td id="tmp_<%=tmp_scode%>" align="left" rowspan="<%=tmp_code%>" class='align-middle'>
<p style="line-height:150%;margin-left:5.0pt;">
<font color="blue"><%=tmp_depart%></font> - <font color="black"><b><%=tmp_name%></b></font> :
<% if cstr(tmp_namecode) = cstr(session("User_number")) then %>
[<a href="javascript:delit('<%=tmp_sn%>')"><font color="red"><b>예약취소</b></font></a>]
<% end if %>
<%=tmp_comment%>
</p>
</td>
<%
tmp_chk = 0
end if
tmp_code = tmp_code - 1
end if
%>
</tr>
<%
tmp_scode = tmp_scode + 1
end if
next
next
%>
</table>
</td>
</tr>
<tr>
<td align="center" style="padding:10 0 0 0">
<img src="/images/common/btn_input.jpg" align="absmiddle" onClick="subit('1')" style="CURSOR:pointer;">
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- /.content -->
<!-- REQUIRED SCRIPTS -->
<script>
$(function(){
currentMenu("/other/week.asp", "");
});
function chrchk(z){
var m_Sp = /[$\\@\\\#%\^\&\*\+\_\{\}\`\~\=\|\:\/\,\;\"\']/;
var m_val = document.all['p_comment_' + z].value;
var strLen = m_val.length;
var m_char = m_val.charAt((strLen) - 1);
if(m_char.search(m_Sp) != -1){
alert("특수문자가 입력되었습니다.");
document.all['p_comment_' + z].value = m_val.substring(0, eval(strLen)-1);
document.all['p_comment_' + z].focus();
return false;
}
}
function autofnc(a, b){
var tmp_radio_cnt;
tmp_radio_cnt = document.srp.p_retimecode.length;
tmp_a = document.srp.st_posi.value;
tmp_b = document.srp.ed_posi.value;
if (a == 1){
document.srp.st_posi.value = b;
if (tmp_b != ''){
document.srp.p_retimecode[parseInt(tmp_b) - 1].checked = false;
}
for (i = 0; i < parseInt(tmp_radio_cnt) - 1; i++){
document.srp.p_retimecode[i].disabled = true;
}
for (i = parseInt(b) - 1; i < tmp_radio_cnt; i++){
if (document.srp.p_rstimecode[i].disabled == true){
break;
}else{
document.srp.p_retimecode[i].disabled = false;
document.srp.p_retimecode[i].checked = false;
}
}
if (document.srp.ed_posi.value != ''){
document.all['p_comment_' + document.srp.ed_posi.value].value = '';
document.all['p_comment_' + document.srp.ed_posi.value].style.display = 'none';
document.all['p_comment_' + document.srp.ed_posi.value].className = 'inputn';
}
}
else if (a == 2){
var tmp_b;
tmp_b = document.srp.ed_posi.value;
document.srp.ed_posi.value = b;
if (tmp_b != ''){
document.all['p_comment_' + tmp_b].value = '';
document.all['p_comment_' + tmp_b].style.display = 'none';
document.all['p_comment_' + tmp_b].className = 'inputn';
}
document.all['p_comment_' + b].style.display = '';
document.all['p_comment_' + b].className = 'inputy';
document.all['p_comment_' + b].focus();
}
}
function subit(a,b){
if (a == 1){
var tmp_check = 0;
var tmp_radio_cnt;
tmp_radio_cnt = document.srp.p_retimecode.length;
for (i = 0; i < tmp_radio_cnt; i++){
if (document.srp.p_rstimecode[i].checked == true){
tmp_check = 1;
}
}
if (tmp_check != 1){
alert('시작시간을 선택해 주세요');
return false;
}
tmp_check = 0;
for (i = 0; i < tmp_radio_cnt; i++){
if (document.srp.p_retimecode[i].checked == true){
tmp_check = 1;
}
}
if (tmp_check != 1){
alert('종료시간을 선택해 주세요');
return false;
}
document.srp.action = 'writeok.asp';
document.srp.submit();
}else if (a == 2){
document.srp.action = 'week.asp?sdate=<%=p_rdate%>';
document.srp.submit();
}else if (a == 3){
location.href = 'view.asp?condate=<%=p_rdate%>&workit=' + b;
}else if (a == 4){
if(event.keyCode==13) subit(1);
return false;
}
}
function delit(a){
if (confirm('삭제하시겠습니까?')){
document.srp.action = 'delok.asp?p_sn=' + a;
document.srp.submit();
}
}
</script>
</div>
<!-- /.content-wrapper -->
<!-- #include virtual = "include/footer.asp" -->