package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class voteresult1_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
String filmname;
int count1 = 0;
int count2 = 0;
int count3 = 0;
int count4 = 0;
int count5= 0;
int count6 = 0;
int tcount;
private static java.util.Vector _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=GBK");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write('\r');
out.write('\n');
out.write('\r');
out.write('\n');
if (application.getAttribute("fcount1") == null)
application.setAttribute("fcount1", new Integer(0));
if (application.getAttribute("fcount2") == null)
application.setAttribute("fcount2", new Integer(0));
if (application.getAttribute("fcount3")== null)
application.setAttribute("fcount3", new Integer(0));
if (application.getAttribute("fcount4") == null)
application.setAttribute("fcount4", new Integer(0));
if (application.getAttribute("fcount5") == null)
application.setAttribute("fcount5", new Integer(0));
if (application.getAttribute("fcount6") == null)
application.setAttribute("fcount6", new Integer(0));
if (application.getAttribute("totalcount")== null)
application.setAttribute("totalcount", new Integer(0));
count1=((Integer) application.getAttribute("fcount1")).intValue();
count2=((Integer) application.getAttribute("fcount2")).intValue();
count3=((Integer) application.getAttribute("fcount3")).intValue();
count4=((Integer) application.getAttribute("fcount4")).intValue();
count5=((Integer) application.getAttribute("fcount5")).intValue();
count6=((Integer) application.getAttribute("fcount6")).intValue();
tcount=((Integer) application.getAttribute("totalcount")).intValue();
System.out.println( "count1=" + count1);
System.out.println( "count2=" + count2);
System.out.println( "count3=" + count3);
System.out.println( "count4=" + count4);
System.out.println( "count5=" + count5);
System.out.println( "count6=" + count6);
request.setCharacterEncoding("GBK");
String filmstr = request.getParameter("radiobutton");
int filmid = new Integer(filmstr).intValue();
System.out.println( "filmid=" + filmid);
switch (filmid) {
case 1:
filmname = "乱世佳人";
count1++;
application.setAttribute("fcount1", new Integer(count1));
break;
case 2:
filmname = "勇敢的心";
count2++;
application.setAttribute("fcount2", new Integer(count2));
break;
case 3:
filmname = "与狼共舞";
count3++;
application.setAttribute("fcount3", new Integer(count3));
break;
case 4:
filmname = "角斗士";
count4++;
application.setAttribute("fcount4", new Integer(count4));
break;
case 5:
filmname = "泰坦尼克号";
count5++;
application.setAttribute("fcount5", new Integer(count5));
break;
case 6:
filmname = "辛德勒的名单";
count6++;
application.setAttribute("fcount6", new Integer(count6));
break;
}
tcount=count1+count2+count3+count4+count5+count6;
application.setAttribute("totalcount", new Integer(tcount));
out.write("\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<title>voteresult1</title>\r\n");
out.write("</head>\r\n");
out.write("<body bgcolor=\"#ffffff\">\r\n");
out.write("<h1>\r\n");
out.write("<p> 您选中的是:\r\n");
out.print(filmname );
out.write("</p>\r\n");
out.write("</h1>\r\n");
out.write("<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td width=\"127\" valign=\"top\">\r\n");
out.write(" <p>选项</p> </td>\r\n");
out.write(" <td width=\"180\" valign=\"top\">\r\n");
out.write(" <p>得票数</p> </td>\r\n");
out.write(" <td width=\"261\" valign=\"top\">\r\n");
out.write(" <p>占比</p> </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td width=\"127\" valign=\"top\">\r\n");
out.write(" <p>乱世佳人</p> </td>\r\n");
out.write(" <td width=\"180\" valign=\"top\">\r\n");
out.write(" <p>");
out.print(count1);
out.write('票');
out.write(',');
out.write('共');
out.print(tcount);
out.write("票</p> </td>\r\n");
out.write(" <td width=\"261\" valign=\"top\">\r\n");
out.write(" <p>");
out.print((int)(((float)count1/(float)tcount)*100));
out.write("% </p>\r\n");
out.write(" <table width=\"");
out.print((int)(((float)count1/(float)tcount)*100));
out.write("%\" border=\"0\" bgcolor=\"orange\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td> </td>\r\n");
out.write(" </tr>\r\n");
out.write(" </table>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td width=\"127\" valign=\"top\">\r\n");
out.write(" <p>勇敢的心</p> </td>\r\n");
out.write(" <td width=\"180\" valign=\"top\">\r\n");
out.write(" <p>");
out.print(count2);
out.write('票');
out.write(',');
out.write('共');
out.print(tcount);
out.write("票</p> </td>\r\n");
out.write(" <td width=\"261\" valign=\"top\">\r\n");
out.write(" <p>");
out.print((int)(((float)count2/(float)tcount)*100));
out.write("% </p>\r\n");
out.write(" <table width=\"");
out.print((int)(((float)count2/(float)tcount)*100));
out.write("%\" border=\"0\" bgcolor=\"orange\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td> </td>\r\n");
out.write(" </tr>\r\n");
out.write(" </table>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td width=\"127\" valign=\"top\">\r\n");
out.write(" <p>与狼共舞</p> </td>\r\n");
out.write(" <td width=\"180\" valign=\"top\">\r\n");
out.write(" <p>");
out.print(count3);
out.write('票');
out.write(',');
out.write('共');
out.print(tcount);
out.write("票</p> </td>\r\n");
out.write(" <td width=\"261\" valign=\"top\">\r\n");
out.write(" <p>");
out.print((int)(((float)count3/(float)tcount)*100));
out.write("% </p>\r\n");
out.write(" <table width=\"");
out.print((int)(((float)count3/(float)tcount)*100));
out.write("%\" border=\"0\" bgcolor=\"orange\" cellpadding=\"0\" cell