%@ 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); } System.out.println("sss"); response.setCharacterEncoding("utf-8"); request.setCharacterEncoding("utf-8"); String t = request.getParameter("t"); String trainid = request.getParameter("ar"); String classid = request.getParameter("ac"); 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); JSONObject app = IConstant.getAppInfo(appid); if(user!=null) app = user.getAppInfo(); else app =IConstant.getAppInfo(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; } Jedis redis = null; redis = Redis.getRedis(); int role = 301; AdminUserDaoImpl au = new AdminUserDaoImpl(); if(trainid==null){ if(classid==null){ response.sendRedirect(basePath+"app/error.html?c=5"); return; } JSONObject room = au.getTrainRoom(appid, classid); if(room==null){ response.sendRedirect(basePath+"app/error.html?c=5"); return; } trainid = room.getString("trainid"); } JSONObject train = au.getTrain(appid,trainid); if(train==null){ response.sendRedirect(basePath+"app/error.html?c=5"); return; } train.put("producttype", -2); train.put("url",basePath+"tpl/"+template+"/iTrain.jsp?ar="+trainid+"&ac="+classid); String picture=null; try{ picture = train.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"; } if(picture==null||picture.isEmpty()){ 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"; } //获得所有报名学生 JSONArray users = IConstant.getTrainUsers(redis, appid,trainid, t); //获得所有开设班级 String classname=""; String price=""; String intro = ""; String schedule = ""; String tit = ""; price = train.getString("price"); JSONArray rooms = IConstant.getTrainRoomsByTrainid(redis, appid, trainid,t); JSONObject r = null; if(classid==null){ if(rooms.size()>0){ r = rooms.getJSONObject(rooms.size()-1); classid = r.getString("id"); classname = r.getString("title"); intro = r.getString("intro"); tit = r.getString("tit"); price = r.getString("price"); schedule = r.getString("schedule_date"); } else{ classid="0"; } }else{ if(rooms.size()>0){ for(int i=0;i 开班报名 个人中心 我的课程 我的收藏 帐户信息 站内消息 退出 登录| 注册 /images/logo.png) 0 0px no-repeat;" report-tdw="action=rainbow-logo-clk" title="课堂_专业的在线教育平台">课堂 首页 课程库 直播课 线下开班 联系我们 课程 机构 首页 课程库 线下开班 立即报名 首页 ">训练营 <%=train.getString("title") %> <%=train.getString("title") %> 报名人数 <%=train.getString("innumber") %> 评分 <%=train.getString("grade") %> 分 分享 <%if(!classid.equals("0")){ String startdate=""; if(schedule==null||schedule.isEmpty()){ startdate="每月滚动开班"; } else { startdate = schedule; } %> <%=classname %> 更多班级 <%=classname %> <%=startdate %>开课 , <%=tit %> <%=intro %> <%if(price.equals("0")){ %> 免费 <%}else{ %> 价格 <%=price %> 元 <%} %> <%} %> 在线支付 填表报名 收藏 "> <%if(subs!=null && subs.size()>0){ %> 老师还为你推荐了以下几门课程 <% for(int i=0;i=5) break; JSONObject sub = subs.getJSONObject(i); %> " 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"> " title="<%=sub.getString("subType") %>" class="item-img" width="220" height="124" onerror="javascript:lod(this);"> " target="_blank" class="item-tt-link" title="<%=sub.getString("subType") %>" report-tdw="action=Coursecard_Coursesname-clk&ver1=116991&ver3=1.1" cors-path="1"><%=sub.getString("subType") %> <%if(sub.getDouble("price") ==0){%> 免费 <%}else{ %> 价格<%= sub.getDouble("price")%>元 <%} %> <%} %> <%} %> 9 。《》1/23!,(Dan) 6“”!NotsBrihCucl8、
个人中心
<%=startdate %>开课 , <%=tit %>