<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/ExhibitorMaster.Master" Inherits="System.Web.Mvc.ViewPage<List<FamousFurnitureExpo.Models.Person>>" %>


<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        $(function () {
            $("#CurrentPosition").html("观众报名审核");
            $("#menu41").css("visibility", "visible");

            var st = $("#Status").val();
            $("#statusmenu"+st).attr("class","tdMenuSelect");
        });

        function checkAll() {
            var check = $("#check").attr("checked");
            $("input[name='PsnID']").attr("checked", check);
        }

        function setStatus(status) {
            var items = $("input[name='PsnID']:checked");
            if (items.length > 0) {
                $("#AtaStatus").val(status);
                $("#f1").submit();
            } else {
                MsgTip.show({ msg: "没有选择任何记录！", ico: "warning", top: 340 });
            }
        }

        function goBack() {
            window.location = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ActivityList";
        }

        function GoToStatus(status) {
            window.location = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ActivityApplyExam?atyID=<%=ViewData["AtyID"] %>&status="+status+"&page=1";
        }
    </script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <center>
            <form id="f1" action="" method="post">
            <table width="100%" border="0" style="text-align: left" cellpadding="0" cellspacing="0" id="main">
                <tr>
                    <td align="left">
                    <% 
                        System.Data.DataRow drCount = ViewData["CountDataRow"] as System.Data.DataRow;
                    %>
                        <table border='0' cellpadding="0" cellspacing="0" width="100%" align="left">
                            <tr>
                                <td id="statusmenu0" class="tdMenu" onclick="GoToStatus(0)">
                                    未审核(<%=drCount["count0"] %>)
                                </td>
                                <td class="tdMenuWidth">&nbsp;</td>
                                <td id="statusmenu1" class="tdMenu" onclick="GoToStatus(1)">
                                    已通过(<%=drCount["count1"] %>)
                                </td>
                                <td class="tdMenuWidth">&nbsp;</td>
                                <td id="statusmenu2" class="tdMenu" onclick="GoToStatus(2)">
                                    已拒绝(<%=drCount["count2"] %>)
                                </td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="tdMenuLine" colspan="6"></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>当前活动：<%=ViewData["AtyTheme"] %></td>
                </tr>
                <tr>
                    <td align="left">
                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td class="td01" width="10%" align="center">全选<input id="check" name="check" type="checkbox" onclick="checkAll()" /></td>
                                <td class="td01" width="10%" align="center">姓名</td>
                                <td class="td01" width="15%" align="center">公司</td>
                                <%--<td class="td01" width="10%" align="center">职务</td>--%>
                                <td class="td01" width="15%" align="center">所在地</td>
                                <td class="td01" width="15%" align="center">手机</td>
                                <td class="td01" width="20%" align="center">电话</td>
                                <td class="td01" width="15%" align="center">Email</td>
                            </tr>
                    <%
                        if (Model.Count > 0)
                        {
                            foreach (FamousFurnitureExpo.Models.Person psn in Model)
                            {
                    %>
                            <tr>
                                <td class="td03" align="center"><input id="Psn<%=psn.PsnID %>" name="PsnID" type="checkbox" value="<%=psn.PsnID %>" /></td>
                                <td class="td03" align="left"><%=psn.PsnName%></td>
                                <td class="td03" align="left"><%=psn.PsnComName%></td>
                                <%--<td class="td03" align="left"><%=psj.PsjRank %></td>--%>
                                <td class="td03" align="left"><%=psn.PsnCountry + psn.PsnProvince%></td>
                                <td class="td03" align="left"><%=psn.PsnMobile%></td>
                                <td class="td03" align="left"><%=psn.PsnTel1%></td>
                                <td class="td03" align="left"><%=psn.PsnEmail%></td>
                            </tr>
                    <%
                            }
                    %>
                            <tr>
                                <td colspan="8">
                                    <script type="text/javascript">
                                        Pager.Display("<%=ViewData["Page"] %>","<%=ViewData["PageSize"] %>","<%=ViewData["TotalNum"] %>","<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ActivityApplyExam?atyID=<%=ViewData["AtyID"] %>&status=<%=ViewData["Status"] %>");
                                    </script>
                                </td>
                            </tr>
                    <%
                        }
                        else
                        { 
                    %>
                            <tr>
                                <td colspan="8" class="td03" align="center" valign="middle" height="40" width="100%">暂无信息</td>
                            </tr>
                    <%    
                        }
                    %>
                        </table>
                    </td>
                </tr>
                <tr><td>&nbsp;</td></tr>
                <tr>
                    <td >
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
        <% 
            if (Model.Count > 0)
            {
                int status = Convert.ToInt32(ViewData["Status"]);
                if (status != 1)
                {
        %>                        
                                <td><div class="button" onclick="setStatus('已审核')">同意</div></td>
        <%
                }
                if (status != 2)
                { 
        %>
                                <td><div class="button" onclick="setStatus('已拒绝')">拒绝</div></td>
        <%
                }
            }    
        %>
                                <td><div class="button" onclick="goBack()">返回</div></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type="hidden" id="AtyID" name="AtyID" value="<%=ViewData["AtyID"] %>" />
                        <input type="hidden" id="Status" name="Status" value="<%=ViewData["Status"] %>" />
                        <input type="hidden" id="AtaStatus" name="AtaStatus" value="" />
                    </td>
                </tr>
            </table>
            </form>
        </center>
    </div>
</asp:Content>
