<%@ page language="java" contentType="text/html" session="false" import="java.util.*,java.text.*,java.sql.*,com.money.servlet.tools.fortune.*"%> <%! public static BestCompaniesPool _pool = BestCompaniesPool.getInstance(); DecimalFormat df = new DecimalFormat("###,###,###"); public static String join(Collection s, String delimiter) { StringBuffer buffer = new StringBuffer(); Iterator iter = s.iterator(); while (iter.hasNext()) { buffer.append(iter.next()); if (iter.hasNext()) { buffer.append(delimiter); } } return buffer.toString(); } String format(String s) { if(s == null) return "N.A."; double d; try { d = Double.parseDouble(s); } catch (Exception e) { return "N.A."; } return df.format(d); } String format2(String s) { if(s == null) return "N.A."; double d; try { d = Double.parseDouble(s); } catch (Exception e) { return "N.A."; } d /= 1000.0; return df.format(d); } %> <% String view = request.getParameter("view"); if(view == null || view.equals("")) view = "a"; String[] params = request.getParameterValues("id"); Vector v = new Vector(); if(params != null) { for(int i = 0; i< params.length; i++) { String s = params[i]; if(s == null || s.equals("")) continue; if(s.indexOf(',') > -1) { StringTokenizer st = new StringTokenizer(s, ","); while (st.hasMoreTokens()) { v.add(st.nextToken()); } } else { v.add(s); } } } String add = request.getParameter("add"); if(add != null && ! add.equals("")) v.add(add); int[] winners = { 2255, 387, 385, 175, 327, 170, 160, 2927, 2580, 2756 }; String idList = join(v, ","); %> FORTUNE 500 2008: Company Comparison <%@ include file="/fn_adspaces/ad_head0.txt" %> <%@ include file="/.element/ssi/javascript/1.0/video.txt" %>
<%@ include file="/fn_adspaces/business_news/lists/fortune_500_list/fortune/top.728x90.ad" %>
<%@ include file="/.element/ssi/sections/mag/fortune/fortune500/2008/widget_search.html" %>
<%@ include file="/fn_adspaces/business_news/lists/fortune_500_list/fortune/rgt.336x280.ad" %>
<%@ include file="/.element/ssi/sections/mag/fortune/fortune500/2008/box_methodology.html" %>
<%@ include file="/.element/ssi/sections/mag/fortune/fortune500/2008/bannertop.html" %> <%@ include file="/.element/ssi/sections/mag/fortune/fortune500/2008/nav_main.html" %>
Fortune 1000 Compare Tool
<% if(view.equals("c")) { %> <% } else if(view.equals("b")) { %>
Earnings per share Total Return to Investors Employees
Rank Company 1997-2007
Annual growth (%)
1997-2007
Annual rate (%)
2007 (%) Number % change
from 2006
<% } else { %>
Rank Company Revenues % Assets % Stockholders' Equity %
<% } Connection c = _pool.getConnection(); java.sql.Statement sth = null; String sql = "select * from ( select RANK, COMPANY_ID, NAME, REVENUE, REVENUE_GROWTH, PROFIT, PROFIT_GROWTH, PROF_PCT_REVENUE, PROF_PCT_ASSETS, PROF_PCT_EQUITY, EPS_10YR_GROWTH, TRI_10YR, TRI, EMPLOYEES, EMPLOYEE_GROWTH from TIME_OWNER.F500_2008 where RANK <= 10 order by rank asc)"; if(! idList.equals("")) { sql = "select * from ( select RANK, COMPANY_ID, NAME, REVENUE, REVENUE_GROWTH, PROFIT, PROFIT_GROWTH, PROF_PCT_REVENUE, PROF_PCT_ASSETS, PROF_PCT_EQUITY, EPS_10YR_GROWTH, TRI_10YR, TRI, EMPLOYEES, EMPLOYEE_GROWTH from TIME_OWNER.F500_2008 where COMPANY_ID IN("+idList+") order by rank asc) union all " + sql; } try { sth = c.createStatement(); ResultSet rs = sth.executeQuery(sql); int count = 1; while(rs.next()) { int rank = rs.getInt("RANK"); int color = (count % 2 == 0) ? 2 : 1 ; String removeLink = ""; Iterator it = v.iterator (); while (it.hasNext ()) { String s = (String)it.next(); if(! s.equals(rs.getString("COMPANY_ID"))) removeLink = removeLink + s + ","; } if(view.equals("c")) { %> <% } else if(view.equals("b")) { %> <% } else { %> <% } count++; } } catch (Exception e) { %>
ERROR!
<%= sql %>
<% e.printStackTrace(new PrintWriter(out)); %>
<% } finally { try { if(sth != null) sth.close(); } catch (Exception e2) {} _pool.freeConnection(c); } %>
Revenues Profits
Rank Company $ millions % change from 2006 $ millions % change from 2006
<%= rs.getString("RANK") %> .html"><%= rs.getString("NAME") %> <%= format(rs.getString("EPS_10YR_GROWTH")) %> <%= format(rs.getString("TRI_10YR")) %> <%= format(rs.getString("TRI")) %> <%= format(rs.getString("EMPLOYEES")) %> <%= format(rs.getString("EMPLOYEE_GROWTH")) %>
<%= rs.getString("RANK") %> .html"><%= rs.getString("NAME") %> <%= format(rs.getString("PROF_PCT_REVENUE")) %> <%= format(rs.getString("PROF_PCT_ASSETS")) %> <%= format(rs.getString("PROF_PCT_EQUITY")) %>
<%= rs.getString("RANK") %> .html"><%= rs.getString("NAME") %> <%= format(rs.getString("REVENUE")) %> <%= format(rs.getString("REVENUE_GROWTH")) %> <%= format(rs.getString("PROFIT")) %> <%= format(rs.getString("PROFIT_GROWTH")) %>
<%@ include file="/.element/ssi/omniture/omniture.txt" %> <%@ include file="/.element/ssi/footer/2.0/fortune.footer.html" %> <%@ include file="/.element/ssi/footer/2.0/fortune.copyright.html" %>
<%@ include file="/fn_adspaces/ad_tail0.txt" %>