diff --git a/public/index.ejs b/public/index.ejs new file mode 100644 index 0000000..a340b1a --- /dev/null +++ b/public/index.ejs @@ -0,0 +1,161 @@ +<% +var[] travelBoardList; + + + +%> + +<%//유저 아이디 불러오기. +String userID = null;;String userName=null; +if(session.getAttribute("userID")!=null) +{ + userID = (String) session.getAttribute("userID"); +} + + //보드 대분류 + String travelClassfy="tripPlan"; + //검색사안 + String search = null; + //페이지당 보드 출력수. + int boardIndexNoPerPage=15; + + + if(request.getParameter("search")!=null) + {try{search = (String)(request.getParameter("search"));}catch(Exception e){System.out.println("검색에러");}} + + + + ArrayList tripBoardList = new ArrayList(); + int pageNo=1; + //href로 검색한것 int변형해서 가져올수 있다면, 페이지번호 바꿔줌. + if(request.getParameter("pageNo")!=null){try{pageNo = Integer.parseInt(request.getParameter("pageNo"));}catch(Exception e){System.out.println("검색에러");}} + +%> + + + + + + + + WTG + + + + + + + + + +
+ <%- include ../part/header.ejs %> +
+
+
+
+
+ +
+ + + + + + + +
+
+
+ <% + //글수에 따라 << 1 ... 10>>, <<현재 , ... , 현재+8 >>식 이동. + //가장 오랜된글 >>(맨끝으로) + //1 : <<(최신글로) + //MaxIndexAdd1 : 10개 못채우는 나머지 있을때 최대페이지번호 +1해줘야함. + if(travelBoardList!=null&&travelBoardList.size()!=0){ + int MaxIndexAdd1=0; + if(travelBoardList.size()%boardIndexNoPerPage!=0){MaxIndexAdd1=1;} + int MaxIndex=(travelBoardList.size()/boardIndexNoPerPage)+MaxIndexAdd1;%> +
+ << + <% + //시작번호 10넘어가면 현재번호부터 10개 + if(pageNo>10) + { + //-10돌아가는 < 추가.%> +   <   + <%//1페이지씩 표시. + for(int i=pageNo;(i<%=i%><%} + + //+10이후 더있으면 +10하는 >추가. + if(pageNo+10   >   <%} + }else{ + //1붙터 시작하면 10or최대값 까지 + for(int i=1;(i<=MaxIndex);i++){%><%=i%><%} + }%> + >> +
+ <%}%> +
+ <%if(userID==null||userID.equals("")){%> + <%}else{ %> +
+ + +
+ <%} %> +
+ + +
+ + + + + + + + + + + + + + <%//보드 내용 검색 + //보드 에러 + if(travelBoardList==null){%><%} + //보드 검색내용 없음 + else if(travelBoardList.size()==0){%><%} + //보드 검색중. + else{ + int NoStart = travelBoardList.size()-(pageNo-1)*boardIndexNoPerPage; + int NoNextStart = NoStart-boardIndexNoPerPage; + for(int indexNo=NoStart ;(indexNo>=1)&&(indexNo>NoNextStart);indexNo--){%> + + + + + + + + + + <%} + }%> + +
번호여행국가여행시작여행총일자글쓴이제목

등록된 보드가 없습니다.

등록된 글이 없습니다.

<%=indexNo%><%=travelBoardList[indexNo].travelCountry%><%=travelBoardList[indexNo].travelStartDate%><%=travelBoardList[indexNo].travelTatalSpanTime%><%=travelBoardList[indexNo].travelWriter%><%=travelBoardList[indexNo].travelContent%>
+
+
+
+ <%- include ./part/login.ejs%> +
+
+ + + + + +