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

<%@ Register Src="~/user/MyHeader.ascx" TagPrefix="uc1" TagName="MyHeader" %>
<%@ Register Src="~/user/MyFooter.ascx" TagPrefix="uc1" TagName="MyFooter" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>会议室预约系统</title>
    <link href="/control/plugin/bootstrap3/css/bootstrap.min.css" rel="stylesheet" />
    <link href="/admin/css/style.css?v=201721" rel="stylesheet" />
    <script src="/control/js/jquery.js"></script>
    <script src="/control/plugin/bootstrap3/js/bootstrap.min.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 type="text/css">
        .ditem {
            font-size: 18px;
            color: brown;
        }
    </style>
</head>
<body>
    <uc1:MyHeader runat="server" ID="MyHeader1" />
    <div class=" container-fluid">

        <div class="row">
            <div class="col-lg-12 ">
                <!-- Nav tabs -->
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation"><a href="Room_Details.aspx?id=<%=Request["id"] %>">[<%=rModel.r_name %>]会议室描述</a></li>
                    <li role="presentation" class="active"><a href="Room_Meeting.aspx?id=<%=Request["id"] %>">[<%=rModel.r_name %>]相关会议</a></li>
                </ul>
                <!-- Tab panes -->
                <div class="tab-content">
                    <div class="panel">
                        <div class="panel-body">
                            <div class="row">
                                <div class=" col-lg-12 ">
                                    <div id="calendar"></div>
                                </div>
                     
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <uc1:MyFooter runat="server" ID="MyFooter1" />

          <script type="text/javascript">
                            $(function () {
                                var DefaultRoom = '<%=DefaultRoom %>';

                                $("#" + DefaultRoom).addClass("active");
                                
                                $('#calendar').fullCalendar({
                                    header: {
                                        left: 'prev,next today',
                                        center: 'title',
                                        right: 'month,agendaWeek,agendaDay'
                                    },
                                    defaultView: 'agendaWeek',
                                    defaultDate: '<%=DateTime.Now.ToString("yyyy-MM-dd")%>',
                                    minTime: '06:00:00',
                                    defaultTimedEventDuration: '01:00:00',
                                    selectable: false,
                                    selectHelper: true,
                                    selectOverlap: false,
                                    height: 760,
                                    eventClick: function (calEvent, jsEvent, view) {
                                        location.href = "/user/Meeting/MeetingDetails.aspx?id=" + calEvent.id;
                                    },
                                    viewRender: function (view, element) {
                                        document.cookie = "lbview=" + view.name + "; path=/";
                                    },
                                    dayClick: function (date, jsEvent, view, resourceObj) {
                                        console.log('Date: ' + date.format());
                                    },
                                    businessHours: {
                                        start: '<%=startTime %>',
                                        end: '<%=endTime %>',
                                        dow: [1, 2, 3, 4, 5, 6, 0]
                                    },
                                    timezone: 'local',
                                    editable: false,
                                    eventLimit: true, // allow "more" link when too many events
                                    events: {
                                        url: '/user/UseAjax.ashx',
                                        type: 'POST',
                                        data: {
                                            rid: DefaultRoom,
                                            tv: true
                                        }
                                    }
                                });
                            });

                            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>
</body>
</html>

