314 lines
12 KiB
Plaintext
314 lines
12 KiB
Plaintext
|
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||
|
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||
|
|
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
|
||
|
|
|
||
|
|
<html>
|
||
|
|
<head>
|
||
|
|
<script src="${pageContext.request.contextPath}/js/jquery/jquery-1.10.2.min.js"></script>
|
||
|
|
<link rel="stylesheet" HREF="${pageContext.request.contextPath}/css/admins/style.css" type="text/css">
|
||
|
|
<script>
|
||
|
|
$(document).ready(function(){
|
||
|
|
var flag = $("#fileExist").val();
|
||
|
|
|
||
|
|
if(flag == "N" ){
|
||
|
|
$("#updateFlagY").hide();
|
||
|
|
// $("#updateFlagN").show();
|
||
|
|
}else{
|
||
|
|
// $("#updateFlagY").show();
|
||
|
|
$("#updateFlagN").hide();
|
||
|
|
}
|
||
|
|
|
||
|
|
/* 2023.10.16 LHJ 팝업노출 시/분 selected */
|
||
|
|
function fn_SelectBoxSelected(selName, sValue){
|
||
|
|
|
||
|
|
for(var i=0; i < document.getElementById(selName).length; i++){
|
||
|
|
|
||
|
|
if(document.getElementById(selName).options[i].value == sValue){
|
||
|
|
|
||
|
|
document.getElementById(selName).options[i].selected = true;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
var sPopupBgndtHH = "${detailView.sPopupBgndtHH}";
|
||
|
|
fn_SelectBoxSelected("popupBgndtHH", sPopupBgndtHH);
|
||
|
|
|
||
|
|
var sPopupBgndtMM = "${detailView.sPopupBgndtMM}";
|
||
|
|
fn_SelectBoxSelected("popupBgndtMM", sPopupBgndtMM);
|
||
|
|
|
||
|
|
var sPopupEnddtHH = "${detailView.sPopupEnddtHH}";
|
||
|
|
fn_SelectBoxSelected("popupEnddtHH", sPopupEnddtHH);
|
||
|
|
|
||
|
|
var sPopupEnddtMM = "${detailView.sPopupEnddtMM}";
|
||
|
|
fn_SelectBoxSelected("popupEnddtMM", sPopupEnddtMM);
|
||
|
|
|
||
|
|
|
||
|
|
/* 2023.10.16 LHJ 게시판 상단노출, 팝업적용여부 radio checked */
|
||
|
|
var top = '${detailView.top}';
|
||
|
|
|
||
|
|
if(top == 'Y'){
|
||
|
|
document.getElementById('topY').checked = true;
|
||
|
|
} else {
|
||
|
|
document.getElementById('topN').checked = true;
|
||
|
|
}
|
||
|
|
|
||
|
|
var popupAt = '${detailView.popupAt}';
|
||
|
|
|
||
|
|
if(popupAt == 'Y'){
|
||
|
|
document.getElementById('popupAtY').checked = true;
|
||
|
|
} else {
|
||
|
|
document.getElementById('popupAtN').checked = true;
|
||
|
|
|
||
|
|
let el1 = document.querySelector('#popupBgndtDD');
|
||
|
|
let el2 = document.querySelector('#popupEnddtDD');
|
||
|
|
let el3 = document.querySelector('#popupBgndtHH');
|
||
|
|
let el4 = document.querySelector('#popupBgndtMM');
|
||
|
|
let el5 = document.querySelector('#popupEnddtHH');
|
||
|
|
let el6 = document.querySelector('#popupEnddtMM');
|
||
|
|
if (el1) { el1.value = ''; el1.disabled = true; }
|
||
|
|
if (el2) { el2.value = ''; el2.disabled = true; }
|
||
|
|
if (el3) { el3.value = ''; el3.disabled = true; }
|
||
|
|
if (el4) { el4.value = ''; el4.disabled = true; }
|
||
|
|
if (el5) { el5.value = ''; el5.disabled = true; }
|
||
|
|
if (el6) { el6.value = ''; el6.disabled = true; }
|
||
|
|
}
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
/* 2023.10.16 LHJ datepicker 적용 */
|
||
|
|
//달력팝업
|
||
|
|
function fn_CalPopupDiv1(id, calId, divId) {
|
||
|
|
var cal = $("#" + calId);
|
||
|
|
var calPosition = cal.position();
|
||
|
|
$.ajax({
|
||
|
|
type : 'post',
|
||
|
|
url : '${pageContext.request.contextPath}/web/popup/calender.do',
|
||
|
|
async : false,
|
||
|
|
data : { id : id },
|
||
|
|
error : function(xhr, status) {
|
||
|
|
alert('Unknown error ' + status);
|
||
|
|
},
|
||
|
|
success : function(data) {
|
||
|
|
$("#" + divId).css({
|
||
|
|
'top' : calPosition.top + 20,
|
||
|
|
'left' : calPosition.left - 20
|
||
|
|
});
|
||
|
|
$("#" + divId).removeClass("trViewOff");
|
||
|
|
$("#" + divId).html(data);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
/* 2023.10.16 LHJ 팝업사용여부에 따라 팝업노출일시 삭제 */
|
||
|
|
function fn_PopupAtN_chk(event) {
|
||
|
|
if (event.target.checked) {
|
||
|
|
let el1 = document.querySelector('#popupBgndtDD');
|
||
|
|
let el2 = document.querySelector('#popupEnddtDD');
|
||
|
|
let el3 = document.querySelector('#popupBgndtHH');
|
||
|
|
let el4 = document.querySelector('#popupBgndtMM');
|
||
|
|
let el5 = document.querySelector('#popupEnddtHH');
|
||
|
|
let el6 = document.querySelector('#popupEnddtMM');
|
||
|
|
if (el1) { el1.value = ''; el1.disabled = true; }
|
||
|
|
if (el2) { el2.value = ''; el2.disabled = true; }
|
||
|
|
if (el3) { el3.value = ''; el3.disabled = true; }
|
||
|
|
if (el4) { el4.value = ''; el4.disabled = true; }
|
||
|
|
if (el5) { el5.value = ''; el5.disabled = true; }
|
||
|
|
if (el6) { el6.value = ''; el6.disabled = true; }
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
function fn_PopupAtY_chk(event) {
|
||
|
|
if (event.target.checked) {
|
||
|
|
if (document.querySelector('#popupBgndtDD')) { document.querySelector('#popupBgndtDD').disabled = false; }
|
||
|
|
if (document.querySelector('#popupEnddtDD')) { document.querySelector('#popupEnddtDD').disabled = false; }
|
||
|
|
if (document.querySelector('#popupBgndtHH')) { document.querySelector('#popupBgndtHH').disabled = false; }
|
||
|
|
if (document.querySelector('#popupBgndtMM')) { document.querySelector('#popupBgndtMM').disabled = false; }
|
||
|
|
if (document.querySelector('#popupEnddtHH')) { document.querySelector('#popupEnddtHH').disabled = false; }
|
||
|
|
if (document.querySelector('#popupEnddtMM')) { document.querySelector('#popupEnddtMM').disabled = false; }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function fn_deleteFile(){
|
||
|
|
$("#updateFlag").val("Y");
|
||
|
|
$("#updateFlagY").hide();
|
||
|
|
$("#updateFlagN").show();
|
||
|
|
};
|
||
|
|
|
||
|
|
function onclick_chk(){
|
||
|
|
var f = document.writeForm;
|
||
|
|
|
||
|
|
if(f.file.value != ""){
|
||
|
|
if(fileCheck() == false){
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if(f.subject.value == ""){
|
||
|
|
alert("제목을 입력하여 주세요");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
if(f.contents.value == ""){
|
||
|
|
alert("내용을 입력하여 주세요");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
if(f.top.value == ""){
|
||
|
|
alert("공지사항 상단고정 여부를 선택하여 주세요");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
if(f.popupAt.value == ""){
|
||
|
|
alert("팝업 사용여부를 선택하여 주세요");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
if(f.popupAt.value == "Y") {
|
||
|
|
if(f.popupBgndtDD.value == "" || f.popupBgndtHH.value == "" || f.popupBgndtMM.value == ""){
|
||
|
|
alert("팝업노출 시작일시를 선택하여 주세요");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
if(f.popupEnddtDD.value == "" || f.popupEnddtHH.value == "" || f.popupEnddtMM.value == "") {
|
||
|
|
alert("팝업노출 종료일시를 선택하여 주세요");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
if(f.file.value == ""){
|
||
|
|
$("#writeForm").attr("action", "${pageContext.request.contextPath}/admins/notice/updatePost.do").submit();
|
||
|
|
} else {
|
||
|
|
$("#updateFlag").val("Y");
|
||
|
|
$("#writeForm").attr("action", "${pageContext.request.contextPath}/admins/notice/updatePost.do").submit();
|
||
|
|
}
|
||
|
|
alert("정상적으로 수정이 완료되었습니다.");
|
||
|
|
}
|
||
|
|
|
||
|
|
function fileCheck(){
|
||
|
|
var file = document.writeForm.file.value; // 폼.파일이름.value
|
||
|
|
var fileExt = file.substring(file.lastIndexOf('.')+1); //파일의 확장자를 구합니다.
|
||
|
|
var bSubmitCheck = true;
|
||
|
|
|
||
|
|
if(!(fileExt == "hwp" || fileExt == "pdf" || fileExt == "ppt" || fileExt == "pptx" || fileExt == "wmv"||
|
||
|
|
fileExt == "txt"|| fileExt == "exe" || fileExt == "zip" || fileExt == "jpg" || fileExt == "gif" ||
|
||
|
|
fileExt == "png"|| fileExt == "doc" || fileExt == "xls"))
|
||
|
|
{
|
||
|
|
alert("등록할 수 없는 파일입니다!");
|
||
|
|
return false;
|
||
|
|
}else{
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
</script>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<form name="writeForm" id="writeForm" method="post" enctype="multipart/form-data">
|
||
|
|
<input type="hidden" name="cls">
|
||
|
|
<input type="hidden" name="pId" value="00">
|
||
|
|
<input type="hidden" name="idx" id="idx" value="${detailView.idx}">
|
||
|
|
<input type="hidden" name="orgFile" id="orgFile" value="${detailView.savename}">
|
||
|
|
<input type="hidden" name="updateFlag" id="updateFlag" value="N">
|
||
|
|
<input type="hidden" name="fileExist" id="fileExist" value="${fileExist}">
|
||
|
|
|
||
|
|
<table id="Table_Main" width="100%" border="0" cellpadding="0" cellspacing="0">
|
||
|
|
<tr><td colspan=2><img src="${pageContext.request.contextPath}/images/notice/4_toptit_01.gif"></td></tr>
|
||
|
|
<tr height=20><td colspan=2> </td></tr>
|
||
|
|
<tr height=25>
|
||
|
|
<td> </td>
|
||
|
|
<td align="right"> </td>
|
||
|
|
</tr>
|
||
|
|
<tr height=12><td colspan=2><img src="${pageContext.request.contextPath}/images/admins/spacer.gif" width="1" height="12"></td></tr>
|
||
|
|
<tr>
|
||
|
|
<td colspan=2>
|
||
|
|
<!-- START : Modify ----------------------------------------------------------------------------->
|
||
|
|
<table id="Table_Write" width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D6D6D6">
|
||
|
|
<colgroup>
|
||
|
|
<col bgcolor="#F5F5F5" width=19% />
|
||
|
|
<col bgcolor="#FFFFFF" width=31% />
|
||
|
|
<col bgcolor="#F5F5F5" width=19% />
|
||
|
|
<col bgcolor="#FFFFFF" width=31% />
|
||
|
|
</colgroup>
|
||
|
|
<tr height=28>
|
||
|
|
<td class="list_head_noti" style="padding:5px;">제목</td>
|
||
|
|
<td class="list_content" style="padding:5px;" colspan="3">
|
||
|
|
<input type="text" name="subject" class="input" size="75" maxlength="37" value="${detailView.subject}">
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr height=28>
|
||
|
|
<td class="list_head_noti" style="padding:5px;">공지사항 상단고정</td>
|
||
|
|
<td class="list_content" style="padding:5px;" colspan="3">
|
||
|
|
<input type="radio" name="top" id="topY" value="Y">예
|
||
|
|
<input type="radio" name="top" id="topN" value="N">아니오
|
||
|
|
</tr>
|
||
|
|
<tr height=28>
|
||
|
|
<td class="list_head_noti" style="padding:5px;">팝업 사용여부</td>
|
||
|
|
<td class="list_content" style="padding:5px;" colspan="3">
|
||
|
|
<input type="radio" name="popupAt" id="popupAtY" value="Y" onChange="fn_PopupAtY_chk(event);return false;">예
|
||
|
|
<input type="radio" name="popupAt" id="popupAtN" value="N" onChange="fn_PopupAtN_chk(event);return false;">아니오
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr height=28>
|
||
|
|
<div id="calenderDiv" class="trViewOff" style="position: absolute;"></div>
|
||
|
|
<td class="list_head_noti" style="padding:5px;">팝업노출 시작일시</td>
|
||
|
|
<td class="list_content" style="padding:5px;">
|
||
|
|
<input type="text" name="popupBgndtDD" id="popupBgndtDD" class="input" size="8" maxlength="8" value="<c:out value="${fn:substring(detailView.popupBgndt, 0, 8)}"/>"
|
||
|
|
onFocus="fn_CalPopupDiv1('popupBgndtDD','popupBgndtDD','calenderDiv');return false;" placeholder="클릭하여 날짜 선택" readonly="readonly">
|
||
|
|
<form:select path="popupBgndtHH" id="popupBgndtHH" name="popupBgndtHH">
|
||
|
|
<form:options items="${popupBgndtHH}" itemValue="code" itemLabel="codeNm"/>
|
||
|
|
</form:select> H
|
||
|
|
<form:select path="popupBgndtMM" id="popupBgndtMM" name="popupBgndtMM">
|
||
|
|
<form:options items="${popupBgndtMM}" itemValue="code" itemLabel="codeNm"/>
|
||
|
|
</form:select> M
|
||
|
|
</td>
|
||
|
|
<td class="list_head_noti" style="padding:5px;">팝업노출 종료일시</td>
|
||
|
|
<td class="list_content" style="padding:5px;">
|
||
|
|
<input type="text" name="popupEnddtDD" id="popupEnddtDD" class="input" size="8" maxlength="8" value="<c:out value="${fn:substring(detailView.popupEnddt, 0, 8)}"/>"
|
||
|
|
onFocus="fn_CalPopupDiv1('popupEnddtDD','popupEnddtDD','calenderDiv');return false;" placeholder="클릭하여 날짜 선택" readonly="readonly">
|
||
|
|
<form:select path="popupEnddtHH" id="popupEnddtHH" name="popupEnddtHH">
|
||
|
|
<form:options items="${popupEnddtHH}" itemValue="code" itemLabel="codeNm"/>
|
||
|
|
</form:select> H
|
||
|
|
<form:select path="popupEnddtMM" id="popupEnddtMM" name="popupEnddtMM">
|
||
|
|
<form:options items="${popupEnddtMM}" itemValue="code" itemLabel="codeNm"/>
|
||
|
|
</form:select> M
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr height=200>
|
||
|
|
<td bgcolor="#FFFFFF" class="list_content" colspan=4 style="padding:10px;" valign="top">
|
||
|
|
<textarea name="contents" id="contents" cols="90" rows="12" class="write">${detailView.contents}</textarea>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr height=28 align="center">
|
||
|
|
<td bgcolor="#F5F5F5" class="list_head" align="left" style="padding:5px;">첨부파일</td>
|
||
|
|
<td bgcolor="#FFFFFF" class="list_content" colspan=3 align="left" style="padding:5px;">
|
||
|
|
<div id="updateFlagY">
|
||
|
|
<c:out value="${detailView.filename}"/>
|
||
|
|
<img src="${pageContext.request.contextPath}/images/file/bu5_close.gif"
|
||
|
|
width="19" height="18" onClick="javascript:fn_deleteFile();" alt="파일삭제">
|
||
|
|
</div>
|
||
|
|
<div id="updateFlagN">
|
||
|
|
<input type="file" name="file" id="file" size="72" alt="파일등록">
|
||
|
|
</div>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
<!-- END : Modify ----------------------------------------------------------------------------->
|
||
|
|
<!-- START : Button ----------------------------------------------------------------------------->
|
||
|
|
<tr height=15>
|
||
|
|
<td class="list_head" align="center">※ 파일 사이즈는 1 GB로 제한되어 있습니다.</td>
|
||
|
|
</tr>
|
||
|
|
<tr height=33>
|
||
|
|
<td bgcolor="#FFFFFF" class="list_content" colspan=4 style="padding:5px;" border="none" align="right">
|
||
|
|
<a href="#" onClick="javascript:onclick_chk()"><img src="${pageContext.request.contextPath}/images/cus_bnt_save.gif" align="absmiddle"></a>
|
||
|
|
<img src="${pageContext.request.contextPath}/images/cus_bnt_cancel.gif" style="cursor:hand" onClick="javascript:history.go(-1)" align="absmiddle">
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<!-- END : Button ----------------------------------------------------------------------------->
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</form>
|
||
|
|
</body>
|
||
|
|
</html>
|