<!DOCTYPE html>
<html>
    <head>
        <meta charset='utf-8' />
        <link href='<?php echo THEME_PATH?>plugins/calendar/fullcalendar.min.css' rel='stylesheet' />
        <link href='<?php echo THEME_PATH?>plugins/calendar/fullcalendar.print.min.css' rel='stylesheet' media='print' />
        <script src='<?php echo THEME_PATH?>plugins/calendar/lib/moment.min.js'></script>
        <script src='<?php echo THEME_PATH?>plugins/calendar/lib/jquery.min.js'></script>
        <script src='<?php echo THEME_PATH?>plugins/calendar/fullcalendar.min.js'></script>
        <script src='<?php echo THEME_PATH?>plugins/calendar/locale/ar.js'></script>
        <script>
            var today = <?php echo json_encode($today);?>,
                    is_actual = <?php echo json_encode($is_actual);?>;
            $(document).ready(function() {

                $('#calendar').fullCalendar({
                    header: {
                        left: 'prev,next today',
                        center: 'title',
                        right: 'month,agendaWeek,agendaDay,listWeek'
                    },

                    defaultDate: today,
                    Boolean, default: true,
                    editable: false,
                    navLinks: true, // can click day/week names to navigate views
                    eventLimit: true, // allow "more" link when too many events
                    events: {
                        url: 'HRMAjax/leaveCalenderRequest?is_actual='+is_actual, 
//                        url: 'calendar/demos/json/events.json', 
                        error: function() {
                            $('#script-warning').show();
                        }
                    },
                    loading: function(bool) {
                        $('#loading').toggle(bool);
                    }
                });

            });

        </script>
        <style>

            body {
                margin: 0;
                padding: 0;
                font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
                font-size: 14px;
            }

            #script-warning {
                display: none;
                background: #eee;
                border-bottom: 1px solid #ddd;
                padding: 0 10px;
                line-height: 40px;
                text-align: center;
                font-weight: bold;
                font-size: 12px;
                color: red;
            }

            #loading {
                display: none;
                position: absolute;
                top: 10px;
                right: 10px;
            }

            #calendar {
                /*                max-width: 900px;*/
                margin: 40px auto;
                padding: 0 10px;
            }

        </style>
    </head>
    <body>

        <!--                < ?php echo "<pre>"; die(json_encode($resources));?>-->
        <div class="container-fluid container-fixed-lg bg-white">
            <div class="panel panel-transparent">

                <div class="panel-title"><?php print CommonLanguage::getMessage('leave_calendar'); ?></div>
                <div class="clearfix"></div>
                <div id='script-warning'>
                    <code>error connecting </code> must be check data running.
                </div>

                <div id='loading'>loading...</div>

                <div id='calendar'></div>

            </div>
        </div>
    </body>
</html>
