<?php session_start();?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>EduAsk</title>
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link rel="stylesheet" href="assets/css/main.css">
    <link rel="stylesheet" href="assets/css/materialize.min.css">
</head>
<body>
    <ul id="slide-out" class="side-nav">
        <li><a href="all-questions.php">Question</a></li>
        <li><a href="users.php">Users</a></li>
        
        <?php
            if(!isset($_SESSION['username'])){
                print '
                <ul id="nav-mobile" class="right hide-on-med-and-down">
                    <li><div class="divider"></div></li>
                    <li><a href="signin.php">Sign in</a></li>
                    <li><a href="signup.php">Sign up</a></li>
                </ul>
                ';
            }
        ?>
    </ul>

    <nav>
        <div class="nav-wrapper">
            <a href="#" data-activates="slide-out" class="button-collapse"><i class="material-icons">menu</i></a>
            <a href="index.php" class="brand-logo center">EduAsk</a>
            <ul id="nav-mobile" class="left hide-on-med-and-down">
                <li><a href="all-questions.php">Question</a></li>
                <!-- <li><a href="#">Tags</a></li> -->
                <li><a href="users.php">Users</a></li>
            </ul>
            <?php
                if(!isset($_SESSION['username'])){
                    print '
                    <ul id="nav-mobile" class="right hide-on-med-and-down">
                        <li><a href="signin.php">Sign in</a></li>
                        <li><a href="signup.php">Sign up</a></li>
                    </ul>
                    ';
                }else{
                    print '  
                        <div class="chip">
                            <img src="'.$_SESSION["avatar"].'" alt="'.$_SESSION["username"].'" />
                            '.$_SESSION["username"].'
                        </div>
                        <ul id="nav-mobile" class="right hide-on-med-and-down">
                            <li><a class="waves-effect waves-light btn modal-trigger" href="#askquestion">Ask A Question</a></li>
                            <li><a class="waves-effect black waves-light btn modal-trigger" href="signout.php">Sign out</a></li>
                        </ul>
                    ';
                }
            ?>

        </div>
    </nav>