%@ 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 套餐 个人中心 我的课程 我的收藏 帐户信息 站内消息 退出 登录| 注册 /images/logo.png) 0 0px no-repeat;" report-tdw="action=rainbow-logo-clk" title="课堂_专业的在线教育平台">课堂 首页 课程库 直播课 线下开班 联系我们 课程 机构 首页 课程库 线下开班 立即报名 首页 ">课程库 <%=sub.getString("role") %> <%=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){ %> 老师还为你推荐了以下几门课程 <% for(int i=0;i=5) break; JSONObject sb = subs.getJSONObject(i); if(sb.getString("subTypeId").equals(subtypeid)){ continue; } %> " target="_blank" class="item-img-link" data-id="116991" data-index="0 + 1" report-tdw="action=Coursecard_Coursecover-clk&ver1=116991&ver3=1.1" cors-path="1"> " alt="<%=sb.getString("subType") %>" title="<%=sb.getString("subType") %>" class="item-img" width="220" height="auto" onerror="javascript:lod(this);"/> " target="_blank" class="item-tt-link" title="<%=sb.getString("subType") %>" report-tdw="action=Coursecard_Coursesname-clk&ver1=116991&ver3=1.1" cors-path="1"><%=sb.getString("subType") %> <%if(sb.getDouble("price") ==0){%> 免费 <%}else{ %> <%= sb.getDouble("price")%> <%} %> <%} %> <%} %>
个人中心
<%=sub.getString("tip") %>