📄 costqueryresult2.jsp
字号:
<%--
模块名称:费用管理
模块功能:律师案件收费统计结果
版 本:V1.0
著 作 人:蔡静
著作日期:2001-11-05
使用说明:
主要技术说明:
参考文献:法律事务设计书
修改历史:
= = = = = = = = = = = = = = = = = = = = = = = = = =
修改日期:
修 改 人:
修改理由:
修改出处:
= = = = = = = = = = = = = = = = = = = = = = = = = =
--%>
<%@ page contentType= "text/html; charset=gb2312" %>
<%@ page language="java" import="java.sql.*" %>
<%@ page import="system.*" %>
<jsp:useBean id="db" class="dbconnection.DbConnection" scope="page" />
<%
String begindate = request.getParameter("begindate2");
String enddate = request.getParameter("enddate2");
if ((begindate == null) || (begindate.equals("")))
begindate = "1900/01/01";
if ((enddate == null) || (enddate.equals("")))
enddate = "2050/01/01";
String employee = request.getParameter("employee");
String employee_name = null;
ResultSet rs1 = null;
String sql = "select a.receive_time, a.charge_sum, ";
sql = sql + "currency_kind=case(a.currency_kind) when 'rmb' then '人民币' when 'mj' then '美金' end,";
sql = sql + "b.case_reason from t_charge a, t_caseinfo b";
sql = sql + " where a.case_id = b.case_id and a.receive_time between '";
sql = sql + begindate + "' and '" + enddate + "'";
if ((employee != null) && (!employee.equals(""))) {
sql = sql + " and b.employee_id = '" + employee + "'";
String sql1 = "select employee_name from t_employee where employee_id = '" + employee + "'";
rs1 = db.executeQuery(sql1);
if (rs1.next())
employee_name = rs1.getString("employee_name");
}
ResultSet rs = db.executeQuery(sql);
sql = "select sum(charge_sum) charge_sum from t_charge a, t_caseinfo b where ";
sql = sql + "a.case_id = b.case_id and a.receive_time between '";
sql = sql + begindate + "' and '" + enddate + "'";
if ((employee != null) && (!employee.equals(""))) {
sql = sql + " and b.employee_id = '" + employee + "'";
}
rs1 = db.executeQuery(sql);
String sum = "";
if (rs1.next())
sum = rs1.getString("charge_sum");
%>
<html>
<head>
<title>律师案件收费统计结果</title>
<%@ include file="../inc/config.jsp" %>
</head>
<body class=page>
<!--显示工具条-->
<table width="98%" align="center" cellspacing="1">
<tr>
<td width="90%"> </td>
<td width="10%" align="right"><img src="../images/back.gif" width="50" height="22" onClick="window.history.back()" style="cursor:hand"></td>
</tr>
</table>
<table width="98%" background="../images/line.gif" border="0" cellspacing="0" cellpadding="0" height="12" align="center">
<tr>
<td> </td>
</tr>
</table>
<!--显示工具条结束-->
<table width="98%" align="center">
<tr>
<td><span class="font1">
<%
if ((employee_name != null) && (!employee_name.equals("")))
out.print(employee_name);
%>
</span>律师 自<span class="font1"><%=begindate%></span>
至 <span class="font1"><%=enddate%></span> 办理案件收费统计</td>
</tr>
</table>
<!--显示内容-->
<table cellspacing="1" cellpadding="0" height="25" align="center" border="0" class="table_bg" width="98%">
<tr class="title_bg">
<td height="25" align="center"> 收费日期</td>
<td align="center"> 金额</td>
<td align="center">币种</td>
<td align="center">案由</td>
</tr>
<%
String receive_time, charge_sum, currency_kind, case_reason;
while (rs.next()) {
receive_time=rs.getString("receive_time");
charge_sum=rs.getString("charge_sum");
currency_kind=rs.getString("currency_kind");
case_reason=rs.getString("case_reason");
if (rs.getRow()!=(rs.getRow()/2*2)) {
%>
<tr class="tr_bg1">
<% }
else {
%>
<tr class="tr_bg2">
<% }
%>
<td height="25" align="center"><%=receive_time.substring(0,10)%></td>
<td align="right">
<%if ((charge_sum != null) && (!charge_sum.equals(""))) {
if ((charge_sum.indexOf(".")) >= 0) {
charge_sum=charge_sum + "00";
charge_sum=charge_sum.substring(0,charge_sum.indexOf(".")+3);
}
out.print("¥"+charge_sum);
}
%>
</td>
<td align="right"><%=currency_kind%></td>
<td align="right">
<%
if (case_reason != null)
out.print(case_reason);
%>
</td>
</tr>
<%}%>
</table>
总计:
<%
if ((sum != null) && (!sum.equals(""))) {
if ((sum.indexOf(".")) >= 0) {
sum = sum + "00";
sum = sum.substring(0,sum.indexOf(".")+3);
}
out.print("¥" + sum);
}
else {
out.print("0");
}
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -