<%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <link href="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Content/Site.css" rel="stylesheet"
        type="text/css" />
    <link href="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Scripts/messagetipthem1/css/style.css"
        rel="stylesheet" type="text/css" />
    <style type="text/css">
        body
        {
            background-image: none;
            font-size: 12px;
            margin-top: 0px;
        }
    </style>
    <script language="javascript" type="text/javascript" src="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Scripts/MessageTip.js"></script>
    <script src="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Scripts/jquery-1.4.1-vsdoc.js"
        type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            SetTime(1);
        });

        function Save() {
            var TktIDObj = $("input[name='TktID']");
            if (TktIDObj.length > 0) {
                var TktIDObjChk = $("input[name='TktID']:checked");
                if (TktIDObjChk.length <= 0) {
                    TktIDObj[0].focus();
                    showMsg("请选择接待人员！");
                    return;
                }
            } else {
                //                if (confirm("您还没有设置接待人员，是否跳转到接待人员管理？")) {
                //                    window.location = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/Reception";
                //                } else {

                //                }
                showMsg("您还没有设置接待人员,先在接待人员管理中设置接待人员！");
                return;
            }

            //            var area = $("input[name='Area']:checked").val();
            //            if ($.trim(area) == "") {
            //                $("input[name='Area']")[0].focus();
            //                showMsg("请选择见面地点！");
            //                return;
            //            }

            var date = $("input[name='Date']:checked").val();
            if ($.trim(date) == "") {
                $("input[name='Date']")[0].focus();
                showMsg("请选择预约日期！");
                return;
            }

            //            var reason = $("input[name='Reason']:checked").val();
            //            if ($.trim(reason) == "") {
            //                $("input[name='Reason']")[0].focus();
            //                showMsg("请选择会面主题！");
            //                return;
            //            }

            if (confirm("确认此次预约信息？")) {
                $("#f1").submit();
            }
        }

        function Show(id) {
            $("#ShowInfo").attr("src", "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ScheduleReceiverInfo/" + id);
            $("#trShow").css("display", "");
        }

        function Back() {
            window.history.go(-1);
        }

        function showMsg(msg) {
            MsgTip.show({ msg: msg, ico: "warning", top: 340 });
        }
    </script>
</head>
<body>
    <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">
                        <table width="100%" border="0" cellpadding="10" cellspacing="0">
                            <tr>
                                <td width="20%" align="right">接待人员：</td>
                                <td>
                        <%
                            FamousFurnitureExpo.Models.Person p = ViewData["Person"] as FamousFurnitureExpo.Models.Person;
                            
                            Dictionary<int, string> di = ViewData["ReceptionDi"] as Dictionary<int, string>;
                            if (di.Count > 0)
                            {
                                foreach (int TktID in di.Keys)
                                {
                        %>
                                    <input type="radio" name="TktID" value="<%=TktID %>" onclick="Show(this.value)" /><%=di[TktID]%>&nbsp;
                        <%
                                }
                            }
                            else
                            { 
                        %>
                                    <font color="red">请先在接待人员管理中设置接待人员。</font>
                                    <%--<a href="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/Reception">点击这里</a>--%>
                        <%    
                            }
                        %>
                                </td>
                            </tr>
                            <tr id="trShow" style="display:none">
                                <td align="center" valign="top" colspan="2">
                                    <iframe id="ShowInfo" marginwidth="0" frameborder="0" width="100%"></iframe>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">被预约人姓名：</td>
                                <td>
                                    <%=Server.HtmlEncode(p.PsnName) %>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">被预约人公司：</td>
                                <td>
                                    <%=Server.HtmlEncode(p.PsnComName) %>
                                </td>
                            </tr>
                            <%--<tr>
                                <td align="right">见面地点：</td>
                                <td>
                                    <input type="radio" name="Area" value="展台接待处" />展台接待处
                                    <input type="radio" name="Area" value="观众休息区" />观众休息区
                                    <input type="radio" name="Area" value="其他" />其他
                                </td>
                            </tr>--%>
                            <tr>
                                <td align="right">预约日期：</td>
                                <td>
                        <%--<%
                            List<DateTime> li = ViewData["Date"] as List<DateTime>;
                            if (li.Count > 0)
                            {
                                foreach (DateTime date in li)
                                {
                        %>
                                    <input type="radio" name="Date" value="<%=date.ToShortDateString() %>" /><%=date.ToShortDateString() %>&nbsp;
                        <%
                                }
                            }
                        %>--%>

                               <input type="radio" id="Date1" name="Date" value="2014/8/21" onclick="SetTime(1)" checked="checked" />&nbsp;&nbsp;<label for="Date1" style="color:Black">2014/8/21</label>&nbsp;<input type="radio" id="Date2" name="Date" value="2014/8/22" onclick="SetTime(1)" />&nbsp;&nbsp;<label for="Date2" style="color:Black">2014/8/22</label>
                               &nbsp;<input type="radio" id="Date3" name="Date" value="2014/8/23" onclick="SetTime(1)" />&nbsp;&nbsp;<label for="Date3" style="color:Black">2014/8/23</label>&nbsp;<input type="radio" id="Date4" name="Date" value="2014/8/24" onclick="SetTime(2)" />&nbsp;&nbsp;<label for="Date4" style="color:Black">2014/8/24</label>&nbsp;


                                </td>
                            </tr>
                            <tr>
                                <td align="right">预约时间：</td>
                                <td>
                                    <script type="text/javascript">
                                        function SetTime(Time) {
                                            var varOptionHour = "";
                                            if (Time == "1") {
                                                for (var i = 9; i < 18; i++) {
                                                    var hour = i + "";
                                                    if (i < 10) {
                                                        hour = "0" + hour;
                                                    }
                                                    varOptionHour += "<option value='" + hour + "'>" + hour + "</option>";
                                                }
                                            }
                                            else {
                                                for (var i = 9; i < 16; i++) {
                                                    var hour = i + "";
                                                    if (i < 10) {
                                                        hour = "0" + hour;
                                                    }
                                                    varOptionHour += "<option value='" + hour + "'>" + hour + "</option>";
                                                }
                                            }
                                            var varOptionMinute = "";
                                            for (var i = 0; i < 60; i++) {
                                                if (i % 15 == 0) {
                                                    var minute = i + "";
                                                    if (i < 10) {
                                                        minute = "0" + minute;
                                                    }
                                                    varOptionMinute += "<option value='" + minute + "'>" + minute + "</option>";
                                                }

                                            }
                                            var html = "";
                                            html += "<select id='Hour' name='Hour' style='width:40px;'>" + varOptionHour + "</select>";
                                            html += "时";
                                            html += "<select id='Minute' name='Minute' style='width:40px;'>" + varOptionMinute + "</select>";
                                            html += "分";

                                            document.getElementById("showtime").innerHTML = html;
                                        }
                                    </script>
                                    <span id="showtime"></span>
                                </td>
                            </tr>
                            <%--<tr>
                                <td align="right">会面主题：</td>
                                <td>
                                    <input type="radio" name="Reason" value="渠道合作" />渠道合作
                                    <input type="radio" name="Reason" value="代理产品" />代理产品
                                    <input type="radio" name="Reason" value="其他" />其他
                                </td>
                            </tr>--%>
                            <tr>
                                <td align="right" valign="top">备注信息：</td>
                                <td>
                                    <textarea cols="40" rows="5" id="LinkInfo" name="LinkInfo"></textarea>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <table border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td><div class="button" onclick="Save()">预约</div></td>
                                            <%--<td><div class="button" onclick="Back()">返回</div></td>--%>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input type="hidden" id="PsnID" name="PsnID" value="<%=p.PsnID %>" />
                                                <input type="hidden" id="Type" name="Type" value="<%=ViewData["Type"] %>" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            </form>
        </center>
    </div>
</body>
</html>