<%@include file="/WEB-INF/common/layouts/common.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<html>
<head>
    <title>邀请记录报表</title>
</head>
<body>

<!-- 面包屑 begin -->
<div class="row-fluid">
    <div class="span12">
        <ul class="breadcrumb">
            <li class="active"><span class="divider" style="color:#26a0da;font-weight:bold;">/</span>邀请记录报表
            </li>
        </ul>
    </div>
</div>
<!-- 面包屑 begin -->

<div class="page-container">
    <div class="row${fluid}">
        <div class="span12">
            <form id="filterForm" class="form-inline filterForm" action="${ctx}/invitereport/list" method="get">
                <input type="text" class="span2 date datetime-picker"
                       placeholder="开始时间" id="startTime" value="${param['startTime']}"
                       name="startTime" title="开始时间">
                <input type="text"
                       class="span2 date datetime-picker" placeholder="结束时间" title="结束时间"
                       id="endTime" name="endTime" value="${param['endTime']}">
                <labael>手机号:</labael>
                <textarea id="phone" name="phone"></textarea>
                <div class="buttons pull-right" style="margin:3px 40px 0 0;">
                    <i class="icon-search icon-2x pointer" onclick="$('#filterForm').submit();" title="搜索"></i>
                    <button type="button"
                            onclick="$('#filterForm').attr('action','${ctx}/invitereport/exportList');$('#filterForm').submit();$('#filterForm').attr('action','${ctx}/invitereport/list');"
                            style="margin-left: 10px;">
                        导出Excel
                    </button>
                </div>
            </form>
        </div>
    </div>
    <table class="table table-striped table-advance table-hover">
        <thead>
        <tr>
            <th width="100">编号</th>
            <th width="100">邀请人手机号</th>
            <th width="100">邀请码</th>
            <th width="100">邀请人数</th>
            <th width="150">操作</th>
        </tr>
        </thead>
        <c:forEach items="${dataList}" var="item">
            <tr>
                <td nowrap="nowrap">
                        ${item.id}
                </td>
                <td nowrap="nowrap">
                        ${item.city}
                </td>
                <td nowrap="nowrap">
                    <c:out value="${item.inviteCode}"/>
                </td>
                <td nowrap="nowrap">
                        ${item.inviteCount}
                </td>
                <td nowrap="nowrap">
                    <button type="button" onclick="goUrl(${item.inviteCode});">二级菜单</button>
                </td>
            </tr>
        </c:forEach>
    </table>
    <div class="row${fluid}">
        <house365:pagination page="${page}"/>
    </div>
</div>
<script type="text/javascript">

    $(function () {
        var hasPhone = ${hasPhone};
        if (hasPhone == 1) {
            var phone = ${phone};
            if (phone != null && phone != '' && phone != '100') {
                phone.join(',');
            }
            $("#phone").val(phone);
        }
    });

    function goUrl(inviteCode) {
        debugger;
        var startTime = $('#startTime').val();
        var endTime = $('#endTime').val();
        var url = '${ctx}/invitereport/stepList/' + inviteCode + '?';
        url = url + 'startTime=' + startTime + '&endTime=' + endTime;
        window.location = url;
    }


</script>
</body>
</html>
