hzj_outputaction.jsp

来自「服务器tomcat 数据库mysql Hospital Managemen」· JSP 代码 · 共 485 行 · 第 1/2 页

JSP
485
字号
<%@ page language="java" import="java.sql.*,java.util.*" %>
<%! 
         Connection con=null;
		 int  output_id=0;
		 int medicine_id=0;
		 int medicine_number=0;
		 int outputer_id=0;
		 float medicine_price=0;
		 java.sql.Date output_date=null;
		  Calendar rightNow = null;
		    java.util.Date now=null;
		 float total_price=0;
 %>
 <% 
      try{
	       medicine_id=Integer.parseInt(request.getParameter("medicine_id")); 
		   output_id=Integer.parseInt(request.getParameter("output_id"));
		   medicine_number=Integer.parseInt(request.getParameter("medicine_number"));
		   outputer_id=Integer.parseInt(request.getParameter("outputer_id"));
		   
		   Class.forName("com.mysql.jdbc.Driver");		  
		   con=DriverManager.getConnection("jdbc:mysql:///lenovo_db?user=root&password=amethyst&useUnicode=true&characterEncoding=gb2312");	
		   Statement st=con.createStatement();		
		   ResultSet rs=st.executeQuery("select * from medicine where Medicine_id="+medicine_id);
		   rs.next();
		   medicine_price=rs.getFloat(6);
		   rs.close();
		   st.close();
		   total_price=medicine_number*medicine_price;		   
		   	   
		   PreparedStatement ps=con.prepareStatement("insert into output values(?,?,?,?,?,?)");		
		   
		    rightNow = Calendar.getInstance();
		   now=rightNow.getTime();			
		   output_date=new java.sql.Date(now.getTime());
		   ps.setInt(1,output_id);
		   ps.setInt(2,medicine_id);
		   ps.setInt(3,medicine_number);
		   ps.setInt(4,outputer_id);
		   ps.setDate(5,output_date);
		   ps.setFloat(6,total_price);
		  
		   ps.executeUpdate();
		   ps.close();
		   out.print("this is aple");
%>
<% 
         }
  catch(Exception ex)
     {	
	 
   System.out.println(ex);
      }

 %>		     
<HTML>
<HEAD>
<TITLE>Hospital Management System</TITLE>
<!--CharSet-->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<link rel="stylesheet" href="images/CSS.CSS" type="text/css">
<style type="text/css">
<!--
.STYLE1 {font-size: 18px}
.STYLE2 {font-size: 12px}
-->
</style>
<SCRIPT  LANGUAGE=javascript type="text/javascript">
<!--

function window_onload() {
<!--Page.OnLoad-->
}

//-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR=#CC9933 leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--Counter-->
<!--Something Here-->
<table width="778" border="0" cellspacing="0" cellpadding="0" align="center" height="203">
  <tr>
    <td colspan="3" height="20"><img src="images/index_top1.gif" width="778" height="20"></td>
  </tr>
  <tr>
    <td height="165" width="50"><img src="images/index_top2.gif" width="50" height="165"></td>
    <td height="165" width="165" background="images/01.gif"><img src="images/index_pic.gif" width="165" height="165"></td>
    <td height="165" width="563" background="images/index_top3.gif" valign="top"><table border="0" cellspacing="0" cellpadding="0" width="563" align="center">
        <tr>
          <td height="25" width="303"><font color="#FFFFFF"><b></b></font>
            <div align="center"><font color="#000000"><b><font size="5">
              <!--Your Company Name-->
              Hospital Management System </font></b></font></div></td>
          <td height="25" width="260">&nbsp;</td>
        </tr>
        <tr>
          <td height="30" width="303"><font color="#FFFFFF"><b></b></font>
            <div align="center"><font size="4" color="#000000">
              <!--Your Company Name.English-->
              By Lenovo Group </font></div></td>
          <td height="30" width="260">&nbsp;</td>
        </tr>
        <tr>
          <td height="30" width="303"><div align="center"></div></td>
          <td height="30" width="260">&nbsp;</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td colspan="3" height="18"><img src="images/index_top4.gif" width="778" height="18"></td>
  </tr>
</table>
<!--横幅条-->
<table width="778" border="0" cellspacing="0" cellpadding="0" align="center" background="images/index_lmbg.gif" height="60">
  <tr>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" height="35">
        <tr>
          <td width="9%"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="35" background="images/index_lm.gif">
              <tr>
                <td width="100%"><div align="center"><b><a href="index.html">index</a></b> </div></td>
              </tr>
            </table></td>
          <!--Button1.Content.Begin-->
          <td width="13%"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="35" background="images/index_lm.gif">
              <tr>
                <td width="100%"><div align="center"><b>
                    <!--Button1.Link-->
                    <a href="#">
                    <!--Button1-->
                    appointment schedule </a></b></div></td>
              </tr>
            </table></td>
          <!--Button1.Content.End-->
          <!--Button2.Content.Begin-->
          <td width="9%"><table width="100%" height="35"  border="0" cellpadding="0" cellspacing="0" background="images/index_lm.gif">
              <tr>
                <td width="100%"><div align="center"><b>
                    <!--Button2.Link-->
                    <a href="#">
                    <!--Button2-->
                    ADT</a></b></div></td>
              </tr>
            </table></td>
          <!--Button2.Content.End-->
          <!--Button3.Content.Begin-->
          <td width="10%"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="35" background="images/index_lm.gif">
              <tr>
                <td width="100%"><div align="center"><b>
                    <!--Button3.Link-->
                    <a href="#">
                    <!--Button3-->
                    bed mangement </a></b></div></td>
              </tr>
            </table></td>
          <!--Button3.Content.End-->
          <!--Button4.Content.Begin-->
          <td width="12%"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="35" background="images/index_lm.gif">
              <tr>
                <td width="100%"><div align="center"><b>
                    <!--Button4.Link-->
                    <a href="#">
                    <!--Button4-->
                    doctor workstation </a></b></div></td>
              </tr>
            </table></td>
          <!--Button4.Content.End-->
          <!--Button5.Content.Begin-->
          <td width="8%"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="35" background="images/index_lm.gif">
              <tr>
                <td width="100%"><div align="center"><b>
                    <!--Button5.Link-->
                    <a href="#">
                    <!--Button5-->
                    LIS</a></b></div></td>
              </tr>
            </table></td>
          <!--Button5.Content.End-->
          <!--Button6.Content.Begin-->
          <td width="8%"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="35" background="images/index_lm.gif">
              <tr>
                <td width="100%"><div align="center"><b>
                    <!--Button6.Link-->
                    <a href="#">
                    <!--Button6-->
                    EMS</a></b></div></td>
              </tr>
            </table></td>
          <!--Button6.Content.End-->
          <!--Button7.Content.Begin-->
          <td width="12%"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="35" background="images/index_lm.gif">
              <tr>
                <td width="100%"><div align="center"><b>
                    <!--Button7.Link-->
                    <a href="#">
                    <!--Button7-->
                    pharmacy management </a></b></div></td>
              </tr>
            </table></td>
          <!--Button7.Content.End-->
          <!--Button8.Content.Begin-->
          <td width="12%"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="35" background="images/index_lm.gif">
              <tr>
                <td width="100%"><div align="center"><b>
                    <!--Button8.Link-->
                    <a href="#">
                    <!--Button8-->
                    finance management </a></b></div></td>
              </tr>
            </table></td>
          <!--Button8.Content.End-->
          <!--Button9.Content.Begin-->
          <td width="9%"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="35" background="images/index_lm.gif">
              <tr>
                <td width="100%"><div align="center"><b>
                    <!--Button9.Link-->
                    <a href="#">
                    <!--Button9-->
                    LSS</a></b></div></td>
              </tr>
            </table></td>
          <!--Button9.Content.End-->
          <!--Button10.Content.Begin-->
          <td width="9%"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="35" background="images/index_lm.gif">
              <tr>
                <td width="100%"><div align="center"><b>
                    <!--Button10.Link-->
                    <a href="#">
                    <!--Button10-->
                    SMS</a></b></div></td>
              </tr>
            </table></td>
          <!--Button10.Content.End-->
        </tr>
      </table></td>
  </tr>
</table>
<!--横幅条-->
<!--内容-->
<table width="778" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#E4EDFB">
  <tr>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td></td>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?