瀏覽代碼

공지팝업 추가
공지 게시판 진행 중

junekeunsong 4 年之前
父節點
當前提交
6dd4c0f8fe

+ 20 - 0
src/main/java/com/lemon/lifecenter/controller/BoardController.java

@@ -4,6 +4,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.servlet.ModelAndView;
@@ -31,4 +32,23 @@ public class BoardController extends LifeCenterController {
         ModelAndView mv = setMV("board/new");
         return mv;
     }
+    
+    @RequestMapping("/new/insert")
+    public String boardNewInsert() {
+//        @ModelAttribute("dto") final CenterInfoDTO dto
+        
+        return "redirect:/board/content?postSeq=" + 1;
+    }
+    
+    @RequestMapping("/content")
+    public ModelAndView boardContent() {
+        ModelAndView mv = setMV("board/content");
+        return mv;
+    }
+    
+    @RequestMapping("edit")
+    public ModelAndView boardEdit() {
+        ModelAndView mv = setMV("board/edit");
+        return mv;
+    }
 }

+ 83 - 0
src/main/java/com/lemon/lifecenter/dto/BoardDTO.java

@@ -0,0 +1,83 @@
+package com.lemon.lifecenter.dto;
+
+public class BoardDTO {
+    int postSeq                  = 0;
+    private String title         = "";
+    private String content       = "";
+    private String createBy      = "";
+    private String createDate    = null;
+    private String updateBy      = "";
+    private String updateDate    = null;
+    private int views            = 0;
+    private String answerContent = "";
+    private String answerDate    = null;
+    private String answerId      = "";
+    
+    public int getPostSeq() {
+        return postSeq;
+    }
+    public void setPostSeq(int postSeq) {
+        this.postSeq = postSeq;
+    }
+    public String getTitle() {
+        return title;
+    }
+    public void setTitle(String title) {
+        this.title = title;
+    }
+    public String getContent() {
+        return content;
+    }
+    public void setContent(String content) {
+        this.content = content;
+    }
+    public String getCreateBy() {
+        return createBy;
+    }
+    public void setCreateBy(String createBy) {
+        this.createBy = createBy;
+    }
+    public String getCreateDate() {
+        return createDate;
+    }
+    public void setCreateDate(String createDate) {
+        this.createDate = createDate;
+    }
+    public String getUpdateBy() {
+        return updateBy;
+    }
+    public void setUpdateBy(String updateBy) {
+        this.updateBy = updateBy;
+    }
+    public String getUpdateDate() {
+        return updateDate;
+    }
+    public void setUpdateDate(String updateDate) {
+        this.updateDate = updateDate;
+    }
+    public int getViews() {
+        return views;
+    }
+    public void setViews(int views) {
+        this.views = views;
+    }
+    public String getAnswerContent() {
+        return answerContent;
+    }
+    public void setAnswerContent(String answerContent) {
+        this.answerContent = answerContent;
+    }
+    public String getAnswerDate() {
+        return answerDate;
+    }
+    public void setAnswerDate(String answerDate) {
+        this.answerDate = answerDate;
+    }
+    public String getAnswerId() {
+        return answerId;
+    }
+    public void setAnswerId(String answerId) {
+        this.answerId = answerId;
+    }
+    
+}

+ 81 - 0
src/main/webapp/WEB-INF/jsp/board/content.jsp

@@ -0,0 +1,81 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+    pageEncoding="UTF-8"%>
+<jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
+<script>
+</script>
+</head>
+<body>
+    <div class="wrapper">
+        <jsp:include page="${data._INCLUDE}/sidebar.jsp"></jsp:include>
+        
+        <div class="main">
+            <jsp:include page="${data._INCLUDE}/top.jsp"></jsp:include>
+
+            <main class="content">
+                <div class="container-fluid p-0">
+                    <div class="row">
+                        <div class="col-12 col-lg-6">
+                            <h1 class="h3 mb-3">공지사항</h1>
+                        </div>
+                        <div class="col-12 col-lg-6  text-right">
+                            <nav aria-label="breadcrumb">
+                                <ol class="breadcrumb">
+                                    <li class="breadcrumb-item"><a href="javscript:;">Home</a></li>
+                                    <li class="breadcrumb-item">공지사항 수정</li>
+                                </ol>
+                            </nav>
+                        </div>
+                    </div>
+                    <div class="row">
+                        <div class="col-12">
+                            <div class="card">
+                                <form id="sendForm" action="?" method="post">
+                                    <div class="card-body">
+                                        <table class="table mobile-table">
+                                            <colgroup>
+                                                <col style="width:20%">
+                                                <col style="width:80%">
+                                            </colgroup>
+                                            <tr>
+                                                <th><span class="fix">*</span>제목</th>
+                                                <td>제에목</td>
+                                            </tr>
+                                            
+                                            <tr>
+                                                <th><span class="fix">*</span>내용</th>
+                                                <td style="white-space: pre;">내에에ㅔ에에용</td>
+                                            </tr>
+                                            
+                                            <tr>
+                                                <th>첨부파일</th>
+                                                <td>
+                                                    <input type="file" name="fileName" >
+                                                </td>
+                                            </tr>
+                                        </table>
+                                        
+                                        <div class="row mt-3">
+                                            <div class="col-12">
+                                                <div class="text-right">
+                                                    <button type="button" class="btn btn-outline-primary w100" onclick="history.back();">취소</button>
+                                                    <button type="submit" class="btn btn-primary w100">삭제</button>
+                                                    <button type="submit" class="btn btn-primary w100">수정</button>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </form>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </main>
+
+            <jsp:include page="${data._INCLUDE}/footer.jsp"></jsp:include>
+        </div>
+    </div>
+</body>
+</html>

+ 85 - 0
src/main/webapp/WEB-INF/jsp/board/edit.jsp

@@ -0,0 +1,85 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+    pageEncoding="UTF-8"%>
+<jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
+<script>
+</script>
+</head>
+<body>
+    <div class="wrapper">
+        <jsp:include page="${data._INCLUDE}/sidebar.jsp"></jsp:include>
+        
+        <div class="main">
+            <jsp:include page="${data._INCLUDE}/top.jsp"></jsp:include>
+
+            <main class="content">
+                <div class="container-fluid p-0">
+                    <div class="row">
+                        <div class="col-12 col-lg-6">
+                            <h1 class="h3 mb-3">공지사항</h1>
+                        </div>
+                        <div class="col-12 col-lg-6  text-right">
+                            <nav aria-label="breadcrumb">
+                                <ol class="breadcrumb">
+                                    <li class="breadcrumb-item"><a href="javscript:;">Home</a></li>
+                                    <li class="breadcrumb-item">공지사항 수정</li>
+                                </ol>
+                            </nav>
+                        </div>
+                    </div>
+                    <div class="row">
+                        <div class="col-12">
+                            <div class="card">
+                                <form id="sendForm" action="?" method="post">
+                                    <div class="card-body">
+                                        <table class="table mobile-table">
+                                            <colgroup>
+                                                <col style="width:20%">
+                                                <col style="width:80%">
+                                            </colgroup>
+                                            <tr>
+                                                <th><span class="fix">*</span>제목</th>
+                                                <td>
+                                                    <input type="text" name="nbTitle" class="form-control" placeholder="제목을 입력하세요" maxlength="80" required>
+                                                </td>
+                                            </tr>
+                                            
+                                            <tr>
+                                                <th><span class="fix">*</span>내용</th>
+                                                <td>
+                                                    <textarea  class="form-control" rows="10" cols="" name="nbContent" placeholder="내용을 입력하세요" maxlength="1000" required></textarea>
+                                                </td>
+                                            </tr>
+                                            
+                                            <tr>
+                                                <th>첨부파일</th>
+                                                <td>
+                                                    <input type="file" name="fileName" >
+                                                </td>
+                                            </tr>
+                                        </table>
+                                        
+                                        <div class="row mt-3">
+                                            <div class="col-12">
+                                                <div class="text-right">
+                                                    <button type="button" class="btn btn-outline-primary w100" onclick="history.back();">취소</button>
+                                                    <button type="submit" class="btn btn-primary w100">삭제</button>
+                                                    <button type="submit" class="btn btn-primary w100">수정</button>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </form>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </main>
+
+            <jsp:include page="${data._INCLUDE}/footer.jsp"></jsp:include>
+        </div>
+    </div>
+</body>
+</html>

+ 18 - 13
src/main/webapp/WEB-INF/jsp/board/new.jsp

@@ -52,21 +52,26 @@
                                                     <textarea  class="form-control" rows="10" cols="" name="nbContent" placeholder="내용을 입력하세요" maxlength="1000" required></textarea>
                                                 </td>
                                             </tr>
+                                            
+                                            <tr>
+                                                <th>첨부파일</th>
+                                                <td>
+                                                    <input type="file" name="fileName" >
+<!--                                                     <div class="form-row"> -->
+<!--                                                         <div class="col-6"> -->
+<!--                                                             <select class="custom-select  form-control" id="selectState" name="selectState"> -->
+<!--                                                                 <option value="nbTitle">제목</option> -->
+<!--                                                                 <option value="nbContent">내용</option> -->
+<!--                                                             </select> -->
+<!--                                                         </div> -->
+<!--                                                         <div class="col-6"> -->
+<%--                                                             <input type="text" class="form-control" name="sData" value="${searchTxt}" placeholder="검색어를 입력하세요."> --%>
+<!--                                                         </div> -->
+<!--                                                     </div> -->
+                                                </td>
+                                            </tr>
                                         </table>
                                         
-                                                    <div class="form-row">
-                                                        <div class="col-6">
-                                                            <select class="custom-select  form-control" id="selectState" name="selectState">
-                                                                <option value="nbTitle">제목</option>
-                                                                <option value="nbContent">내용</option>
-<%--                                                                 <option value="sCenterName" <c:if test="${selectState eq 'sCenterName'}"> selected="selected"</c:if>>치료센터명</option> --%>
-                                                            </select>
-                                                        </div>
-                                                        <div class="col-6">
-                                                            <input type="text" class="form-control" name="sData" value="${searchTxt}" placeholder="검색어를 입력하세요.">
-                                                        </div>
-                                                    </div>
-                                        
                                         <div class="row mt-3">
                                             <div class="col-12">
                                                 <div class="text-right">

+ 1 - 1
src/main/webapp/WEB-INF/jsp/include/header.jsp

@@ -18,4 +18,4 @@
 <link href="/resources/css/common/classic.css" rel="stylesheet">
 <script src="/resources/js/common/app.js"></script>
 <script src="/resources/js/common/common.js"></script>
-<script type="text/javascript" src="/resources/js/common/jquery.modal.min.js"></script>
+<script type="text/javascript" src="/resources/js/common/jquery.modal.min.js"></script>

+ 37 - 0
src/main/webapp/WEB-INF/jsp/include/sidebar.jsp

@@ -1,6 +1,43 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 <%@ page language="java" contentType="text/html; charset=UTF-8"
     pageEncoding="UTF-8"%>
+    
+<script>
+$( function(){
+// localStorage.clear();
+    var lifeCenterNotice = localStorage.getItem( "notice" );
+    
+    if( lifeCenterNotice != "ok" ){
+        alertBox({ 
+            title : '<span class="" style="">공지<br/>(Notice)</span>', 
+            txt : '<div class="text-dark" style="line-height:30px;font-size:16px !important;color:#000;">' +
+                  '  <div>○ 생활치료센터 비대면진료시스템 콜센터 운영기간 안내</div> <span class="notice-en">시스템 이용문의 관련 콜센터 운영기간이 연중무휴로 연장되어 안내드립니다.</span>' + 
+                  '  <div class="mt-4">- 콜센터 운영 : (기존) 평일 9시~18시 → (변경) 연중무휴 9시~18시</div>' +
+                  '  <div class="mt-2">- 콜센터 번호 :  ☏ 1661-7551</div>' +
+                  '</div>' +
+                  '<br/><label id="check-notice"><input type="checkbox" id="life-center-notice" /> 다시보지않기 <label>', 
+            callBack : function( result ){
+                if( $( "#life-center-notice" ).prop( "checked" ) == true ){
+                    localStorage.notice = "ok";
+                }
+            }
+        });
+    }
+});
+</script>
+<style type="text/css">
+#check-notice{    font-size: 14px;
+    margin-top: 20px;
+    position: absolute;
+    border: 1px solid #c9c9c9;
+    background: #FFFFFF;
+    height: 33px;
+    line-height: 33px;
+    bottom: 4px;
+    padding: 0 10px;}
+/* .notice-en{font-size:14px;color:#444;} */
+</style>
+
 
 <nav id="sidebar" class="sidebar">
     <div class="sidebar-content ">