<?php 
include('../include/connection.php');
require_once '../lib/dbconfig.php';
require_once '../lib/custom.php';
include('../include/app_config.php');
//require_once 'lib/auth.class.php';

if(!$user->is_loggedin() || (isset($_SESSION['user_role']) && $_SESSION['user_role'] == CLIENT_USER_KEY))
{
    echo '<script>window.location="../admin/login"</script>';
}
date_default_timezone_set('Africa/Lagos');
?>
<!DOCTYPE html>
<html class="loading" lang="en" data-textdirection="ltr">
<!-- BEGIN: Head-->

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <meta name="description" content="Modern admin is super flexible, powerful, clean &amp; modern responsive bootstrap 4 admin template with unlimited possibilities with bitcoin dashboard.">
    <meta name="keywords" content="admin template, modern admin template, dashboard template, flat admin template, responsive admin template, web app, crypto dashboard, bitcoin dashboard">
    <meta name="author" content="PIXINVENT">
    <title><?php echo $title;?> :: NDPHC Admin</title>
    <link rel="apple-touch-icon" href="app-assets/images/ico/apple-icon-120.png">
    <link rel="icon" type="image/png" href="../images/favicon.png"/>
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i%7CQuicksand:300,400,500,700" rel="stylesheet">

    <!-- BEGIN: Vendor CSS-->
    <link rel="stylesheet" type="text/css" href="app-assets/vendors/css/vendors.min.css">
    <link rel="stylesheet" type="text/css" href="app-assets/vendors/css/weather-icons/climacons.min.css">
    <link rel="stylesheet" type="text/css" href="app-assets/fonts/meteocons/style.css">
    <link rel="stylesheet" type="text/css" href="app-assets/vendors/css/charts/morris.css">
    <link rel="stylesheet" type="text/css" href="app-assets/vendors/css/charts/chartist.css">
    <link rel="stylesheet" type="text/css" href="app-assets/vendors/css/charts/chartist-plugin-tooltip.css">
    <!-- END: Vendor CSS-->
    
    
    
    <!-- BEGIN: Theme CSS-->
    <link rel="stylesheet" type="text/css" href="app-assets/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="app-assets/css/bootstrap-extended.css">
    <link href="../assets/bootstrap-fileupload/bootstrap-fileupload.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="app-assets/css/colors.css">
    <link rel="stylesheet" type="text/css" href="app-assets/css/components.css">
    <!-- END: Theme CSS-->

    <!-- BEGIN: Page CSS-->
    <link href="../admin/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="../admin/css/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="app-assets/css/core/menu/menu-types/vertical-menu.css">
    <link rel="stylesheet" type="text/css" href="app-assets/css/core/colors/palette-gradient.css">
    <link rel="stylesheet" type="text/css" href="app-assets/fonts/simple-line-icons/style.css">
    <link rel="stylesheet" type="text/css" href="app-assets/css/core/colors/palette-gradient.css">
    <link rel="stylesheet" type="text/css" href="app-assets/css/pages/timeline.css">
    <link rel="stylesheet" type="text/css" href="app-assets/css/pages/dashboard-ecommerce.css">
    
    <!-- Toastr style -->
    <link href="../admin/css/plugins/toastr/toastr.min.css" rel="stylesheet">
    
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css" rel="stylesheet" />

<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css" rel="stylesheet">


    <script src="app-assets/vendors/js/vendors.min.js"></script>

    <script>
        function logout()
        {
        	$(document).ready(function(){
        		var datastring = {'id' : 1};
        		$.ajax({
        		            type: "POST",
        		            url: "../admin/logout.php",
        		            data: datastring,
        		            cache: false,
        		            success: function(data) {
        		                window.location.href="../index";
        		                //alert(data);
        		            },
        		            error: function(){
        		                  alert('error handling here');
        		            }
        		        });
        		
        	});
        }
    </script>
    
    <style>
    .table.smaller td, .table.smaller th
    {
    	font-size: 12px!important;
    }
    .main-menu.menu-dark .navigation {
        background: #2c343b!important;
    }
    .card-content
    {
    	padding: 15px;
    }
    .row-pad
    {
    	padding-bottom: 7px
    }
    input.form-control.input-sm {
        height: calc(1.25em + 1.5rem + 2px);
        padding: 0.75rem 1rem;
        font-size: 1rem;
        line-height: 1.45;
        border-radius: 0.21rem;
    }
.form-control {
    border: 1px solid #e7e7e7;
}
.input-group-addon {
	border: none!important
}
.btn-white
{
	border: 1px solid #ddd!important;
	color: #333;
}
    </style>

</head>
<!-- END: Head-->

<!-- BEGIN: Body-->

<body class="vertical-layout vertical-menu 2-columns   fixed-navbar" data-open="click" data-menu="vertical-menu" data-col="2-columns">

    <!-- BEGIN: Header-->
    <nav class="header-navbar navbar-expand-md navbar navbar-with-menu navbar-without-dd-arrow fixed-top navbar-semi-dark navbar-shadow">
        <div class="navbar-wrapper">
            <div class="navbar-header">
                <ul class="nav navbar-nav flex-row">
                    <li class="nav-item mobile-menu d-md-none mr-auto"><a class="nav-link nav-menu-main menu-toggle hidden-xs" href="#"><i class="ft-menu font-large-1"></i></a></li>
                    <li class="nav-item"><a class="navbar-brand" href="index"><img class="brand-logo" alt="ndphc admin" src="../assets/img/favicon.png">
                            <h3 class="brand-text">NDPHC</h3>
                        </a></li>
                    <li class="nav-item d-md-none"><a class="nav-link open-navbar-container" data-toggle="collapse" data-target="#navbar-mobile"><i class="la la-ellipsis-v"></i></a></li>
                </ul>
            </div>
            <div class="navbar-container content">
                <div class="collapse navbar-collapse" id="navbar-mobile">
                    <ul class="nav navbar-nav mr-auto float-left">
                        <li class="nav-item d-none d-md-block"><a class="nav-link nav-menu-main menu-toggle hidden-xs" href="#"><i class="ft-menu"></i></a></li>
                        <li class="nav-item d-none d-lg-block"><a class="nav-link nav-link-expand" href="#"><i class="ficon ft-maximize"></i></a></li>
                    </ul>
                    <ul class="nav navbar-nav float-right">
                        <li class="dropdown dropdown-user nav-item"><a class="dropdown-toggle nav-link dropdown-user-link" href="#" data-toggle="dropdown"><span class="mr-1 user-name text-bold-700"><?php echo $_SESSION['user_session'];?></span><span class="avatar avatar-online"><img src="app-assets/images/portrait/small/avatar-s-19.png" alt="avatar"><i></i></span></a>
                            <div class="dropdown-menu dropdown-menu-right">
                                <div class="dropdown-divider"></div><a class="dropdown-item" href="javascript:;" onclick="logout()"><i class="ft-power"></i> Logout</a>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </nav>
    <!-- END: Header-->


    <!-- BEGIN: Main Menu-->

    <div class="main-menu menu-fixed menu-light menu-accordion    menu-shadow " data-scroll-to-active="true">
        <div class="main-menu-content">
            <ul class="navigation navigation-main" id="main-menu-navigation" data-menu="menu-navigation">
          
                <li class=" nav-item" id="dashboard"><a href="index"><i class="la la-home"></i><span class="menu-title" data-i18n="eCommerce">Dashboard</span></a>
                </li>
                <li class=" nav-item" id="category"><a href="category_list"><i class="la la-plane"></i><span class="menu-title" data-i18n="Travel &amp; Booking">Categories</span></a>
                </li>
                <li class=" nav-item" id="article"><a href="article_list"><i class="la la-book"></i><span class="menu-title" data-i18n="Hospital">Articles</span></a>
                </li>
                <li class=" nav-item" id="event"><a href="event_list"><i class="la la-briefcase"></i><span class="menu-title" data-i18n="Crypto">Events</span></a>
                </li>
                <li class=" nav-item" id="gen"><a href="gen_list"><i class="la la-building"></i><span class="menu-title" data-i18n="Crypto">Power Generation</span></a>
                </li>
                <li class=" nav-item" id="staffbday"><a href="staff_birthdays"><i class="la la-briefcase"></i><span class="menu-title" data-i18n="Crypto">Staff Birthdays</span></a>
                </li>

                <li class=" nav-item" id="template"><a href="message_template"><i class="ft-mail"></i><span class="menu-title" data-i18n="Crypto">Message Template</span></a>
                </li>

                <li class=" nav-item" id="msgHistory"><a href="message_history"><i class="la la-trash"></i><span class="menu-title" data-i18n="Crypto">Message History</span></a>
                </li>

                <?php if ($_SESSION['user_role']==SUPER_ADMIN_USER_KEY) { ?>
                    
                    <li class=" nav-item" id="adminSetup"><a href="admins"><i class="ft-user"></i><span class="menu-title" data-i18n="Crypto">Setup Admin</span></a>
                    </li>
                
                <?php } ?>
                

                <li class=" nav-item"><a href="javascript:;" onlick="logout()"><i class="la la-power-off"></i><span class="menu-title" data-i18n="Crypto">Logout</span></a>
                </li>
                
                
            </ul>
        </div>
    </div>

    <!-- END: Main Menu-->
    <!-- BEGIN: Content-->
    <div class="app-content content">
        <div class="content-overlay"></div>
        <div class="content-wrapper">
            <div class="content-header row">
            </div>