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

📄 index.jsp

📁 Sun公司Dream项目
💻 JSP
字号:
<%@ page errorPage="error_page.jsp" %>
<%@ include file="common_imports.jsp" %>

<%

jspPath = "/shop/index.jsp";
homeTab = "on";

final int MAX_ITEMS_DISPLAYED = 3;

Vector topSellers = DBUtil.getRecords("SELECT contentid, count(*) FROM OPERA_LICENSE_INFO WHERE shopid='" + operaShopID + "' GROUP BY contentid",
        new int[] {java.sql.Types.VARCHAR, java.sql.Types.INTEGER}, null);
        
        int prevCount = -1;
        int index = -1;
        for (int i=0; i < topSellers.size(); i++) {
            String[] aRec = (String[])topSellers.elementAt(i);
            int count = Integer.parseInt(aRec[1]);
            if (count > prevCount) {
                prevCount = count;
                index = i;
            }
        }
        
        String[] topSeller = null;
        
        String prodSQL = "SELECT prod.contentid FROM SHOP_PRODUCT prod WHERE prod.category=";
        int[] prodTypes = new int[] {java.sql.Types.VARCHAR};
        
        String detailInfoSQL = "SELECT prod.contentid, prod.listprice,prod.price, prod.filename,meta.title,meta.description,meta.publisher,meta.artist,meta.creationdata,meta.language,meta.country,meta.runtime,meta.previewfile,meta.thumbnail1,meta.thumbnail2,meta.contentloc,meta.datatype,meta.resolution,meta.bitrate,meta.mimetype,meta.rating,meta.drmtype,meta.deliverymode,prod.category FROM SHOP_PRODUCT prod LEFT OUTER JOIN OPERA_CONTENT_METADATA meta ON prod.contentid = meta.contentid WHERE prod.contentid=?";
        //                                  0                1            2          3              4            5               6             7             8               9           10            11            12                13            14              15             16               17            18            19          20          21              22                 23
        int[] detailInfoTypes = new int[] {java.sql.Types.VARCHAR,java.sql.Types.FLOAT,java.sql.Types.FLOAT,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR,java.sql.Types.VARCHAR, java.sql.Types.VARCHAR};
        
        if (index > -1) {
            String[] aRec = (String[])topSellers.elementAt(index);
            topSeller = DBUtil.getRecord(detailInfoSQL, detailInfoTypes, null, new String[] {aRec[0]});
        }
        
        topSellers.clear();
        if(topSeller != null) topSellers.add(topSeller);
        
        Vector musics = DBUtil.getRecords(prodSQL + "'music'", prodTypes, null);
        Vector movies = DBUtil.getRecords(prodSQL + "'movie'", prodTypes, null);
        Vector games = DBUtil.getRecords(prodSQL + "'game'", prodTypes, null);
        
        if (musics.size() > 0) {
            String[] aRec = (String[]) musics.elementAt(getRandomNumber(0.0, musics.size()-1));
            topSellers.add(DBUtil.getRecord(detailInfoSQL, detailInfoTypes, null, new String[] {aRec[0]}));
            
        }
        
        if (movies.size() > 0)  {
            String[] aRec = (String[]) movies.elementAt(getRandomNumber(0.0, movies.size()-1));
            topSellers.add(DBUtil.getRecord(detailInfoSQL, detailInfoTypes, null, new String[] {aRec[0]}));
        }
        
        if (games.size() > 0) {
            String[] aRec = (String[]) games.elementAt(getRandomNumber(0.0, games.size()-1));
            topSellers.add(DBUtil.getRecord(detailInfoSQL, detailInfoTypes, null, new String[] {aRec[0]}));
        }

%>

<%@ include file = "top_body.jsp" %>

            <td width="395" valign="top">
              <table width="375" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td valign="top">
                    <table width="175" border="0" cellspacing="0" cellpadding="0">
                    <%
                    for (int i=0; i < topSellers.size(); i++) {
        if( i == MAX_ITEMS_DISPLAYED) break;
        topSeller = (String[])topSellers.elementAt(i);
        if (topSeller[13] == null || "".equals(topSeller[13].trim()) ) {
            topSeller[13] = "images/thumbnail1.gif";
        }
                    %>                                            
                    <tr>
                        <td width="175">
                            <table width="175" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td colspan="2" class="subsong_title">&nbsp;&nbsp;<a href="<%=topSeller[23]%>.jsp?selected_content_id=<%=topSeller[0]%>" class="subsong_title" style="text-decoration:none"><%=(topSeller[4]== null?topSeller[0]:topSeller[4])%></a></td>
                                </tr>
                                <tr>
                                    <td width="75" valign="top" class="subsong_detail"><a href="<%=topSeller[23]%>.jsp?selected_content_id=<%=topSeller[0]%>"><img src="<%=topSeller[13]%>" width="75" height="75" border="0"></a><p/>
                                        <%                              
                                        
                                        if (topSeller[12] != null && !"".equals(topSeller[12].trim())) {
            //if (topSeller[12].indexOf("://") == -1)
            //    topSeller[12] = "download/" + topSeller[12];

                                        %>
                                        <a href="<%=topSeller[12]%>"
                                        class="subsong_detail"
                                        style="text-decoration:none"><img
                                        src="images/listenicon3.gif" border="0" width="19" height="14" alt="Preview">&nbsp;Preview</a>
                                        <%
        } else {
                                        %>
                                        <img src="images/listenicon3.gif" border="0" width="19" height="14" alt="Preview not available">&nbsp;Preview
                                        <%
        }
                                        %>      
                                    </td>
                                    <td width="100">
                                        <table width="100" border="0" cellspacing="0" cellpadding="0">                                  
                                            <tr>
                                                <td>
                                                    <table width="100" border="0" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td width="20">&nbsp;</td>
                                                            <td width="80">
                                                                <table width="80" border="0" cellspacing="0" cellpadding="2">
                                                                    <tr>
                                                                        <td class="subsong_detail"><%=(topSeller[7]==null?"":topSeller[7])%></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td class="subsong_detail">List Price: $<span style="text-decoration:line-through;"><%=(topSeller[1]==null?"":topSeller[1])%></span></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td class="subsong_detail">Price: $<%=(topSeller[2]==null?"":topSeller[2])%></td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table width="100" border="0" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td width="20">&nbsp;</td>
                                                            <td width="80">
                                                                <table width="80" border="0" cellspacing="0" cellpadding="0">
                                                                    <tr>
                                                                        <td width="59"><a href="buy.jsp?item_id=<%=topSeller[0]%>&item_title=<%=(topSeller[4]==null?"":topSeller[4])%>&jsp_path=<%=jspPath%>" class="subsong_detail" style="text-decoration:none"><img src="images/addtocarticon3.gif" border="0" width="20" height="14" border="0" alt="Add to Cart">&nbsp;Buy</a></td>                                                
                                                                        <td width="39">&nbsp;</td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td width="200" align="right" valign="top">
                        <table border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td witdh="25">
                            <td>
                                <table width="175" cellspacing="0" cellpadding="2">
                                    <tr rowspan="2">
                                        <td class="subsong_detail" align="left" valign="top"><%=(topSeller[5]==null?"":topSeller[5])%></td>
                                    </tr>
                                    <tr>
                                        <td class="subsong_detail" align="left"><%=(topSeller[9]==null?"":topSeller[9])%>&nbsp,<%=(topSeller[10]==null?"":topSeller[10])%></td>
                                    </tr>
                                    <tr>
                                        <td class="subsong_detail" align="left">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td align="right"><a href="<%=topSeller[23]%>.jsp?selected_content_id=<%=topSeller[0]%>" class="subsong_detail" style="text-decoration:none">detail ...</a>&nbsp;&nbsp;</td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                            </table>
                        </td>
                    </tr>
                        <tr>
                            <td width="175" height="30"><img src="images/blueline2.gif" width="175" height="3"></td>
                            <td width="200" align="right"><img src="images/blueline2.gif"></td>
                        </tr>
<%
                    }
%>                  
                        <tr>
                            <td width="175">&nbsp;</td>
                            <td width="200">&nbsp;</td>
                        </tr>
                        </table>
                    </td>
                </tr>
                      </table>
                  </td>

<%@ include file = "right_content.jsp" %>                                      
<%@ include file = "footer.jsp" %>                                      
                                      

⌨️ 快捷键说明

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