📄 email.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page language="java" %>
<%@ page import="java.io.*" %>
<jsp:useBean id="JspSel" scope="page" class="myjsp.JspSelect" />
<jsp:useBean id="JspGet" scope="page" class="myjsp.JspGetString" />
<%!
%>
<%
String sJspSel=new String();
String sJspSql=new String();
int int_num=5;
int pages1=0;
int int_max=0;
int sunjilu=0;
//判断类型
sJspSel=request.getParameter("jspClass");
////////////////////////////////////////
//判断是否是查询
if(sJspSel!=null && sJspSel.equals("sel"))
{
//System.out.println("开始查询数据库");
//的到字符串
sJspSql=request.getParameter("jspSql");
//解码
sJspSql=JspGet.SetString(sJspSql);
//out.println(sJspSql);
sJspSql=JspGet.myreplace(sJspSql,"*","%");
session.setAttribute("sSqlsel",sJspSql);
//开始查询
String SqlSel=JspSel.SqlSelect(sJspSql);
sunjilu=JspSel.getRowCount();
//判断是不是政页数
pages1=1;
int_max=sunjilu/int_num;
if(sunjilu%int_num>0)
int_max=int_max+1;
//System.out.println("jsp报告"+sJspSql+"jsp报告");
}
/////////////////////////////////////////////
//判断是否是添加
if(sJspSel!=null && sJspSel.equals("add"))
{
//System.out.println("开始查询数据库");
//获得传递值
String sName=request.getParameter("name");
String sEmail=request.getParameter("email");
String sDanwei=request.getParameter("danwei");
String sLeixing=request.getParameter("leixing");
//将传递值解码
sName=JspGet.SetString(sName);
sEmail=JspGet.SetString(sEmail);
sDanwei=JspGet.SetString(sDanwei);
sLeixing=JspGet.SetString(sLeixing);
///////////////////////////////////////
String SqlSel=JspSel.SqlInsert(sName,sEmail,sDanwei,sLeixing);
out.println(SqlSel);
}
//判断是否是页数
if(sJspSel!=null && sJspSel.equals("page"))
{
String sPage=request.getParameter("page");
String sPages=request.getParameter("pageint");
pages1=java.lang.Integer.parseInt(sPages);
//开始查询
String sSqlect=session.getAttribute("sSqlsel").toString();
//out.println(sSqlect);
String SqlSel=JspSel.SqlSelect(sSqlect);
if(sPage.equals("up"))
{
//确定最大页数
sunjilu=JspSel.getRowCount();
int_max=sunjilu/int_num;
if(sunjilu%int_num>0)
int_max=int_max+1;
pages1=pages1-1;
if(pages1<1)
pages1=1;
}
else if (sPage.equals("down"))
{
//out.print(sPage+pages1);
pages1=pages1+1;
//确定最大页数
sunjilu=JspSel.getRowCount();
int_max=sunjilu/int_num;
//判断是不是政页数
if(sunjilu%int_num>0)
int_max=int_max+1;
if (pages1>int_max)
pages1=int_max;
}
if (pages1==0)
pages1=1;
//out.print(pages1+"当前页数"+sPages);
}
//判断是否是发送邮件
if(sJspSel!=null && sJspSel.equals("send"))
{
//out.println("发送完成");
}
%>
<script language="JavaScript">
<!-- Hide
function clssName()
{
if (form1.sName.value=="姓名")
form1.sName.value="";
if (form1.semail.value=="邮箱地址")
form1.semail.value="";
if (form1.danwei.value=="单位名称")
form1.danwei.value="";
if (form1.leixing.value=="备注(暂无)")
form1.leixing.value="";
}
-->
</script>
<script language="JavaScript">
<!-- Hide
var id2;
var id3;
var id4;
var id5;
var next1//提交标记
var next2//
function test1(id1,ie1,if1,ig1)
{
//获得表格值
var str1=id1.innerText;
var str2=ie1.innerText;
var str3=if1.innerText;
var str4=ig1.innerText;
//alert(str1);
//判断是否选过
if (id2!=null)
{
//将上次选择恢复原色
id2.bgColor="#F7FBF2";
id3.bgColor="#F7FBF2";
id4.bgColor="#F7FBF2";
id5.bgColor="#F7FBF2";
}
//给本次选择上色
id1.bgColor="#008080";
ie1.bgColor="#008080";
if1.bgColor="#008080";
ig1.bgColor="#008080";
//显示当前选择的值
document.form1.sName.value=str1;
document.form1.semail.value=str2;
document.form1.danwei.value=str3;
document.form1.leixing.value=str4;
//为下次去色付值
id2=id1;
id3=ie1;
id4=if1;
id5=ig1;
//alert(form1.a1.value);
}
function clstext()
{
document.form1.sName.value="";
document.form1.semail.value="";
document.form1.danwei.value="";
document.form1.leixing.value="";
next1="no";
}
function xiankan()
{
next1="no";
var subWindow=window.open("email_html/policy.htm","newWindow1");
}
function xiankan1()
{
next1="no";
var subWindow=window.open("jindu.jsp","newWindow2","width=780,height=300,toolbar");
}
function error()
{
next1="no";
}
function false1()
{
next2="yes";
}
function ceshi()
{
if (next1=="no")
{
next1="yes";
return false;
}
else if(next2=="yes")
{
next2="no";
return true;
}
else if(document.form1.sName.value=="" && document.form1.semail.value=="" && document.form1.danwei.value=="" && document.form1.leixing.value=="")
{
alert("文本框都为空值,禁止提交!");
return false;
}
else
return true;
}
-->
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>法律之星邮件发送管理系统</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
</head>
<body topmargin="0">
<div align="center"><center>
<table border="0" cellpadding="0" cellspacing="0" width="776">
<tr>
<td height="50" bgcolor="#B9D095"><p align="center"><img src="imags/emailbn.jpg" width="500"
height="40" alt="emailbn.jpg (21636 字节)"></td>
</tr>
<tr>
<td height="1" bgcolor="#804040"></td>
</tr>
<tr>
<td height="14"></td>
</tr>
<tr>
<form method="POST" action="SubAll.jsp" name="form1" onSubmit="return ceshi()">
<td><p align="center"><input name="B10" type="submit" value="查询用户"
style="background-color: rgb(135,162,216); color: rgb(255,255,255)"> <input
name="B10" type="submit" value="添加用户"
style="background-color: rgb(135,162,216); color: rgb(255,255,255)"> <input
name="B10" type="submit" value="保存修改"
style="background-color: rgb(135,162,216); color: rgb(255,255,255)" onClick="error()"> <input
name="B10" type="submit" value="删除用户"
style="background-color: rgb(135,162,216); color: rgb(255,255,255)" onClick="error()"> <input
name="B10" type="submit" value="清空重添" onClick="clstext()"
style="background-color: rgb(135,162,216); color: rgb(255,255,255)"> <input
name="B10" type="submit" value="失败记录"
style="background-color: rgb(135,162,216); color: rgb(255,255,255)" onClick="false1()">
<input name="B10" type="submit" value="进度"
style="background-color: rgb(185,208,149); color: rgb(255,255,255)" onClick="xiankan1()"> <input
name="B10" type="submit" value="预览"
style="background-color: rgb(185,208,149); color: rgb(255,255,255)" onClick="xiankan()"> <input
name="B10" type="submit" value="发送"
style="background-color: rgb(185,208,149); color: rgb(255,255,255)" onClick="false1()"></td>
</tr>
<tr>
<td height="14"></td>
</tr>
<tr>
<td height="1" background="line_grey.gif"></td>
</tr>
<tr>
<td bgcolor="#DFEFCB" height="60" valign="middle"><p align="center">
<input name="sName" size="8" type="text" onClick="clssName()"><SCRIPT language=javascript>document.form1.sName.value="姓名";</SCRIPT>
<input name="semail" size="20" type="text" onClick="clssName()"><SCRIPT language=javascript>document.form1.semail.value="邮箱地址";</SCRIPT>
<input name="danwei" size="30" type="text" onClick="clssName()"><SCRIPT language=javascript>document.form1.danwei.value="单位名称";</SCRIPT>
<input name="leixing" size="30" type="text" onClick="clssName()"><SCRIPT language=javascript>document.form1.leixing.value="备注(暂无)";</SCRIPT></td>
</tr>
</form>
<tr>
<td bgcolor="#F7FBF2" valign="top" background="line_grey.gif" height="1"></td>
</tr>
<tr>
<td bgcolor="#F7FBF2" valign="top" height="8"></td>
</tr>
<tr>
<td bgcolor="#F7FBF2" valign="top" height="42"><div align="center"><center><table
border="1" cellpadding="0" cellspacing="0" width="740" bordercolorlight="#B9D095"
bordercolordark="#F7FBF2">
<%
if(((sJspSel!=null && sJspSel.equals("sel")) || (sJspSel!=null && sJspSel.equals("page"))) && sunjilu>0)
{
int iCount=JspSel.getRowCount();
//out.println(iCount);
//当前页的起始记录号
int test1=(pages1-1)*int_num;
//当前页的终止记录号
int test2=int_num*pages1;
int test3=0;
if (test2>sunjilu)
test3=sunjilu;
else
test3=test2;
for(int i=test1;i<test3;i++)
{
%>
<tr>
<td width="71" onClick="test1(a<%=i%>,d<%=i%>,c<%=i%>,e<%=i%>)" id="a<%=i%>"><%
Object ObjGeL1=JspSel.getValueAt(i,1);
if(ObjGeL1!=null && !ObjGeL1.equals(""))
{
String sObjName=ObjGeL1.toString();
out.print(sObjName);
}
%></td>
<td width="149" onClick="test1(a<%=i%>,d<%=i%>,c<%=i%>,e<%=i%>)" id="d<%=i%>"><%
Object ObjGeL2=JspSel.getValueAt(i,2);
if(ObjGeL2!=null && !ObjGeL2.equals(""))
{
String sObjEmail=ObjGeL2.toString();
out.print(sObjEmail);
}
%></td>
<td width="215" onClick="test1(a<%=i%>,d<%=i%>,c<%=i%>,e<%=i%>)" id="c<%=i%>"><%
Object ObjGeL3=JspSel.getValueAt(i,3);
if(ObjGeL3!=null && !ObjGeL3.equals(""))
{
String sObjdanwei=ObjGeL3.toString();
out.print(sObjdanwei);
}
%></td>
<td width="215" onClick="test1(a<%=i%>,d<%=i%>,c<%=i%>,e<%=i%>)" id="e<%=i%>"><%
Object ObjGeL4=JspSel.getValueAt(i,4);
if(ObjGeL4!=null && !ObjGeL4.equals(""))
{
String sObjleixing=ObjGeL4.toString();
out.print(sObjleixing);
}
%></td>
</tr>
<%}}%>
</table>
</center></div></td>
</tr>
<tr>
<td></td>
</tr>
</table>
</center></div>
<%if(int_max>0)
{%>
<A href="email.jsp?page=up&jspClass=page&pageint=<%=pages1%>"><%}%>上一页<%if(int_max>0)
{%></A> <A href="email.jsp?page=down&jspClass=page&pageint=<%=pages1%>"><%}%>下一页<%if(int_max>0)
{%></A><%}%> 当前第<%=pages1%>页 共<%=int_max%>页
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -