<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page import="com.Admin.daoimpl.SubTypeDaoImpl" %> <%@ page import="com.Admin.daoimpl.SuperTypeDaoImpl" %> <%@ page import="com.Admin.daoimpl.AdminUserDaoImpl" %> <%@ page import="com.Admin.daoimpl.AdminProdDaoImpl" %> <%@ page import="com.Admin.vo.SubType"%> <%@ page import="com.Admin.vo.SuperType"%> <%@ page import="com.Admin.vo.User"%> <%@ page import="com.Admin.vo.Recommend"%> <%@ page import="java.util.ArrayList"%> <%@ page import="net.sf.json.JSONArray"%> <%@ page import="net.sf.json.JSONObject"%> <%@ page import="com.common.IConstant"%> <%@ page import="com.common.Redis"%> <%@ page import="com.common.ReadDBPropertiesFile"%> <%@ page import="redis.clients.jedis.Jedis"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="cf" uri="/WEB-INF/els.tld" %> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String realPath = "http://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath()+request.getServletPath().substring(0,request.getServletPath().lastIndexOf("/")+1); String context = request.getServletPath().substring(1,request.getServletPath().lastIndexOf("/")); //String apppath = getServletContext().getRealPath("/tpl/test"); String apppath = getServletContext().getRealPath("/"+context); String tp = request.getParameter("tp"); if(tp!=null){ apppath = getServletContext().getRealPath("/tpl/"+tp); } response.setCharacterEncoding("utf-8"); request.setCharacterEncoding("utf-8"); String t = request.getParameter("t"); String subtypeid = request.getParameter("ar"); if(subtypeid==null){ response.sendRedirect(basePath+"app/error.html?c=5"); return; } String appid = IConstant.getCurrentAppid(apppath); if(appid!=null) request.getSession().setAttribute(IConstant.CURRENT_APPID,appid); else{ response.sendRedirect(basePath+"app/error.html?c=1"); return; } JSONObject jsonUser = null; User user = null; try{ user = (User)request.getSession().getAttribute(IConstant.CURRENT_USER); }catch(Exception ex){ user=null; } if(user==null) jsonUser = null; else jsonUser = JSONObject.fromObject(user); Jedis redis = null; redis = Redis.getRedis(); int role = 301; //get app JSONObject app = null; app =IConstant.getAppInfo(redis,appid); if(app==null){ response.sendRedirect(basePath+"app/error.html?c=1"); return; } String template = null; try{ template = app.getString("template"); }catch(Exception ex){ } if(template==null){ response.sendRedirect(basePath+"app/error.html?c=5"); return; } //get data JSONArray jsonTypes = IConstant.getCacheTypes(redis, appid, role, t); JSONObject sub = new AdminUserDaoImpl().getJSONRoleById(subtypeid, appid); if(sub==null){ response.sendRedirect(basePath+"app/error.html?c=5"); return; } sub.put("producttype", 2);//设置类型为会员资格 sub.put("url",IConstant.toStaticURL("iRole.jsp?ar="+subtypeid,appid)); String picture=null; try{ picture = sub.getString("picture"); }catch(Exception ex){ int sno = (int)(1+Math.random()*(8)); if(sno<1) sno=1; if(sno>10) sno = 10; picture="http://js.andisk.com/tpl/nm/images/cover"+sno+".jpg"; } //get notices JSONArray notices = IConstant.getCacheNotices(redis, appid, t); //get index recommend String type="0"; JSONArray recommends = IConstant.getRecommends(redis, appid, type, t); String email=null; try{ email = app.getString("email"); }catch(Exception ex){ email="bd@andisk.com"; } String price = sub.getString("price"); //get news types JSONArray types = IConstant.getTypes(appid, subtypeid); JSONArray subs=new JSONArray(); for(int i=0;i 套餐

<%=sub.getString("role") %>

  • "><%=sub.getString("role") %>
更多课程

<%=sub.getString("role") %>

<%=sub.getString("tip") %>

<%=sub.getString("roledesc") %>
<%if(price.equals("0")){ %> 免费 <%}else{ %> 价格 <%=price %> 元 <%} %>
我要购买 收藏
<%if(subs!=null && subs.size()>0){ %>
<%} %>