<?php
    $filepath = realpath(dirname(__FILE__));
    include_once $filepath."/../lib/Session.php";
    Session::init();
    spl_autoload_register(function($classes){
      include DOCUMENT_ROOT_CLASS.'classes/'.$classes.".php";
    });
    $users = new Users();
    $commonFunctions = new CommonFunctions();
    Session::CheckSession();
?>
<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="utf-8" />
        <title><?php echo TITLE;?></title>
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
        <meta content="" name="author" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />

        <!-- App favicon -->
        <link rel="shortcut icon" href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/images/favicon.ico">

        <!-- DataTables -->
        <link href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/plugins/datatables/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/plugins/datatables/buttons.bootstrap4.min.css" rel="stylesheet" type="text/css" />
        <!-- Responsive datatable examples -->
        <link href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/plugins/datatables/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css" />
        
        <link href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/plugins/RWD-Table-Patterns/dist/css/rwd-table.min.css" rel="stylesheet" type="text/css" media="screen">
        
        <link href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/plugins/leaflet/leaflet.css" rel="stylesheet">
        <link href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/plugins/lightpick/lightpick.css" rel="stylesheet" />
        
        <!-- App css -->
        <link href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/css/icons.min.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/css/metisMenu.min.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/plugins/daterangepicker/daterangepicker.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/css/app.min.css" rel="stylesheet" type="text/css" />
        <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
        <link href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/plugins/treeview/themes/default/style.css" rel="stylesheet">

        <link href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/plugins/bootstrap-touchspin/css/jquery.bootstrap-touchspin.min.css" rel="stylesheet" />

        <!-- Custom css -->
        <link href="<?php echo DOCUMENT_ROOT_CLASS;?>assets/css/common.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
        <script src="<?php echo DOCUMENT_ROOT_CLASS;?>assets/js/jquery.min.js"></script>
    </head>

<body>
<style type="text/css">
    .select2-container .select2-selection--single{height: 37px;}
    .paginate {font-family:"Times New Roman", Times, serif;padding: 3px;margin: 3px;font-size: 15px;}
    .paginate a {padding:2px 5px 2px 5px;margin:2px;border:1px solid #999;text-decoration:none;color: #666;}
    .paginate a:hover, .paginate a:active {border: 1px solid #999;color: #0066FF;}
    .paginate span.current {margin: 2px;padding: 2px 5px 2px 5px;border: 1px solid #1761fd;font-weight: bold;background-color: #1761fd;color: #FFF;}
    .paginate span.disabled {padding:2px 5px 2px 5px;margin:2px;border:1px solid #eee;color:#DDD;}
</style>
<?php
$sub = DOCUMENT_ROOT_CLASS;
if(empty(DOCUMENT_ROOT_INC_FOLDER)){
    $sub = "";
}
require $filepath.$sub."/".@DOCUMENT_ROOT_INC_FOLDER."menu.php";?>
<div class="page-wrapper">
    <!-- Top Bar Start -->
    <div class="topbar">            
        <!-- Navbar -->
        <nav class="navbar-custom">    
            <ul class="list-unstyled topbar-nav float-right mb-0">  
                <li class="dropdown hide-phone">
                    <a class="nav-link dropdown-toggle arrow-none waves-light waves-effect" data-toggle="dropdown" href="#" role="button"
                        aria-haspopup="false" aria-expanded="false">
                        <i data-feather="search" class="topbar-icon"></i>
                    </a>
                    
                    <div class="dropdown-menu dropdown-menu-right dropdown-lg p-0">
                        <!-- Top Search Bar -->
                        <div class="app-search-topbar">
                            <form action="#" method="get">
                                <input type="search" name="search" class="from-control top-search mb-0" placeholder="Type text...">
                                <button type="submit"><i class="ti-search"></i></button>
                            </form>
                        </div>
                    </div>
                </li>                      

                <li class="dropdown notification-list">
                    <a class="nav-link dropdown-toggle arrow-none waves-light waves-effect" data-toggle="dropdown" href="#" role="button"
                        aria-haspopup="false" aria-expanded="false">
                        <i data-feather="bell" class="align-self-center topbar-icon"></i>
                        <span class="badge badge-danger badge-pill noti-icon-badge">2</span>
                    </a>
                    <div class="dropdown-menu dropdown-menu-right dropdown-lg pt-0">
                    
                        <h6 class="dropdown-item-text font-15 m-0 py-3 border-bottom d-flex justify-content-between align-items-center">
                            Notifications <span class="badge badge-primary badge-pill">2</span>
                        </h6> 
                        <div class="notification-menu" data-simplebar>
                            <!-- item-->
                            <a href="#" class="dropdown-item py-3">
                                <small class="float-right text-muted pl-2">2 min ago</small>
                                <div class="media">
                                    <div class="avatar-md bg-soft-primary">
                                        <i data-feather="shopping-cart" class="align-self-center icon-xs"></i>
                                    </div>
                                    <div class="media-body align-self-center ml-2 text-truncate">
                                        <h6 class="my-0 font-weight-normal text-dark">Your order is placed</h6>
                                        <small class="text-muted mb-0">Dummy text of the printing and industry.</small>
                                    </div><!--end media-body-->
                                </div><!--end media-->
                            </a><!--end-item-->
                            <!-- item-->
                            <a href="#" class="dropdown-item py-3">
                                <small class="float-right text-muted pl-2">10 min ago</small>
                                <div class="media">
                                    <div class="avatar-md bg-soft-primary">
                                        <img src="assets/images/users/user-4.jpg" alt="" class="thumb-sm rounded-circle">
                                    </div>
                                    <div class="media-body align-self-center ml-2 text-truncate">
                                        <h6 class="my-0 font-weight-normal text-dark">Meeting with designers</h6>
                                        <small class="text-muted mb-0">It is a long established fact that a reader.</small>
                                    </div><!--end media-body-->
                                </div><!--end media-->
                            </a><!--end-item-->
                            <!-- item-->
                            <a href="#" class="dropdown-item py-3">
                                <small class="float-right text-muted pl-2">40 min ago</small>
                                <div class="media">
                                    <div class="avatar-md bg-soft-primary">                                                    
                                        <i data-feather="users" class="align-self-center icon-xs"></i>
                                    </div>
                                    <div class="media-body align-self-center ml-2 text-truncate">
                                        <h6 class="my-0 font-weight-normal text-dark">UX 3 Task complete.</h6>
                                        <small class="text-muted mb-0">Dummy text of the printing.</small>
                                    </div><!--end media-body-->
                                </div><!--end media-->
                            </a><!--end-item-->
                            <!-- item-->
                            <a href="#" class="dropdown-item py-3">
                                <small class="float-right text-muted pl-2">1 hr ago</small>
                                <div class="media">
                                    <div class="avatar-md bg-soft-primary">
                                        <img src="assets/images/users/user-5.jpg" alt="" class="thumb-sm rounded-circle">
                                    </div>
                                    <div class="media-body align-self-center ml-2 text-truncate">
                                        <h6 class="my-0 font-weight-normal text-dark">Your order is placed</h6>
                                        <small class="text-muted mb-0">It is a long established fact that a reader.</small>
                                    </div><!--end media-body-->
                                </div><!--end media-->
                            </a><!--end-item-->
                            <!-- item-->
                            <a href="#" class="dropdown-item py-3">
                                <small class="float-right text-muted pl-2">2 hrs ago</small>
                                <div class="media">
                                    <div class="avatar-md bg-soft-primary">
                                        <i data-feather="check-circle" class="align-self-center icon-xs"></i>
                                    </div>
                                    <div class="media-body align-self-center ml-2 text-truncate">
                                        <h6 class="my-0 font-weight-normal text-dark">Payment Successfull</h6>
                                        <small class="text-muted mb-0">Dummy text of the printing.</small>
                                    </div><!--end media-body-->
                                </div><!--end media-->
                            </a><!--end-item-->
                        </div>
                        <!-- All-->
                        <a href="javascript:void(0);" class="dropdown-item text-center text-primary">
                            View all <i class="fi-arrow-right"></i>
                        </a>
                    </div>
                </li>

                <li class="dropdown">
                    <a class="nav-link dropdown-toggle waves-effect waves-light nav-user" data-toggle="dropdown" href="#" role="button"
                        aria-haspopup="false" aria-expanded="false">
                        <span class="ml-1 nav-user-name hidden-sm">
                            <?php echo $commonFunctions->getname($_SESSION['id'],"sys_users","first_name","id")." ".$commonFunctions->getname($_SESSION['id'],"sys_users","last_name","id"); ?>
                        </span>
                        <img src="<?php echo DOCUMENT_ROOT_CLASS;?><?php echo empty($commonFunctions->getname($_SESSION['id'],"sys_users","logo","id"))?'assets/images/users/user-5.jpg':'uploads/admin-setting/users/'.$commonFunctions->getname($_SESSION['id'],"sys_users","logo","id");?>" alt="profile-user" class="rounded-circle thumb-xs" />                                 
                    </a>
                    <div class="dropdown-menu dropdown-menu-right">
                        <a class="dropdown-item" href=""><i data-feather="user" class="align-self-center icon-xs icon-dual mr-1"></i> Profile</a>
                        <a class="dropdown-item" href="#"><i data-feather="settings" class="align-self-center icon-xs icon-dual mr-1"></i> Settings</a>
                        <div class="dropdown-divider mb-0"></div>
                        <a class="dropdown-item" href="<?php echo DOCUMENT_ROOT_CLASS;?>logout.php"><i data-feather="power" class="align-self-center icon-xs icon-dual mr-1"></i> Logout</a>
                    </div>
                </li>
            </ul><!--end topbar-nav-->

            <ul class="list-unstyled topbar-nav mb-0">                        
                <li>
                    <button class="nav-link button-menu-mobile">
                        <i data-feather="menu" class="align-self-center topbar-icon"></i>
                    </button>
                </li> 
                <li class="creat-btn">
                    <div class="nav-link">
                        <div class="col-auto align-self-center">
                            <!-- <i data-feather="calendar" class="align-self-center icon-xs ml-1"></i>&nbsp;&nbsp; --><span id="Dash_Date1"></span>
                        </div>
                    </div>                                
                </li>                           
            </ul>
        </nav>
        <!-- end navbar-->
    </div>
    <!-- Top Bar End -->
    <div class="page-content">
        <div class="container-fluid">