📄 doctorsearch_jsp.java
字号:
package org.apache.jsp.patient;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import java.util.Vector;
import com.hospital.web.psearch;
public final class doctorsearch_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
String use=(String)session.getAttribute("username");
if ( use == null || use.equals("") ){
response.sendRedirect("login.jsp");
}
out.write('\r');
out.write('\n');
com.hospital.util.DBConnection link = null;
synchronized (session) {
link = (com.hospital.util.DBConnection) _jspx_page_context.getAttribute("link", PageContext.SESSION_SCOPE);
if (link == null){
link = new com.hospital.util.DBConnection();
_jspx_page_context.setAttribute("link", link, PageContext.SESSION_SCOPE);
}
}
out.write('\r');
out.write('\n');
com.hospital.web.psearch ps = null;
synchronized (_jspx_page_context) {
ps = (com.hospital.web.psearch) _jspx_page_context.getAttribute("ps", PageContext.PAGE_SCOPE);
if (ps == null){
ps = new com.hospital.web.psearch();
_jspx_page_context.setAttribute("ps", ps, PageContext.PAGE_SCOPE);
}
}
out.write("\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<title>患者页面</title>\r\n");
out.write("ID号:");
out.print(use);
out.write("\r\n");
out.write("\r\n");
out.write("<script language=javascript>\r\n");
out.write("function checkform1(){\r\n");
out.write("\tif(document.form1.name1.value==0&&document.form1.section.value==0&&document.form1.level.value==0&&document.form1.sp.value==0)\r\n");
out.write("\t{\r\n");
out.write("\talert(\"您没有选择查询方式!\");\r\n");
out.write("\treturn false;\r\n");
out.write("\t}\r\n");
out.write("\telse if(document.form1.name1.value!=0&&document.form1.name2.value==\"\"){\r\n");
out.write("\talert(\"请填写查询姓名\");\r\n");
out.write("\treturn false;\r\n");
out.write("\t}\r\n");
out.write("\treturn true;\r\n");
out.write("}\r\n");
out.write("function openScript(url,name, width, height){\r\n");
out.write("\tvar Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );\r\n");
out.write("}\r\n");
out.write("</script>\r\n");
out.write("</head>\r\n");
out.write("<body >\r\n");
out.write(" <td align=\"left\" width=\"23%\" valign=\"center\"> \r\n");
out.write(" <table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\r\n");
out.write(" <tr> \r\n");
out.write(" <td> </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td align=\"left\"><a href=\"main.jsp\">回病人首页</a></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr> \r\n");
out.write(" <td align=\"left\"><a href=\"updateinfo.jsp\">修改个人信息</a></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr> \r\n");
out.write(" <td align=\"left\"><a href=\"doctorsearch.jsp\">医生预约查询</a></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr> \r\n");
out.write(" <td align=\"left\"><a href=\"app_cancel.jsp\">患者预约信息</a></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr> \r\n");
out.write(" <td align=\"left\"><a href=\"logout.jsp\">退出</a></td>\r\n");
out.write(" </tr>\r\n");
out.write(" </table>\r\n");
out.write(" </td>\r\n");
out.write("<table align=center>\r\n");
out.write(" <form action=\"doctorsearch.jsp\" method=\"post\" name=\"form1\" align=center>\r\n");
out.write("\t\t姓名:\r\n");
out.write("\t\t<select name=\"name1\">\r\n");
out.write(" <option value=0 selected>\r\n");
out.write(" <option value=1 >姓氏\r\n");
out.write(" <option value=2 >全名\r\n");
out.write("\t\t</select>\r\n");
out.write("\t\t<input type=\"text\" name=\"name2\" size=5>  \r\n");
out.write("\t\t科室:\r\n");
out.write("\t\t");
Connection conn_s = null;
Statement stmt_s = null;
ResultSet rs_s = null;
String sqlStr_s = "";
conn_s = link.getConnection();
stmt_s = conn_s.createStatement();
sqlStr_s="select * from section";
rs_s = stmt_s.executeQuery(sqlStr_s);
out.write("\r\n");
out.write("\t\t<select name=\"section\">\r\n");
out.write("\t\t<option value=0 selected>\r\n");
out.write("\t\t");
while(rs_s.next()){
out.write("\r\n");
out.write("\t\t<option value=");
out.print(rs_s.getString("name"));
out.write('>');
out.print(rs_s.getString("name"));
out.write("\r\n");
out.write("\t\t");
;}
out.write("\r\n");
out.write("\t\t</select>  \r\n");
out.write("\t\t职称:\r\n");
out.write("\t\t");
Connection conn_l = null;
Statement stmt_l = null;
ResultSet rs_l = null;
String sqlStr_l = "";
conn_l = link.getConnection();
stmt_l = conn_l.createStatement();
sqlStr_l="select * from level";
rs_l = stmt_l.executeQuery(sqlStr_l);
out.write("\r\n");
out.write("\t\t<select name=\"level\">\r\n");
out.write("\t\t<option value=0 selected>\r\n");
out.write("\t\t");
while(rs_l.next()){
out.write("\r\n");
out.write("\t\t<option value=");
out.print(rs_l.getString("lname"));
out.write('>');
out.print(rs_l.getString("lname"));
out.write("\r\n");
out.write("\t\t");
;}
out.write("\r\n");
out.write("\t\t</select>  \r\n");
out.write("\t\t<select name=\"sp\">\r\n");
out.write(" <option value=0 selected>\r\n");
out.write(" <option value=2 >是\r\n");
out.write(" <option value=1 >不是\r\n");
out.write("\t\t</select>专家号\r\n");
out.write("\r\n");
out.write("\t\t <input type=\"submit\" name=\"submit1\" value=\"查询\" onclick=\"javascript:return(checkform1());\">\r\n");
out.write("\t\t <input type=\"reset\" name=\"reset1\" value=\"重置\"><br>\r\n");
out.write("</form>\r\n");
out.write("</table>\r\n");
out.write(" <table width=\"40%\" border=\"1\" cellspacing=\"1\" cellpadding=\"1\" align=center>\r\n");
out.write(" <tr align=\"center\"> \r\n");
out.write(" <td>Doctor ID</td>\r\n");
out.write(" <td>姓名</td>\r\n");
out.write(" <td>性别</td>\r\n");
out.write(" <td>科室</td>\r\n");
out.write("\t\t\t<td>职称</td>\r\n");
out.write("\t\t\t<td>是否为专家号</td>\r\n");
out.write("\t\t\t<td>操作</td>\r\n");
out.write(" </tr>\r\n");
String mesf="";
String str1="";
String str2="";
int j=0;
String name2="";
int name1=0;
String section="";
String level="";
int sp=0;
if(request.getParameter("submit1")!=null){
name1=Integer.parseInt(request.getParameter("name1"));
name2=ps.unicodeGbk(request.getParameter("name2"));
section=ps.unicodeGbk(request.getParameter("section"));
level=ps.unicodeGbk(request.getParameter("level"));
sp=Integer.parseInt(request.getParameter("sp"));
ps.setIc(use);
out.write('3');
mesf=ps.doctorsearch(name1,name2,section,level,sp);
if(mesf==""){
out.write('1');
for(j=0;j<ps.getSearchlist_2().size();j++){
psearch dlist=(psearch)ps.getSearchlist_2().elementAt(j);
if(dlist.getSpa()==1)
str1="是";
else
str1="否";
out.write("\r\n");
out.write("2\r\n");
out.write(" \t <tr>\r\n");
out.write(" <td align=center>");
out.print(dlist.getDid());
out.write("</td>\r\n");
out.write(" <td align=center>");
out.print(dlist.getName());
out.write("</td>\r\n");
out.write(" <td align=center>");
out.print(dlist.getSex());
out.write("</td>\r\n");
out.write(" <td align=center>");
out.print(dlist.getSection());
out.write("</td>\r\n");
out.write(" <td align=center>");
out.print(dlist.getLevel());
out.write("</td>\r\n");
out.write(" <td align=center>");
out.print(str1);
out.write("</td>\r\n");
out.write(" <td align=center><a href=\"#\" onclick=\"openScript('showdoctorapp.jsp','showdoctorapp',450,500)\">预约信息</a>\r\n");
out.write(" </tr>\r\n");
out.write(" \t");
}
}
}
out.write("\r\n");
out.write("</table>\r\n");
out.write(" ");
out.print(mesf);
out.write("\r\n");
out.write("</body>\r\n");
out.write("</html>");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -