<?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];
$usertype = $_SESSION["usertype_" . $dbname];
$src = "";
$action = isset($_GET["action"]) ? $_GET["action"] : "";
switch ($action) { 

    case "profile";
        if ($usertype == 1) {
            $src = "user.php?mode=last";
        } else {
            $src = "user2.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 "cash";
        $src = "cash.php?mode=last";
        break;
        
        case "bank";
        $src = "bank.php?mode=last";
        break;
        
        case "cashrecp";
        $src = "cashrecp.php?mode=last";
        break;
        
        case "bankrecp";
        $src = "bankrecp.php?mode=last";
        break;

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

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

        case "mofa_ent";
        $src = "mofa.php?mode=true";
        break;

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

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

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

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

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

        case "nonsubmission";
        $src = "nonsubmission.php";
        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;

        case "pastatus";
        $src = "pastatus.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);
?>
<body class="off-canvas">
    <div id="container" class="sidebar-mini">
        <header id="header">
            <!--logo start-->
            <div class="brand"><a href="menu.php" class="logo"><?php Echo "NVQ"; ?></a></div>
            <!--<div class="brand"><a href="menu.php" class="logo"><?php // Echo $project_name;                              ?></a></div>-->
            <!--logo end-->
            <div class="navbar-collapse collapse" id="navbar-mobile" style="">
                <ul class="nav navbar-nav ">
                    <li><a class="sidebar-control sidebar-main-toggle hidden-xs"><i class="icon-paragraph-justify3"></i></a></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 <?= $submissionent; ?> ><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 <?= $mofaent; ?> ><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 <?= $entinvoice; ?>><a href="menu.php?action=entinvoice"><button type="button" class="btn" style="padding-top: 2px;font-size: 15px;color: orange;border: 1px solid #129edc;background: white;font-weight: 600;">Invoice</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>
                <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown dropdown-user">
                        <a class="dropdown-toggle" data-toggle="dropdown">
                            <span style="font-size: 15px;"><b><?php echo $_SESSION["username_" . $dbname]; ?></b></span>
                            <i class="caret" style="font-size: 15px;"></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 <?= $tlbackup; ?>><a href = "backup_excel.php"><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>
        </header>
        <nav class="sidebar sidebar-left">
            <h5 class="sidebar-header">Navigation</h5>
            <ul class="nav nav-pills nav-stacked">
                <li class="nav-dropdown">
                    <a href="#" title="Entries"><i class="fa fa-plus-square"></i>Entries</a>
                    <ul class="nav-sub">
                        <li <?= $addnewvisa; ?>><a href="?action=addnewvisa">Add New Entry</a></li>
                        <li <?= $submissionent; ?>><a href="?action=submission_ent">Submission Update</a></li>
                        <li <?= $release; ?>><a href="?action=release">Release Update</a></li>
                        <li <?= $stampdateupd; ?>><a href="?action=stampdate_upd">Stamping Date Update</a></li>
                        <li <?= $mofaent; ?>><a href="?action=mofa_ent">Mofa Update</a></li>
                        <li <?= $crm; ?> ><a href="?action=crm">CRM</a></li>
                        <li <?= $cash; ?> ><a href="?action=cash">Cash </a></li>
                        <li <?= $bank; ?> ><a href="?action=bank">Bank </a></li>
                        <li <?= $cashrecp; ?> ><a href="?action=cashrecp">Cash Receipt </a></li>
                        <li <?= $bankrecp; ?> ><a href="?action=bankrecp">Bank Receipt </a></li>
                        <li <?= $movefile; ?> ><a href="?action=movefile">Move File</a></li>
                        <li <?= $entinvoice; ?> ><a href="?action=entinvoice">Invoice</a></li>
                        <hr <?= $hr; ?>>
                        <li <?= $visareg; ?>><a href="?action=visareg">Visa Register</a></li>
                        <li <?= $agentreg; ?>><a href="?action=agentreg">Agent Register</a></li>
                        <li <?= $pastatus; ?>><a href="?action=pastatus">Passport Status</a></li>
                        <li <?= $submission; ?>><a href="?action=submission">Submission List</a></li>
                        <li <?= $mofalist; ?>><a href="?action=mofalist">Mofa List</a></li>
                        <li <?= $nonsubmission; ?>><a href="?action=nonsubmission">Non-Submission List</a></li>
                    </ul>
                </li>
            </ul>
        </nav>
        <section class="main-content-wrapper">
            <section id="main-content">
                <div class="col-md-12 pad" >
                    <iframe src="<?php echo $src; ?>" name="frame1" style="width: 100%; height:1000px;"  frameBorder="0" scrolling="yes"></iframe>
                </div>
            </section>
        </section>
    </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>
