%@page import="com.hanweb.common.util.StringUtil"%>
<%@page import="com.hanweb.common.util.NumberUtil"%>
<%@page contentType="text/html;charset=UTF-8" %>
<%@page import="java.util.*"%>
<%@page import="java.io.File"%>
<%@page import="com.hanweb.jcms.plugins.voting.service.VotingFun" %>
<%@page import="com.hanweb.jcms.plugins.voting.service.Jcms_Voting_ListBLF" %>
<%@page import="com.hanweb.jcms.plugins.voting.entity.Jcms_Voting_ListEntity" %>
<%@page import="com.hanweb.jcms.plugins.voting.service.Jcms_Voting_KindBLF"%>
<%@page import="com.hanweb.jcms.plugins.voting.entity.Jcms_Voting_KindEntity"%>
<%@ include file="./config.jsp" %>
<%
int tempWebId = NumberUtil.getInt(request.getParameter("webid"),0);
if(tempWebId > 0){
strWebID = ""+tempWebId;
}
// 调用方式:是嵌入在单元中显示 yes;通过URL直接调用 no
String strInlay = StringUtil.getSafeString(request.getParameter("inlay"));
if(StringUtil.equals(strInlay, "")){
strInlay = "yes";
}
String strPath = VotingFun.getPath(application.getRealPath(""), strAppID, NumberUtil.getInt(strWebID));
String strM = StringUtil.getSafeString(request.getParameter("m"));
// 得到调查类别的ID
int kindid = 0;
// 类别下问题ID
String strQueId = StringUtil.getSafeString(request.getParameter("queid"));
// 调查类型 strScope=0 为当前调查 strScope = 1 为往期调查
int iscope = NumberUtil.getInt(request.getParameter("scope"),-1);
//字数限制
int limit = NumberUtil.getInt(request.getParameter("limit"));
// 是否带答案显示 1=显示;0=不显示
int isAnswer = NumberUtil.getInt(request.getParameter("answer"), 0);
String strUnitPath = "";
strUnitPath = strPath + "config"+File.separator+"initnormallist.xml";
String strConfigPath = strPath + "config"+File.separator+"config.xml";
//列表页显示的记录数
String strListCount = xmlFile.getContent( "listcount", strUnitPath );
strListCount = StringUtil.getString(strListCount);
strListCount = strListCount.trim().length() ==0 ?"5":strListCount;
//更多列表页显示的记录数
String strPageCount = xmlFile.getContent( "pagelistnum", strUnitPath );
String strqyHeight = xmlFile.getContent( "qyheight", strUnitPath );
String strqyWidth = xmlFile.getContent( "qywidth", strUnitPath );
if(isAnswer == 1){ // 如果是带答案显示,那么跳转到que_commondetail.jsp进行处理
response.sendRedirect("./que_commondetail.jsp?inlay="+strInlay+"&m="+strM+"&classid="+kindid+"&queid="+strQueId+"&answer="+isAnswer
+"&height="+strqyHeight+"&width="+strqyWidth);
return;
}
strPageCount = StringUtil.getString(strPageCount);
strPageCount = strPageCount.trim().length()==0?"10":strPageCount;
String strScript = xmlFile.getContent( "columlist", strUnitPath ); // 更多的script
strScript =StringUtil.getString(strScript);
String strwebtype = xmlFile.getContent( "webtype", strConfigPath ); // 1 制作端; 2 web服务器端
strwebtype = StringUtil.getString(strwebtype);
String strWebServerName = xmlFile.getContent( "web_in_servername", strConfigPath );
strWebServerName = StringUtil.getString(strWebServerName);
//系统路径
String strSysPath = "/";
if(strwebtype.equals("1")){
strSysPath = request.getContextPath() + "/jcms_files/jcms"+strAppID+"/web"+strWebID+"/site/";
}
if(strwebtype.equals("2")){
strSysPath = "/";
}
int nStart = strScript.indexOf( "" );
int nEnd = strScript.indexOf( "" );
String strHead = "";
String strForTr = "";
String strEnd = "";
String strContent = "";
String strDisplay = "";
if( nStart != -1 && nEnd != -1 && nEnd > nStart ){
strHead = strScript.substring(0,nStart );
strForTr = strScript.substring( nStart+10,nEnd );
strEnd = strScript.substring( nEnd+11 );
}
String strMoreUrl = strSysPath + "module/voting/que_normalvotinglist.jsp?"
+ "scope="+iscope+"&inlay="+strInlay+"&webid="+strWebID+"&m="+strM; // 更多的链接
String strUrl = "";
/* 要替换的标签 */
Vector v_label = new Vector(4);
v_label.add( "");
v_label.add( "" );
v_label.add( "" );
v_label.add( "");
/* 标签替换 */
Vector v_value = new Vector(4);
Jcms_Voting_KindBLF kindBlf = Jcms_Voting_KindBLF.getInstance().init(strAppID, NumberUtil.getInt(strWebID));
ArrayList kindsEn = kindBlf.getEntities(0,0,iscope);//一般调查的问题实体,第二个参数0表示是一般调查类型
String kindIds = "";
if(kindsEn!=null&&kindsEn.size()>0){
for(int i=0;i 0)
{
String strLabel = "";
String strKindName = "";
String strEndtime = "";
int nScope = 0 ;
int nLen = list.size(); // 总的记录条数
int defaultLen = NumberUtil.getInt(strListCount); // 后台设置的默认显示条数
nLen = defaultLen > nLen ? nLen : defaultLen;
strDisplay = defaultLen > nLen ? "none" : "";
int id = 0;
// i_id ,vc_question,i_sparefield,c_endtime
for( int i=0;ilimit){
strKindName = strKindName.substring(0,limit) + "...";
}
strLabel = "截至 "+strEndtime;
strKindName = "" +strKindName+ "";
id = en.getI_id();
strUrl = strSysPath + "module/voting/que_commondetail.jsp?classid="+en.getI_kindid()
+"&queid="+id+"&scope="+iscope+"&inlay="+strInlay+"&m="+strM
+"&height="+strqyHeight+"&width="+strqyWidth;
v_value.add( String.valueOf(i+1) );
v_value.add( strUrl );
v_value.add( strKindName );
v_value.add( strLabel );
for( int j=0;j",strDisplay);
strContent = StringUtil.replace( strContent,"",strMoreUrl);
strContent = StringUtil.replace( strContent,"\n","");
strContent = StringUtil.replace( strContent,"\r","");
strContent = StringUtil.replace( strContent,"\"","\\\\\"");
if(sbContent.length() > 0)
sbContent.delete(0,sbContent.length());
sbContent = VotingFun.organiseContent(strContent,strInlay);
out.println( sbContent.toString() );
%>