<%--
  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;
    Hashtable ht_log = new Hashtable();
    String login_id = pub.trimNull((String)session.getAttribute("session_login_id"));
    try {
        conn = com.censoft.db.DBUtil.getConnection();
        String sql = "select ip,add_time,(select count(*) from t_book_log  where add_user=? and model='登录') as dlcs from t_book_log where add_user=? and model='登录' order by add_time desc";
        Vector v_list = cf.doPageQueryWithCount(conn, sql, "1", "1", null, new Object[]{login_id,login_id});
        if (v_list == null) {
            out.println("查询角色出错");
            return;
        }else if(v_list.size()>1){
            ht_log = (Hashtable)v_list.get(1);
        }
    } catch (Exception e) {
        out.println("查询角色信息异常" + e);
        return;
    } finally {
        if (conn != null) {
            try {
                conn.close();
            } catch (Exception e) {
            }
        }
    }
%>
    <div class="page-container">
        <p class="f-20 text-success"><%=pub.trimNull((String) session.getAttribute("session_login_name"))%>，欢迎使用资产管理系统!</p>
        <p style="text-align:right;">登录次数：<%=pub.trimNull((String)ht_log.get("dlcs"))%>&nbsp;&nbsp;登录IP：<%=pub.trimNull((String)ht_log.get("ip"))%>&nbsp;&nbsp;登录时间：<%=pub.trimNull((String)ht_log.get("add_time"))%></p>
        <div class="mt-20" id="datalist">

        </div>
    </div>

<script type="text/javascript">

	<%
		String s_menus = pub.trimNull((String)session.getAttribute("menu_ids"));
			
	%>
	<%if(s_menus.indexOf("fa08d700b4154703adbeca6d9f6f5153")>=0){%>
    searchModel();
	<%}%>
    function searchModel() {
        $.ajax({
            type: "post",
            url: "notice/notice_homepage_list_ajax.jsp",
            data: $('#data_form_search').serialize(),
            success: function (msg) {
                $("#datalist").html(msg);
                changeBtn();
            }
        });
    }



</script>