%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ 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.Product"%>
<%@ page import="com.Admin.vo.Attr"%>
<%@ page import="net.sf.json.JSONArray"%>
<%@ page import="net.sf.json.JSONObject"%>
<%@ page import="com.Admin.vo.App"%>
<%@ page import="com.Admin.vo.User"%>
<%@ page import="com.Admin.vo.AppUser"%>
<%@ page import="com.wx.SignUtil"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.List"%>
<%@ page import="java.net.URLDecoder"%>
<%@ page import="com.common.IConstant"%>
<%@ page import="com.Admin.daoimpl.SubTypeDaoImpl"%>
<%@ page import="com.common.DbUtil"%>
<%@ 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" %>
<%
response.setCharacterEncoding("utf-8");
request.setCharacterEncoding("utf-8");
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("/"+context);
String currentUrl = null;
if(request.getServerPort() == 80){
currentUrl = request.getScheme()+"://"+ request.getServerName() + request.getRequestURI()+"?"+request.getQueryString();
}
else{
currentUrl = request.getScheme()+"://"+ request.getServerName()+ ":" + request.getServerPort() +request.getRequestURI()+"?"+request.getQueryString();
}
String tp = request.getParameter("tp");
if(tp!=null){
apppath = getServletContext().getRealPath("/tpl/"+tp);
}
String appid = request.getParameter("appid");
if(appid==null)
{
appid = IConstant.getCurrentAppid(apppath);
if(appid==null){
response.sendRedirect(basePath+"app/error.html?c=1");
return;
}
}
User user = null;
JSONArray products = null;
JSONArray teachers = null;
int role = 0;
JSONObject jsonUser = null;
String supertype=null;
String subtype=null;
String chapter=null;
ArrayList chapters = null;
JSONArray outlines = null;
JSONArray resources = new JSONArray();
JSONObject lesson = null;
JSONObject product = null;
JSONObject wx = null;
boolean isPublic = false;
JSONObject app = null;
JSONObject gzh = null;
String gzh_appid = null;
String intro = "";
int producttype=0;
String payid=null;
Double payprice=0.0;
JSONObject jsonType=null;
JSONObject teacher=null;
JSONArray recommends=null;
String template="";
JSONArray types = new JSONArray();
DbUtil dao = null;
String maps = null;
String simple_types = null;
try{
//get data
app = IConstant.getAppInfo(appid);
if(app==null){
response.sendRedirect(basePath+"app/error.html?c=5");
return;
}
template = app.getString("template");
types = IConstant.getTypes(appid, "301");
if(types.size()==0){
response.sendRedirect(basePath+"app/error.html?c=5");
return;
}
int checkupload=0;
try{
checkupload = app.getInt("checkupload");
}catch(Exception ex){
}
dao = new DbUtil();
if(checkupload==0) {
products=new AdminProdDaoImpl().getAllJSONProdForCache(dao,appid);
}else {
products=new AdminProdDaoImpl().getAllJSONProdForCheck(dao,appid);//需要审核后才能发布
}
if(types.size()==0){
response.sendRedirect(basePath+"app/error.html?c=5");
return;
}
teachers = IConstant.getTeachers(appid);
String filename = "maps.js";
maps = IConstant.readCacheFileAsString(appid,filename);
simple_types = null;
filename = "simple_roles.js";
simple_types = IConstant.readCacheFileAsString(appid,filename);
}catch(Exception ex){
ex.printStackTrace();
String url = basePath+"m/page-error.html";
response.sendRedirect(url);
}
finally{
if(dao!=null) dao.close();
}
%>
课件阅读