<%--
  Created by IntelliJ IDEA.
  User: mc
  Date: 2021/1/15
  Time: 10:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%
    ConnectionFactory cf = new ConnectionFactory();
    Pub pub = new Pub();
    Connection conn = null;
    Vector v_list = null;
	Vector v_list_1 = null;
    String zd_e_name = pub.trimNull(request.getParameter("zd_e_name"));
    String value = pub.trimNull(request.getParameter("value"));
    value=java.net.URLDecoder.decode(value,"UTF-8");
    String name_id = pub.trimNull(request.getParameter("name_id"));
    List list_s = new ArrayList();
    Hashtable ht=null;
	String first_name="请选择";
    try {
        StringBuffer sb = new StringBuffer();
        sb.append("select * from zb_role order by order_num asc");
        conn = com.censoft.db.DBUtil.getConnection();
        v_list = cf.doQuery(conn, sb.toString(),null, list_s.toArray());
        if (v_list == null) {
            out.println("查询出错" + cf.getMsg());
            return;
        }
%>
    <select class="input-text" name="<%=name_id%>" id="<%=name_id%>" style="width:120px;float:right;">
        <option value=""><%=first_name%></option>
        <%
            if(v_list!=null && v_list.size()>0){
                for(int i=0;i<v_list.size();i++){
                    ht=(Hashtable)v_list.get(i);
                    String col_name=pub.trimNull((String)ht.get("role_name"));
        %>
        <option value="<%=col_name%>" <%if(value.equals(col_name)){%>selected="selected"<%}%>><%=col_name%></option>
        <%
                }
            }
        %>
    </select>
<%
    } catch (Exception e) {
        out.println("查询异常" + e);
        return;
    } finally {
        if (conn != null) {
            try {
                conn.close();
            } catch (Exception e) {
            }
        }
    }
%>
