?? adm_addbookclass.jsp
字號(hào):
<%@ page session="true" %>
<%
if (session.getAttribute("admin")==null || session.getAttribute("admin")==""){
response.sendRedirect("error.htm");
} %>
<%@ page import="bookshop.book.*"%>
<jsp:useBean id="classlist" scope="page" class="bookshop.run.op_bookclass" />
<jsp:useBean id="book" scope="page" class="bookshop.run.op_book" />
<%
String mesg = "";
String submit = request.getParameter("Submit");
if (submit!=null && !submit.equals("")){
if(classlist.getRequest(request)){
if(classlist.insert()){
mesg = "新圖書資料提交成功!";
} else {
mesg = "數(shù)據(jù)庫操作失敗";
}
}else {
mesg = "對(duì)不起,你提交的參數(shù)有錯(cuò)誤";
}
}
if (request.getParameter("action")!=null && request.getParameter("action").equals("del")){
try {
int delid = Integer.parseInt(request.getParameter("id"));
if (classlist.delete(delid)){
mesg = "刪除成功!";
} else {
mesg = "刪除出錯(cuò)!";
}
} catch (Exception e){
mesg = "你要?jiǎng)h除的對(duì)象錯(cuò)誤!";
}
}
%>
<script language="javascript">
function checkform() {
if (document.form1.bookclassname.value=="") {
document.form1.bookname.focus();
alert("圖書名為空!");
return false;
}
return true;
}
</script>
<%@include file="/bookshop/inc/adm_head.inc"%>
<tr>
<tr><td align="center">現(xiàn)有圖書分類:</td></tr>
<% if (classlist.seachBookClass()){
for (int i=0;i<classlist.getClasslist().size();i++){
bookclass bc = (bookclass) classlist.getClasslist().elementAt(i); %>
<tr align="left"> <td> 分類名稱:<%= bc.getClassName() %> <a href="adm_addbookclass.jsp?id=<%= bc.getId()%>&action=del">刪除</a></td></tr>
<% }
}%>
<td align="center" width="100%">
<p><br>
<font size="3"><b>添加新的圖書分類</b></font></p>
<% if(!mesg.equals("")){
out.println(mesg);
}%>
<form name="form1" method="post" action="adm_addbookclass.jsp">
<table width="90%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td align="right" width="35%">圖書分類名稱:</td>
<td width="65%">
<input type="text" name="bookclassname" maxlength="40" size="30">
</td>
</tr>
<tr>
<td align="right" width="35%"> </td>
<td width="65%">
<input type="submit" name="Submit" value="提交" onclick="return(checkform());">
<input type="reset" name="reset" value="重置">
</td>
</tr>
</table>
</form>
<p> </p>
</td>
</tr>
<%@include file="/bookshop/inc/adm_tail.inc"%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -