<?php
require("check_auth_user.php");
require("dbconnect.php");
include('../includes/function.php');

//include("includes/menu_rights.php");
//browse(1);
$project_title = "TILEDATA";
$admin = $_SESSION["admin_" . $dbname];
$usertype = $_SESSION["usertype"];
$src = "";
$action = isset($_GET["action"]) ? $_GET["action"] : "";
$dispyear = right(($_SESSION["zdbyear_" . $dbname]), 4);
$yearname = right(($_SESSION["zdbyearname_" . $dbname]), 9);

$myear = $_SESSION[$myyear];

if ($usertype != 1) {
//    include("includes/menu_rights.php");
}

//browse($reports);
switch ($action) {
    ####################### PROFILES ##########################

    case "profile";
        $head = "Create User";
            $src = "user2.php?mode=last";
        break;
    ####################### DASHBOARD ########################
    case "generate";
        if ($guser['generate'] == '') {
            $src = "";
        } else {
            $src = "wordpress-api.php?mode=last";
        }
        break;

    ####################### MASTERS ##########################

    case "addcustomer";
//        if ($guser['customer'] == '') {
//            $src = "";
//        } else {
        $src = "custdata.php?mode=true";
//        }
        break;

    case "custprint";
//        if ($guser['ticredothreg'] == '') {
//            $src = "";
//        } else {
        $src = "custdata_print.php";
//        }
        break;
    
    default :
        $head = "Home";

        $src = "default.php";
}

include("includes/linkshead.php");
?>
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
    <title></title>
    <meta name="description" content="Blueprint: Horizontal Slide Out Menu" />
    <meta name="keywords" content="horizontal, slide out, menu, navigation, responsive, javascript, images, grid" />
    <meta name="author" content="Codrops" />
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" type="text/css" href="menu/css/default.css" />
    <link rel="stylesheet" type="text/css" href="menu/css/component.css" />
    <script src="menu/js/modernizr.custom.js"></script>
<!--    <style>
        .cbp-hssubmenu > li:hover{
            color: red
        }
    </style>-->
</head>

<body>
    <!--<div class="container-scroller">-->
    <!-- partial:partials/_horizontal-navbar.html -->
    <div class="main">
        <nav class="cbp-hsmenu-wrapper" id="cbp-hsmenu-wrapper">
            <div class="cbp-hsinner">
                <ul class="cbp-hsmenu" style="margin-left: 0px;max-width: 250em;width:100%">
                    <li class="text-left"><b><u><a href="menuapp.php" style="color:#8F4131; font-size:20px ">TILEDATA</a></u></b></li>
                    <!--<li <?= $generate; ?> ><a href="menu.php?action=generate"><button type="button" class="btn" style="padding-top: 6px;font-size: 15px;color: orange;border: 1px solid #129edc;background: white;font-weight: 600;" >GENERTAE</button></a></li>-->

<!--<li class="text-left"><b><u><a href="year.php" style="color:black; font-size:10px "><?= $dispyear ?></a></u></b></li>-->
                    <li <?= $addsale ?> class="dropdown settings"><a href="?action=addcustomer"><button type="button" class="btn btn-primary" style="color: black;background: transparent;border: 1px solid brown">Add Customer</button></a></li>
                    <li <?= $addsale ?> class="dropdown settings"><a href="?action=custprint"><button type="button" class="btn btn-primary" style="color: black;background: transparent;border: 1px solid brown">View  List</button></a></li>

                    

                   
<!--                    <li class="dropdown settings" style="float: right">
                        <a class="dropdown-toggle" href="year.php">
                            <label class="label-control" style="font-size: 13px"><i class="fa fa-calendar" aria-hidden="true"></i> <?php echo 'Year : ' . $yearname; ?></label>
                        </a>
                    </li>-->
                   <li class="dropdown settings" style="float: right">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <b><? echo $_SESSION["username_" . $dbname] ?></b>
                        </a>
                        <ul class="dropdown-menu">
                            <li <? $tlprofile; ?>><a href="?action=profile"><i class="fa fa-user"></i> Profile</a></li>
                            <!--<li <? $tlbackup; ?>><a href="?action=backup"><i class="fa fa-cloud-download"></i> Backup</a></li>-->
                            
                            <li><a href="logout.php"><i class="fa fa-power-off"></i> Logout</a></li>
                        </ul>
                    </li>
                    
                </ul>
            </div>
        </nav>
    </div>
    <div class="">
        <iframe src="<?php echo $src; ?>" name="frame1" class="frame1" style="width: 100%; height:5000px;" frameBorder="0" scrolling="no"></iframe>
    </div>
    <script src="menu/js/cbpHorizontalSlideOutMenu.min.js"></script>
    <script>
        var menu = new cbpHorizontalSlideOutMenu(document.getElementById('cbp-hsmenu-wrapper'));
    </script>    
</body>
</html>