<?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 "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);
?>
<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 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 <?= $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 <?= $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 <?= $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>
                </ul>

                <!--<p class="" style="" align="right"><span class="label "></span></p>-->
                <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.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>
        <!--sidebar left start-->
        <!--        <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="UI Elements"><i class="fa fa-graduation-cap"></i>Masters</a>
                            <ul class="nav-sub">
                                <li <?= $supplier; ?>><a href="?action=supplier">Party</a></li>
                                <li <?= $expense; ?>><a href="?action=expense">Expense</a></li>
        
                                <li <?= $group; ?>><a href="?action=group">Group</a></li>
                                <li <?= $otherac; ?>><a href="?action=otherac">Other A/C</a></li>
                                <li <?= $saletype; ?>><a href="?action=saletype">Sale Type</a></li>
                            </ul>
                        </li>
                        <li class="nav-dropdown">
                            <a href="#" title="Transaction"><i class="fa fa-usd"></i>Transaction</a>
                            <ul class='nav-sub'>
                                <li <?= $cashpay; ?> ><a href="?action=cashpay">Cash Payment</a></li>
                            </ul>
                        </li>
                        <li class="nav-dropdown">
                            <a href='#'><i class="fa fa-file"></i>Reports</a>
                            <ul class='nav-sub'>
                                <li <?= $rpledger; ?>><a href="?action=partyexp">Partywise - Expense</a></li>
                            </ul>
                        </li> 
                    </ul>
                </nav>-->
        <!--sidebar left end-->
        <!--main content start-->
        <!--<section class="main-content-wrapper">-->
        <!--        <section class="">
            <section id="main-content">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 pad">
                    <div class="toggle-navigation toggle-left padimenu ">
                <a class="dropdown-toggle" href="?action=member">
                    <button class="" style="background-color:white;border:1px solid #B79EC6;border-radius: 3px;height: 30px;width: 135px;">
                        <b style="font-size: 12px;">Member</b>
                    </button>
                </a>
                &nbsp;
                <a class="dropdown-toggle" href="?action=memberprint">
                    <button class="" style="background-color:white;border:1px solid #B79EC6;border-radius: 3px;height: 30px;width: 135px;">
                        <b style="font-size: 12px;">Listing</b>
                    </button>   
                </a>
                &nbsp;
                <a class="dropdown-toggle" href="?action=labels">
                    <button class="" style="background-color:white;border:1px solid #B79EC6;border-radius: 3px;height: 30px;width: 135px;">
                        <b style="font-size: 12px;">Labels</b>
                    </button>
                </a>&nbsp;
                <a class="dropdown-toggle" href="?action=sms">
                    <button class="" style="background-color:white;border:1px solid #B79EC6;border-radius: 3px;height: 30px;width: 135px;">
                        <b style="font-size: 12px;">Sms</b>
                    </button>
                </a>&nbsp;

                <a class="dropdown-toggle" href="?action=alldata">
                    <button class="" style="background-color:#B79EC6;border:1px solid black;color: white;border-radius: 3px;height: 30px;width: 135px;">
                        <b style="font-size: 12px;">All Data</b>
                    </button>
                </a>&nbsp;
                <a class="dropdown-toggle" href="?action=alllisting">
                    <button class="" style="background-color:#B79EC6;border:1px solid black;color: white;border-radius: 3px;height: 30px;width: 135px;">
                        <b style="font-size: 12px;">All Listing</b>
                    </button>
                </a>
                <a class="dropdown-toggle" href="?action=member_all">
                    <button class="" style="background-color:white;border:1px solid black;color: #B79EC6;border-radius: 3px;height: 30px;width: 135px;">
                        <b style="font-size: 12px;">Member All</b>
                    </button>
                </a>-->
        <!--                <a class="dropdown-toggle" href="?action=finallist">
                            <button class="" style="background-color:#B79EC6;border:1px solid white;color: black;border-radius: 3px;height: 30px;width: 135px;">
                                <b style="font-size: 12px;">Final List</b>
                            </button>
                        </a>-->
        <!--                <button type="button" class="btn btn-default" id="toggle-left" data-toggle="tooltip" data-placement="right" title="Toggle Navigation">
                            <i class="fa fa-bars"></i>
                        </button>-->
    </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>