Created
June 23, 2016 09:19
-
-
Save Hellonoynoy/dd48616a56e4b613c8e2beca47c98c3d to your computer and use it in GitHub Desktop.
schedule data test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
| <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> | |
| <%@ page contentType="text/html;charset=UTF-8" language="java" %> | |
| <jsp:include page="/student/fragments/head"/> | |
| <script src='/ssop/lib/printThis.js'></script> | |
| <body> | |
| <div class="wrapper"> | |
| <jsp:include page="/student/fragments/top"/> | |
| <div class="main"> | |
| <div class="container"> | |
| <div class="col-xs-7"> | |
| <div class="row"> | |
| <div id="calendar"></div> | |
| </div> | |
| </div> | |
| <!--오른쪽 아이콘 모음--> | |
| <div class="col-xs-5 plan"> | |
| <div class="col-xs-4"> | |
| <div class="jeju text-right title"> | |
| <span class="glyphicon glyphicon-time" style="top:3px" aria-hidden="true"></span> | |
| 학습시간 | |
| </div> | |
| </div> | |
| <div class="stop col-xs-8 well"> | |
| <div class="col-xs-7 time jeju text-center"> | |
| 00:00:00 | |
| </div> | |
| <Div class="col-xs-5"> | |
| <button type="button" class="btn btn-danger pull-right">일시정지</button> | |
| </Div> | |
| </div> | |
| <div class="menubtn clearfix"> | |
| <button type="button" class="btn btn-primary jeju col-xs-3" onclick = "location.href = '/student/planner/plan'">월간계획</button> | |
| <button type="button" class="btn btn-success jeju col-xs-3" data-toggle="modal" data-target="#newplan">학습플랜</button> | |
| <button type="button" class="btn btn-danger jeju col-xs-3" onclick="location.href = '/student/planner/today'">학습하기</button> | |
| <button type="button" class="btn btn-warning jeju col-xs-3" onclick="location.href = '/student/planner/satistic'">학습통계</button> | |
| </div> | |
| <div class="col-xs-12 well dplan"> | |
| <div class="clearfix title"> | |
| <div class="today jeju pull-left"> | |
| ${month}월${day}일 (${today}) | |
| </div> | |
| <div class="pull-right"> <div class="printbtn"> | |
| <button type="button" class="btn btn-toolbar pull-right">${month}월 학습 계획 인쇄하기</button> | |
| </div></div> | |
| </div> | |
| <div class="tolist nng"> | |
| <ul> | |
| <c:if test="${fn:length(myPlanList) == 0 }"> | |
| 등록된 일정이 없습니다<br> | |
| 학습 플랜에서 일정을 등록하세요 | |
| </c:if> | |
| <c:forEach items="${myPlanList}" var = "planList" varStatus="idx"> | |
| <li>${planList.subjects} ${planList.texts}</li> | |
| </c:forEach> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="modal fade" id="newplan" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> | |
| <div class="modal-dialog"> | |
| <div class="modal-content"> | |
| <div class="modal-header"> | |
| <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
| <h4 class="modal-title text-center jeju" id="exampleModalLabel">학습계획</h4> | |
| </div> | |
| <div class="modal-body"> | |
| <div class="planwb" id = "myPlan"> | |
| <table class="table table-bordered" id="modalTable"> | |
| <tr class="box"> | |
| <td class="ca text-center jeju">과목</td> | |
| <td class="planw text-center jeju"> | |
| 학습플랜 | |
| </td> | |
| <td class="planw text-center jeju">추가</td> | |
| </tr> | |
| <c:choose> | |
| <c:when test="${fn:length(myPlanList) == 0}"> | |
| <tr class="bhe"> | |
| <td class="cp text-center"> | |
| <input class="inputpw" type="text" value = "" name="subjects" size="5"></td> | |
| <td class="pw"> | |
| <input class="inputpw" type="text" value = "" name="plan" size="20"></td> | |
| <td class="cp text-center" align="center"> | |
| <a href="#" onclick='textAdd()'><img src="/ssop/images/plus_btn.jpg"></a> | |
| </td> | |
| </tr> | |
| </c:when> | |
| <c:otherwise> | |
| <c:forEach items="${myPlanList}" var = "myPlanList"> | |
| <tr class="bhe"> | |
| <td class="cp text-center"> | |
| <input class="inputpw" type="text" value = "${myPlanList.subjects}" name="subjects" size="5"></td> | |
| <td class="pw"> | |
| <input class="inputpw" type="text" value = "${myPlanList.texts}" name="plan" size="20"></td> | |
| <td class="cp text-center" align="center"> | |
| <a href="#" onclick='textAdd()'><img src="/ssop/images/plus_btn.jpg"></a> | |
| </td> | |
| </tr> | |
| </c:forEach> | |
| </c:otherwise> | |
| </c:choose> | |
| </table> | |
| </div> | |
| </div> | |
| <div class="modal-footer"> | |
| <button type="button" class="btn btn-danger" onclick = "javascript:planPrint()">인쇄</button> | |
| <button type="button" class="btn btn-primary" onclick = "javascript:submit()">저장</button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Layer start--> | |
| <div id="eventContent" title="Event Details" style="display:none;"> | |
| 일자: <span id="startTime"></span><br> | |
| <p id="eventInfo"></p> | |
| </div> | |
| <!-- Layer end--> | |
| </div> | |
| <jsp:include page="/student/fragments/footer"/> | |
| <script type="text/javascript"> | |
| function textAdd() | |
| { | |
| console.log("textAdd"); | |
| var html = ''; | |
| html += '<tr class = "bhe">'; | |
| html += '<td class = "cp text-center">'; | |
| html += '<input class="inputpw" type="text" name="subjects" size="5"></td>'; | |
| html += '<td class = "pw">'; | |
| html += '<input class="inputpw" type="text" name="plan" size="20"></td>'; | |
| html += '<td class = "cp text-center" align="center">'; | |
| html += '<a href = "#" onclick = "textAdd()"><img src="/ssop/images/plus_btn.jpg"></a></td></tr>'; | |
| $('#modalTable').append(html); | |
| } | |
| function submit() | |
| { | |
| var subjects = ""; | |
| var texts = ""; | |
| $('input[name="subjects"]').each(function(index){ | |
| subjects += $(this).val() + ","; | |
| console.log("subjects:::" + subjects); | |
| }); | |
| $('input[name="plan"]').each(function(index){ | |
| texts += $(this).val() + ","; | |
| console.log("texts:::" + texts); | |
| }); | |
| $.ajax({ | |
| url : '/student/planner/mark', | |
| type: 'POST', | |
| data: {subjects: subjects, texts: texts}, | |
| success: function(result) | |
| { | |
| if(result == "1") | |
| alert("학습목표를 성공적으로 저장하였습니다"); | |
| window.location.reload(); | |
| }, | |
| error: function(jqXHR, textStatus, errorThrown) | |
| { | |
| alert("에러발생!!" + textStatus + ": " + errorThrown); | |
| } | |
| });//ajax | |
| } | |
| function planPrint() //프린트 | |
| { | |
| $("#myPlan").printThis({ | |
| debug: false, | |
| importCSS: true, | |
| importStyle: true, | |
| printContainer: true, | |
| pageTitle: "학습플랜", | |
| removeInline: false, | |
| printDelay: 333, | |
| header: null, | |
| formValues: true | |
| }); | |
| } | |
| $(document).ready(function(){ | |
| var date = new Date(); | |
| var day = date.getDate(); | |
| var month = date.getMonth(); | |
| var year = date.getFullYear(); | |
| var newEvent = new Object(); | |
| $.post('/student/planner/plan/month', function(result){ | |
| for(var data in result) | |
| { | |
| var schedule = result[data]; | |
| console.log(schedule); | |
| //var tempText = schedule.texts; | |
| newEvent.title = '일정: ' + schedule.count + '개'; | |
| newEvent.start = schedule.planDate; | |
| newEvent.allDay = true; | |
| $('#calendar').fullCalendar('renderEvent', newEvent); | |
| } | |
| }); | |
| }); | |
| function layer_open(el){ | |
| var temp = $('#' + el); //레이어의 id를 temp변수에 저장 | |
| var bg = temp.prev().hasClass('bg'); //dimmed 레이어를 감지하기 위한 boolean 변수 | |
| if(bg) | |
| { | |
| $('.layer').fadeIn(); | |
| } | |
| else | |
| { | |
| temp.fadeIn(); //bg 클래스가 없으면 일반레이어로 실행한다. | |
| } | |
| // 화면의 중앙에 레이어를 띄운다. | |
| if (temp.outerHeight() < $(document).height() ) temp.css('margin-top', '-'+temp.outerHeight()/2+'px'); | |
| else temp.css('top', '0px'); | |
| if (temp.outerWidth() < $(document).width() ) temp.css('margin-left', '-'+temp.outerWidth()/2+'px'); | |
| else temp.css('left', '0px'); | |
| temp.find('a.cbtn').click(function(e) | |
| { | |
| if(bg){ | |
| $('.layer').fadeOut(); | |
| } | |
| else | |
| { | |
| temp.fadeOut(); //'닫기'버튼을 클릭하면 레이어가 사라진다. | |
| } | |
| e.preventDefault(); | |
| }); | |
| $('.layer .bg').click(function(e){ | |
| $('.layer').fadeOut(); | |
| e.preventDefault(); | |
| }); | |
| } | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment