<?php
$colname_korisnik = $_SESSION['username'];
$query_korisnik = "SELECT * FROM le_users WHERE email = '".$colname_korisnik."'";
$korisnik = mysqli_query($leld,$query_korisnik) or die(mysqli_error());
$row_korisnik = mysqli_fetch_assoc($korisnik);
$totalRows_korisnik = mysqli_num_rows($korisnik);
?>
        <!-- Main left sidebar menu -->
        <div id="left-sidebar" class="sidebar">
            <a href="#" class="menu_toggle"><i class="fa fa-angle-left"></i></a>
            <div class="navbar-brand">
                <a href="https://www.laktusdev.com" target="new"><img src="assets/images/logo.png" alt="LaktusDev" class="img-fluid logo"><span>LaktusDev</span></a>
                <button type="button" class="btn-toggle-offcanvas btn btn-sm float-right"><i class="fa fa-close"></i></button>
            </div>
            <div class="sidebar-scroll">
                <div class="user-account">
                    <div class="user_div">
                        <?php if ($row_korisnik['level'] == '1') { ?><img src="assets/images/user.png" class="user-photo" alt="User Profile Picture"><?php } else if ($row_korisnik['level'] == '2') { ?><img src="assets/images/user2.png" class="user-photo" alt="User Profile Picture"><?php } ?>
                    </div>
                    <div class="dropdown">
                        <span><?php if ($row_korisnik['level'] == '1') { ?>Webmaster<?php } else if ($row_korisnik['level'] == '2') { ?>Administrator<?php } ?></span>
                        <a href="javascript:void(0);" class="dropdown-toggle user-name" data-toggle="dropdown"><strong><?php echo $row_korisnik['ime']; ?></strong></a>
                        <ul class="dropdown-menu dropdown-menu-right account vivify flipInY">
                            <li><a href="user.php?ime=<?php echo $row_korisnik['ime']; ?>"><i class="fa fa-user"></i>My Profile</a></li>
                            <li><a href="settings.php"><i class="fa fa-gear"></i>Settings</a></li>
                            <li class="divider"></li>
                            <li><a href="logout.php"><i class="fa fa-power-off"></i>Logout</a></li>
                        </ul>
                    </div>
                </div>  
                <nav id="left-sidebar-nav" class="sidebar-nav">
                    <ul id="main-menu" class="metismenu animation-li-delay">
                        <li class="header">Main</li>
                        <li <?php if(basename($_SERVER['SCRIPT_NAME']) == 'index.php'){echo 'class="active"'; }else { echo ''; } ?>><a href="./"><i class="fa fa-dashboard"></i> <span>Dashboard</span></a></li>
                        <li class="header">Apps</li>

                        <li <?php if(basename($_SERVER['SCRIPT_NAME']) == 'events_catering.php'){echo 'class="active"'; }else { echo ''; } ?>><a href="events_catering.php"><i class="fa fa-calendar"></i> <span>Events Catering</span></a></li>
						<li <?php if(basename($_SERVER['SCRIPT_NAME']) == 'menu.php'){echo 'class="active"'; }else { echo ''; } ?><?php if(basename($_SERVER['SCRIPT_NAME']) == 'add_content.php'){echo 'class="active"'; }else { echo ''; } ?>><a href="menu.php"><i class="fa fa-th-list"></i> <span>Menu</span></a>
						<ul>
							<li <?php if(basename($_SERVER['SCRIPT_NAME']) == 'menu.php'){echo 'class="active"'; }else { echo ''; } ?>><a href="menu.php"><i class="fa fa-eye"></i> <span>Pregled</span></a></li>
							<li <?php if(basename($_SERVER['SCRIPT_NAME']) == 'add_content.php'){echo 'class="active"'; }else { echo ''; } ?>><a href="add_content.php"><i class="fa fa-plus-square"></i> <span>Dodaj</span></a></li>
						</ul>
						</li>
						<li <?php if(basename($_SERVER['SCRIPT_NAME']) == 'gallery.php'){echo 'class="active"'; }else { echo ''; } ?>><a href="gallery.php"><i class="fa fa-photo"></i> <span>Gallery</span></a></li>
						<li <?php if(basename($_SERVER['SCRIPT_NAME']) == 'portfolio.php'){echo 'class="active"'; }else { echo ''; } ?>><a href="portfolio.php"><i class="fa fa-photo"></i> <span>Portfolio</span></a></li>
						<li <?php if(basename($_SERVER['SCRIPT_NAME']) == 'users.php'){echo 'class="active"'; }else { echo ''; } ?>><a href="users.php"><i class="fa fa-users"></i> <span>Korisnici</span></a></li>
						
						
                        <li class="extra_widget">

                            
                        </li>
                    </ul>
                </nav>     
            </div>
        </div>