all.jsp

<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

<html>
<head>
<meta name="decorator" content="default"/>
<script type="text/javascript">
$(document).ready(function() {
//任务类型二级联动
   $("#select1").change(function(){
    var pro=$("#select1").val();
    $.ajax({
        type: "POST",
        url: "${ctx}/cs/select5",
        data: { //发送给数据库的数据
            idKey:pro
            },
        dataType: 'json',
        success: function(data) {
        // var v = $('#select2').html();
         $("#select2").empty();
           //  $("#select2").append(v);
             $.each(data.tasks, function(index,value){
             $("#select2").append("<option value='"+value.taskName+"'>"+value.taskName+"</option>");
              });
            }
  })
    });
});
function editMsg(id,noteSetId){
var oldCount='';//旧记录数
var id = id;
var noteSetId = noteSetId;
var url="${ctx}/cs/visit?id="+id+"&sid="+noteSetId;

$.ajax({
  type:"POST",
dataType:"text",
url:"${ctx}/cs/findCount",
data:{"id":id},
success: function(result){
oldCount=result;
//alert(oldCount);
}
 });

 layer.open({
 type: 2,
 title: "回访",
 closeBtn: 1, //显示关闭按钮
 shade: 0.3,
 area: ['700px', '500px'],
 content:url,
 end:function(){
 $.ajax({
  type:"POST",
dataType:"text",
url:"${ctx}/cs/visitState",
data:{"id":id,"oldCount":oldCount},
success: function(result){
window.location.href="${ctx}/cs/all?id=2";
}
 });
 
 }
  }); 
 
};

function editMsg1(id,noteSetId){
var id = id;
var noteSetId = noteSetId;
var url="${ctx}/cs/visit2?id="+id+"&sid="+noteSetId;
 layer.open({
 type: 2,
 title: "查看",
 closeBtn: 1, //不显示关闭按钮
 shade: 0.3,
 area: ['700px', '450px'],
 content:url,
 end:function(){
 }
  }); 
}

//翻页
function page(n,s){
$("#pageNo").val(n);
$("#pageSize").val(s);
$("#searchForm").submit();
    return false;
   }
</script>
<style>
.table a{margin-right:5px;}
</style>
</head>
<body>
<div class="tab_div z_mt10">
<ul class="ul1">
    <li class="z_ml20"><a href="${ctx}/cs/customerService?id=0"><img class="img1" src="${ctxStatic}/images/tab_p3.png"/>待回访</a></li>
       <li><a href="${ctx}/cs/customerVisited?id=1"><img class="img1" src="${ctxStatic}/images/tab_p9.png"/>已回访</a></li>
       <li><a class="cur" href="${ctx}/cs/all?id=2"><img class="img2" src="${ctxStatic}/images/tab_p11.png"/><img class="img1" src="${ctxStatic}/images/tab_p6.png"/>全部</a></li>
   </ul>
<div class="div1">
<div class="mdiv1">

<form:form id="searchForm" modelAttribute="customerInfo" action="${ctx}/cs/all?id=2" method="post" class="z_mt10">
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<div class="site_bg clx">
<div class="site1 clx z_w85">
<p class="p_text">
<span>任务类型:</span>
<form:select class="inp_120" path="taskType" value="${customerInfo.taskType}" id="select1">
<form:option value="all">请选择</form:option>
<form:option value="1">常规任务</form:option>
<form:option value="2">专项任务</form:option>
</form:select>
</p>
<p class="p_text">
<span>任务名称:</span>
<form:select class="inp_120" path="taskName" value="${customerInfo.taskName}" id="select2">
<form:option value="all">请选择</form:option>

</form:select>
</p>
<p class="p_text">
<span>短信回复状态:</span>
<form:select class="inp_120" path="noteStatus" value="${customerInfo.noteStatus}">
<form:option value="all">请选择</form:option>
<form:option value="1">已回复</form:option>
<form:option value="0">未回复</form:option>
</form:select>
</p>
<p class="p_text">
<span>科室:</span>
<form:select class="inp_120" path="office" value="${customerInfo.office}">
<form:option value="all">请选择</form:option>
<form:option value="心内科">心内科</form:option>
<form:option value="骨科">骨科</form:option>
<form:option value="体检科">体检科</form:option>
  </form:select>
 </p> 
 <p class="p_text">
<span> 医生:</span>
    <form:select class="inp_120" path="doctor" value="${customerInfo.doctor}">
<form:option value="all">请选择</form:option>
<form:option value="张三">张三</form:option>
<form:option value="李四">李四</form:option>
<form:option value="王五">王五</form:option>
  </form:select>
  </p>
 <p class="p_text">
<span>评价:</span>
      <form:select class="inp_120" path="status" value="${customerInfo.status}">
<form:option value="all">请选择</form:option>
<form:option value="1">满意</form:option>
<form:option value="0">非常满意</form:option>
<form:option value="2">不满意</form:option>
<form:option value="3">非常不满意</form:option>
<form:option value="4">其他</form:option>
</form:select>
</p> 
<p class="p_text">
<span>处理状态:</span>
<form:select class="inp_120" path="visitState" value="${customerInfo.visitState}">
<form:option value="all">请选择</form:option>
<form:option value="1">已处理</form:option>
<form:option value="0">未处理</form:option>
</form:select>
</p>
<p class='p_text'>
<span>日期:</span>
<input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="inp_125 Wdate"
value="<fmt:formatDate value="${customerInfo.beginDate}" pattern="yyyy-MM-dd"/>" οnclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>

</p>
</div>
<div class="site2 clx">
<span class="new_btn z_fl">
<input id="btnSubmit" class="s1" type="submit" value="查 询"/>
</span>
</div>
</div>
</form:form>

<table id="contentTable" class="table table-striped table-bordered table-condensed">
<thead><tr><th>序号</th><th>姓名</th><th>性别</th><th>联系人(电话)</th><th>年龄</th><th>科室</th><th>医生</th><th>任务类型</th><th>任务名称</th><th>启动时间</th><th>评价</th><th>处理状态</th><th>短信回复状态</th><th>问卷回复状态</th><shiro:hasPermission name="sys:user:edit"><th>操作</th></shiro:hasPermission></tr></thead>
<tbody>
<c:forEach items="${page.list}" var="i" varStatus="n">
   <tr>
<td>${n.index+1}</td>
  <td>${i.name}</td>
  <td>${i.sex}</td>
  <td>${i.phone}</td>
  <td>${i.age}</td>
  <td>${i.office}</td>
  <td>${i.doctor}</td>
  <td>
  <c:if test="${i.taskType eq '1'}">常规任务</c:if>
  <c:if test="${i.taskType eq '2'}">专项任务</c:if>
  </td>
  <td>${i.taskName}</td>
  <td><fmt:formatDate value="${i.diagnoseDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>  
  <td>
  ${i.status }
  <c:if test="${i.status eq '0'}">非常满意</c:if>
  <c:if test="${i.status eq '1'}">满意</c:if>
  <c:if test="${i.status eq '2'}">不满意</c:if>
  <c:if test="${i.status eq '3'}">非常不满意</c:if>
  <c:if test="${i.status eq '4'}">其他</c:if>
  </td>
  <td>
  <c:if test="${i.visitState eq '0'}">待回访</c:if>
  <c:if test="${i.visitState eq '1'}">已回访</c:if>
  </td>
  <td>
  <c:if test="${i.noteStatus eq '0'}">未回复</c:if>
  <c:if test="${i.noteStatus eq '1'}">已回复</c:if>
  </td>
  <td>
  <c:if test="${i.questStatus eq '0'}">未回复</c:if>
  <c:if test="${i.questStatus eq '1'}">已回复</c:if>
  </td>
<shiro:hasPermission name="sys:user:edit">
<td>
    <c:if test="${i.visitState eq '0'}">
    <a href="javascript:void(0)" οnclick="editMsg('${i.num}','${i.noteSetId}')"><i class='icon-phone'></i>回访</a>
    </c:if>
    <c:if test="${i.visitState eq '1'}">
    <a href="javascript:void(0)" οnclick="editMsg('${i.num}','${i.noteSetId}')"><i class='icon-phone'></i>回访</a>
    </c:if>
    <c:if test="${empty i.visitState}">
    <a href="javascript:void(0)" οnclick="editMsg('${i.num}','${i.noteSetId}')"><i class='icon-phone'></i>回访</a>
    </c:if>
    <c:if test="${i.visitState eq '2'}">
    <a href="javascript:void(0)" οnclick="alert('正在回访中...')"><i class="icon-spinner"></i>回访中...</a>
    </c:if>
<a href="javascript:void(0)" οnclick="editMsg1('${i.num}','${i.noteSetId}')"><i class='icon-search'></i>查看</a>
</td>
</shiro:hasPermission>
</tr>
</c:forEach>
</tbody>
</table>
<div class="pagination">${page}</div>
</div>
    </div>
</div>
</body>
</html>
好的,以下是四个JSP页面的代码。 1. searchStu.jsp 页面: ``` <!DOCTYPE html> <html> <head> <title>Search Students</title> </head> <body> <h1>Search Students</h1> <form action="byNumber.jsp" method="get"> <label>Search by Number:</label> <input type="text" name="number" /> <input type="submit" value="Search" /> </form> <form action="byName.jsp" method="get"> <label>Search by Name:</label> <input type="text" name="name" /> <input type="submit" value="Search" /> </form> </body> </html> ``` 2. byNumber.jsp 页面: ``` <%@ page language="java" %> <%@ page import="java.sql.*" %> <!DOCTYPE html> <html> <head> <title>Search Students by Number</title> </head> <body> <h1>Search Students by Number</h1> <% // Get the number parameter from the request String number = request.getParameter("number"); // Connect to the database Connection conn = null; Class.forName("com.mysql.jdbc.Driver"); String url = "jdbc:mysql://localhost/students"; String username = "root"; String password = "password"; conn = DriverManager.getConnection(url, username, password); // Query the database PreparedStatement stmt = conn.prepareStatement("SELECT * FROM stuinfo WHERE xh = ?"); stmt.setString(1, number); ResultSet rs = stmt.executeQuery(); // Display the results while (rs.next()) { out.println("Number: " + rs.getString("xh") + " Name: " + rs.getString("name")); } // Close the database connection rs.close(); stmt.close(); conn.close(); %> </body> </html> ``` 3. byName.jsp 页面: ``` <%@ page language="java" %> <%@ page import="java.sql.*" %> <!DOCTYPE html> <html> <head> <title>Search Students by Name</title> </head> <body> <h1>Search Students by Name</h1> <% // Get the name parameter from the request String name = request.getParameter("name"); // Connect to the database Connection conn = null; Class.forName("com.mysql.jdbc.Driver"); String url = "jdbc:mysql://localhost/students"; String username = "root"; String password = "password"; conn = DriverManager.getConnection(url, username, password); // Query the database PreparedStatement stmt = conn.prepareStatement("SELECT * FROM stuinfo WHERE name = ?"); stmt.setString(1, name); ResultSet rs = stmt.executeQuery(); // Display the results while (rs.next()) { out.println("Number: " + rs.getString("xh") + " Name: " + rs.getString("name")); } // Close the database connection rs.close(); stmt.close(); conn.close(); %> </body> </html> ``` 4. allStu.jsp 页面: ``` <%@ page language="java" %> <%@ page import="java.sql.*" %> <!DOCTYPE html> <html> <head> <title>All Students</title> </head> <body> <h1>All Students</h1> <% // Connect to the database Connection conn = null; Class.forName("com.mysql.jdbc.Driver"); String url = "jdbc:mysql://localhost/students"; String username = "root"; String password = "password"; conn = DriverManager.getConnection(url, username, password); // Query the database Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM stuinfo"); // Display the results while (rs.next()) { out.println("Number: " + rs.getString("xh") + " Name: " + rs.getString("name")); } // Close the database connection rs.close(); stmt.close(); conn.close(); %> </body> </html> ``` 在浏览器中访问 searchStu.jsp 页面,即可开始查询学生信息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值