<?php
// Include the database connection
include 'db_connection.php';

// Fetch settings from the database
$sql = "SELECT school_name, school_tagline, logo, current_term, current_session FROM settings WHERE id = 1";
$result = mysqli_query($conn, $sql);
$settings = mysqli_fetch_assoc($result);
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="#"> <!-- Link to your CSS file -->
    <style type="text/css">
        .navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #343a40;
    padding: 10px 20px;
    color: #fff;
}

.navbar-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.navbar-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.navbar-info {
    flex-grow: 1;
    text-align: left;
}

.navbar-school-name {
    margin: 0;
    font-size: 20px;
    color: #fff;
}

.navbar-school-tagline {
    margin: 0;
    font-size: 14px;
    color: #ccc;
}

.navbar-session-info {
    text-align: right;
    font-size: 18px;
}

.navbar-session-info p {
    margin: 0;
    color: #ccc;
}

.navbar-term-info {
    text-align: center;
    font-size: 18px;
     flex-grow: 10;
}

.navbar-term-info p {
    margin: 0;
    color: #ccc;
}

    </style>
    <title>School Header</title>
</head>
<body>
    <nav class="navbar">
        <div class="navbar-logo-container">
           <a href=admin_dashboard.php><img src="uploads/<?php echo $settings['logo']; ?>" alt="School Logo" class="navbar-logo"></a>
        </div>
        <div class="navbar-info">
            <a href=admin_dashboard.php><h1 class="navbar-school-name"><?php echo $settings['school_name']; ?></h1>
            <p class="navbar-school-tagline"><?php echo $settings['school_tagline']; ?></p></a>
        </div>
        <div class="navbar-term-info">
            <p>Current Term: <?php echo $settings['current_term']; ?></p>
       </div>
        <div class="navbar-session-info">
            <p>Current Session: <?php echo $settings['current_session']; ?></p>
        </div>
    </nav>
</body>
</html>
