📄 indextest.jsp
字号:
<%@ page import="java.util.*,
java.sql.*,
java.lang.*,
java.* ,
javax.servlet.http.*,
com.everstar.util.*"
%>
<jsp:usebean id="dbConn" scope="request" class="com.everstar.database.Database"/>
<jsp:include page="header.jsp" flush="true"/>
<html>
<head>
<title>欢迎进入长星国际软件公司主页</title>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<style type="text/css">
<!--
A { text-decoration: none; }
A:hover { color:#FF3300; }
.normal { text-decoration: underline; color:#0033cc; }
.subject { font-family: verdana; }
.subjectOn { font-family: verdana; font-weight: bold; }
.username { font-family: verdana; color: #000000; }
.usernameOn { font-family: verdana; color: #000000; font-weight: bold; }
.datetime { font-family: verdana; color: #333333; }
.datetimeOn { font-family: verdana; color: #333333; font-weight: bold; }
.dateTimeList { font-family: verdana; color: #666666; text-align: center; }
.dateTimeListToday { font-family: verdana; color: #ff6600; text-align: center; }
.breadcrumbBox { font-family: verdana;
font-size: 9pt;
color: #0033cc;
font-weight: bold;
}
.messageNav { font-size: 7pt;
font-family: verdana;
}
.messageNavButton { font-size: 8pt;
font-family: verdana;
}
-->
</style>
</HEAD>
<BODY bgColor=#CCCCFF leftMargin=0 text=#000000 topMargin=0 MARGINWIDTH="0" MARGINHEIGHT="0">
<basefont face="Times New Roman,Verdana, Arial, Helvetica">
<div align=center>
<table border=0 cellpadding=0 cellspacing=0 width=726>
<tbody>
<tr>
<td width=207 valign="top">
<div align="center">
<p><br>
<img src="images/back_blue.gif" width="181" height="26"> </p>
<table border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<input name="doLogin" type="hidden" value="yes">
<td align="right"><i><font size="-1">username:</font></i></td>
<td>
<input name="username" size="13">
</td>
</tr>
<tr>
<td align="right"><i><font size="-1">password:</font></i></td>
<td>
<input name="password" type="password" value size="13">
</td>
</tr>
<tr>
<td align="right" colspan="2">
<p align="center">
<input type="submit" value="Login" name="submit">
</p>
</td>
</tr>
</tbody>
</table>
<p> </p>
</div>
<%
com.everstar.database.Database dbConn=new com.everstar.database.Database();
int themeNo = 1;
String showThemeNo = "";
String tempStr1 = "";
String tempStr2 = "";
String outputStr = "nothing";
ResultSet rs = null;
String sqlStr = "select THEMENO,THEMETITLE,THEMEDETAIL from THEMEINFO where STATUS=1";
if (dbConn.count(sqlStr)==0)
{
response.sendRedirect("../Error.jsp?message=POLL_ERROR_NOPOLL");
}
else
try
{
rs = dbConn.select(sqlStr);
if(rs.next())
{
themeNo = rs.getInt(1);
tempStr1 = rs.getString(2);
tempStr2 = rs.getString(3);
}
rs.close();
dbConn.close();
}
catch(SQLException ex)
{
response.sendRedirect("../Error.jsp?message=POLL_ERROR_NOPOLL");
}
%>
<p>
<script language=javascript>
function sumCount()
{
document.showForm.answerCount.value=document.showForm.answerGroup.length;
document.showForm.answer1Count.value="uncheck";
document.showForm.answer2Count.value="uncheck";
document.showForm.answer3Count.value="uncheck";
document.showForm.answer4Count.value="uncheck";
if (document.showForm.answerGroup[0].checked==true)
{
document.showForm.answer1Count.value="check";
}
if (document.showForm.answerGroup[1].checked==true)
{
document.showForm.answer2Count.value="check";
}
if (document.showForm.answerGroup.length==4)
{
if (document.showForm.answerGroup[2].checked==true)
{
document.showForm.answer3Count.value="check";
}
if (document.showForm.answerGroup[3].checked==true)
{
document.showForm.answer4Count.value="check";
}
}
if (document.showForm.answerGroup.length==3)
{
if (document.showForm.answerGroup[2].checked==true)
{
document.showForm.answer3Count.value="check";
}
}
if((document.showForm.answer1Count.value=="uncheck")&&(document.showForm.answer2Count.value=="uncheck")
&&(document.showForm.answer3Count.value=="uncheck")&&(document.showForm.answer4Count.value=="uncheck"))
{
alert("Please select opinion!");
return false;
}
return true;
}
</script>
</p>
<p> </p>
<form method="POST" action="./pollResult.jsp" name="showForm" onSubmit="return sumCount()">
<table width ="69%" align =center>
<tr>
<td ><font style="FONT-FAMILY: ; FONT-SIZE: 10pt"> <b><%=tempStr1%></b></font></td>
</tr>
</table>
<table width ="67%" align =center>
<tr>
<td ><%=tempStr2%></td>
</tr>
</table>
<hr>
<%
try{
showThemeNo = "<input type=hidden name=themeNo value="+themeNo+">";
String sql = "select OPINTEXT from THEMEOPINION where THEMENO="+themeNo;
ResultSet rs2 = dbConn.select(sql);
rs2.next();
String tempOpinText;
tempOpinText = rs2.getString(1);
outputStr = "<TR><td><input type=radio name=answerGroup>"+tempOpinText+"</td></TR>";
rs2.next();
tempOpinText = rs2.getString(1);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -