<%@ page contentType="text/html;charset=GBK" %> <%@ page import="java.lang.*"%> <%@ page import="java.io.*"%> <%@ page import="java.sql.*"%> <%@ page import = "java.util.*" %> <%@ page import = "java.text.SimpleDateFormat" %> <%@ page import="com.suneasy.basic.util.Tools" %> <%@ page import = "com.suneasy.web.sql.DatabaseSql"%> <%@ page import = "com.suneasy.basic.dbsconnect.*" %> <%@ include file="/config.jsp"%> <% request.setCharacterEncoding("GBK"); String login_html = "login/reg.htm"; String t=Tools.RmNull(request.getParameter("t")); String a=Tools.RmNull(request.getParameter("a")); if(null==a){a="";} if (t.equals("ajax"))login_html = "login/reg_ajax.htm"; String c = Tools.RmNull(request.getParameter("c")); String ctype = Tools.RmNull(request.getParameter("ctype")); String content = ""; String c_reg_xieyi = ""; String xuexiao=""; String banji=""; String xx_id=""; String bj_id=""; String zhuanye=""; String zy_id=""; int k = 0; String xueyuan=""; String xy_id=""; if (template_user.equals("login_01")) { login_html = "login_01/reg.htm"; if (t.equals("ajax"))login_html = "login_01/reg_ajax.htm"; }else if (template_user.equals("login_02")) { login_html = "login_02/reg.htm"; if (t.equals("ajax"))login_html = "login_02/reg_ajax.htm"; }else if (template_user.equals("login_03")) { login_html = "login_03/reg.htm"; if (t.equals("ajax"))login_html = "login_03/reg_ajax.htm"; }else if (template_user.equals("login_04")) { login_html = "login_04/reg.htm"; if (t.equals("ajax"))login_html = "login_04/reg_ajax.htm"; }else if (template_user.equals("login_05")) { login_html = "login_05/reg.htm"; if (t.equals("ajax"))login_html = "login_05/reg_ajax.htm"; }else if (template_user.equals("login_06")) { login_html = "login_06/reg.htm"; if (t.equals("ajax"))login_html = "login_06/reg_ajax.htm"; } String js="logincheck"; if(cnoren.equals("1")){ js="logincheck_cn"; } String sqlstr = ""; Connection con=null; Statement stmt=null; PreparedStatement pstmt = null; ResultSet rs=null; try { DBcon db = new DBcon(); con = db.getConnection(); stmt = con.createStatement(); sqlstr="select * from t_basicinfo where rid="+c_companyid+" "; rs = stmt.executeQuery(sqlstr); if(rs.next()) { content=Tools.RmNull(rs.getString("c_reg_content")); c_reg_xieyi=Tools.RmNull(rs.getString("c_reg_xieyi")); } rs.close(); //学校栏目 sqlstr="select c_code from t_type where c_companyid="+c_companyid+" and c_class=1 and c_mod='公司'"; rs = stmt.executeQuery(sqlstr); k = 0; if(rs.next()) { xx_id=Tools.RmNull(rs.getString(1)); //xueyuan = ""; k++; } rs.close(); //所属学校 sqlstr="select c_code,c_name from t_type where c_companyid="+c_companyid+" and c_belong="+xx_id+""; rs = stmt.executeQuery(sqlstr); k = 0; if(rs.next()) { xx_id=Tools.RmNull(rs.getString(1)); xuexiao = ""; k++; } rs.close(); //所属学院 sqlstr="select rid,titles from t_company where c_companyid="+c_companyid+" and enable<255"; rs = stmt.executeQuery(sqlstr); k = 0; while(rs.next()) { xy_id=Tools.RmNull(rs.getString(1)); xueyuan += ""; k++; } rs.close(); //所属专业 sqlstr="select rid,titles from t_zhuanye where xx_ctype="+xx_id+" and enable<255 order by rid desc "; rs = stmt.executeQuery(sqlstr); k = 0; while(rs.next()) { zy_id=Tools.RmNull(rs.getString(1)); zhuanye += ""; k++; } rs.close(); //所属班级 sqlstr="select rid,titles from t_banji where xx_ctype="+xx_id+" and enable<255 order by rid desc "; rs = stmt.executeQuery(sqlstr); k = 0; while(rs.next()) { bj_id=Tools.RmNull(rs.getString(1)); banji += ""; k++; } rs.close(); } catch (Exception e){ System.out.println("----数据库--sql---- :" + e+sqlstr); e.printStackTrace(); } finally { if (stmt!=null) { stmt.close(); } if (pstmt!=null) { pstmt.close(); } if (con!=null) { con.close(); } } //读入模板 StringBuffer strb = Tools.readFile(request.getRealPath("/mod_user/login_06/reg_content.htm")); if(content.equals("")){ content = strb.toString(); } strb = Tools.readFile(request.getRealPath("/mod_user/"+login_html+""));//模板head.htm //out.print(login_html); //模板head.htm strb = Tools.replaceAll(strb,"[c_companyname]",c_companyname); //strb = Tools.replaceAll(strb,"[server_lang]",server_lang); strb = Tools.replaceAll(strb,"[c]",c); strb = Tools.replaceAll(strb,"[a]",a); strb = Tools.replaceAll(strb,"[js]",js); strb = Tools.replaceAll(strb,"[content]",content); strb = Tools.replaceAll(strb,"[c_reg_xieyi]",c_reg_xieyi); strb = Tools.replaceAll(strb,"[xuexiao]",xuexiao); strb = Tools.replaceAll(strb,"[banji]",banji); strb = Tools.replaceAll(strb,"[zhuanye]",zhuanye); strb = Tools.replaceAll(strb,"[xueyuan]",xueyuan); out.println(strb); strb=null; %>