<?php
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');
$usertype = $_SESSION["usertype_" . $dbname];
if ($usertype != 1) {
    include("includes/menu_rights.php");
}
//browse($usertype);
//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";
        //        $head = "Create User";
        //        $src = '';
        //        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";
        if ($usertype == 1) {
            $src = "user.php?mode=last";
        } else {
            $src = "user2.php?mode=last";
        }
        break;

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

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

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

    case "newsearchvisa";
        $src = "entrymain_new.php";
        break;

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

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

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

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

    case "ledger";
        $src = "ledger.php";
        break;
    
        case "ledger2";
        $src = "ledger.php";
        break;

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

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

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

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

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

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

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

        //    case "medicalsearch";
        //        $src = "medicalsearch.php?mode=last";
        //        break;
    case "medicalsearch";
        $src = "medical_new.php?mode=last";
        break;

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

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

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

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

    case "mofalist";
        $src = "mofalist.php?mode=last";
        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);
?>
<style type="text/css">

</style>
</head>

<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">
                <ul class="nav navbar-nav ">
                    <li><a class="sidebar-control sidebar-main-toggle hidden-xs"><i class="icon-paragraph-justify3"></i></a></li>
                    <li <?= $newsearchvisa; ?>><a href="menu.php?action=newsearchvisa"><button type="button" class="btn" style="padding-top: 6px;font-size: 15px;color: blue;border: 1px solid #129edc;background: white;font-weight: 600;">Files</button></a></li>
                    <li <?= $searchvisa; ?>><a href="menu.php?action=searchvisa"><button type="button" class="btn" style="padding-top: 6px;font-size: 15px;color: blue;border: 1px solid #129edc;background: white;font-weight: 600;">Search</button></a></li>
                    <li <?= $addnew2; ?>><a href="menu.php?action=addnewvisa"><button type="button" style="padding-top: 6px;font-size: 15px;color: green; border: 1px solid #129edc;background: white;font-weight: 600;" class="btn">Add New </button></a></li>
                    <li <?= $medicalsearch; ?>><a href="menu.php?action=medicalsearch"><button type="button" class="btn" style="padding-top: 6px;font-size: 15px;color: #ce2525;border: 1px solid #129edc;background: white;font-weight: 600;">Medical </button></a></li>
                    <li <?= $crmsearch; ?>><a href="menu.php?action=crmsearch"><button type="button" class="btn" style="padding-top: 6px;font-size: 15px;color: orange;border: 1px solid #129edc;background: white;font-weight: 600;">CRM</button></a></li>
                    <li <?= $ledger2; ?>><a href="menu.php?action=ledger2"><button type="button" class="btn" style="padding-top: 6px;font-size: 15px;color: blue;border: 1px solid #129edc;background: white;font-weight: 600;">Agent Ledger</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>
                </ul>
                <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;"><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 <?= $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_excel.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>
        </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 <?= $searchvisa; ?>><a href="?action=searchvisa">Search Visa</a></li>-->
                        <li <?= $addnewvisa; ?>><a href="?action=addnewvisa">Add New Entry</a></li>
                        <li <?= $medical; ?>><a href="?action=medical">Medical Entry</a></li>
                        <li <?= $customer; ?>><a href="?action=customer">Agent</a></li>
                        <li <?= $crm; ?>><a href="?action=crm">CRM</a></li>
                        <!-- <li <?= $bank; ?>><a href="?action=bank">Bank</a></li> -->
                        <!-- <li <?= $cash; ?>><a href="?action=cash">Cash</a></li> -->
                        <!-- <li <?= $bankrecp; ?>><a href="?action=bankrecp">Bank Receipt</a></li>
                        <li <?= $cashrecp; ?>><a href="?action=cashrecp">Cash Receipt</a></li> -->
                        <hr <?= $hr; ?>>
                        <li <?= $visareg; ?>><a href="?action=visareg">Visa Register</a></li>
                        <li <?= $agentreg; ?>><a href="?action=agentreg">Agent Statement</a></li>
                        <li <?= $ledger; ?>><a href="?action=ledger">Agent Ledger</a></li>
                        <li <?= $pastatus; ?>><a href="?action=pastatus">Passport Status</a></li>
                        <hr <?= $hr; ?>>
                        <li <?= $submission; ?>><a href="?action=submission">Submission List</a></li>
                        <li <?= $emigration; ?>><a href="?action=emigration">Immigration List</a></li>
                        <li <?= $mofalist; ?>><a href="?action=mofalist">Mofa List</a></li>
                        <li <?= $service; ?>><a href="?action=service">Service 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:10000px;" 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>