📄 dataadd.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*"%>
<% request.setCharacterEncoding("gb2312"); %>
<%@ page import="beans.Condb"%>
<%@ page import="beans.Strto" %>
<%@ page import="java.lang.*" %>
<%@ page import="java.util.*"%>
<% Strto strto=new Strto();
Condb con=new Condb();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>数据添加</title>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</head>
<script language="JavaScript">
function CheckDate(INDate)
{ if(INDate=="")
{return true;}
subYY=INDate.substr(0,4)
//转换月份
if(INDate.indexOf('-',0)!=-1){ separate="-"}
else{
if(INDate.indexOf('/',0)!=-1){separate="/"}
else {return true;}}
area=INDate.indexOf(separate,0)
subMM=INDate.substr(area+1,INDate.indexOf(separate,area+1)-(area+1))
if(subMM.length<2){subMM="0"+subMM}
//转换日
area=INDate.lastIndexOf(separate)
subDD=INDate.substr(area+1,INDate.length-area-1)
if(eval(subDD)<10){subDD="0"+eval(subDD)}
NewDate=subYY+"-"+subMM+"-"+subDD
if(NewDate.length!=10){return true;}
if(NewDate.substr(4,1)!="-"){return true;}
if(NewDate.substr(7,1)!="-"){return true;}
if(NewDate.substr(5,2)>"12"){return true;}
if(NewDate.substr(8,2)>"31"){return true;}
return false;}
</script>
<script language="javascript">
<!--
function check(){
if(form1.publishtime.value==""){
window.alert("输入你的发表时间");
form1.publishtime.focus();
return false;
}else{
if(CheckDate(form1.publishtime.value)){
window.alert("您输入的日期有误,请重新输入!");
return false;
}
}
}
-->
</script>
<script src="../../Js/Trans.js"></script>
<link rel="stylesheet" href="../../Css/style.css">
<body topmargin="0" leftmargin="0">
<table width="558" height="110" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#bdcbd6">
<tr>
<td width="567" height="26" valign="bottom" background="../../Image/skintop2.gif"><div align="center"><font style="color:#FFFFFF; font-size:13px; ">视 频 数 据 添 加</font> </div></td>
</tr>
<tr>
<td><table width="559" align="center" cellpadding="0" cellspacing="0" bordercolor="#9caab5">
<tr>
<td height="92"><table width="404" height="90" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#216184" class="wenbenkuang">
<tr>
<td width="402" valign="top"><table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="list" method="post" action="DataAdd.jsp">
<tr>
<td height="15" colspan="2"> </td>
</tr>
<tr>
<td width="131" height="20"><div align="right" class="style2 style1"></div>
<div align="left" class="style2 style1">
<div align="right">名称:</div>
</div></td>
<td width="269" height="20"><span class="style2 style1">
<input name="names" type="text" class="wenbenkuang1" id="names" size="30">
* </span></td>
</tr>
<tr>
<td height="20"><div align="right" class="style1">图片名称:</div></td>
<td height="20"><input name="pictrue" type="text" class="wenbenkuang1" id="pictrue">
<span class="style2 style1">*只支持“jpg”格式</span></td>
</tr>
<tr>
<td height="20"><div align="right" class="style1">数据名称:</div></td>
<td height="20"><input name="address" type="text" class="wenbenkuang1" id="address">
<span class="style2 style1">*只支持“AVI”格式</span></td>
</tr>
<tr>
<td height="20"><div align="right" class="style1"><span class="style2">等级:</span></div></td>
<td height="20">
<span class="style1"><select name="grade" id="grade" class="wenbenkuang1">
<option value="一级">一级</option>
<option value="二级">二级</option>
<option value="三级">三级</option>
<option value="无限制级">无限制级</option>
<option value="禁片">禁片</option>
</select>
*</span></td>
</tr>
<tr>
<td height="20"><div align="right" class="style1"><span class="style2">发行商:</span></div></td>
<td height="20"><span class="style2 style1">
<input name="publisher" type="text" class="wenbenkuang1" id="publisher" size="30">
*</span></td>
</tr>
<tr>
<td height="20"><div align="right" class="style1"><span class="style2">主要演员:</span></div></td>
<td height="20"><span class="style2 style1">
<input name="actor" type="text" class="wenbenkuang1" id="actor" size="30">
*</span></td>
</tr>
<tr>
<td height="20"><div align="right" class="style1"><span class="style2">导演:</span></div></td>
<td height="20"><span class="style2 style1">
<input name="director" type="text" class="wenbenkuang1" id="director" size="30">
*</span></td>
</tr>
<tr>
<td height="20"><div align="right" class="style1"><span class="style2">制片人:</span></div></td>
<td height="20"><span class="style2 style1">
<input name="maker" type="text" class="wenbenkuang1" id="maker" size="30">
*</span></td>
</tr>
<tr>
<td height="30"><div align="right" class="style1"><span class="style2">语言:</span></div></td>
<td height="30"><div align="left" class="style2 style1">
<input type="radio" name="language" value="中文" checked>
中文
<input type="radio" name="language" value="英文">
英文
<input type="radio" name="language" value="韩语">
韩语
<br>
<input type="radio" name="language" value="日语">
日语
<input type="radio" name="language" value="德语">
德语
<input type="radio" name="language" value="法语">
法语 <span class="style2">*</span></div> </td>
</tr>
<tr>
<td height="20"><div align="right" class="style1"><span class="style2">类别:</span></div></td>
<td height="20">
<span class="style1"><select name="style" class="wenbenkuang1" id="style" >
<% String sqldata="select * from tb_AudioList ";
ResultSet rsdata=con.executeQuery(sqldata);
while(rsdata.next())
{
%>
<option value="<%=rsdata.getString("Name")%>"><%=rsdata.getString("Name")%></option>
<% }
rsdata.close();
%>
</select>
*</span></td>
</tr>
<%
String names=request.getParameter("names");
String grade=request.getParameter("grade");
String publisher=request.getParameter("publisher");
String director=request.getParameter("director");
String maker=request.getParameter("maker");
String language=request.getParameter("language");
String from=request.getParameter("from");
String news=request.getParameter("news");
String remark=request.getParameter("remark");
String pictrue=request.getParameter("pictrue");
String style=request.getParameter("style");
String types=request.getParameter("type");
String address=request.getParameter("address");
String publishtime=request.getParameter("publishtime");
String actor=request.getParameter("actor");
if(names!=null){
String sqldadd="select * from tb_Audio where Name='"+names+"' and Actor='"+actor+"' and Director='"+director+"' and Maker='"+maker+"'";
ResultSet rsdata1=con.executeQuery(sqldadd);
if(rsdata1.next()){
%>
<script language="javascript">
alert("相同信息已经存在,请检验您的数据重新上传!");
history.back();
</script>
<% }
else{
java.util.Date date=new java.util.Date();
if(names!=""){
String sqlelse="insert into tb_Audio values('','"+names+"','"+pictrue+"','"+0+"','"+grade+"','"+publisher+"','"+actor+"','"+director+"','"+maker+"','"+language+"','"+types+"','"+style+"','"+from+"','"+publishtime+"','"+remark+"','管理员','"+address+"','"+session.getAttribute("check")+"','"+date.toLocaleString()+"',0,'"+date.toLocaleString()+"','未限制','"+news+"')";
int rselse=con.excuteUpdate(sqlelse);
if(rselse>0){
%>
<script language="javascript">
alert("数据添加成功");
history.back();
</script>
<%
} if(rselse==0){
%>
<script language="javascript">
alert("数据添加失败");
history.back();
</script>
<%}
}
}
}%>
<tr>
<td height="20"><div align="right" class="style1"><span class="style2">发行国家:</span></div></td>
<td height="20"><span class="style2 style1">
<input name="from" type="text" class="wenbenkuang1" id="from" size="30">
*</span></td>
</tr>
<tr>
<td height="20"><div align="right" class="style1"><span class="style2">发行时间:</span></div></td>
<td height="20"><span class="style2 style1">
<input name="publishtime" type="text" class="wenbenkuang1" id="publishtime" size="30">
*</span></td>
</tr>
<tr>
<td height="20"><div align="right" class="style1"><span class="style2">新品:</span></div></td>
<td height="20"><span class="style2 style1">
<input name="news" type="radio" class="wenbenkuang1" value="新品" checked>
是
<input name="news" type="radio" class="wenbenkuang1" value="非新品">
否 *</span></td>
</tr>
<tr>
<td height="20"><div align="right" class="style1"><span class="style2">简要介绍:</span></div></td>
<td height="20"><span class="style2 style1">
<textarea name="remark" cols="35" rows="5" class="wenbenkuang1" id="remark"></textarea>
*</span></td>
</tr>
<tr>
<td height="30" colspan="2"><div align="center">
<input name="Submit" type="Submit" class="go-wenbenkuang1" value=" 添 加" onClick="transcheck('Audio')">
<span class="style1">(*为必填项) </span>
<input name="Submit" type="button" class="go-wenbenkuang1" value=" 返 回 " onclick="javascript:window.location.href='../Manager.jsp?action=Audio'">
</div></td>
</tr> </form>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -