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

if ($usertype != 1) {
    include("includes/menu_rights.php");
}
$admin = $_SESSION["admin_" . $dbname];

$zroot = $_SESSION["zdir"];
$myyear = $_SESSION["tit_" . $dbname];

$src = "";
$action = isset($_GET["action"]) ? $_GET["action"] : "";
switch ($action) {

    case "profile";
        if ($usertype == 1) {
            $src = "user.php?mode=last";
        } else {
            $src = "user.php?mode=last";
        }
        break;


    case "company";
        $src = "company.php?mode=last";
        break;

        //    case "profile";
        //        $src = "user2.php?mode=last";
        //        break;

    case "backup";
        $src = "backup.php";
        break;

    case "yearend";
        $src = "yearend.php";
        break;

    case "searchvisa";
        $src = "entrymain.php";
        break;

    case "addnewvisa";
        $src = "entry.php?mode=true";
        break;

        case "submission_ent";
        $src = "submission.php?mode=true";
        break;
        
    case "movefile";
        $src = "movefile.php?mode=true";
        break;

    case "visareg";
        $src = "register_sc.php";
        break;

    case "blamt";
        $src = "blamt_fr.php?mode=last";
        break;

    case "agentreg";
        $src = "agentinv.php";
        break;

    default:
        $head = "Home";
        $src = "default.php";
}

include("includes/linkshead.php");
$dispyear = right(($_SESSION["zdbyear_" . $dbname]), 4);

$zdb = $_SESSION["zdbyear_" . $dbname];
//browse($zdb);
$compcd = $_SESSION["comp_" . $dbname];

$getcomp = mysqli_query($conn, "SELECT code, name FROM `company` where `code`= '$compcd'") or die(mysqli_error($conn));
$fetcomp = mysqli_fetch_array($getcomp);
$cmpname = $fetcomp['name'];

mysqli_select_db($conn, $zdb);
?>
<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>
    
<style type="text/css">
    .flashit {
        /*                    color:yellow;*/
        -webkit-animation: flash linear 2s infinite;
        animation: flash linear 2s infinite;
    }

    @-webkit-keyframes flash {
        0% {
            opacity: 1;
        }

        50% {
            opacity: .1;
        }

        100% {
            opacity: 1;
        }

    }

    @keyframes flash {
        0% {
            opacity: 1;
        }

        50% {
            opacity: .1;
        }

        100% {
            opacity: 1;
        }
    }
</style>
</head>

<body class="off-canvas">
    <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="menu.php" style="color:#5d96e4; font-size:20px "><?= $project_title; ?></a></u></b></li>

                    <li <?= $tlcompany; ?>><a class="sidebar-control sidebar-main-toggle hidden-xs"><i class="icon-paragraph-justify3"></i></a></li>
                    <li <?= $searchvisa; ?>><a href="menu.php?action=searchvisa"><button type="button" class="btn" style="padding-top: 2px;font-size: 15px;color: blue;border: 1px solid #129edc;background: white;font-weight: 600;">Search Visa</button></a></li>
                    <li <?= $addnewvisa; ?>><a href="menu.php?action=addnewvisa"><button type="button" style="padding-top: 2px;font-size: 15px;color: green; border: 1px solid #129edc;background: white;font-weight: 600;" class="btn">Add New Entry</button></a></li>
                    <li <?= $submission_ent; ?> ><a href="menu.php?action=submission_ent"><button type="button" class="btn" style="padding-top: 6px;font-size: 15px;color: #ce2525;border: 1px solid #129edc;background: white;font-weight: 600;" >Submission</button></a></li>
                    <li <?= $mofa_ent; ?> ><a href="menu.php?action=mofa_ent"><button type="button" class="btn" style="padding-top: 6px;font-size: 15px;color: orange;border: 1px solid #129edc;background: white;font-weight: 600;" >Mofa</button></a></li>
                    <li <?= $agentreg; ?>><a href="menu.php?action=agentreg"><button type="button" class="btn" style="padding-top: 2px;font-size: 15px;color: #5D96E4;border: 1px solid #129edc;background: white;font-weight: 600;">Agent Register</button></a></li>
                    <li <?= $visareg; ?>><a href="menu.php?action=visareg"><button type="button" class="btn" style="padding-top: 2px;font-size: 15px;color: orange;border: 1px solid #129edc;background: white;font-weight: 600;">Visa Register</button></a></li>
                    <li <?= $pastatus; ?>><a href="menu.php?action=pastatus"><button type="button" class="btn" style="padding-top: 6px;font-size: 15px;color: #73256e;border: 1px solid #129edc;background: white;font-weight: 500;" >Passport Status</button></a></li>
                    <li <?= $blamt; ?>><a href="menu.php?action=blamt"><button type="button" class="btn flashit" style="padding-top: 2px;font-size: 15px;color: black;border: 1px solid #129edc;background: white;font-weight: 600;">Blank Amount</button></a></li>
                    <li <?= $movefile; ?>><a href="menu.php?action=movefile"><button type="button" class="btn" style="padding-top: 6px;font-size: 15px;color: red;border: 1px solid #129edc;background: white;font-weight: 500;" >Move File</button></a></li>

                 <ul class="nav navbar-nav navbar-right">
                    <li><a style="font-size: 15px;" href="year.php?compname=<?= $series ?>"><b>Financial Year : <?php echo $myyear; ?></b></a></li>
                    <li class="dropdown dropdown-user">
                        <a class="dropdown-toggle" data-toggle="dropdown">
                            <span style="font-size: 15px;color:#5d96e4"><b><?php echo $_SESSION["username_" . $dbname]; ?></b></span>
                            <i class="caret" style="font-size: 15px;color:#5d96e4"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-menu-right" style="background-color: white;">
                            <li <?= $tlprofile; ?> style="color:white"><a href="?action=profile"><i class="fa fa-user"></i>Profile</a></li>
                            <li <?= $tlcompany; ?>><a href="?action=company"><i class="fa fa-building-o"></i> Company SetUp</a></li>

                            <li <?= $tlcreate; ?>><a href="?action=yearcreate"><i class="fa fa-exclamation-triangle"></i>Year Creation</a></li>
                            <li <?= $tlyearend; ?>><a href="?action=yearend"><i class="fa fa-calendar"></i>Year End</a></li>
                            <?
                            if ($guser['usertype'] == 1) {
                            ?>

                                <li <?= $tlbackup; ?>><a href="backup.php"><i class="fa fa-cloud-download"></i> Backup</a></li>
                            <?php }
                            ?>
                            <li><a href="logout.php"><i class="fa fa-power-off"></i> Logout</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </nav>
    </div>
   
    <iframe src="<?php echo $src; ?>" name="frame1" style="width: 100%; height:5000px;" frameBorder="0" scrolling="no"></iframe>
    </div>
    </section>
    </section>
    </div>
    <!--main content end-->
    <?php include("includes/linksfoot.php") ?>
</body>

</html>