<%@page import="Dto.MemberDto"%>
<%@page import="java.time.LocalDateTime"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<%-- <link rel="stylesheet" href="<%=request.getContextPath()%>/CSS/form.css"> --%>
<link rel="stylesheet" type="text/css" href="/KH_SecondPJ/CSS/Table.css"/>
<title>Reserve</title>
</head>
<body>
<%
LocalDateTime now = LocalDateTime.now();
String today = now.toString().substring(0, 10);
response.setContentType("text/html; charset=utf-8");
request.setCharacterEncoding("utf-8");
MemberDto dto = (MemberDto)session.getAttribute("kh_member");
%>
<jsp:include page="Header.jsp"></jsp:include>
<!-- 최상단 이미지 부분 -->
<div class="img">
<!-- img_위에 망 덮어씌움 이유 : 이미지가 색이 강력크 .. ㅋㅌ 방지용 -->
<div class="img-cover"></div>
</div>
<div class="outer-container">
<h2>Reserve</h2>
<br>
<form
action="<%=request.getContextPath() %>/ReserveController?command=reserve"
method="post">
<div class="inner-container">
<table border="0" style="border-collapse: collapse">
<col width="100">
<col width="920">
<tr>
<td>이름</td>
<td><input type="text" class="input_data" name="title"
readonly value="<%=dto.getName() %>"
style="padding-left: 2px; border: 0;"></td>
</tr>
<tr>
<td>일자</td>
<td><input type="date" class="input_data" name="date"
value='<%=today %>' id="date" style="width: 170px;"></td>
</tr>
<tr>
<td>시간</td>
<td><select class="input_data" name="time" required>
<option value="0900">9:00 AM</option>
<option value="1100">11:00 AM</option>
<option value="1400">2:00 PM</option>
<option value="1600">4:00 PM</option>
</select></td>
</tr>
<tr style="border-bottom: 0;">
<td style="vertical-align: top; padding-top: 8px;">내용</td>
<td style="padding-top: 8px;"><textarea class="input_data"
rows="4" cols="50" name="content" required
style="width: 90%; height: 500px;"></textarea></td>
</tr>
</table>
</div>
<input type="submit" class="mainbut" value="예약하기">
<button type="button" class="mainbut"
onclick="location='<%=request.getContextPath() %>/JSP/Calendar.jsp'">일정보기</button>
</form>
<%-- <div class="form-style-5">
<form>
<fieldset>
<legend><span class="number">1</span> 회원 정보 </legend>
<input type="text" name="name" value="<%=dto.getName() %>" readonly>
<input type="date" name="date" value='<%=today %>' id="date">
<textarea name="field3" placeholder="About yourself"></textarea>
<label for="job">Interests:</label>
<select id="job" name="time">
<option value="0900">9:00 AM</option>
<option value="1100">11:00 AM</option>
<option value="1400">2:00 PM</option>
<option value="1600">4:00 PM</option>
</select>
</fieldset>
<fieldset>
<legend><span class="number">2</span> Additional Info</legend>
<textarea name="field3" placeholder="About Your School"></textarea>
</fieldset>
<input type="submit" value="Apply" />
</form>
</div>
--%>
</div>
<jsp:include page="Footer.jsp"></jsp:include>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="Dto.*, Dao.*, java.util.*"%>
<%
request.setCharacterEncoding("utf-8");
MemberDto dto = (MemberDto)session.getAttribute("kh_member");
boolean logincheck = false;
if(dto != null){
logincheck = true;
}
%>
<jsp:include page="Header.jsp"></jsp:include>
<!DOCTYPE html>
<html>
<head>
<!-- 검색창 밑 backgraund_img.css -->
<link href="<%=request.getContextPath()%>/CSS/QAList.css" rel="stylesheet">
<link rel='stylesheet' href='../fullcalendar/fullcalendar.min.css' />
<script src="../fullcalendar/lib/jquery.min.js"></script>
<script src='../fullcalendar/lib/moment.min.js'></script>
<script src='../fullcalendar/fullcalendar.min.js'></script>
<script src='../fullcalendar/locale/ko.js'></script>
<%-- <%=request.getContextPath() %>/ReservController --%>
<script>
$(function() {
$('#calendar').fullCalendar({
navLinks: true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
viewRender: function(view,element){
var moment = view.intervalStart;
//$('#calendar').fullCalendar('getDate');
var year = moment.year();
var month = moment.month()+1;
var arr;
var str = "<%=request.getContextPath() %>/ReserveController?command=list&year="+year+"&month="+month;
$.get(str, function(data, status){
console.log(data);
arr = JSON.parse(data);
for(var i = 0; i< arr.length;i++){
console.log(arr[i].start);
}
$('#calendar').fullCalendar('removeEventSources');
$('#calendar').fullCalendar('addEventSource', arr);
});
},
eventClick: function(eventObj) {
if (eventObj.url) {
location.href = eventObj.url;
} else {
alert('Clicked ' + eventObj.title);
}
}
});
});
</script>
<style type="text/css">
#calendar{
margin: 20px auto;
width: 1020px;
}
.wrapper{
text-align: center;
}
</style>
<meta charset="UTF-8">
<title>Calendar</title>
</head>
<body>
<!-- 최상단 이미지 부분 -->
<div class="img">
<!-- img_위에 망 덮어씌움 이유 : 이미지가 색이 강력크 .. ㅋㅌ 방지용 -->
<div class="img-cover"></div>
</div>
<div style="width:1020px; margin: 50px auto 30px; text-align: center;">
<h2>Reservation</h2>
<hr style="width: 1020px; border-color: black;">
<div id='calendar'></div>
<button id="btn" class="mainbut" onclick="location = '<%=request.getContextPath() %>/JSP/About.jsp'" >돌아가기</button>
<button id="btn" class="mainbut" onclick="reserve()" type="button" >상담예약</button>
<button id="btn" class="mainbut" onclick="mylist()" type="button" >내 예약 보기</button>
<br>
<br>
<script>
function reserve(){
if(!<%= logincheck%>){
alert("로그인 해 주십시오");
}else{
location='<%=request.getContextPath() %>/JSP/Reserve.jsp';
}
}
function mylist(){
if(!<%= logincheck%>){
alert("로그인 해 주십시오");
}else{
location='<%=request.getContextPath() %>/ReserveController?command=mylist';
}
}
</script>
</div>
<jsp:include page="Footer.jsp"></jsp:include>
</body>
</html>
'JavaScript mini Project > Project java code ' 카테고리의 다른 글
About (0) | 2018.09.26 |
---|---|
자료올리기 (0) | 2018.09.26 |
Gallery (0) | 2018.09.26 |
Myinfo() (0) | 2018.09.24 |
Regi(회원가입) (0) | 2018.09.24 |