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

$admin = $_SESSION["admin_" . $dbname];
$usertype = $_SESSION["usertype"];
$complogo = $_SESSION["complogo"];
$menutype = $_SESSION["menutype"];

$zroot = $_SESSION["zdir"];
$tdate = date("Y-m-d");
$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);
$src = "";
$action = isset($_GET["action"]) ? $_GET["action"] : "";
//$srchresult = mysqli_query($conn, "SELECT * FROM `consultmain` where apprv = '1' and vouchdt = '$tdate' order by vouchdt DESC, vouchtime ASC") or die(mysqli_error($conn));
$srchresult = mysqli_query($conn, "SELECT * FROM `schedtreat` where checkin = '1' and scheddate = '$tdate' and consult = '' order by apttime ASC") or die(mysqli_error($conn));
// $srchresult = mysqli_query($conn, "SELECT * FROM `consultmain` where apprv = '' and vouchdt <= '$tdate' order by vouchdt DESC, vouchtime ASC") or die(mysqli_error($conn));
if ($srchresult) {
    $sno = mysqli_num_rows($srchresult);
}
if ($usertype != 1) {
    include("includes/menu_rights.php");
}


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

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

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

    case "patient";
        //        if ($guser['customer'] == '') {
        //            $src = "";
        //        } else {
        $src = "patient.php?mode=last";
        //        }
        break;
    case "patient_main";
        //        if ($guser['customer'] == '') {
        //            $src = "";
        //        } else {
        $src = "patient_main.php";
        //        }
        break;

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

    case "ticredothgstreg";
        //        if ($guser['ticredothreg'] == '') {
        //            $src = "";
        //        } else {
        $src = "ticredothgstreg.php";
        //        }
        break;

    case "ticredoth";
        //        if ($guser['ticredoth'] == '') {
        //            $src = "";
        //        } else {
        $src = "credoth.php?mode=last&credtype=O";
        //        }
        break;

    case "tideboth";
        //        if ($guser['tideboth'] == '') {
        //            $src = "";
        //        } else {
        $src = "deboth.php?mode=last&debtype=O";
        //        }
        break;

    case "sale";
        //        if ($guser['sale'] == '') {
        //            $src = "";
        //        } else {
        $src = "sale.php?mode=last";
//        $src = "salegstmulti.php?mode=last";
        //        }
        break;

    case "transport";
        //        if ($guser['transport'] == '') {
        //            $src = "";
        //        } else {
        $src = "transport.php?mode=last";
        //        }
        break;

    case "transfer";
        //        if ($guser['transport'] == '') {
        //            $src = "";
        //        } else {
        $src = "transfer.php?mode=last";
        //        }
        break;

    case "supplier";
        //        if ($guser['supplier'] == '') {
        //            $src = "";
        //        } else {
        $src = "supplier.php?mode=last";
        //        }
        break;
    case "staff";
        //        if ($guser['supplier'] == '') {
        //            $src = "";
        //        } else {
        $src = "staff.php?mode=last";
        //        }
        break;

    case "itemgrp";
        //        if ($guser['itemgrp'] == '') {
        //            $src = "";
        //        } else {
        $src = "prodgrp.php?mode=last";
        //        }
        break;

    case "item";
        //        if ($guser['item'] == '') {
        //            $src = "";
        //        } else {
        $src = "productgst.php?mode=last";
        //        }
        break;

    case "crednote";
        //        if ($guser['saleret'] == '') {
        //            $src = "";
        //        } else {
        $src = "crednotegstmulti.php?mode=last&debtype=G";
        //        }
        break;

    case "inward";
        //        if ($guser['inward'] == '') {
        //            $src = "";
        //        } else {
        $src = "inward.php?mode=last";
        //        }
        break;

    case "outward";
        //        if ($guser['itemgrp'] == '') {
        //            $src = "";
        //        } else {
        $src = "outward.php?mode=last";
        //        }
        break;

    case "tidamage";
        //        if ($guser['tidamage'] == '') {
        //            $src = "";
        //        } else {
        $src = "damaged.php?mode=last";
        //        }
        break;

    case "purchase";
        //        if ($guser['purchase'] == '') {
        //            $src = "";
        //        } else {
        $src = "purchgstmulti.php?mode=last";
        //        }
        break;
    case "consult_ent";
        //        if ($guser['purchase'] == '') {
        //            $src = "";
        //        } else {
        $src = "consult_ent.php?mode=last";
        //        }
        break;

    case "drawbank";
        //        if ($guser['drawbank'] == '') {
        //            $src = "";
        //        } else {
        $src = "drawbank.php?mode=last";
        //        }
        break;

    case "openbal";
        //        if ($guser['openbal'] == '') {
        //            $src = "";
        //        } else {
        $src = "openbal.php?mode=last&form=openbal";
        //        }
        break;

    case "debnote";
        //        if ($guser['purret'] == '') {
        //            $src = "";
        //        } else {
        $src = "debnotegstmulti.php?mode=last&debtype=G";
        //        }
        break;

    case "bank";
        //        if ($guser['bank'] == '') {
        //            $src = "";
        //        } else {
        $src = "bank.php?mode=last";
        //        }
        break;

    case "cash";
        //        if ($guser['cash'] == '') {
        //            $src = "";
        //        } else {
        $src = "cash.php?mode=last";
        //        }
        break;

    case "expense";
        //        if ($guser['expense'] == '') {
        //            $src = "";
        //        } else {
        $src = "expense.php?mode=last";
        //        }
        break;

    case "expenserep";
        //        if ($guser['expense'] == '') {
        //            $src = "";
        //        } else {
        $src = "expenserep.php?mode=last";
        //        }
        break;

    case "gstrevenue";
        //        if ($guser['expense'] == '') {
        //            $src = "";
        //        } else {
        $src = "gstrevenue.php";
        //        }
        break;

    case "otherac";
        //        if ($guser['otherac'] == '') {
        //            $src = "";
        //        } else {
        $src = "otherac.php?mode=last";
        //        }
        break;

    case "group";
        //        if ($guser['group'] == '') {
        //            $src = "";
        //        } else {
        $src = "group.php?mode=last";
        //        }
        break;

    case "narration";
        //        if ($guser['narration'] == '') {
        //            $src = "";
        //        } else {
        $src = "narration.php?mode=last";
        //        }
        break;

    case "area";
        //        if ($guser['area'] == '') {
        //            $src = "";
        //        } else {
        $src = "area.php?mode=last";
        //        }
        break;

    case "unit";
        //        if ($guser['unit'] == '') {
        //            $src = "";
        //        } else {
        $src = "unit.php?mode=last";
        //        }
        break;

    case "bankrecp";
        //        if ($guser['bankrecp'] == '') {
        //            $src = "";
        //        } else {
        $src = "bankrecp.php?mode=last";
        //        }
        break;

    case "cashrecp";
        //        if ($guser['cashrecp'] == '') {
        //            $src = "";
        //        } else {
        $src = "cashrecp.php?mode=last";
        //        }
        break;

    case "bankpay";
        //        if ($guser['bankpay'] == '') {
        //            $src = "";
        //        } else {
        $src = "bankpay.php?mode=last";
        //        }
        break;

    case "multibankpay";
        //        if ($guser['bankpay'] == '') {
        //            $src = "";
        //        } else {
        $src = "bankmultipay.php?mode=last";
        //        }
        break;

    case "multicashpay";
        //        if ($guser['bankpay'] == '') {
        //            $src = "";
        //        } else {
        $src = "cashmultipay.php?mode=last";
        //        }
        break;

    case "cashpay";
        //        if ($guser['cashpay'] == '') {
        //            $src = "";
        //        } else {
        $src = "cashpay.php?mode=last";
        //        }
        break;

    case "contra";
        //        if ($guser['contraent'] == '') {
        //            $src = "";
        //        } else {
        $src = "contra.php?mode=last";
        //        }
        break;

    case "contreg";
        //        if ($guser['contreg'] == '') {
        //            $src = "";
        //        } else {
        $src = "contreg.php?mode=last";
        //        }
        break;

    case "journal";
        //        if ($guser['journal'] == '') {
        //            $src = "";
        //        } else {
        $src = "jv.php?mode=last";
        //        }
        break;

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

    case "bankrecorep";
        $src = "bankreco_rep.php";
        break;

    ####################### REPORTS ##########################


    case "osrec";
        //        if ($guser['outsrecevrp'] == '') {
        //            $src = "";
        //        } else {
        $src = "osbill.php?para=R";
        //        }
        break;

    case "ospay";
        //        if ($guser['outspayrp'] == '') {
        //            $src = "";
        //        } else {
        $src = "osbill.php?para=P";
        //        }
        break;

    case "ledger";
        //        if ($guser['ledger'] == '') {
        //            $src = "";
        //        } else {
        $src = "ledger.php";
        //        }
        break;

    case "stock";
        //        if ($guser['stock'] == '') {
        //            $src = "";
        //        } else {
        $src = "stock.php";
        //        }
        break;

    case "pathistory";
        $src = "patient_historyrep.php";
        break;

    case "stockall";
        //        if ($guser['stock'] == '') {
        //            $src = "";
        //        } else {
        $src = "stockall.php";
        //        }
        break;

    case "inwout";
        //        if ($guser['inwout'] == '') {
        //            $src = "";
        //        } else {
        $src = "inwoutrep.php";
        //        }
        break;

    case "itemwise";
        //        if ($guser['itemwise'] == '') {
        //            $src = "";
        //        } else {
        $src = "itemwise_gst.php";
        //        }
        break;

    case "itemwisesale";
        $src = "itemwise_sale.php";
        break;

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

    case "dailyreport";
        $src = "dailyrep.php";
        break;

    case "itemgrpwisesale";
        //        $src = "itemgrpsale.php";
        $src = "saleitemgrp.php";
        break;

    //    case "tdsrep";
    //        if ($guser['stkpack'] == '') {
    //            $src = "";
    //        } else {
    //        $src = "tdsrep.php?";
    //        }
    //        break;

    case "changeofrates";
        //        if ($guser['changeofrates'] == '') {
        //            $src = "";
        //        } else {
        $src = "changeRate.php";
        //        }
        break;

    case "salereg";
        //        if ($guser['salereg'] == '') {
        //            $src = "";
        //        } else {
        $src = "salereg.php";
        //        }
        break;

    case "salereg";
        //        if ($guser['salereg'] == '') {
        //            $src = "";
        //        } else {
        $src = "salegstreg.php";
        //        }
        break;

    case "bankbook";
        //                if ($guser[bankbook] == '') {
        //                    $src = "";
        //                } else {
        $src = "bankbook.php?para=B";
        //                }
        break;

    case "cashbook";
        //        if ($guser[rpcashbook] == '') {
        //            $src = "";
        //        } else {
        $src = "bankbook.php?para=C";
        //        }
        break;

    case "jvbook";
        //                if ($guser[jvbook] == '') {
        //                    $src = "";
        //                } else {
        $src = "jvbook.php?para=C";
        //                }
        break;

    case "salesumm";
        //        if ($guser[rpcashbook] == '') {
        //            $src = "";
        //        } else {
        $src = "salesumm.php";
        //        }
        break;

    //    case "jvgst";
    //        //        if ($guser[rpcashbook] == '') {
    //        //            $src = "";
    //        //        } else {
    //        $src = "jvgst.php";
    //        //        }
    //        break;
    //    case "bpaychq";
    //        if ($guser['bpaychq'] == '') {
    //            $src = "";
    //        } else {
    //            $src = "bkpy_chq.php";
    //        }
    //        break;

    case "chqrep";
        //        if ($guser['chqrep'] == '') {
        //            $src = "";
        //        } else {
        $src = "chqrep.php";
        //        }
        break;

    case "amtrep";
        //        if ($guser['rpamountqry'] == '') {
        //            $src = "";
        //        } else {
        $src = "amtrep.php";
        //        }
        break;

    case "inwgstreg";
        //        if ($guser['tiinwdreg'] == '') {
        //            $src = "";
        //        } else {
        $src = "inwgstreg.php";
        //        }
        break;

    case "outgstreg";
        //        if ($guser['tiinwdreg'] == '') {
        //            $src = "";
        //        } else {
        $src = "outgstreg.php";
        //        }
        break;

    case "debgstreg";
        //        if ($guser['debnoterg'] == '') {
        //            $src = "";
        //        } else {
        $src = "debgstreg.php";
        //        }
        break;

    case "credgstreg";
        //        if ($guser['crednoterg'] == '') {
        //            $src = "";
        //        } else {
        $src = "credgstreg.php";
        //        }
        break;

    case "credothreg";

        $src = "credothreg.php";

        break;

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

    case "damgstreg";
        //        if ($guser['tidamreg'] == '') {
        //            $src = "";
        //        } else {
        $src = "damgstreg.php";
        //        }
        break;

    ####################### FINALIZATION ##########################
    case "godown";
        //        if ($guser['godown'] == '') {
        //            $src = "";
        //        } else {
        $src = "godown.php?mode=last";
        //        }
        break;

    case "trbal";
        //        if ($guser[fntrialbal] == '') {
        //            $src = "";
        //        } else {
        $src = "trbal.php?mode=last";
        //        }
        break;

    case "profit";
        //        if ($guser[fnprofit] == '') {
        //            $src = "";
        //        } else {
        $src = "profit.php?mode=last";
        //        }
        break;

    case "profshar";
        //        if ($guser[fnprofshar] == '') {
        //            $src = "";
        //        } else {
        $src = "profshar.php?mode=last";
        //        }
        break;

    case "balsheet";
        //        if ($guser[fnbalsheet] == '') {
        //            $src = "";
        //        } else {
        $src = "balsheet.php?mode=last";
        //        }
        break;

    case "excreg";
        $src = "excreg.php";
        break;
    case "calendar";
        $src = "calendar.php";
        break;

    case "tranreg";

        $src = "tranreg.php";

        break;

    ####################### TOOLS ##########################

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

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

    case "company";
        //        if ($guser[tlcompany] == '') {
        //            $src = "";
        //        } else {
        $src = "company.php?mode=last";
        //        }
        break;

    case "graph";
        $src = "misdashboard.php";
        break;

    case "yearselection";
        //        if ($guser['yearselection'] == '') {
        //            $src = "";
        //        } else {
        $src = "yea.php?mode=last";
        //        }
        break;

    case "backup";
        //        if ($guser['tlbackup'] == '') {
        //            $src = "";
        //        } else {
        $src = "backup.php";
        //        }
        break;

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

    case "unmarkrecp";
        $src = "unmark.php?para=R";
        break;

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

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

    case "purgstreg";
        //        if ($guser['purrawreg'] == '') {
        //            $src = "";
        //        } else {
        $src = "purgstreg.php";
        //        }
        break;

    case "inwardreg";
        $src = "inwreg.php";
        break;

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

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

    case "unmarkpay";
        $src = "unmark.php?para=P";
        break;

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

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

    default:
        //        $head = "Home";
        //        $src = "misdashboard.php";
        //        if ($usertype == 1) {
        //            $src = "misdashboard.php";
        //        } else {
        $src = "default.php";
    //        }
//        $src = "dashboard.php";
}



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

$zdb = $_SESSION["zdbyear_" . $dbname];

$compcd = $_SESSION["comp_" . $dbname];

//mysqli_select_db($conn, $zdb);
//
//$srchresult = mysqli_query($conn, "SELECT vouchno, DATE_FORMAT(`vouchdt`, '%d-%m-%Y')as vouchdt, party, totqty
//                                       FROM `purmain` where `complete`= '0000-00-00' and `salevouch` > 0 group by vouchno order by vouchdt DESC") or die(mysqli_error($conn));
//
////            print table($srchresult);
//if (!empty($srchresult)) {
//    $srcinst = mysqli_num_rows($srchresult);
//} else {
//    $srcinst = 0;
//}
?>
<script>
    $(document).ready(function () {

        document.addEventListener("keydown", function (zEvent) {
            if (zEvent.ctrlKey && zEvent.altKey && zEvent.code === "KeyE") {
                //                alert('Invalid key Nagvigate Through Menu');

                $(window).keydown(function (event) {
                    if (event.ctrlKey && event.keyCode == 52) {
                        var href = $('#crlink').attr('href');
                        window.location.href = href;
                    }
                });
            }
            if (zEvent.ctrlKey && zEvent.altKey && zEvent.code === "KeyR") {

                $(window).keydown(function (event) {
                    if (event.ctrlKey && event.keyCode == 55) {
                        var href = $('#dclink').attr('href');
                        window.location.href = href;
                    }
                });
            }
        });

        //        $(document).keydown(function (event) {
        //            //19 for Mac Command+S
        //            if (!(String.fromCharCode(event.which).toLowerCase() == 'x' && event.altKey) && !(event.which == 19))
        //                return true;
        //            //alert("Ctrl-s pressed");
        ////        $("#edit").click();
        //            var href = $('#logout').attr('href');
        //            window.location.href = href;
        //            event.preventDefault();
        //            return false;
        //        });

    });
</script>

<style>
    @import url('https://fonts.googleapis.com/css2?family=Ephesis&display=swap');
</style>


<style>
    /* .cbp-hssubmenu > li:hover{
        color: red
    } */

    .button-68 {
        appearance: none;
        backface-visibility: hidden;
        background-color: #454752;
        border-radius: 8px;
        border-style: none;
        box-shadow: rgba(39, 174, 96, .15) 0 4px 9px;
        box-sizing: border-box;
        color: #fff;
        cursor: pointer;
        display: inline-block;
        font-family: Inter, -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
        font-size: 16px;
        font-weight: 600;
        letter-spacing: normal;
        line-height: 1;
        outline: none;
        overflow: hidden;
        padding: 10px 20px;
        position: relative;
        text-align: center;
        text-decoration: none;
        transform: translate3d(0, 0, 0);
        transition: all .3s;
        user-select: none;
        -webkit-user-select: none;
        touch-action: manipulation;
        /* vertical-align: top; */
        white-space: nowrap;
        margin: 2px;
    }

    .button-68:hover {
        background-color: #6c757d;
        opacity: 1;
        transform: translateY(0);
        transition-duration: .35s;
    }

    .button-68:active {
        transform: translateY(2px);
        transition-duration: .35s;
    }

    .button-68:hover {
        box-shadow: rgba(39, 174, 96, .2) 0 6px 12px;
    }

    .link {
        height: 40px;
        width: 120px;

        text-decoration: none;
        color: initial;
        position: relative;
        text-align: center;
        display: inline-block;
        z-index: 10;
    }

    .link>span {
        white-space: nowrap;
        /* overflow: hidden; */
        width: 76px;
        /* display: inline-block; */
        text-overflow: ellipsis;
        margin-top: 5px;
        font-size: 15px;
        margin: 0;
    }

    .btn {
        border-radius: 8px;
        color: #000000;
        border: 2px solid #ced4da;
    }

    .btn:hover {
        color: #B91646;
        box-shadow: 0 4px 8px 0 rgba(11, 76, 120, 0.2), 0 6px 20px 0 rgba(11, 76, 120, 0.2);
        /* box-shadow: 0 4px 8px 0 rgba(11, 76, 120, 0.50), 0 6px 20px 0 rgba(11, 76, 120, 0.50); */
    }
</style>
</head>

<body class="off-canvas">
    <div id="container" class="sidebar-mini">
        <header id="header">
            <!--logo start-->
            <div class="brand">
                <a href="mainmenu.php" class="logo" style="font-family:'Times New Roman', Times, serif;font-size:20px">
                    <?php echo $project_title; ?>
                </a>
            </div>

            <!--logo end-->
            <div class="toggle-navigation toggle-left">
                <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>

            <div class="user-nav">
                <ul>

                    <li <?= $mainsearch; ?> class="srchMain" ><a href="?action=patient_main"><button class="button-68" id="search" role="button"> Search <i class="fa fa-search" aria-hidden="true"></i></button></a></li>

                    <?php
                    $currentdate = date("Y-m-d");
                    $getPurchRow = mysqli_query($conn, "SELECT `duedate` FROM `purmain` WHERE `duedate`<='$currentdate' and pay = ''") or die(mysqli_error($conn));
                    $row = mysqli_num_rows($getPurchRow);
                    ?>

                    <?php if ($row >= 1) { ?>
                        <li class="dropdown settings users">
                            <a class="dropdown-toggle" href="?action=purchalert">
                                <label class="label-control" style="font-size: 18px; color:red !important">Purchase - Due&nbsp;<?php echo '( ' . $row . " )"; ?></label>
                            </a>
                        </li>

                            <!-- <li class="dropdown settings users" ><a href="?action=purchalert.php"><button style="font-size: 17px; color:red !important" role="button">Purchase - Due&nbsp;<?php echo '( ' . $row . " )"; ?></button></a></li> -->

                    <?php } ?>

                    <?php if ($sno > 0) { ?>
                        <li class="dropdown settings users">
                            <a class="dropdown-toggle" href="?action=consultalert">
                                <label class="label-control" style="font-size: 18px;">Appointments&nbsp;<?php echo '( ' . $sno . " )"; ?></label>
                            </a>
                        </li>
                    <?php } ?>

                    <li class="dropdown settings calendar">
                        <a <?= $calendar; ?> href="?action=calendar" class="link bg-hover">
                            <button type="button" class="btn btn-pad btn-square " style="background-color:#ffffff;line-height:0.7;">
                                <span>Calendar</span>
                            </button>
                        </a>
                    </li>

                    <li class="dropdown settings" style="">
                        <a href="?action=addnew" class="link bg-hover">
                            <button type="button" class="btn btn-pad btn-square " style="background-color:#454752;line-height:0.7;color:white">
                                <span>New Appointment</span>
                            </button>
                        </a>
                    </li>




                    <li class="dropdown settings">
                        <a class="dropdown-toggle balsms" data-toggle="dropdown" href="#">
                            <b style="font-size: 20px;color:#58B19F;"><?php echo $_SESSION["username_" . $dbname]; ?></b> <i class="fa fa-angle-down"></i>
                        </a>
                        <ul class="dropdown-menu animated fadeInDown">
                            <li <?= $tlcompany; ?>><a href="?action=company"><i class="fa fa-building-o"></i> Company SetUp</a></li>
                            <li <?= $tlbackup; ?>><a href="backup.php"><i class="fa fa-cloud-download"></i> Backup</a></li>
                            <li <?= $tlprofile; ?>><a href="?action=profile"><i class="fa fa-user"></i> Profile</a></li>
                            <li <?= $tlprofile; ?>><a href="?action=dashboard"><i class="fa fa-dashboard"></i>Dashboard</a></li>
                            <!--<li <?= $tlbalsms; ?>><a href="?action=balsms"><i class="fa fa-user"></i> Balance SMS</a></li>-->
                            <!--<li <?= $tlyearend; ?>><a href="?action=yearend"><i class="fa fa-calendar"></i>Year End</a></li>-->
                            <li><a id="logout" 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  <?= $clinic; ?> class="master nav-dropdown">
                    <a href="#" title="UI Elements"><i class="fa fa-user-md"></i>Clinic</a>

                    <ul class="nav-sub">
                        <li <?= $patient; ?>><a href="?action=patient">Patient / Meeting</a></li>
                        <li <?= $consult_ent; ?>><a href="?action=consult_ent">Consultancy</a></li>

                    </ul>
                </li>
                <li  <?= $master; ?> class="master nav-dropdown">
                    <a href="#" title="UI Elements"><i class="fa fa-graduation-cap"></i>Masters</a>

                    <ul class="nav-sub">
                        <li <?= $treatment; ?>><a href="?action=treatment">Treatment</a></li>
                        <li <?= $item; ?>><a href="?action=item">Product</a></li>
                        <li <?= $supplier; ?>><a href="?action=supplier">Supplier</a></li>
                        <li <?= $staff; ?>><a href="?action=staff">Staff</a></li>
                        <li <?= $cash; ?>><a href="?action=cash">Cash </a></li>
                        <li <?= $bank; ?>><a href="?action=bank">Bank </a></li>
                        <li <?= $expense; ?>><a href="?action=expense">Expense </a></li>
                    </ul>
                </li>

                <li <?= $entries; ?> class="transaction nav-dropdown" >
                    <a href="#" title="UI Elements"><i class="fa fa-money"></i>Entries</a>

                    <ul class="nav-sub">
                        <li <?= $sale; ?>><a href="?action=sale">Sale</a></li>
                        <li <?= $purchase; ?>><a href="?action=purchase">Purchase</a></li>
                        <li <?= $inward; ?>><a href="?action=inward">Inward</a></li>
                        <!--<li <?= $purret; ?>><a href="?action=debnote">Purchase Return</a></li>
                            <li <?= $saleret; ?>><a href="?action=crednote">Goods Return</a></li>
                            <li <?= $tidamage; ?>><a href="?action=tidamage">Damage</a></li>-->
                        <hr>

                        <li <?= $cashrecp; ?>><a href="?action=cashrecp">Cash Receipt</a></li>
                        <li <?= $cashpay; ?>><a href="?action=cashpay">Cash Payment</a></li>
                        <li <?= $bankrecp; ?>><a href="?action=bankrecp">Bank Receipt</a></li>
                        <li <?= $bankpay; ?>><a href="?action=bankpay">Bank Payment</a></li>
                        <!--<li <?= $contra; ?>><a href="?action=contra">Contra Entry</a></li>-->
                    </ul>
                </li>



                <li <?= $reports; ?> class="report nav-dropdown" >
                    <a href="#" title="UI Elements"><i class="fa fa-line-chart"></i>Reports</a>
                    <ul class="nav-sub">
                        <li <?= $stock; ?>><a href="?action=stock">Inventory</a></li>
                        <li <?= $pathistory; ?>><a href="?action=pathistory">Patient History</a></li>
                        <li <?= $inwout; ?>><a href="?action=inwout">Product History</a></li>
                        <li <?= $ledger; ?>><a href="?action=ledger">Ledger</a></li>
                        <li <?= $cashbook; ?>><a href="?action=cashbook">Cash Book</a></li>
                        <li <?= $bankbook; ?>><a href="?action=bankbook">Bank Book</a></li>
                        <li <?= $salesummary; ?>><a href="?action=salesumm">Sale Summary(Monthwise)</a></li>
                        <li <?= $gstrevenue; ?>><a href="?action=gstrevenue">Revenue Report</a></li>
                    </ul>
                </li> 

                <li  <?= $register; ?> class="register nav-dropdown">
                    <a href="#" title="UI Elements"><i class="fa fa-bar-chart"></i>Register</a>

                    <ul class="nav-sub">
                        <li <?= $consultreg; ?>><a href="?action=consultreg">Consultancy</a></li>
                        <li <?= $salereg; ?>><a href="?action=salereg">Sale</a></li>
                        <li <?= $purreg; ?>><a href="?action=purgstreg">Purchase</a></li>
                        <li <?= $inwardreg; ?>><a href="?action=inwardreg">Inward</a></li>
                        <!--<li <?= $debreg; ?>><a href="?action=debgstreg">Debit Note</a></li>-->
                        <!--<li <?= $credreg; ?>><a href="?action=credgstreg">Credit Note</a></li>-->
                        <!--<li <?= $damreg; ?>><a href="?action=damgstreg">Damaged</a></li>-->
                    </ul>
                </li> 
            </ul>
        </nav>
        <!--sidebar left end-->
        <!--main content start-->
        <section class="main-content-wrapper">
            <section id="main-content">
                <div class="col-md-12 pad">
                    <iframe id='frame1' 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_msg.php") ?>
</body>

</html>