⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 look.jsp

📁 数据库课程设利用好的是这个请使用网上调系统
💻 JSP
字号:
<%@ page import="java.sql.*" %> 
<%@ page import="java.io.*" %> 
<%@ page import="java.util.*" %>
 
<%@ page contentType="text/html;charset=GB2312"%>
<%@ include file="conn.jsp"%> 
<%

String research1=new String();
String research2=new String();
String SQL=new String();
research1="版面设计";
research2="网站内容";
SQL="select * from research where id=1";
Statement stmt=con.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,java.sql.ResultSet.CONCUR_READ_ONLY);
ResultSet rs=stmt.executeQuery(SQL);
if(rs.next()){
%>
<html>
<head>
<title>调查结果</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="ie4.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body ,td { font-family: "宋体"; font-size: 9pt; color: #FFE7B3} 
a:link { font-family: "宋体"; font-size: 9pt;color: #FFCC66;text-decoration: none} 
a:visited { font-family: "宋体"; font-size: 9pt; color: #cccccc;text-decoration: none} 
a:hover { font-family: "宋体"; font-size: 9pt; color: #ffffff; text-decoration: underline} 
-->
</style> 
</head>
<body bgcolor="#663300">
<%!float soptiona,soptionb,soptionc,soptiond,soptione,soptionf;%>
<%!int optiona,optionb,optionc,optiond,optione,optionf,total1,total2;%>
<%   
optiona=rs.getInt("optiona");
optionb=rs.getInt("optionb");
optionc=rs.getInt("optionc");
optiond=rs.getInt("optiond");
optione=rs.getInt("optione");
optionf=rs.getInt("optionf");
total1=optiona+optionb+optionc;
total2=optiond+optione+optionf;
if (optiona!=0 || optionb!=0 || optionc!=0){
soptiona=(float)((float)(optiona)/total1)*100;
soptionb=(float)((float)(optionb)/total1)*100;
soptionc=(float)((float)(optionc)/total1)*100;
}
if (optiond!=0 || optione!=0 || optionf!=0){
soptiond=(float)((float)(optiond)/total1)*100;
soptione=(float)((float)(optione)/total1)*100;
soptionf=(float)((float)(optionf)/total1)*100;
}
%>
<table width="500" border="1" cellspacing="1" cellpadding="0" height="150" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF">
  <tr> 
    <td height="20" colspan="5"> 
      <div align="center">△关于<%=research1%>的调查结果△</div>
    </td>
  </tr>
  <tr bgcolor="AB6C00"> 
    <td height="110" rowspan="3" align="center" valign="middle"><img src=images/bar1.gif width=17 height=<%=Math.round(soptiona*0.8)%>>&nbsp;<img src=images/bar2.gif width=17 height=<%=Math.round(soptionb*0.8)%>>&nbsp;<img src=images/bar3.gif width=17 height=<%=Math.round(soptionc*0.8)%>></td>
    <td height="20" width="160"> 
      <div align="center"><font color="#421084">■</font>有进步!</div>
    </td>
    <div align="center">
      <td height="20" width="80"><div align="center"><%=optiona%> 
        人 </div>
      </td></div>
    <td height="20" width="80"> 
      <div align="center">占:<%=Math.round(soptiona*100)/100.00%>%</div>
    </td>
  </tr>
  <tr> 
    <td height="20" width="160" bgcolor="AB6C00"> 
      <div align="center"><font color="#089442">■</font>退步了!</div>
    </td>
    
      <td height="20" bgcolor="AB6C00"><div align="center"><%=optionb%> 
        人 </div>
      </td>
    <td height="20" width="80" bgcolor="AB6C00"> 
      <div align="center">占:<%=Math.round(soptionb*100)/100.00%>%</div>
    </td>
  </tr>
  <tr> 
    <td height="20" width="160" bgcolor="AB6C00"> 
      <div align="center"><font color="#7B104A">■</font>说不清!</div>
    </td>
    
      <td height="20" bgcolor="AB6C00"><div align="center"><%=optionc%> 
        人 </div>
      </td>
    <td height="20" width="80" bgcolor="AB6C00"> 
      <div align="center">占:<%=Math.round(soptionc*100)/100.00%>%</div>
    </td>
  </tr>
  <tr bgcolor="AB6C00"> 
    <td height="20" colspan="5"> 
      <div align="right">共有:<%=total1%>人参加调查 </div>
    </td>
  </tr>
</table>
<p></p>
<hr noshade size="1" width="500">
<br>
<table width="500" border="1" cellspacing="1" cellpadding="0" height="150" align="center" dwcopytype="CopyTableRow" bordercolorlight="#000000" bordercolordark="#FFFFFF">
  <tr> 
    <td height="20" colspan="5"> 
      <div align="center">△关于<%=research2%>的调查结果△ </div>
    </td>
  </tr>
  <tr bgcolor="AB6C00"> 
    <td height="110" rowspan="3" align="center" valign="middle"><img src=images/bar4.gif width=17 height=<%=Math.round(soptiond*0.8)%>>&nbsp;<img src=images/bar5.gif width=17 height=<%=Math.round(soptione*0.8)%>>&nbsp;<img src=images/bar6.gif width=17 height=<%=Math.round(soptionf*0.8)%>></td>
    <td height="20" width="160"> 
      <div align="center"><font color="AD00CD">■</font>有进步!</div>
    </td>
    
      <td height="20" width="80"><div align="center"><%=optiond%> 
        人 </div>
      </td>
    <td height="20" width="80"> 
      <div align="center">占:<%=Math.round(soptiond*100)/100.00%>%</div>
    </td>
  </tr>
  <tr> 
    <td height="20" width="160" bgcolor="AB6C00"> 
      <div align="center"><font color="#EF0000">■</font>退步了!</div>
    </td>
      <td height="20" bgcolor="AB6C00"><div align="center"><%=optione%> 
        人 </div>
      </td>
    <td height="20" width="80" bgcolor="AB6C00"> 
      <div align="center">占:<%=Math.round(soptione*100)/100.00%>%</div>
    </td>
  </tr>
  <tr> 
    <td height="20" width="160" bgcolor="AB6C00"> 
      <div align="center"><font color="#0045FF">■</font>说不清!</div>
    </td>
    
      <td height="20" bgcolor="AB6C00"><div align="center"><%=optionf%> 
        人 </div>
      </td>
    <td height="20" width="80" bgcolor="AB6C00"> 
      <div align="center">占:<%=Math.round(soptionf*100)/100.00%>%</div>
    </td>
  </tr>
  <tr bgcolor="AB6C00"> 
    <td height="20" colspan="5"> 
      <div align="right">共有:<%=total2%>人参加调查 </div>
    </td>
  </tr>
</table>
<p></p>
<hr noshade size="1" width="500">
<%}
else{
 out.print("还没有人参与调查");
}
rs.close();
stmt.close();
con.close();
%> 
<div align="center"><%@ include file="end.jsp"%></div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -