📄 view_daily_sales_report.jsp
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Daily Sales Report Page</title>
</head>
<body bgcolor="#C0C0C0" topmargin="0" background="http:\\localhost:8000\music\Background.bmp" >
<table border="0" width="100%">
<tr>
<td width="100%">
<table border="0" width="97%" height="19">
<tr>
<td width="18%" height="13" valign="middle" align="right">
<font face="Arial" size="5" color="#800000"><b><i>eMusicWorld-----> The World of Music</i></b></font>
</td>
</tr>
</table>
</td>
</tr>
</table>
<form method="get" action="http://localhost:8000/music/admin_home_page.htm">
<table border="0" width="100%">
<tr>
<td width="100%"><table border="0" width="100%" height="19">
<tr>
<td width="9%" height="13" valign="middle" align="center"><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/home_page.htm">Home</a></b></font></td>
<td width="10%" height="13" valign="middle" align="center"></td>
<td width="19%" height="13" valign="middle" align="center"></td>
<td width="13%" height="13" valign="middle" align="center"></td>
<td width="13%" height="13" valign="middle" align="center"></td>
<td width="11%" height="13" valign="middle" align="center"></td>
<td width="10%" height="13" valign="middle" align="center"></td>
<td width="9%" height="13" valign="middle" align="center"><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/logout_page.jsp">Logout</b></font></td>
<td width="9%" height="13" valign="middle" align="center"><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/admin_home_page_old.htm">Help</a></b></font></td>
</tr>
</table>
</td>
</tr>
</table>
<table border="1" width="100%" height="353">
<tr>
<td width="15%" height="347" valign="top">
<p><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/admin_del_user.jsp">Delete User</a></b></font></p>
<p><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/ItemContext/ItemAlias">Add Item</a></b></font></p>
<p><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/admin_mod_item.jsp">Modify Item</a></b></font></p>
<p><font face="Arial" size="2" color="#800000"><b>Sales Reports<br>---<a HREF="http://localhost:8000/music/daily_sales_report.jsp">Choose a Date</a><br>---<a HREF="http://localhost:8000/music/weekly_sales_report.jsp">Previous
Week</a><br>---<a HREF="http://localhost:8000/music/monthly_sales_report.jsp">Previous Month</a></b></font></p>
<p><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/admin_wishlist.jsp">View Wishlist</a></b></font></p>
<p><font face="Arial" size="2" color="#800000"><b><a HREF="http://localhost:8000/music/admin_messages.jsp">View Messages</a></b></font></p>
</td>
<td width="85%" height="347" valign="top">
<p align="center"><b><u><font face="Arial" color="#800000" size="2">Sales Report</font></u></b></p>
<%
String date;
date=request.getParameter("date");
%>
<p align="left"><b><u><font face="Arial" color="#800000" size="2">Sales Report for the Date:</u> <%=date%></font></b></p>
<table border="1" width="100%">
<tr>
<td width="20%"><font face="Arial" size="2" color="#800000"><b>Buyer</b></font></td>
<td width="15%"><font face="Arial" size="2" color="#800000"><b>Item Code</b></font></td>
<td width="20%"><font face="Arial" size="2" color="#800000"><b>Item Desc</b></font></td>
<td width="10%"><font face="Arial" size="2" color="#800000"><b>Quantity</b></font></td>
<td width="15%"><font face="Arial" size="2" color="#800000"><b>Price($)</b></font></td>
<td width="15%"><font face="Arial" size="2" color="#800000"><b>Total($)</b></font></td>
</tr>
<%! float totalsale;%>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.text.*" %>
<%@ page import="java.sql.Date" %>
<%@ page language = "java" %>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection connect;
connect=DriverManager.getConnection("jdbc:odbc:RegisterDataSource","wasiqr","bhalbabatu");
Statement state;
state = connect.createStatement();
String saledate;
saledate=request.getParameter("date");
String strQuery1 = "select Sales_master.*, Item_Master.Item_Desc from Sales_Master, Item_Master where Sale_date='" + saledate + "' and Item_Master.Item_Code=Sales_master.Item_code";
ResultSet result = state.executeQuery(strQuery1);
String username, itemcode, itemdesc;
int quantity;
float rate;
totalsale=0;
while(result.next())
{
itemcode=result.getString("Item_code");
quantity=result.getInt("Sale_qty");
rate=result.getFloat("Rate");
username=result.getString("User_name");
itemdesc=result.getString("Item_Desc");
totalsale=totalsale+(rate*quantity);
out.println("<tr>");
out.println("<td width=\"20%\"><font face=\"Arial\" size=\"2\" color=\"#800000\">" + username + "</font></td>");
out.println("<td width=\"20%\"><font face=\"Arial\" size=\"2\" color=\"#800000\">" + itemcode + "</font></td>");
out.println("<td width=\"20%\"><font face=\"Arial\" size=\"2\" color=\"#800000\">" + itemdesc+ "</font></td>");
out.println("<td width=\"20%\"><font face=\"Arial\" size=\"2\" color=\"#800000\">" + quantity+ "</font></td>");
out.println("<td width=\"20%\"><font face=\"Arial\" size=\"2\" color=\"#800000\">" + rate+ "</font></td>");
out.println("<td width=\"20%\"><font face=\"Arial\" size=\"2\" color=\"#800000\">" + rate*quantity+ "</font></td>");
out.println("</tr>");
}
connect.close();
}
catch(Exception e)
{
out.println("Exception: " + e + " occured.");
}
%>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td><font face="Arial" size="2" color="#800000"><b>Total Sale($)</b></font></td>
<td><font face="Arial" size="2" color="#800000"><b><%=totalsale%></b></font></td>
</tr>
</table>
</p>
<table border="0" width="100%">
<tr>
<td width="50%" valign="middle" align="right">
<input type="submit" value="OK" name="ok"></td>
<td width="50%" valign="middle" align="right"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -