<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/9/11
  Time: 12:54
  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;
    String login_id = (String) session.getAttribute("session_login_id");
    if ("".equals(login_id)) {
        System.out.println("当前没有用户信息");
    }
    String page_number = pub.trimNull(request.getParameter("page_number"));
    String opt = pub.trimNull(request.getParameter("opt"));
    if ("".equals(page_number)) page_number = "1";
    String page_size = pub.trimNull(request.getParameter("page_size"));
    if ("".equals(page_size)) page_size = "20";
    StringBuffer sql = new StringBuffer();
    List list = new ArrayList();
    sql.append("select * from zb_role");
	sql.append(" order by order_num asc");
    try {
        conn = com.censoft.db.DBUtil.getConnection();
        v_list = cf.doPageQueryWithCount(conn, sql.toString(), page_number, page_size, null, list.toArray());
        if (v_list == null) {
            out.println("查询用户出错");
            return;
        }
    } catch (Exception e) {
        out.println("查询用户信息异常" + e);
        return;
    } finally {
        if (conn != null) {
            try {
                conn.close();
            } catch (Exception e) {
            }
        }
    }
    Hashtable ht_row = (Hashtable) v_list.get(0);
    String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT"));
    String pageCnt = pub.trimNull((String) ht_row.get("PAGECOUNT"));
%>
<div style="margin-top: 10px;" id="leftMx">
    <ul>
<%
        if (v_list != null && v_list.size() > 0) {
            for (int i = 1; i < v_list.size(); i++) {
                Hashtable ht = (Hashtable) v_list.get(i);
                String id = pub.trimNull((String) ht.get("id"));
                String name = pub.trimNull((String) ht.get("role_name"));
%>
        <li id="li_<%=id%>" style="padding-left: 30px;height:30px;line-height: 30px;cursor: pointer;" onclick="openLi('<%=id%>');">
            <%=name%>
        </li>
<%}}%>
    </ul>
</div>
