<%include ../layout/second_menu.html %>
<div class="panel-content">
    <div class="panel-title">
        <div class="title-main">
            <h2><%= secondMenu[action].title %></h2>
        </div>
    </div>
    <div class="content-wrap">
        <div class="c-header">
            <form class="form-inline" method="get" action="">
                <!--最近使用定额-->
                <div class="btn-group">
                    <button type="button" class="btn btn-default dropdown-toggle btn-sm" data-toggle="dropdown"
                            aria-haspopup="true" aria-expanded="false">
                       最近使用费用定额： <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu selector">
                        <% for(let compilation of compilationList){ %>
                        <li><a  data-value="<%= compilation._id.toString()%>"><%= compilation.name %></a></li>
                        <% } %>
                    </ul>
                    <input type="hidden" name="latestUsed" value="<%= filter.latestUsed%>" />
                </div>
                <!--已升级费用定额-->
                <div class="btn-group">
                    <button type="button" class="btn btn-default dropdown-toggle btn-sm" data-toggle="dropdown"
                            aria-haspopup="true" aria-expanded="false">
                        已升级费用定额： <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu selector">
                        <% for(let compilation of compilationList){ %>
                        <li><a  data-value="<%= compilation._id.toString()%>"><%= compilation.name %></a></li>
                        <% } %>
                    </ul>
                    <input type="hidden" name="upGrade" value="<%= filter.upGrade%>" />
                </div>
                <!--最新注册-->
                <div class="btn-group">
                    <button type="button" class="btn btn-default dropdown-toggle btn-sm" data-toggle="dropdown"
                            aria-haspopup="true" aria-expanded="false">
                        最新注册：<%= filter.regtimeMsg === undefined ? '所有' : filter.regtimeMsg %><span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu selector">
                        <li><a  data-value="0">所有</a></li>
                        <li><a  data-value="1">最近24小时</a></li>
                        <li><a  data-value="2">最近3天</a></li>
                        <li><a  data-value="3">最近7天</a></li>
                        <li><a  data-value="4">最近30天</a></li>
                    </ul>
                    <input type="hidden" name="regtime" value="<%= filter.regtime%>" />
                </div>
                <!--最近登录-->
                <div class="btn-group">
                    <button type="button" class="btn btn-default dropdown-toggle btn-sm" data-toggle="dropdown"
                            aria-haspopup="true" aria-expanded="false">
                        最新注册：<%= filter.regtimeMsg === undefined ? '所有' : filter.regtimeMsg %><span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu selector">
                        <li><a  data-value="0">所有</a></li>
                        <li><a  data-value="1">最近24小时</a></li>
                        <li><a  data-value="2">最近3天</a></li>
                        <li><a  data-value="3">最近7天</a></li>
                        <li><a  data-value="4">最近30天</a></li>
                    </ul>
                    <input type="hidden" name="loginTime" value="<%= filter.loginTime%>" />
                </div>
                <!--结果-->
                <div class="btn-group">
                    &nbsp;共 <%= total %> 条结果
                </div>
                <!--搜索-->
                <div class="btn-group pull-right">
                    <div class="input-group">
                        <input type="text" name="keyword" class="form-control input-sm" value="<%= filter.keyword === undefined ? '' : filter.keyword %>" placeholder="手机/邮箱/姓名/公司">
                        <span class="input-group-btn">
                        <button class="btn btn-default btn-sm" type="submit">
                            <i class="glyphicon glyphicon-search"></i>
                        </button>
                    </span>
                    </div>
                </div>
            </form>
        </div>
        <div class="c-body">
            <table class="table">
                <thead>
                <tr>
                    <th width="350">注册手机/邮箱</th>
                    <th>姓名</th>
                    <th>企业名称</th>
                    <th>企业地区</th>
                    <th>最近使用版本</th>
                    <th width="180">最近登录</th>
                    <th width="180">注册时间</th>
                    <th>详细</th>
                    <th>升级</th>
                </tr>
                </thead>
                <tbody>
                <% userList.forEach(function (user){ %>
                <tr>
                    <td><%= user.mobile %> / <%= user.email %></td>
                    <td><%= user.real_name %></td>
                    <td><a tabindex="0" role="button" data-toggle="popover" data-trigger="focus" title="更多信息"
                           data-content="企业类型：<%= model.companyType[user.company_type] %>，企业规模：<%= model.companyScale[user.company_scale] %>"><%= user.company %></a>
                    </td>
                    <td><%= model.province[user.province] %></td>
                    <td>重庆01版</td>
                    <td>登录时间</td>
                    <td><%= moment(user.create_time).format('YYYY-MM-DD HH:mm:ss') %></td>
                    <td><a>详细</a></td>
                    <td>升级</td>
                </tr>
                <% }) %>
                </tbody>
            </table>
            <nav aria-label="Page navigation">
                <%include ../layout/page.html %>
            </nav>
        </div>
    </div>
</div>


<!-- 弹窗查看用户详情-->
<div class="modal fade" id="view" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" >用户信息</h4>
            </div>
            <div class="modal-body">
                <table class="table table-bordered">
                    <tbody>
                    <tr><th>注册时间</th><td>2017-03-03 14:29:03</td><th>最近登录</th><td>2017-03-04 14:29:03</td></tr>
                    <tr><th>手机</th><td>12345678909</td><th>邮箱</th><td></td></tr>
                    <tr><th>姓名</th><td colspan="3">张三</td></tr>
                    <tr><th>企业名称</th><td colspan="3">珠海纵横创新软件有限公司</td></tr>
                    <tr><th>企业地区</th><td>珠海</td><th>企业类型</th><td>设计</td></tr>
                    <tr><th>企业规模</th><td colspan="3">20-50</td></tr>
                    </tbody>
                </table>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>


<script type="text/javascript" src="/web/users/js/user.js"></script>