the code of login module:
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>personal information management system</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<%
request.setCharacterEncoding("GBK") ;
%>
<link rel="stylesheet" href="css/login.css" type="text/css" />
</head>
<body background="images\20101127309.jpg">
<marquee height="100"></marquee><br />
<div align="center" >
<br/><br/><br/><br/>
<jsp:useBean id="login" scope="request" class="benben.check"/>
<div align="center" >
<br/>
<br/>
<center><h1>welcome!!!</h1>
<form action = "check.jsp" method = "post" name = "form1 ">
<table width="250" border="0">
<tbody><tr>
<td>ID:</td>
<td><input type = "text" name = "userId" id="userId"side="15"maxlength="15"></td></tr>
<tr>
<td>Password:</td>
<td><input type = "password" name = "password" id = "password"side="15"maxlength="15"></td></tr>
<tr>
<td> </td>
<td><input type = "submit" value = "OK" >
<input type="reset" value="Cancel">
<input type="button" value="Registered" onClick="window.open('zhuce.jsp')"><br></td></tr>
</tbody></table>
</form>
(input ID and password in 6~15 digits)
</center>
<div class="div1"><table border="0" width="250px">
<tr>
<td height="23px"><%=login.getErrorMsg("erruserId")%></td></tr>
<tr>
<td height="23px"><%=login.getErrorMsg("errpassword")%></td></tr></table></div></div></div>
</body>
</html>
The code of registered module:
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ page import="java.text.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Registered</title>
<link rel="stylesheet" type="text/css" href="../css/base.css">
<script language="javascript" type="text/javascript" src="../js/base.js"></script>
</head>
<body leftmargin="8" topmargin="8">
<!-- 快速转换位置按钮 -->
<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center">
<tr>
<td height="26">
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
</td></tr></table></td></tr></table>
<!-- 内容列表 -->
<form name="form" action="add_user.jsp" method="post">
<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
<tr bgcolor="#E7E7E7">
<td height="24" colspan="10"> Registered </td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%"> ID:</td>
<td align="left"><input type="text" name="userId" />(6~15 digits)</td></tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%">ID:</td>
<td align="left"><input type="text" name="userName" /></td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%">password:</td>
<td align="left"><input type="text" name="password" />(6~15 digits)</td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%">Age:</td>
<td align="left"><input type="text" name="uage" /></td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%">Birth:</td>
<td align="left"><input type="text" name="ubirthday" />(YYYY-MM-DD)</td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%">Phone number:</td>
<td align="left"><input type="text" name="utelephoto" /></td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%">QQ:</td>
<td align="left"><input type="text" name="uqq"/></td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%">Job:</td>
<td align="left"><input type="text" name="ujob"/></td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%">Address:</td>
<td align="left"><input type="text" name="uworkingPlace"/></td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td colspan="2" height="280">
<textarea rows="10" cols="120" name="uremaks"></textarea>
</td></tr>
<tr align="left" bgcolor="#FAFAF1" height="22">
<td colspan="2" >
<input type="submit" value="Save">
<input type="reset" value="Reset">
</td></tr></table></form>
</body>
</html>
The code of morandum module:
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ page import="java.text.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%String userId = null;%>
<%@ include file="../cookie2.html"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>memorandum</title>
<link rel="stylesheet" type="text/css" href="../css/base.css">
<script language="javascript" type="text/javascript" src="../js/base.js"></script>
</head>
<body leftmargin="8" topmargin="8">
<!-- 快速转换位置按钮 -->
<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center">
<tr>
<td height="26">
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<%@ include file="top.jsp"%>
</td></tr></table></td></tr></table>
<!-- 内容列表 -->
<form name="form" action="add_mem.jsp" method="post">
<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
<tr bgcolor="#E7E7E7">
<td height="24" colspan="10"> Add memorandum </td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%"> Time :</td>
<td align="left"><input type="text" name="mtime" value="<%=new SimpleDateFormat("yyyy-M-d HH:mm:ss").format(new Date())%>"/></td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%">Add time:</td>
<td align="left"><input type="text" name="maddtime" value="<%=new SimpleDateFormat("yyyy-M-d HH:mm:ss").format(new Date())%>"/></td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%"> Place :</td>
<td align="left"><input type="text" name="mplace"/></td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td colspan="2" height="280">
<textarea rows="20" cols="120" name="mthings"></textarea>
</td>
</tr>
<tr align="left" bgcolor="#FAFAF1" height="22">
<td colspan="2" >
<input type="submit" class="coolbg"value="Save">
<input type="reset" class="coolbg"value="Reset">
</td></tr></table></form>
</body>
</html>
The code of address book module:
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ page import="java.text.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%String userId = null;%>
<%@ include file="../cookie2.html"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Add address book</title>
<link rel="stylesheet" type="text/css" href="../css/base.css">
<script language="javascript" type="text/javascript" src="../js/base.js"></script>
</head>
<body leftmargin="8" topmargin="8">
<!-- 快速转换位置按钮 -->
<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center">
<tr>
<td height="26">
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<%@ include file="top.jsp"%>
</td></tr></table></td></tr></table>
<!-- 内容列表 -->
<form name="form" action="add_book.jsp" method="post">
<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
<tr bgcolor="#E7E7E7">
<td height="24" colspan="10"> new address book </td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%"> Name :</td>
<td align="left"><input type="text" name="name" /></td>
<td width="20%"> Sex :</td>
<td align="left"><input type="radio" name="sex" value="male"checked="checked"/>male<input type="radio" name="sex" value="female"/>female</td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%"> Relationship :</td>
<td align="left"><input type="text" name="relation"/></td>
<td width="20%">Add time:</td>
<td align="left"><input type="text" name="aaddtime" value="<%=new SimpleDateFormat("yyyy-MM-dd").format(new Date())%>"/>*</td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%"> Phone number :</td>
<td align="left"><input type="text" name="telephone" /></td>
<td width="20%"> Q Q :</td>
<td align="left"><input type="text" name="qq" /></td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%">Birth:</td>
<td align="left"><input type="text" name="birthday" value="<%=new SimpleDateFormat("yyyy-MM-dd").format(new Date())%>"/>*</td>
<td width="20%"> Job :</td>
<td align="left"><input type="text" name="job" /></td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%">Address:</td>
<td align="left"><input type="text" name="workingPlace" /></td>
<td width="20%"> City :</td>
<td align="left"><input type="text" name="city" /></td>
</tr>
<tr align="left" bgcolor="#FAFAF1" height="22">
<td colspan="4" >
<input type="submit" class="coolbg"value="Save">
<input type="reset" class="coolbg"value="Reset">
</td></tr></table></form>
</body>
</html>
The code of daily record module:
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ page import="java.text.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%String userId = null;%>
<%@ include file="../cookie2.html"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Daily Record</title>
<link rel="stylesheet" type="text/css" href="../css/base.css">
<script language="javascript" type="text/javascript" src="../js/base.js"></script>
</head>
<body leftmargin="8" topmargin="8">
<!-- 快速转换位置按钮 -->
<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center">
<tr>
<td height="26">
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<%@ include file="top.jsp"%>
</td></tr></table></td></tr></table>
<!-- 内容列表 -->
<form name="form" action="add_diary.jsp" method="post">
<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
<tr bgcolor="#E7E7E7">
<td height="24" colspan="10"> new daily </td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%">title:</td>
<td align="left"><input type="text" name="atitle" /></td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%"> time :</td>
<td align="left"><input type="text" name="dtime" value="<%=new SimpleDateFormat("yyyy-MM-dd").format(new Date())%>"/></td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td width="20%"> place :</td>
<td align="left"><input type="text" name="dplace"/></td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
<td colspan="2" height="280">
<textarea rows="20" cols="120" name="dthings"></textarea>
</td>
</tr>
<tr align="left" bgcolor="#FAFAF1" height="22">
<td colspan="2" >
<input type="submit" class="coolbg"value="Save">
<input type="reset" class="coolbg"value="Reset">
</td></tr></table></form>
</body>
</html>
The code of financial management module:
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ page import="javax.naming.*,javax.sql.DataSource,java.sql.*;" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%String userId = null;%>
<%@ include file="../cookie2.html"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<link rel="stylesheet" type="text/css" href="../css/base.css">
<script language="javascript" type="text/javascript" src="../js/base.js"></script>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<marquee height="15"></marquee><br />
<%
ResultSet rs = null;
Statement st = null;
Connection con = null;
String sql=null;
int n=0;
int n1=0;
int n2=0;
int income=0;
int outcome=0;
int total=0;
try
{
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/Oracle_DB");
con = ds.getConnection();
sql = "select * from fC where userId = '"+userId+"'";
st = con.createStatement();
rs = st.executeQuery(sql);
while(rs.next()){
n++;
if(rs.getInt("inorout")==1){n1++;income=income+rs.getInt("fmoney");}
else if(rs.getInt("inorout")==-1){n2++;outcome=outcome+rs.getInt("fmoney");}
total=total+rs.getInt("inorout")*rs.getInt("fmoney");
}
}catch(Exception e)
{
e.printStackTrace();
out.print(e.getMessage()+"<br>");
}
finally{
if(rs!=null)
rs.close();
if(st!=null)
st.close();
if(con!=null)
con.close();
}
%>
<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
<tr bgcolor="#E7E7E7">
<td>income/expenditure</td>
<td>number</td>
<td>amount</td>
</tr>
<tr bgcolor="#E7E7E7">
<td>income</td>
<td><%=n1 %></td>
<td><%=income %></td>
</tr>
<tr bgcolor="#E7E7E7">
<td>expenditure</td>
<td><%=n2 %></td>
<td><%=outcome %></td>
</tr>
<tr bgcolor="#E7E7E7">
<td>total</td>
<td><%=n %></td>
<td><%=total %></td>
</tr></table>
</body>
</html>