Sindbad~EG File Manager

Current Path : /home/copmadinaarea/thecopmadinaarea.org/newsfeed/includes/
Upload File :
Current File : /home/copmadinaarea/thecopmadinaarea.org/newsfeed/includes/header.php

<?php
// Get site settings
$site_title = get_site_title();
$site_logo = get_site_logo();
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= isset($page_title) ? $page_title . ' - ' . $site_title : $site_title ?></title>
    
    <!-- Tailwind CSS -->
    <script src="https://cdn.tailwindcss.com"></script>
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        'cop-blue': '#3B82F6',
                        'cop-yellow': '#F59E0B',
                        'cop-dark': '#374151',
                        'cop-light': '#F3F4F6'
                    }
                }
            }
        }
    </script>
    
    <!-- Vue.js -->
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    
    <!-- Custom CSS -->
    <link rel="stylesheet" href="<?= isset($css_path) ? $css_path : 'assets/css/style.css' ?>">
    
    <style>
        body {
            background: linear-gradient(135deg, #3B82F6 0%, #F59E0B 100%);
            min-height: 100vh;
        }
        
        .glass-effect {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }
        
        .card-hover {
            transition: all 0.3s ease;
        }
        
        .card-hover:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        }
    </style>
</head>
<body class="font-sans">
    <div id="app">
        <header class="glass-effect shadow-lg sticky top-0 z-50">
            <nav class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
                <div class="flex justify-between items-center h-16">
                    <div class="flex items-center">
                        <?php 
                        // Always redirect to dashboard - determine correct path based on current location
                        $current_dir = basename(dirname($_SERVER['PHP_SELF']));
                        
                        if ($current_dir === 'copmadnews') {
                            // We're in the root directory
                            $settings_link = 'dashboard.php';
                        } else {
                            // We're in a subdirectory, go back to root
                            $settings_link = '../dashboard.php';
                        }
                        ?>
                        <a href="<?php echo $settings_link; ?>" class="flex items-center space-x-2 text-cop-blue hover:text-cop-blue transition-colors" title="Dashboard">
                            <?php if (!empty($site_logo) && file_exists($site_logo)): ?>
                                <img src="<?php echo $site_logo; ?>" alt="<?php echo $site_title; ?>" class="h-8 w-8">
                            <?php else: ?>
                                <i class="fas fa-church text-2xl"></i>
                            <?php endif; ?>
                            <span class="text-xl font-bold"><?php echo $site_title; ?></span>
                        </a>
                    </div>
                    
                    <div class="hidden md:block">
                        <div class="ml-10 flex items-baseline space-x-4">
                            <?php if (isset($_SESSION['user_id'])): ?>
                                <a href="<?= isset($dashboard_path) ? $dashboard_path : 'dashboard.php' ?>" class="nav-link">
                                    <i class="fas fa-tachometer-alt"></i> Dashboard
                                </a>
                                <a href="<?= isset($news_path) ? $news_path : 'news/index.php' ?>" class="nav-link">
                                    <i class="fas fa-newspaper"></i> News
                                </a>
                                <a href="<?= isset($create_path) ? $create_path : 'news/create.php' ?>" class="nav-link">
                                    <i class="fas fa-plus"></i> Add News
                                </a>
                                <?php if (in_array($_SESSION['account_type'] ?? '', ['editor', 'admin', 'superuser'])): ?>
                                <a href="<?= isset($editorial_path) ? $editorial_path : 'editorial/dashboard.php' ?>" class="nav-link">
                                    <i class="fas fa-edit"></i> Editorial
                                </a>
                                <?php endif; ?>
                                <?php if (in_array($_SESSION['account_type'] ?? '', ['admin', 'superuser'])): ?>
                                <a href="<?= isset($admin_path) ? $admin_path : 'admin/' ?>" class="nav-link">
                                    <i class="fas fa-cog"></i> Admin
                                </a>
                                <?php endif; ?>
                                <a href="<?= isset($profile_path) ? $profile_path : 'profile.php' ?>" class="nav-link">
                                    <i class="fas fa-user"></i> Profile
                                </a>
                                <a href="<?= isset($logout_path) ? $logout_path : 'logout.php' ?>" class="nav-link text-red-600 hover:text-red-800">
                                    <i class="fas fa-sign-out-alt"></i> Logout
                                </a>
                            <?php endif; ?>
                        </div>
                    </div>
                    
                    <!-- Mobile menu button -->
                    <div class="md:hidden">
                        <button @click="mobileMenuOpen = !mobileMenuOpen" class="text-cop-dark hover:text-cop-blue">
                            <i class="fas fa-bars text-xl"></i>
                        </button>
                    </div>
                </div>
                
                <!-- Mobile menu -->
                <div v-show="mobileMenuOpen" class="md:hidden">
                    <div class="px-2 pt-2 pb-3 space-y-1 sm:px-3 bg-white rounded-lg mt-2 shadow-lg">
                        <?php if (isset($_SESSION['user_id'])): ?>
                            <a href="<?= isset($dashboard_path) ? $dashboard_path : 'dashboard.php' ?>" class="mobile-nav-link">
                                <i class="fas fa-tachometer-alt"></i> Dashboard
                            </a>
                            <a href="<?= isset($news_path) ? $news_path : 'news/index.php' ?>" class="mobile-nav-link">
                                <i class="fas fa-newspaper"></i> News
                            </a>
                            <a href="<?= isset($create_path) ? $create_path : 'news/create.php' ?>" class="mobile-nav-link">
                                <i class="fas fa-plus"></i> Add News
                            </a>
                            <?php if (in_array($_SESSION['account_type'] ?? '', ['editor', 'admin', 'superuser'])): ?>
                            <a href="<?= isset($editorial_path) ? $editorial_path : 'editorial/dashboard.php' ?>" class="mobile-nav-link">
                                <i class="fas fa-edit"></i> Editorial
                            </a>
                            <?php endif; ?>
                            <?php if (in_array($_SESSION['account_type'] ?? '', ['admin', 'superuser'])): ?>
                            <a href="<?= isset($admin_path) ? $admin_path : 'admin/' ?>" class="mobile-nav-link">
                                <i class="fas fa-cog"></i> Admin
                            </a>
                            <?php endif; ?>
                            <a href="<?= isset($profile_path) ? $profile_path : 'profile.php' ?>" class="mobile-nav-link">
                                <i class="fas fa-user"></i> Profile
                            </a>
                            <a href="<?= isset($logout_path) ? $logout_path : 'logout.php' ?>" class="mobile-nav-link text-red-600">
                                <i class="fas fa-sign-out-alt"></i> Logout
                            </a>
                        <?php endif; ?>
                    </div>
                </div>
            </nav>
        </header>

        <main class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists