📄 cd_modify.jsp
字号:
<!--<meta http-equiv="musiclist-Type" musiclist="text/html; charset=gb2312">-->
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page session="true" %>
<%
if (session.getAttribute("admin")==null || session.getAttribute("admin")==""){
// response.sendRedirect("error.htm");
} %>
<%@ page import="cdshop.cd.*" %>
<%@ page import="cdshop.util.*" %>
<jsp:useBean id="classlist" scope="page" class="cdshop.run.op_cdclass" />
<jsp:useBean id="cd" scope="page" class="cdshop.run.op_cd" />
<%
String mesg = "";
String submit = request.getParameter("Submit");
int Id =0;
if (submit!=null && !submit.equals("")){
if(cd.getRequest(request)){
if(cd.update()){
mesg = "CD资料修改成功!";
} else {
mesg = "数据库操作失败";
}
}else {
mesg = "对不起,你提交的参数有错误";
}
}
if (request.getParameter("id")==null || request.getParameter("id").equals("")) {
mesg = "你要修改的数据参数错误!";
} else {
try {
Id = Integer.parseInt(request.getParameter("id"));
if (!cd.getOnecd(Id)){
mesg = "你要修改的数据不存在";
}
} catch (Exception e){
mesg = "你要修改的数据参数错误!";
}
}
%>
<script language="javascript">
function checkform() {
if (document.form1.id.value=="") {
alert("你要修改的数据不存在!");
return false;
}
if (document.form1.cdname.value=="") {
document.form1.cdname.focus();
alert("CD名为空!");
return false;
}
if (document.form1.Singer.value=="") {
alert("歌手名为空!");
document.form1.Singer.focus();
return false;
}
return true;
}
</script>
<%@include file="../inc/adm_head.inc"%>
<tr>
<td align="center" width="77%">
<p><br>
<font size="3"><b>修改CD资料</b></font></p>
<% if(!mesg.equals("")){
out.println(mesg);
} else {
cd modicd = (cd) cd.getcdlist().elementAt(0);
%>
<form name="form1" method="post" action="cd_modify.jsp">
<table width="90%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td align="right" width="35%">CD名称:</td>
<td width="65%">
<input type="text" name="cdname" maxlength="40" size="30" value="<%= dataFormat.toString(modicd.getcdName()) %>">
</td>
</tr>
<tr>
<td align="right" width="35%">歌手名:</td>
<td width="65%">
<input type="text" name="Singer" maxlength="25" size="20" value="<%= dataFormat.toString(modicd.getSinger()) %>">
</td>
</tr>
<tr>
<td align="right" width="35%">发行唱片公司:</td>
<td width="65%">
<input type="text" name="publish" size="40" maxlength="150" value="<%= dataFormat.toString(modicd.getPublish()) %>">
</td>
</tr>
<tr>
<td align="right" width="35%">所属类别:</td>
<td width="65%">
<select name="cdclass">
<% if (classlist.seachcdClass()){
for (int i=0;i<classlist.getClasslist().size();i++){
cdclass bc = (cdclass) classlist.getClasslist().elementAt(i); %>
<option value="<%= bc.getId()%>" <% if (bc.getId() == modicd.getcdClass()) out.print("selected");%>><%= dataFormat.toString(bc.getClassName()) %></option>
<% }
}%>
</select>
</td>
</tr>
<tr>
<td align="right" width="35%">CD编号:</td>
<td width="65%">
<input type="text" name="cdno" size="20" maxlength="30" value="<%= modicd.getcdNo() %>">
</td>
</tr>
<tr>
<td align="right" width="35%">售价:</td>
<td width="65%">
<input type="text" name="price" size="8" maxlength="10" value="<%= modicd.getPrice() %>">
元</td>
</tr>
<tr>
<td align="right" width="35%">总数量:</td>
<td width="65%">
<input type="text" name="amount" size="8" maxlength="10" value="<%= modicd.getAmount() %>">
本</td>
</tr>
<tr>
<td align="right" width="35%" valign="top">CD封面:</td>
<td width="65%">
<input type="text" name="picture" size="8" maxlength="10" value="<%= modicd.getPicture() %>">
</td>
</tr>
<tr>
<td align="right" width="35%" valign="top">CD歌曲列表:</td>
<td width="65%">
<textarea name="musiclist" cols="40" rows="6"><%= dataFormat.toString(modicd.getmusiclist()) %></textarea>
</td>
</tr>
<tr>
<td align="right" width="35%"> </td>
<td width="65%">
<input type="hidden" name="id" value="<%= Id %>">
<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="../inc/adm_tail.inc"%>
蕃;貯X礯┶柆lA
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -