bbs5/modify.jsp > JSP

본문 바로가기
사이트 내 전체검색

JSP

bbs5/modify.jsp

페이지 정보

profile_image
작성자 관리자
댓글 0건 조회 9회 작성일 24-10-29 14:44

본문

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>


<%@ include file="/include/header.jsp" %>


<%

String code = request.getParameter("code"); //데이타베이스 게시판 테이블명

String uid = request.getParameter("uid");


//검색 관련

String field = request.getParameter("field");

String search = request.getParameter("search");


//날짜 관련

int nYear = Integer.parseInt(request.getParameter("nYear"));

int nMonth = Integer.parseInt(request.getParameter("nMonth"));

int nDate = Integer.parseInt(request.getParameter("nDate"));


//게시판 타이틀

String bbs_title = "";


if(code.equals("notice")){

bbs_title = "공지게시판";

}else if(code.equals("free")){

bbs_title = "자유게시판";

}else if(code.equals("gallery")){

bbs_title = "갤러리게시판";

}else if(code.equals("qna")){

bbs_title = "QnA게시판";

}else if(code.equals("cal")){

bbs_title = "달력게시판";

}


//view(상세보기)

String sql="select * from "+code+" where uid="+uid;


Connection conn=DriverManager.getConnection(url, user, password);

Statement stmt=conn.createStatement();

ResultSet rs=stmt.executeQuery(sql);


//전역변수

String id = "";

String name = "";

String gongji = "";

String subject = "";

String comment = "";

String signdate = "";

String ref = "";

String file1 = "";


if(rs.next()){

id = rs.getString("id");

name = rs.getString("name");

gongji = rs.getString("gongji");

subject = rs.getString("subject");

comment = rs.getString("comment");

signdate = rs.getString("signdate");

ref = rs.getString("ref");

file1 = rs.getString("file1");

}


if(gongji.equals("3")){ //비밀글

if((session_level != null && session_level.equals("10")) || (session_id != null && session_id.equals(id))){

//관리자 or 작성자

}else{

%>

<script>

alert("수정 권한이 없습니다.");

history.back();

</script>

<%

}

}

%>


<style>

input , textarea {

border:1px solid #e9e9e9;

background:#f7f7f7;

}

</style>


<table width=100% height=50 border=0>

<tr>

<td align=center style="color:#777;font-size:14px;font-weight:bold;">[<%=bbs_title %>]_수정</td>

</tr>

</table>


<center>

<form name="board" method="post" action="update.jsp" ENCTYPE="multipart/form-data">

<input type="hidden" name="code" value="<%=code%>">

<input type="hidden" name="uid" value="<%=uid%>">

<input type="hidden" name="field" value="<%=field%>">

<input type="hidden" name="search" value="<%=search%>">

<table width="700" border="0" cellpadding="0" cellspacing="0">

<tr><td colspan=3 height=1 width=100% bgcolor=#d1dee2></td></tr>

<tr>

<td height=26>옵션</td>

<td>

<%if(session_level != null && session_level.equals("10")){ //관리자 %>

<input type="radio" name="gongji" value="1" <%if(gongji.equals("1")){%>checked<%}%>>공지 

<%} %>

<input type="radio" name="gongji" value="2" <%if(gongji.equals("2")){%>checked<%}%>>일반 

<input type="radio" name="gongji" value="3" <%if(gongji.equals("3")){%>checked<%}%>>비밀 

</td>

</tr>

<tr><td colspan=3 height=1 width=100% bgcolor=#d1dee2></td></tr>

<tr>

<td height=28>일정</td>

<td>

<input type="number" name="nYear" value="<%=nYear%>" style="width:50px;">년 

<input type="number" name="nMonth" value="<%=nMonth%>" style="width:36px;">월 

<input type="number" name="nDate" value="<%=nDate%>" style="width:36px;">일 

</td>

</tr>

<tr><td colspan=3 height=1 width=100% bgcolor=#d1dee2></td></tr>

<tr>

<td height=26>제목</td>

<td><input name="subject" style="height:20px;width:99%;" value="<c:out value="<%=subject%>" escapeXml="true" />"></td>

</tr>

<tr><td colspan=3 height=1 width=100% bgcolor=#d1dee2></td></tr>

<tr>

<td>내용</td>

<td>

<textarea name="comment" style="height:92px;width:99%;"><%=comment%></textarea>

</td>

</tr>

<tr><td colspan=3 height=1 width=100% bgcolor=#d1dee2></td></tr>

<tr>

<td height=28>첨부</td>

<td>

<input type="file" name="file1">

<%if(!file1.equals("")){ //첨부파일 존재 %>

<%=file1 %> <img src="img/icon_file.gif">

<%} %>

</td>

</tr>

<tr><td colspan=3 height=1 width=100% bgcolor=#d1dee2></td></tr>

</table>

<br>

<table width="700" border="0" cellpadding="0" cellspacing="0">

<tr>

<td align="center"><button>수정완료</button></td>

</tr>

</table>

<br>

</form>

</center>


<%@ include file="/include/footer.jsp" %>

추천0

댓글목록

등록된 댓글이 없습니다.

회원로그인

회원가입

사이트 정보

공지사항
자유게시판
질문답변
1:1문의

 

별명 : 터푸가위
주소 : 부산시 동래구 명장로20번길 90
대표 : 박규태
메일 : dancepkt@******.com

접속자집계

오늘
111
어제
123
최대
10,760
전체
263,710
Copyright © dancePKT . All rights reserved.