<%@ page language="C#" autoeventwireup="true" inherits="user_Meeting_Meeting_My, ALL" enableEventValidation="false" %>


<%@ Register Src="~/user/MyHeader.ascx" TagPrefix="uc2" TagName="MyHeader" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>网上预约系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/control/plugin/bootstrap3/css/bootstrap.min.css" rel="stylesheet" />
    <script src="/control/js/jquery.js"></script>
    <script src="/control/plugin/bootstrap3/js/bootstrap.min.js"></script>
    <link href="/user/css/style.css?v=2" rel="stylesheet" />
    <script src="/control/plugin/My97DatePicker/WdatePicker.js"></script>

    <link href="/control/plugin/fullcalendar/fullcalendar.css" rel="stylesheet" />
    <script src="/control/plugin/fullcalendar/lib/moment.min.js"></script>
    <script src='/control/plugin/fullcalendar/fullcalendar.js'></script>
    <script src="/control/plugin/fullcalendar/locale/zh-cn.js"></script>
    <style>
        .fc-event{
            cursor:pointer;
        }
    </style>
</head>
<body>
    <uc2:MyHeader runat="server" ID="MyHeader1" />
    <div class=" container-fluid">

<%--        <div class="row">
            <div class="col-lg-12 ">
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active"  ><a href="Meeting_My.aspx" >我的会议</a></li>
                    <li role="presentation"  ><a href="Meeting_MyList.aspx" >会议查询</a></li>
                </ul>
            </div>
        </div>--%>
        <div class="row">
            <div class="col-lg-12  ">
        
                <div class="panel panel-default"  >
                    <div class="panel-body">
                        <script type="text/javascript">
                            $(function () {
                                $('#calendar').fullCalendar({
                                    header: {
                                        left: 'prev,next today',
                                        center: 'title',
                                        right: 'month,agendaWeek,agendaDay'
                                    },
                                    defaultView: 'month',
                                    defaultDate: '<%=DateTime.Now.ToString("yyyy-MM-dd")%>', 
                                    minTime: '06:00:00',
                                    defaultTimedEventDuration: '01:00:00',
                                    selectHelper: true,
                                    selectOverlap: false,
                                    height: 760,
                                    eventClick: function (calEvent, jsEvent, view) {
                                        showDetails(calEvent.id);
                                    }, 
                                    businessHours: {
                                        start: '<%=startTime %>', 
                                        end: '<%=endTime %>',
                                        dow: [1, 2, 3, 4, 5,6,0]
                                    },
                                    editable: false,
                                    eventLimit: true, 
                                    events: {
                                        url: '/user/Meeting/Meeting.ashx',
                                        type: 'POST',
                                        data: {
                                            tv: true
                                        }
                                    }
                                });
                            });
                            var currentMeeting = null;
                            function showMeeting() {
                                location.href = "MeetingDetails.aspx?id=" + currentMeeting;
                            }

                            function getDateString(date) {
                                var month = date.getMonth() + 1;
                                if (month < 10) {
                                    month = "0" + month;
                                }
                                var day = date.getDate();
                                if (day < 10) {
                                    day = "0" + day;
                                }
                                var hours = date.getHours();
                                if (hours < 10) {
                                    hours = "0" + hours;
                                }
                                var Minutes = date.getMinutes();
                                if (Minutes < 10) {
                                    Minutes = "0" + Minutes;
                                }
                                return date.getFullYear() + "/" + month + "/" + day + " " + hours + ":" + Minutes;
                            }

                        </script>
                         <div id="calendar"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

        <div class="modal" id="showDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
        <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" id="MeetingName"></h4>
                </div>
                <div id="showContent" class="modal-body">

                    <div class="form-group">
                        <label class=" control-label">
                            会议室名称<span class='rd'>*</span>：  
                        </label>
                        <div>
                            <span id="txtr_name"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class=" control-label">
                            会议开始<span class='rd'>*</span>：</label>
                        <div>

                            <span id="txtstart"></span>

                        </div>
                    </div>
                    <div class="form-group">
                        <label class=" control-label">
                            会议截至<span class='rd'>*</span>：</label>
                        <div>
                            <span id="txtend"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class=" control-label">
                            会议创建者：</label>
                        <div>
                            <span id="txtCreate"></span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class=" control-label">
                            参与者：</label>
                        <div>
                            <span id="txtparticipant"></span>
                        </div>
                    </div>

                     <div class="form-group">
                        <label class=" control-label">
                            外部参与者：</label>
                        <div>
                            <span id="txtexternalPerson"></span>
                        </div>
                    </div>
                    
                </div>

                <div class="modal-footer">
                    <button type="button" onclick="showMeeting()" class="btn btn-primary">会议详细</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>

                </div>
            </div>
        </div>
    </div>

    <script  type="text/javascript">
        var currentMeeting = null;
        function showMeeting() {
            location.href = "/user/Meeting/MeetingDetails.aspx?id=" + currentMeeting;
        }
        function showDetails(key) {
            $.get("/user/Meeting/Meeting.ashx", { sid: key }, function (data) {
                if (data.state == 1) {

                    $("#MeetingName").text(data.name);
                    $("#txtr_name").text(data.rname);
                    $("#txtstart").text(data.start);
                    $("#txtend").text(data.end);
                    $("#txtCreate").text(data.create);
                    $("#txtparticipant").text(data.participant);
                    $("#txtexternalPerson").text(data.externalPerson);
                    $('#showDialog').modal();

                    currentMeeting = key;
                }
            }, "json");
        }
    </script>
</body>
</html>
