<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="list.aspx.cs" Inherits="wjdhcms_SAAS.module.admin.list" %>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>管理员管理</title>

    <!-- start: CSS file-->
    <!-- Vendor CSS-->
    <link href="../static/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="../static/vendor/skycons/css/skycons.css" rel="stylesheet" />
    <link href="../static/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" />

    <!-- Plugins CSS-->
    <link href="../static/plugins/bootkit/css/bootkit.css" rel="stylesheet" />
    <link href="../static/plugins/fullcalendar/css/fullcalendar.css" rel="stylesheet" />
    <link href="../static/plugins/jquery-ui/css/jquery-ui-1.10.4.min.css" rel="stylesheet" />          
    
    <!-- Page CSS -->   
    <link href="../static/css/style.css" rel="stylesheet" />
    <link href="../static/css/add-ons.min.css" rel="stylesheet" />
    <!-- end: CSS file--> 
      
    
    <!-- Head Libs -->
    <script src="../static/plugins/modernizr/js/modernizr.js"></script>
    
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="../static/js/html5shiv.min.js"></script>
      <script src="../static/js/respond.min.js"></script>
    <![endif]-->    
    

</head>

<body class="mainbody">
  <div class="container-fluid">
    <div class="row"> 
            <div class="col-lg-12">
              <div class="panel">
                <div class="panel-heading bk-bg-primary">
                  <div class="list-articles">
                    <a href="edit.aspx?action=add" class="release btn btn-default"><i class="fa fa-pencil-square-o"></i>新增</a>
                  </div>
                </div>
                <div class="panel-body">
                </div>
              </div>
            </div>
          </div>  
  </div>

    <!-- start: JavaScript-->
    
    <!-- Vendor JS-->       
    <script src="../static/vendor/js/jquery-2.1.1.min.js"></script>
    <script src="../static/vendor/js/jquery-migrate-1.2.1.min.js"></script>
    <script src="../static/vendor/bootstrap/js/bootstrap.min.js"></script>
    <script src="../static/vendor/skycons/js/skycons.js"></script> 
    
    <!-- Plugins JS-->
    <script src="../static/plugins/jquery-ui/js/jquery-ui-1.10.4.min.js"></script>
    <script src="../static/plugins/moment/js/moment.min.js"></script>  
    <script src="../static/plugins/fullcalendar/js/fullcalendar.min.js"></script>      
    
    <!-- Theme JS -->   
    <script src="../static/js/jquery.mmenu.min.js"></script>
    <script src="../static/js/core.min.js"></script>


    <!-- Pages JS -->
    <script src="../static/js/ajax.js"></script>
    
    <!-- end: JavaScript-->

    <script>
        $(function () {
            get_json('../../api/admin.ashx?action=list', function (data) {
                var list = '';
                for (var i = 0; i < data.data.length; i++) {
                    var id = data.data[i].id;
                    var username = data.data[i].order_user;
                    var img = data.data[i].img;
                    var ip = data.data[i].ip;
                    var addtime = data.data[i].add_time;
                    addtime = formatTime(addtime, "yyyy-MM-dd hh:mm:ss");
                    var lastlogin = data.data[i].lastlogin;
                   
                    if (lastlogin != null) {
                        lastlogin = formatTime(lastlogin, "yyyy-MM-dd hh:mm:ss");
                    }
                    
                    list += '<div class="col-xs-6 bk-margin-bottom-15">'
                           + '<div class="col-xs-2 bk-vcenter text-center bk-padding-top-10 bk-padding-bottom-10">'
                              + '<a href="edit.aspx?action=edit&id=' + id + '" class="bk-avatar">'
                                + '<img src="' + img + '" class="img-circle bk-img-60 bk-border-primary bk-border-2x bk-border-darken">'
                              + '</a>'
                            + '</div>'
                            + '<div class="col-xs-10 bk-vcenter bk-padding-top-10 bk-padding-bottom-10">'
                              + '<span class="pull-right"><a href="edit.aspx?action=edit&id=' + id + '">[修改]</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:Delete(\'../../api/admin.ashx?action=del&id=' + id + '\')">[删除]</a></span>'
                              + '<h4 class="bk-fg-primary">' + username + '</h4>'
                              + '<small>'
                                + '最后登录IP：' + ip + '&nbsp;&nbsp;&nbsp;&nbsp;添加时间：' + addtime + '&nbsp;&nbsp;&nbsp;&nbsp;最后登录：' + lastlogin
                              + '</small>'
                            + '</div>'
                          + '</div>'
                }
                $('.panel-body').html(list);
            });

        });
        function exdel(e) {
            parent.layer.confirm('确定要删除吗？', {
                btn: ['确定', '取消']
            }, function () {
                $.getJSON(e, function (data) {
                    parent.layer.msg(data.msg, { time: 3000 });
                });
            }, function () {
            });
        }

    </script>
    
</body>

</html>
