📄 yaopinrk.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java"
import="java.sql.*" errorPage=""%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
#Layer1 {
position:absolute;
width:200px;
height:121px;
z-index:1;
left: 249px;
top: 49px;
}
#Layer2 {
position:absolute;
width:200px;
height:119px;
z-index:2;
left: 578px;
top: 49px;
}
body {
background-color: #93A070;
}
.STYLE7 {
font-size: 24px;
font-weight: bold;
color: #000000;
}
.STYLE8 {
font-size: 16px;
font-weight: bold;
}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
</head>
<body>
<jsp:useBean id="Rs" scope="page" class="MyWeb.db.DBManager" />
<%
String sql = null;
String type = null;
String name = null;
String bianhao = null;
String jiage = null;
String changjia = null;
String message = null;
ResultSet rs = null;
%>
<%
request.setCharacterEncoding("GB2312");
type = request.getParameter("type");
if (type != null) {
name = request.getParameter("name");
bianhao = request.getParameter("bianhao");
jiage = request.getParameter("jiage");
changjia = request.getParameter("changjia");
String sql1 = "insert into yaopin (";
String sql2 = "values(";
if (name != null) {
sql1 += "name,";
sql2 += "'" + name + "',";
}
if (bianhao != null) {
sql1 += "bianhao,";
sql2 += "'" + bianhao + "',";
}
if (jiage != null) {
sql1 += "jiage,";
sql2 += "'" + jiage + "',";
}
if (changjia != null) {
sql1 += "changjia,";
sql2 += "'" + changjia + "',";
}
sql1 = sql1.substring(0, sql1.length() - 1);
sql2 = sql2.substring(0, sql2.length() - 1);
sql1 += ")";
sql2 += ")";
sql = sql1 + sql2;
//out.print(sql);
try {
int i = Rs.executeUpdate(sql);
message = "药品入库成功!";
} catch (Exception e) {
e.printStackTrace();
message = "出现异常清况,请重新添加";
}
}
if (message == null)
message = "";
%>
<table width="500" height="30" border="0" align="center">
<tr>
<td bgcolor="#BEC798">
<form id="form" name="form" method="post" action="yaopinrk.jsp">
<table width="100%" border="0">
<tr>
<td height="30" colspan="2" align="center">
<span class="STYLE7">药品入库清单</span>
</td>
</tr>
<tr>
<td height="35">
<span class="STYLE8">药品名称 <label>
<input name="name" type="text" value="" size="15" />
</label> </span>
</td>
<td height="35">
<span class="STYLE8">药品编号 <label>
<input name="bianhao" type="text" value="" size="15" />
</label> </span>
</td>
</tr>
<tr>
<td height="35">
<span class="STYLE8">药品价格 <label>
<input name="jiage" type="text" value="" size="15" />
</label> </span>
</td>
<td height="35">
<span class="STYLE8">生产厂家 <label>
<input name="changjia" type="text" value="" size="15" />
</label> </span>
</td>
</tr>
<tr>
<td height="45" align="center" valign="bottom">
<label>
<input name="Submit" type="submit" class="STYLE8" value="入库" />
</label>
</td>
<td align="center" valign="bottom">
<input name="Submit2" type="reset" class="STYLE8"
onclick="MM_goToURL('parent','../main.jsp');return document.MM_returnValue"
value="返回" />
</td>
</tr>
</table>
<center>
<%=message%>
</center>
</form>
</td>
</tr>
</table>
<hr />
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -