<!DOCTYPE HTML >
<html>
    <head>
        <title>Hotel Management System</title>

        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <script src="../js/jquery-3.0.0.min.js"></script>
        <script type="text/javascript" src="../easyUI/jquery.easyui.min.js"></script>
        <script type="text/javascript" src="../easyUI/plugins/jquery.datagrid.js"></script>
        <script type="text/javascript" src="../easyUI/plugins/jquery.edatagrid.js"></script>
        <script type="text/javascript" src="../easyUI/plugins/datagrid-detailview.js"></script>
        <script type="text/javascript" src="../js/moment.min.js" defer=""></script>
        <script type="text/javascript" src="../js/mine/requisition_notifier.js" defer=""></script>
        <script type="text/javascript" src="../js/Chart.min.js"></script>

        

        <!--Script for Ion sounds-->
        <script src="../frontdesk/ion_sound-master/js/ion.sound.min.js" async="" ></script>
        <!--Script for Lockr. LocalStorage-->
        <script src="../js/lockr-master/lockr.js" async=""></script>

        <script type="text/javascript" src="../pos/reservations_notice.js" defer></script>

        <script>
            // Creating a web worker to check if assets depreciations have been posted.
            var worker = new Worker("../js/mine/depreciation_asset_postings.js");
            var ee
            worker.onmessage = function (e){
                var response = JSON.parse(e.data);
                if (Number(response.counts) !== 0){
                  $.messager.alert("Depreciation Postings", "Asset Depreciation postings have not been made for the last month.");  
                }
            }
        </script>

        <link href="../easyUI/themes/default/easyui.css" rel="stylesheet" type="text/css">

        <link href="../easyUI/themes/icon.css" rel="stylesheet" type="text/css">

        <link href="../easyUI/demo/demo.css" rel="stylesheet" type="text/css">

        <link href="../css/Chart.min.css" rel="stylesheet" type="text/css">


        <style type="text/css">
            .hea{
                font-size:30px;
            }
            .hea2{
                font-size:20px;
            }

        </style>
       
    </head>

    <body background="../images/nn-bg.jpg" link="#000000" vlink="#000000" alink="#000000" topmargin="0" data-curruser="1">
        
        <table width="974" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
            <tr> 
                <td width="200" height="67" background="../images/nn-bg.jpg"><table width="550" border="0" align="left" cellpadding="0" cellspacing="0">
                        <tr> 
                            <td width="4">&nbsp;</td>
                            <td width="200" height="51" valign="bottom" ><font color="#FFFFFF" size="4" class="hea2" face="Arial, Helvetica, sans-serif"class="hea"><strong class="hea"><font class="hea" color="#FF3300"> 
                                    <font color="#FFFFFF" class="hea">Demo Hotel </font> H<font color="#FFFFCC" class="hea">.</font></font><font color="#FFFF00" class="hea">M</font>.S</strong></font></td>
                        </tr>
                        <tr> 
                            <td height="19">&nbsp;</td>
                            <td height="19"><font color="#CCFF00" size="2" face="MS Sans Serif" ><a style="text-decoration:none; color:rgb(204, 255, 0);" href="http://www.karibuhotelsoftware.com">Karibu 
                                    Hotel Management Software</a></font> <span style="    float: right;"> <span class="tooltip-icon-remove modules-tip" ></span> </span> </td>                        </tr>
                    </table></td>
                <td width="343" background="../images/nn-bg.jpg"><div align="right"> 
                        <table width="33" height="60" border="0" align="right" cellpadding="0" cellspacing="0">
                        
                            <tr> 


                                <!-- begin birthday nofification section -->
                                <td width="23%" height="58" id="birthday-notifications" hidden="true" 
                                    style="position: absolute; right: 45%;">
                                    <div align="right" onClick="openBirthdaySettings()">
                                        <table width="153" border="0" cellspacing="0" cellpadding="0">
                                            <tbody>
                                                <tr> 
                                                    <td width="4" height="19" background=""><div align="center"><font color="#FFFFFF" size="2" face="MS Sans Serif"></font></div></td>
                                                    <td width="11"></td>
                                                    <td width="16"></td>
                                                    <td width="4"><div align="center"></div></td>
                                                    <td width="120" height="37" background="../images/new-pics/9c.png"><a style="text-decoration:none;" href="javascript:void(0);"> 
                                                                <div align="center"><font color="#FFFFFF" size="3" face="Arial">Birthdays <span id="birth-day-counts"></span></font></div>
                                                            </a></td>
                                                </tr>
                                            <tr> 
                                                <td width="4">&nbsp;</td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </td>
                                <!--  bendegin birthday nofification section-->


								<!-- begin memo section  colspan --> 
                            	<td width="23%" height="58" valign="top">
									<div align="right" onClick="openMemoDlg()">
                                        <table width="153" border="0" cellspacing="0" cellpadding="0">
                                            <tbody>
												<tr> 
													<td width="4" height="19" background=""><div align="center"><font color="#FFFFFF" size="2" face="MS Sans Serif"></font></div></td>
													<td width="11"></td>
													<td width="16"></td>
													<td width="4"><div align="center"></div></td>
													<td width="120" height="37" background="../images/new-pics/9d.png">
                            <a style="text-decoration:none;" href="javascript:void(0);"> 
																<div align="center"><font color="#FFFFFF" size="3" face="Arial">Memo <span id="memos-count"></span><span class="tooltip-memo"></span></font></div>
															</a></td>
												</tr>
                                            <tr> 
                                                <td width="4">&nbsp;</td>
                                            </tr>
                                        	</tbody>
										</table>
                                    </div>
								</td>
								<td>
								</td>
                      
                      
                                


 <style>

    body {
        padding-top:5px;
    }

    .logout-text {
        color: #ff7910;
    }

    .current-module-name {
        color: #FFF;
        font-weight: bold;
        font-size: 15px;
    }

    .logged-in-as-text {
        color: #FFF;
    }

    #module-wrapper {
        background-color: #0561a9;
    }

    .side_menu_img {
        width: 34px;
        margin-top: 7px;
    }
        
    #menu-wrapper {
        height: 45px;
        width: 145px;
        display: inline-block;
        background-color: #0561a9;
        color: white;
        font-size: 16px;
        cursor: pointer;
    }

    #menu-content {
        display:none;
        position: absolute;
        z-index: 1;
        margin-left: -10px;
    }

    .vertical-menu,
    .home-module {
        margin-top: 4px;
        margin-left: -40px;
    }

    .vertical-menu a,
    .home-module a {
        color: white;
        font-weight: bold;
        display: block; 
        padding: 6px;  
        text-decoration: none;  
        font-family: arial;
        padding-left: 20px;
        border-bottom: 1px solid #85858a;
    }

    .vertical-menu li, 
    .home-module li 
    {
        background-color: #035899;
    }

    .menu-ul {
        list-style-type: none;
    }

    .menu-ul li {
        width: 250px;
        list-style: none;
    }

    .menu-ul li ul {
        position: absolute;
        margin-left: 211px;
    }

    .menu-ul li ul {
        position: absolute;
        /* margin-top: 0px; */
    }

    .menu-ul>ul li {
        width: 100%;
        position: relative;
        text-align:center;
    }

    .menu-ul>li:hover>ul {
        /* display: block; */
    }

    .menu-ul ul li a {
        text-decoration:none;
        color: white;
        font-weight: normal;
        display: inline-block;
        width: 80%;
    }
    
    .menu-ul>ul>li ul {
        position: absolute;
        top: 0;
        left: 100%;
        display: none;
    }

    .menu-ul>li ul{
        display: none;
    }


    .menu-ul>li>a {
        display: inline-block;
        width: 80%;
    }

    i {
        border: solid white;
        border-width: 0 2px 2px 0;
        display: inline-block;
        padding: 2px;
    }

    .right {
        transform: rotate(-45deg);
        -webkit-transform: rotate(-45deg);
    }

    .menu-ul a:hover {
        background-color: #f8af3e;
    }

    .menu-ul>li:hover {
        background-color: #f8af3e;
    }

    #current-module-menu {
        position: absolute;
        z-index: 1;
        display: none;
        width: 300px;
        display: none;
        margin-left: -100px;
    }

    #current-module-menu ul {
        list-style: none;
    }

    #current-module-menu li {
        width: 250px;
        list-style: none;
    }

    #current-module-menu li a {
        display: inline-block;
        width: 80%;
    }

    #current-module-menu li ul {
        position: absolute;
        margin-top: -45px;
        margin-left: 211px;
    }

    .down {
        transform: rotate(45deg);
        -webkit-transform: rotate(45deg);
        padding: 4px;
        margin-top: 12px;
        position: absolute;
    }


    #menu-trigger {
        width: 25px;
        height: 25px;
        display: inline-block;
        margin-left: 10px;
        cursor: pointer;
    }

    #menu-trigger li:hover {
        background-color: #f8af3e;
    }

    #menu-trigger li a:hover {
        background-color: #f8af3e;
    }

    .subsubmenu {
        display:none;
    }

    .submenu-item>.subsubmenu {
        /* display: block; */
        max-height: 450px;
        overflow-x: auto;
    }

    .submenu-item:hover,
    .submenu-item ul li:hover
    {
        background-color: #f8af3e;
    }

    .subsubmenu-wrapper {
        height: 50px;
    }

    #current-module-menu .submenu-item>.subsubmenu {
        max-height: 500px;
        overflow-x: auto;
    }

    #current-module-menu>.vertical-menu>ul,  
    #current-module-menu>.home-module>ul 
    {
        margin-top: 23px !important;
    }

    .vertical-menu .menu-ul .inactive-link,
    .vertical-menu .menu-ul .inactive-link a:hover,
    .vertical-menu .menu-ul  .inactive-link ul  .submenu-item,
    .vertical-menu .inactive-link,
    .home-module .menu-ul .inactive-link,
    .home-module .menu-ul .inactive-link a:hover,
    .home-module .menu-ul  .inactive-link ul  .submenu-item,
    .home-module .inactive-link,
    #menu-trigger .inactive-link a:hover,
    #menu-trigger .inactive-link:hover,
    .menu-ul ul .inactive-link>a,
    .vertical-menu ul .inactive-link a
    {
        color: #a3a3a3;
    }

    #current-module-menu .vertical-menu ul .submenu-item a {
        font-weight: normal;
    }


  
</style>


<script>
    $(function () {
        $('#menu-wrapper').click(()=> {
            $('#menu-content').show('fast');
        });
        

        $('#menu-content').html(`
            <div class="vertical-menu">
                <ul class="menu-ul">
                    <li class='active-link' onClick='showDirectMenu(this)'><a href='javascript: void(0)' class='active dropdown'>
                Frontdesk
                </a><span><i class='arrow right'></i></span> <ul style='margin-top:-27px;'><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../frontdesk/frontdesk-quotation" >Quotations</a>
                            <span class="tooltip-icon-remove menu_tool_tip_quotation" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-27px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../frontdesk/events" >Reception Management</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Reservation_Management" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-54px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../frontdesk/event-calendar" >Reservation Calendar</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Reservation_Calendar" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-81px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../frontdesk/roomsmgnt" >House Keeping</a>
                            <span class="tooltip-icon-remove menu_tool_tip_House_Keeping" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-108px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../frontdesk/front-office-collections" >Front Office Collections</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Room_Sales" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-135px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../frontdesk/cancelledEvents" >Cancelled Reservations</a>
                            <span class="tooltip-icon-remove menu_tool_tip_cancelledreservations" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-162px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../frontdesk/phone_contacts" >Phone Book</a>
                            <span class="tooltip-icon-remove menu_tool_tip_phone_contacts" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-189px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../frontdesk/lost_found" >Lost And Found</a>
                            <span class="tooltip-icon-remove menu_tool_tip_lost_found" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-216px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../pos/fd-cashier-sales" >Cashier P.O.S Sales</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Additional_Services_Sales" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-243px;'></ul>
                        </li></ul></li><li class='active-link' onClick='showDirectMenu(this)'><a href='javascript: void(0)' class='active dropdown'>
                Points Of Sale
                </a><span><i class='arrow right'></i></span> <ul style='margin-top:-54px;'><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../pos/restaurant" >Selling Interface</a>
                            <span class="tooltip-icon-remove menu_tool_tip_pos_selling_interface" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-27px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../pos/pos_membership" >P.O.S Membership</a>
                            <span class="tooltip-icon-remove menu_tool_tip_pos_membership" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-54px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../pos/pos_tables" >P.O.S Tables</a>
                            <span class="tooltip-icon-remove menu_tool_tip_pos_tables" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-81px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../pos/pos_reservations" >P.O.S Reservations</a>
                            <span class="tooltip-icon-remove menu_tool_tip_pos_reservations" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-108px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../pos/charge" >Charged To Room</a>
                            <span class="tooltip-icon-remove menu_tool_tip_chargedtoroom" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-135px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../pos/chargeorders" >Charged To Events</a>
                            <span class="tooltip-icon-remove menu_tool_tip_chargedtoevents" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-162px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../pos/kot" >Kitchen Orders</a>
                            <span class="tooltip-icon-remove menu_tool_tip_kot" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-189px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../pos/pos_costing_input" >Menu Inputs Chart</a>
                            <span class="tooltip-icon-remove menu_tool_tip_pos_costing" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-216px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../pos/report-day-transactions" >Detailed P.O.S Sales</a>
                            <span class="tooltip-icon-remove menu_tool_tip_detailed_pos_sales" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-243px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../pos/OrdersCancelled" >Cancelled Orders</a>
                            <span class="tooltip-icon-remove menu_tool_tip_cancelledorders" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-270px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../pos/pos_deliverables" >Points Of Sale Management</a>
                            <span class="tooltip-icon-remove menu_tool_tip_pos_deliverables" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-297px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../pos/quotation" >P.O.S Quotation</a>
                            <span class="tooltip-icon-remove menu_tool_tip_pos_quotation" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-324px;'></ul>
                        </li></ul></li><li class='active-link' onClick='showDirectMenu(this)'><a href='javascript: void(0)' class='active dropdown'>
                Stores
                </a><span><i class='arrow right'></i></span> <ul style='margin-top:-81px;'><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/lpo_purchase_management?inventorydisplay" >Inventory View</a>
                            <span class="tooltip-icon-remove menu_tool_tip_inventry_view" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-27px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/lpo_purchase_management?inventory_manage" >Item / Inventory Management</a>
                            <span class="tooltip-icon-remove menu_tool_tip_item_inventory_management" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-54px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/store_requisition" >Store Requisitions</a>
                            <span class="tooltip-icon-remove menu_tool_tip_store_requistions" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-81px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/storeRequisitionApproval" >Store Requisition Approval</a>
                            <span class="tooltip-icon-remove menu_tool_tip_store_requisition_approval" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-108px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/inventoryRequisitions" >Stock Transfer</a>
                            <span class="tooltip-icon-remove menu_tool_tip_stock_transfer" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-135px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/stockflows" >Stock Issue Note</a>
                            <span class="tooltip-icon-remove menu_tool_tip_stock_flows" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-162px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/requisition" >Purchase Requisitions</a>
                            <span class="tooltip-icon-remove menu_tool_tip_requisitions" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-189px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/requisitionSStatus" >Purchase Requisition Approval</a>
                            <span class="tooltip-icon-remove menu_tool_tip_new_requisition" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-216px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/requisitionStatus2?lpo_purchase_management" >L.P.O Purchase Management</a>
                            <span class="tooltip-icon-remove menu_tool_tip_lpo_purchase_management" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-243px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/lpo_purchase_management?direct_purchase" >Direct Purchase Management</a>
                            <span class="tooltip-icon-remove menu_tool_tip_general_stock" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-270px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/purchase_rep_grn" >Goods Received Note</a>
                            <span class="tooltip-icon-remove menu_tool_tip_purchase_rpt_grn" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-297px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/PurchaseReport" >Purchase Report</a>
                            <span class="tooltip-icon-remove menu_tool_tip_purchase_report" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-324px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/inventorybin" >Item Bin Card</a>
                            <span class="tooltip-icon-remove menu_tool_tip_item_flow" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-351px;'></ul>
                        </li></ul></li><li class='active-link' onClick='showDirectMenu(this)'><a href='javascript: void(0)' class='active dropdown'>
                Events
                </a><span><i class='arrow right'></i></span> <ul style='margin-top:-108px;'><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../events/event-quotation" >Event Quotation</a>
                            <span class="tooltip-icon-remove menu_tool_tip_events_quotation" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-27px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../events/events" >Events Management</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Events_Management" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-54px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../events/event-calendar" >Events Calendar</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Events_Calendar" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-81px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../events/eventsShow" >Events Cash Collections</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Events" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-108px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../events/cancelledEvents" >Cancelled Events</a>
                            <span class="tooltip-icon-remove menu_tool_tip_cancelledevents" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-135px;'></ul>
                        </li></ul></li><li class='active-link' onClick='showDirectMenu(this)'><a href='javascript: void(0)' class='active dropdown'>
                Human Resource
                </a><span><i class='arrow right'></i></span> <ul style='margin-top:-135px;'><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../hr/admindepartment" >HR Departments</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Department_Setup" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-27px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../hr/index" >Employee Management</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Employee_Management" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-54px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../hr/salaries" >Payroll Management</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Payroll_Management" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-81px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../hr/salariesAdvance" >Salary Advances</a>
                            <span class="tooltip-icon-remove menu_tool_tip_salariesAdvance" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-108px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../hr/performance" >Performance Appraisal</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Performance_Appraisal" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-135px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../hr/Employeeleavemanagement" >Leave Management</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Leave_Management" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-162px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../hr/schedule" >Leave Calendar</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Leave_Calendar" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-189px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../hr/job_applicants" >Job Applicants Database</a>
                            <span class="tooltip-icon-remove menu_tool_tip_job_applicants" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-216px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../hr/documents" >Documents</a>
                            <span class="tooltip-icon-remove menu_tool_tip_documents" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-243px;'></ul>
                        </li></ul></li><li class='active-link' onClick='showDirectMenu(this)'><a href='javascript: void(0)' class='active dropdown'>
                Accounts
                </a><span><i class='arrow right'></i></span> <ul style='margin-top:-162px;'><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../accounts/expenses" >Expenses Management</a>
                            <span class="tooltip-icon-remove menu_tool_tip_expenses" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-27px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../pos/Accountantposordersales" >Staff Debtors</a>
                            <span class="tooltip-icon-remove menu_tool_tip_POS_Debtors" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-54px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/payment_voucher2" >Payment Voucher</a>
                            <span class="tooltip-icon-remove menu_tool_tip_payment_voucher" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-81px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../accounts/cashBankTransfer" >Cash/bank Transfer</a>
                            <span class="tooltip-icon-remove menu_tool_tip_paymentVoucher" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-108px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../accounts/debtors_clients" >Debtors / Clients</a>
                            <span class="tooltip-icon-remove menu_tool_tip_debtors_clients" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-135px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../accounts_new/home" >Advanced Accounts</a>
                            <span class="tooltip-icon-remove menu_tool_tip_new_accounts" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-162px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/suppliers" >Suppliers</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Suppliers" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-189px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../frontdesk/report-dayRoomSales" >Accomodation Daily Sales</a>
                            <span class="tooltip-icon-remove menu_tool_tip_report-dayRoomSales" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-216px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../accounts/assets_management" >Assets Management</a>
                            <span class="tooltip-icon-remove menu_tool_tip_assets_management" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-243px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../accounts/CostofSales" >Cost Of Sales Posting</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Cost_of_Sale_Report_Key" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-270px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../accounts/inventoryCategorySetup" >Category Setup</a>
                            <span class="tooltip-icon-remove menu_tool_tip_CategorySetup" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-297px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../inventory/inventoryadmin" >Departments</a>
                            <span class="tooltip-icon-remove menu_tool_tip_departments" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-324px;'></ul>
                        </li></ul></li><li class='active-link' onClick='showDirectMenu(this)'><a href='javascript: void(0)' class='active dropdown'>
                Maintenance
                </a><span><i class='arrow right'></i></span> <ul style='margin-top:-189px;'><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../maintenance/index?repairs_reporting" >Repairs Management</a>
                            <span class="tooltip-icon-remove menu_tool_tip_repair_reporting" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-27px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../maintenance/index?assets_maintenance" >Assets Maintenance </a>
                            <span class="tooltip-icon-remove menu_tool_tip_assets_maintenace" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-54px;'></ul>
                        </li></ul></li><li class='active-link' onClick='showDirectMenu(this)'><a href='../accounts/systemsettings_client_accounts' class='active dropdown'>
                Guest Access Portal
                </a><span></span> <ul style='margin-top:-216px;'></ul></li><li class='active-link' onClick='showDirectMenu(this)'><a href='javascript: void(0)' class='active dropdown'>
                Website Bookings
                </a><span><i class='arrow right'></i></span> <ul style='margin-top:-243px;'><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../frontdesk/website_bookings" >Website Booking</a>
                            <span class="tooltip-icon-remove menu_tool_tip_website_booking_home" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-27px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../frontdesk/online_booking_engine" >Settings</a>
                            <span class="tooltip-icon-remove menu_tool_tip_online_booking" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-54px;'></ul>
                        </li></ul></li><li class='active-link' onClick='showDirectMenu(this)'><a href='javascript: void(0)' class='active dropdown'>
                Reports
                </a><span><i class='arrow right'></i></span> <ul style='margin-top:-270px;'><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="javascript: void(0)" >Frontdesk Reports</a>
                            <span class="tooltip-icon-remove menu_tool_tip_frontdesk_reports" ></span>
                            <span><i class='arrow right'></i> </span>
                            <ul class='subsubmenu' style='margin-top:-27px;'><li><a href="../report-new/frontdesk_reports?frontdesk_collections_report" >Frontdesk Collections Report</a></li><li><a href="../report-new/frontdesk_reports?guest_roomming_list_report" >Guest Rooming List Report</a></li><li><a href="../report-new/frontdesk_reports?house_keeping_report" >House Keeping Report</a></li><li><a href="../report-new/frontdesk_reports?no_show_report" >No Show Report</a></li><li><a href="../report-new/frontdesk_reports?cancelled_reservations" >Cancelled Report</a></li><li><a href="../report-new/frontdesk_reports?client_meal_plans_report" >Client Meal Plans Report</a></li><li><a href="../report-new/frontdesk_reports?room_occupancy_report" >Room Occupancy Report</a></li><li><a href="../report-new/frontdesk_reports?visa_charges_report" >Visa Charges Report</a></li><li><a href="../report-new/frontdesk_reports?deleted_guests" >Deleted Guests Report</a></li><li><a href="../report-new/frontdesk_reports?short_stay_clients" >Short Stay Clients Report</a></li><li><a href="../report-new/frontdesk_reports?housekeeping_report" >House Keeping Report</a></li><li><a href="../report-new/frontdesk_reports?guest_report" >Guest Report</a></li><li><a href="../report-new/frontdesk_reports?guest_list_report" >Guest List Report</a></li><li><a href="../report-new/frontdesk_reports?guest_check_out_report" >Guest Checkout Report</a></li><li><a href="../report-new/frontdesk_reports?frontdesk_client_payments_report" >Frontdesk Client Payments </a></li><li><a href="../report-new/frontdesk_reports?summarized_day_room_sales_report" >Summarized Day Room Sales </a></li><li><a href="../report-new/frontdesk_reports?additional_services_sales_report" >Additional Services Sales </a></li><li><a href="../report-new/frontdesk_reports?room_sales_report" >Room Sales Report</a></li><li><a href="../report-new/frontdesk_reports?hpuse_use_report" >House Use Report</a></li><li><a href="../report-new/frontdesk_reports?complementary_report" >Complementary Report</a></li><li><a href="../report-new/frontdesk_reports?client_financial_summary_report" >Client Financial Summary Report</a></li><li><a href="../report-new/frontdesk_reports?client_list_report" >Client List Report</a></li><li><a href="../report-new/frontdesk_reports?client_report" >Client Report</a></li><li><a href="../report-new/frontdesk_reports?guest_check_in_report" >Guest Checkin Report</a></li><li><a href="../report-new/frontdesk_reports?frontdesk_service_charge_report" >Frontdesk Servce Charge Report</a></li></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="javascript: void(0)" >Account Reports</a>
                            <span class="tooltip-icon-remove menu_tool_tip_account_reports" ></span>
                            <span><i class='arrow right'></i> </span>
                            <ul class='subsubmenu' style='margin-top:-54px;'><li><a href="../report-new/account_reports?Assets_Report" >Assets Report</a></li><li><a href="../report-new/account_reports?Supplier_List_Report" >Supplier List Report </a></li><li><a href="../report-new/account_reports?Occupancy_Rate_Report" >Occupancy Rate Report </a></li><li><a href="../report-new/account_reports?Salary_Advances_Report" >Salary Advances Report </a></li><li><a href="../report-new/account_reports?FrontDesk_Debtors_Payments" >FrontDesk Debtors Payments </a></li><li><a href="../report-new/account_reports?Event_Debtors_Payments" >Event Debtors Payments </a></li><li><a href="../report-new/account_reports?POS_Deposits_Report" >POS Deposits Report </a></li><li><a href="../report-new/account_reports?Front_Desk_Collections_Report" >Front Desk Collections Report </a></li><li><a href="../report-new/account_reports?Bad_Debtors_Report" >Bad Debtors Report </a></li><li><a href="../report-new/account_reports?Sales_Taxing_Report" >Sales Taxing Report </a></li><li><a href="../report-new/account_reports?POS_Debtors_Payments_Report" >POS Debtors Payments Report </a></li><li><a href="../report-new/account_reports?Cash_Bank_Transfer_Report" >Cash/Bank Transfer Report </a></li><li><a href="../report-new/account_reports?Expenses_Summary_Report" >Expenses Summary Report </a></li><li><a href="../report-new/account_reports?Frontdesk_Exchange_Report" >Frontdesk Exchange Report </a></li><li><a href="../report-new/account_reports?Frontdesk_Tax_Report" >Frontdesk Tax Report </a></li><li><a href="../report-new/account_reports?Events_Tax_Report" >Events Tax Report </a></li><li><a href="../report-new/account_reports?Cost_Of_Sales_Postings_Report" >Cost Of Sales Postings Report </a></li><li><a href="../report-new/account_reports?Supplier_Transactions_Report" >Supplier Transactions Report </a></li><li><a href="../report-new/account_reports?POS_Debtors_Transactions_Report" >P.O.S Debtors Transactions</a></li><li><a href="../report-new/account_reports?Assets_Disposal_Report" >Assets Disposal Report </a></li><li><a href="../report-new/account_reports?Assets_Purchase_Report" >Assets Purchase Report </a></li><li><a href="../report-new/account_reports?Cash_Flow_Summary_Report" >Cash Flow Summary Report</a></li><li><a href="../report-new/account_reports?Creditors_Suppliers_Report" >Creditors / Suppliers Report </a></li><li><a href="../report-new/account_reports?Input_Tax_Report" >Input Tax Report </a></li><li><a href="../report-new/account_reports?Expenses_Report" >Expenses Report </a></li><li><a href="../report-new/account_reports?Item_Expenses_Report" >Item Expenses Report </a></li><li><a href="../report-new/account_reports?Service_Charge_Report" >Service Charge Report </a></li><li><a href="../report-new/account_reports?POS_Sales_Tax_Report" >P.O.S Sales Tax Report </a></li><li><a href="../report-new/account_reports?Refunds_Reversed_Payments_Report" >Refunds / Reversed Payments</a></li><li><a href="../report-new/account_reports?Suppliers_Aging_Report" >Suppliers Aging Report </a></li><li><a href="../report-new/account_reports?Debtors_Transactions" >Debtors Transactions </a></li><li><a href="../report-new/account_reports?Debtors_List" >Debtors List </a></li><li><a href="../report-new/account_reports?Debtors_Aging_Report" >Debtors Aging Report </a></li><li><a href="../report-new/account_reports?Hotel_Operations_Summary_Report" >Hotel Operations Summary</a></li><li><a href="../report-new/account_reports?income_expenditure_report" >Income And Expenditure Report</a></li></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="javascript: void(0)" >Inventory Reports</a>
                            <span class="tooltip-icon-remove menu_tool_tip_inventory_reports" ></span>
                            <span><i class='arrow right'></i> </span>
                            <ul class='subsubmenu' style='margin-top:-81px;'><li><a href="../report-new/inventory_reports?Bin_Card_Report" >Bin Card Report</a></li><li><a href="../report-new/inventory_reports?Store_Requisitions_Report" >Store Requisitions Report </a></li><li><a href="../report-new/inventory_reports?Stock_Posting" >Stock Posting </a></li><li><a href="../report-new/inventory_reports?Stock_Count_Variance" >Stock Count Variance </a></li><li><a href="../report-new/inventory_reports?Summary_Stock_Monitor_Report" >Summary Stock Monitor Report </a></li><li><a href="../report-new/inventory_reports?Purchases_Report" >Purchases Report</a></li><li><a href="../report-new/inventory_reports?Purchases_By_Item_Report" >Purchases By Item Report  </a></li><li><a href="../report-new/inventory_reports?Inventory_Movements_Report" >Inventory Movements Report </a></li><li><a href="../report-new/inventory_reports?General_Inventory_Management_Report" >General Inventory Management</a></li><li><a href="../report-new/inventory_reports?Purchase_Requisitions_Report" >Purchase Requisitions Report </a></li></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="javascript: void(0)" >Events Reports</a>
                            <span class="tooltip-icon-remove menu_tool_tip_events_reports" ></span>
                            <span><i class='arrow right'></i> </span>
                            <ul class='subsubmenu' style='margin-top:-108px;'><li><a href="../report-new/events_reports?Event_Services" >Event Services </a></li><li><a href="../report-new/events_reports?Visa_Charges_Report" >Visa Charges Report </a></li><li><a href="../report-new/events_reports?Resources_Sales_Report" >Resources Sales Report </a></li><li><a href="../report-new/events_reports?OutSourced_Services_Report" >OutSourced Services Report</a></li><li><a href="../report-new/events_reports?Event_Collections_Report" >Event Collections Report</a></li><li><a href="../report-new/events_reports?Event_Financial_Summary_Report" >Event Financial Summary Report </a></li><li><a href="../report-new/events_reports?Complementary_Report" >Complementary Report </a></li><li><a href="../report-new/events_reports?Client_Report" >Client Report </a></li><li><a href="../report-new/events_reports?Client_List_Report" >Client List Report</a></li><li><a href="../report-new/events_reports?Cancelled_Events_Report" >Cancelled Events Report </a></li><li><a href="../report-new/events_reports?Venue_Sales_Report" >Venue Sales Report </a></li></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="javascript: void(0)" >Point Of Sales Reports</a>
                            <span class="tooltip-icon-remove menu_tool_tip_point_of_sales_reports" ></span>
                            <span><i class='arrow right'></i> </span>
                            <ul class='subsubmenu' style='margin-top:-135px;'><li><a href="../report-new/pos_reports?POS_Sales_Summary_Report" >P.O.S Sales Summary Report </a></li><li><a href="../report-new/pos_reports?POS_Cashier_Daily_Sales_Summary_Report" >P.O.S Cashier Daily Sales Summary</a></li><li><a href="../report-new/pos_reports?POS_Waiter_Daily_Sales_Summary_Report" >P.O.S Waiter Daily Sales Summary</a></li><li><a href="../report-new/pos_reports?POS_Service_Charge_Report" >P.O.S Service Charge Report </a></li><li><a href="../report-new/pos_reports?Point_Of_Sale_Reservations" >Point Of Sale Reservations</a></li><li><a href="../report-new/pos_reports?Point_Of_Sale_Reservations_Clients" >Point Of Sale Reservations Clients</a></li><li><a href="../report-new/pos_reports?Point_Of_Sale_Reservations_Deposits" >Point Of Sale Reservations Deposits </a></li><li><a href="../report-new/pos_reports?Membership_List" >Membership List </a></li><li><a href="../report-new/pos_reports?Membership_Payments" >Membership Payments </a></li><li><a href="../report-new/pos_reports?Membership_Attendance" >Membership Attendance </a></li><li><a href="../report-new/pos_reports?Membership_Debtors" >Membership Debtors</a></li><li><a href="../report-new/pos_reports?Membership_Client_Transactions" >Membership Client Transactions </a></li><li><a href="../report-new/pos_reports?POS_Accommodation_Meal_Plan_Sales" >P.O.S Accommodation Meal Plan Sales </a></li><li><a href="../report-new/pos_reports?POS_Discounts" >POS Discounts </a></li><li><a href="../report-new/pos_reports?Returned_Items" >Returned Items</a></li><li><a href="../report-new/pos_reports?Table_Sales_Analysis_Report" >Table Sales Analysis Report </a></li><li><a href="../report-new/pos_reports?Waiters_Analysis_Report" >Waiters Analysis Report </a></li><li><a href="../report-new/pos_reports?Sales_Costing_Report" >Sales Costing Report </a></li><li><a href="../report-new/pos_reports?Credit_Sales" >Credit Sales </a></li><li><a href="../report-new/pos_reports?Cancelled_Orders_and_Items_Report" >Cancelled Orders And Items</a></li><li><a href="../report-new/pos_reports?Cash_Sales_Report" >Cash Sales Report </a></li><li><a href="../report-new/pos_reports?Cashier_Analysis_Report" >Cashier Analysis Report </a></li><li><a href="../report-new/pos_reports?Charge_To_Event_Report" >Charge To Event Report </a></li><li><a href="../report-new/pos_reports?Charge_To_Room_Report" >Charge To Room Report </a></li><li><a href="../report-new/pos_reports?POS_Complementary_Report" >POS Complementary Report </a></li><li><a href="../report-new/pos_reports?POS_House_Charge_Report" >P.O.S House Charge Report </a></li><li><a href="../report-new/pos_reports?POS_Electronic_Sales_Report" >P.O.S Electronic Sales Report </a></li><li><a href="../report-new/pos_reports?Item_Sales_Report" >Item Sales Report </a></li><li><a href="../report-new/pos_reports?Menu_Cost_Report" >Menu Cost Report </a></li><li><a href="../report-new/pos_reports?Menu_Input_Report" >Menu Input Report </a></li><li><a href="../report-new/pos_reports?Item_Sales_Analysis_Report" >Item Sales Analysis Report </a></li><li><a href="../report-new/pos_reports?POS_Menus_Item_Report" >P.O.S Menus / Item Report </a></li><li><a href="../report-new/pos_reports?POS_Close_Day_Report" >P.O.S Close Day Report </a></li></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="javascript: void(0)" >Most Popular</a>
                            <span class="tooltip-icon-remove menu_tool_tip_most_popular" ></span>
                            <span><i class='arrow right'></i> </span>
                            <ul class='subsubmenu' style='margin-top:-162px;'><li><a href="../report-new/most_popular?Item_Bin_Cards" >Item Bin Cards </a></li><li><a href="../report-new/most_popular?Item_Sales_Report" >Item Sales Report </a></li><li><a href="../report-new/most_popular?Expenses_Report" >Expenses Report </a></li><li><a href="../report-new/most_popular?Front_Desk_Collections_Report" >Front Desk Collections Report</a></li><li><a href="../report-new/most_popular?Venue_Sales_Report" >Venue Sales Report </a></li><li><a href="../report-new/most_popular?FrontDesk_Client_Payments_Report" >FrontDesk Client Payments </a></li><li><a href="../report-new/most_popular?General_Inventory_Management_Report" >General Inventory Management</a></li><li><a href="../report-new/most_popular?Hotel_Operations_Summary_Report" >Hotel Operations Summary Report </a></li><li><a href="../report-new/most_popular?POS_Sales_Summary_Report" >P.O.S Sales Summary Report </a></li><li><a href="../report-new/most_popular?Room_Sales_Report" >Room Sales Report </a></li><li><a href="../report-new/most_popular?Membership_Payments" >Membership Payments </a></li></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="javascript: void(0)" >Hr Reports</a>
                            <span class="tooltip-icon-remove menu_tool_tip_hr_reports" ></span>
                            <span><i class='arrow right'></i> </span>
                            <ul class='subsubmenu' style='margin-top:-189px;'><li><a href="../report-new/hr_reports?Staff_List" >Staff List </a></li><li><a href="../report-new/hr_reports?Employee_Leave_Report" >Employee Leave Report </a></li></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../reports/feedback_report" >Client Feedback</a>
                            <span class="tooltip-icon-remove menu_tool_tip_client_feedback" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-216px;'></ul>
                        </li></ul></li><li class='active-link' onClick='showDirectMenu(this)'><a href='javascript: void(0)' class='active dropdown'>
                Settings
                </a><span><i class='arrow right'></i></span> <ul style='margin-top:-297px;'><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="javascript: void(0)" >General Settings</a>
                            <span class="tooltip-icon-remove menu_tool_tip_general_settings" ></span>
                            <span><i class='arrow right'></i> </span>
                            <ul class='subsubmenu' style='margin-top:-27px;'><li><a href="../accounts/systemsettings" >Hotel Details</a></li><li><a href="../accounts/systemsettings-db" >Database Management</a></li><li><a href="../accounts/systemsettings-updates" >System Updates</a></li><li><a href="../accounts/systemsettings-language" >Language</a></li><li><a href="../accounts/systemsettings-security" >Security</a></li><li><a href="../accounts/systemsettings-license" >License</a></li></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="javascript: void(0)" >Front Desk Settings</a>
                            <span class="tooltip-icon-remove menu_tool_tip_eventssettings" ></span>
                            <span><i class='arrow right'></i> </span>
                            <ul class='subsubmenu' style='margin-top:-54px;'><li><a href="../frontdesk/events-settings" >Rooms Management</a></li><li><a href="../frontdesk/Taxes" >Taxes</a></li><li><a href="../frontdesk/AdditionalServices" >Additional Services</a></li><li><a href="../frontdesk/room_inventory" >Rooms With Inventory Management</a></li><li><a href="../frontdesk/front_desk_settings" >Reception Personnel</a></li></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../events/events-settings" >Events Settings</a>
                            <span class="tooltip-icon-remove menu_tool_tip_events_settings" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-81px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../pos/pos_charges" >P.O.S Settings</a>
                            <span class="tooltip-icon-remove menu_tool_tip_pos_charges" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-108px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../accounts/accounts_setup" >Accounts Setup</a>
                            <span class="tooltip-icon-remove menu_tool_tip_accounts_setup" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-135px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../accounts_new/accounts_settings" >Advanced Accounts Settings</a>
                            <span class="tooltip-icon-remove menu_tool_tip_advanced_accounts_settings" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-162px;'></ul>
                        </li></ul></li><li class='active-link' onClick='showDirectMenu(this)'><a href='javascript: void(0)' class='active dropdown'>
                Users
                </a><span><i class='arrow right'></i></span> <ul style='margin-top:-324px;'><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../accounts/users" >General Users</a>
                            <span class="tooltip-icon-remove menu_tool_tip_system_users_module" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-27px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../accounts/roles" >Roles Management</a>
                            <span class="tooltip-icon-remove menu_tool_tip_roles_management" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-54px;'></ul>
                        </li></ul></li><li class='active-link' onClick='showDirectMenu(this)'><a href='../accounts/system_remote_access' class='active dropdown'>
                Remote Access
                </a><span></span> <ul style='margin-top:-351px;'></ul></li><li class='active-link' onClick='showDirectMenu(this)'><a href='javascript: void(0)' class='active dropdown'>
                Facial Recognition Attendance
                </a><span><i class='arrow right'></i></span> <ul style='margin-top:-378px;'><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../hr/attendance_register_facial" >Attendance Register</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Attendance_Register_Facial" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-27px;'></ul>
                        </li><li class='submenu-item active-link'  onClick='showDirectMenu(this)'>
                            <a href="../hr/time_attendance_facial" >Settings And Reports</a>
                            <span class="tooltip-icon-remove menu_tool_tip_Time_and_Attendance_Facial" ></span>
                            <span> </span>
                            <ul class='subsubmenu' style='margin-top:-54px;'></ul>
                        </li></ul></li>                </ul>
            </div>
        `);

        $('#current-module-menu').html(`
            <div class="vertical-menu">
                            </div>
        `);

        $('#menu-trigger').click(()=> {
            $('#current-module-menu').show('fast');
        });

        $(document).mouseup(function(e) 
        {
            let container = $("#current-module-menu");
            // if the target of the click isn't the container nor a descendant of the container
            if (!container.is(e.target) && container.has(e.target).length === 0) 
            {
                container.hide();
            }

            container = $("#menu-content");
            // if the target of the click isn't the container nor a descendant of the container
            if (!container.is(e.target) && container.has(e.target).length === 0) 
            {
                container.hide();
            }

            container = $('.menu-ul>li>ul');
            // if the target of the click isn't the container nor a descendant of the container
            if (!container.is(e.target) && container.has(e.target).length === 0) 
            {
                container.hide();
            }

            container = $('.menu-ul>li>ul>li>ul');
            // if the target of the click isn't the container nor a descendant of the container
            if (!container.is(e.target) && container.has(e.target).length === 0) 
            {
                container.hide();
            }

            container = $('#sugesstion-results-section, #search-sugesstion-guide');
            if (!container.is(e.target) && container.has(e.target).length === 0) 
            {
                $('#sugesstion-results-section').hide();
            }

            container = $('.subsubmenu');
            if (!container.is(e.target) && container.has(e.target).length === 0) 
            {
                $('.subsubmenu').hide();
            }

        });
                

    })

    function showDirectMenu (that) {
        $(that).children('ul').show();
        // console.log('shhh');
    }
</script>

								
								<!-- end memo section -->



                                <!-- Begin section reservation -->
                                    <td width="23%" height="58" id="reservations_td" hidden="true" 
                                        style="position: absolute; right: 45%;">
                                        <div align="right" onClick="openBirthdaySettings()">
                                            <table width="153" border="0" cellspacing="0" cellpadding="0">
                                                <tbody>
                                                    <tr> 
                                                        <td width="4" height="19" background=""><div align="center"><font color="#FFFFFF" size="2" face="MS Sans Serif"></font></div></td>
                                                        <td width="11"></td>
                                                        <td width="16"></td>
                                                        <td width="4"><div align="center"></div></td>
                                                        <td width="120" height="37" background="../images/new-pics/9c.png"><a style="text-decoration:none;" href="javascript:void(0);"> 
                                                                    <div align="center"><font color="#FFFFFF" size="3" face="Arial"> 
                                                                        <span id="btn_reservation_num"></span></font></div>
                                                                </a></td>
                                                    </tr>
                                                <tr> 
                                                    <td width="4">&nbsp;</td>
                                                </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </td>
                                <!-- End section reservation -->

								
								<!-- notifications section begin -->

                                <td width="24%" valign="top" style="display:none;"><table width="136" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td width="4" height="37" background=""><div align="center"><font color="#FFFFFF" size="2" face="MS Sans Serif"></font></div></td>
                                            <td width="12"></td>
                                            <td width="120" height="37" background="../images/new-pics/9d.png"><div align="center"><font color="#FFFFFF" size="3" face="Arial"><a href="#" style="text-decoration: none; color:#FFFFFF;" id="btn_guest_not" ><strong>Notices</strong></a></font></div></td>
                                                                                                                                    </tr>
                                        <tr> 
                                            <td height="19">&nbsp;</td>
                                            <td>&nbsp;</td>
                                            <td><img src="../images/spacer.gif" width="120" height="9"></td>
										</tr>
                                    </table>
								</td>

								<!-- notifications section end -->


								
                                <td width="23%" valign="top" onClick="openUserGuide()"><div align="center"> 
                                        <div align="right">
                                            <table width="153" border="0" cellspacing="0" cellpadding="0">
                                                <tr > 
                                                    <td width="4" height="37" background=""><div align="center" class="tooltip-userguide"><font color="#FFFFFF" size="2" face="MS Sans Serif"></font></div></td>
                                                    <td width="10"></td>
                                                    <td width="120" height="37" background="../images/new-pics/9c.png"><div align="center"><font color="#FFFFFF" size="3" face="Arial"><a href="javascript:undefined" id="btn_guest_not" style="text-decoration: none; color:#FFFFFF;" >User guide</a></font></div></td>
                                                    <td width="10"></td>
                                                                                                            <td width="4"><div align="center"></div></td>
                                                                                                        </tr>
                                                <tr> 
                                                    <td height="19"><img src="../images/spacer.gif" width="4" height="9"></td>
                                                    <td><img src="../images/spacer.gif" width="10" height="9"></td>
                                                    <td><img src="../images/spacer.gif" width="120" height="9"></td>
                                                    <td><img src="../images/spacer.gif" width="10" height="9"> 
                                                    <td><img src="../images/spacer.gif" width="4" height="9"></td>
                                                    <td width="4"><img src="../images/spacer.gif" width="4" height="9"></td>
                                                    <td width="10">&nbsp;</td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div></td>
                            </tr>
                        </table>
                    </div></td>
            </tr>
            <tr id="module-wrapper"> 
                <td height="32" colspan="2"><table width="1090" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr> 
                            <td width="259" align="left" id="side_menu">
                                <span id="menu-wrapper" onClickkkk="location.href= '../frontdesk/start-page.php'">
                                    <table>
                                        <tr>
                                            <td>
                                                <img class="side_menu_img" src="../images/burger.jpg">
                                            </td>
                                            <td>
                                                <span class="module-text">Modules</span>
                                            </td>
                                        </tr>
                                    </table>
                                    <div id="menu-content"></div>
                                </span>
                                
                            </td>
                            <td width="200" height="32" class="current-module-name-header">
                                    <span class="current-module-name">
                                        DASHBOARD                                            <span id ="menu-trigger">
                                                <!-- <img src="../images/drop-down.PNG" alt="down arrow" style="width: 20px;"> -->
                                                <i class='arrow down'></i>
                                                <div id="current-module-menu" class="vertical-menu"> </div>
                                            </span>

                                    </span>
                                   
                            </td>
                            <td width="245" class="logged-in-as-text">
                                <span style=''>Search help</span>
                                <input type="search" id="search-sugesstion-guide" placeholder="" 
                                    onKeyUp="opensuggestionResults($('#search-sugesstion-guide').val());"
                                    onFocus="openSuggesstions(); $(this).css('width', '150px'); $('.current-module-name-header').css('width', '200px')"
                                    onBlur="$(this).css('width', '100px'); $('.current-module-name-header').css('width', '150px')"
                                    >
                                <span class="tooltip-help"></span>
                                <div id="sugesstion-results-section">
                                    <div id="suggestion-results"></div>
                                </div>


                                <u>
                                    <input type="hidden" name="thisuserID" id="thisuserID" value="1" />
                                    <input type="hidden" name="thisuserIDname" id="thisuserIDname" value="admin" />
                                    admin                                </u>
                                    Logged In / 
                                                                            <a href="../index.php?logout" class="logout-text">Log out</a>
                                                                        <input type="hidden" id="user" value="admin"/>
                                   
                                </strong>
                            </td>

                      
                    </table></td>
            </tr>


              

        <style type="text/css">

            .module-text {
                font-weight: 100px;
                font-size: 17px;
            }

            .report-iframe {
                margin: 0px 2px 0px 2px; 
            }

            .hea{
                font-size:30px;
            }
            .hea2{
                font-size:20px;
            }
        </style>
        
        <style>
            nav {
                position: relative;
                background-color: #365EBF;
                padding:10px 0;
            }
            nav .menu_list {
                position: relative;
                list-style-type:none;
                margin:0;
                padding:0;
            }
            nav .menu_list li {
                display:inline-block;
                position:relative;
            }

            nav li .menu_list {    
                background-color: #ff9900;
                position:absolute;
                left:0;
                top:40px; /* make this equal to the line-height of the links (specified below) */
                width:200px;
            }
            nav li li {
                position:relative;
                margin:0;
                display:block;
            }
            nav li li .menu_list {
                position:absolute;
                top:0;
                left:200px; /* make this equal to the width of the sub nav above */
                margin:0;
            }
            nav a {
                line-height:10px;
                padding:0 12px;
                margin:0 12px;
            }
            nav a {
                color:#fff;
                text-decoration:none;
                display:block;
				font-weight:bold;
            }
            nav a:hover,
            nav a:focus,
            nav a:active {
                color:#ffcc00;
            }
            /* style sub level links */
            nav li li a {
                border-bottom:solid 1px rgb(200,50,50);
                margin:0 10px;
                padding:0;
            }
            nav li li:last-child a {
                border-bottom:none;
            }

            .side-buttons {
              color: #FFF;
              background-color: #314FA3;
              /* border-color: 07c; */
              box-shadow: inset 0 1px 0 #66bfff
            }

            .side-buttons:hover {
              /* background-color: #4CAF50; */
              /* color: white; */
            }

            .logout-button {
              color: #FFF;
              background-color: #FF3D3D;
              /* border-color: 07c; */
              box-shadow: inset 0 1px 0 #66bfff
            }

            .logout-button:hover {
              /* background-color: #f44336; */
            }

            .other-buttons {
              color: #FFF;
              background-color: #d9534f;
              /* border-color: 07c; */
              box-shadow: inset 0 1px 0 #66bfff
            }


            #tabledlg-content button {
                width: 140px;
                height: 50px;
                font-size: 18px;
                font-weight: bold;
                cursor: pointer;
            }


            #search-sugesstion-guide {
                border: none;
                margin-top: 0px;
                margin-right: 0px;
                font-size: 13px;
                width: 154px;
                margin-left: 10px;
                border-radius: 11px;
                padding: 2px;
            }

            #sugesstion-results-section {
                margin-top: 16px;
                display:none;
                position: absolute;
                z-index: 10;
                background-color: rgb(255, 255, 255);
                width: 800px;
                text-align: center;
                max-height: 400px;
                overflow-y: auto;
                margin-left: -481px;
                border: 0px;
                border-radius: 0px 0px 24px 24px;
                box-shadow: -50px 366px 25px 366px rgba(55, 55, 55, 0.3), 
                    -10px 8px 15px rgba(55, 55, 55, 0.3), 10px 60px 15px rgba(55, 55, 55, 0.3);
                padding-bottom: 4px;
                color: black;
            }
            
        </style>



<tr> 
    <td colspan="2">
      <table  id="content-wrapper">
      <tr> 
        <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr> 
              <td width="100%" colspan="4" valign="bottom">
                <div id="dashboard-content">
                  <div id="dashboard-header">

                    <select onChange="changeDataDate(this)">
                      <option value = "today" selected >Today</option>
                      <option value = "month-to-date">Month to date</option>
                    </select>
                    <!-- Dashboard -->
                  </div>
                  <div id="dashboard-wrapper">
                    <div id="left-side" class="sections">
                      <div  id="left-side-top" >
                        <h1 class="section-header">
                          Room Occupancy
                        </h1>
                        <canvas id="room-occupancy" class="chart-item"></canvas> 
                        <hr class="memo-card-divider">
                        <div id="room-occupancy-keys"></div>  

                        <div class="notification-card">
                          <span class="notification-counts" id="blocked-rooms-counts">-</span>
                          <span class="notification-desc">Blocked Rooms</span>
                        </div>

                      </div>
                      <div  id="left-side-bottom" >
                        <h1 class="section-header">
                          Notifications
                        </h1>
                        <div class="notification-card">
                          <span class="notification-counts" id="memo-counts">-</span>
                          <span class="notification-desc">Memos</span>
                        </div>
                        <div class="notification-card" style="display:none;" >
                          <span class="notification-counts"  id="bd-counts">-</span>
                          <span class="notification-desc">Birthdays</span>
                        </div>
                        <div class="notification-card">
                          <span class="notification-counts" id="job-card-counts">-</span>
                          <span class="notification-desc">Job Cards</span>
                        </div>
                        <div class="notification-card">
                          <span class="notification-counts"  id="maintence-counts">-</span>
                          <span class="notification-desc">Maintenace</span>
                        </div>
                      </div>
                    </div>
                    <div id="middle-side" class="sections">

                      <div id="middle-section-top-top">
                        <table>
                          <tbody>
                            <tr>
                              <td>
                                <div class="notification-card">
                                  <span class="notification-counts" id="usd-rate">-</span>
                                  <span class="notification-desc">Exchange Rate</span>
                                </div>
                              </td>
                              <td>
                                <div class="notification-card">
                                  <span class="notification-counts" id="stock-counts">-</span>
                                  <span class="notification-desc">Running Low in Stock</span>
                                </div>
                              </td>
                              <td>
                                <div class="notification-card">
                                  <span class="notification-counts" id="requisitions-counts">-</span>
                                  <span class="notification-desc">Others</span>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>

                      
                      <div id="middle-section-top">
                        <h1 class="section-header">
                          Revenues
                        </h1>

                        <canvas id="revenues" class="chart-item"></canvas> 
                        <hr class="memo-card-divider">
                        <div id="revenues-keys"></div>
                      </div>

                      <div id="middle-section-bottom">
                        <table>
                          <tbody>
                            <tr>
                              <td>
                                <div class="notification-card">
                                  <span class="notification-counts" id="arrivals-counts">-</span>
                                  <span class="notification-desc">Arrivals</span>
                                </div>
                              </td>
                              <td>
                                <div class="notification-card">
                                  <span class="notification-counts" id="events-counts">-</span>
                                  <span class="notification-desc">On Going Events</span>
                                </div>
                              </td>
                              <td>
                                <div class="notification-card">
                                  <span class="notification-counts" id="pos-reservations-counts">-</span>
                                  <span class="notification-desc">POS Reservations</span>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      
                    </div>
                    <div id="right-side" class="sections">
                      <div  id="right-side-top" >
                        <h1 class="section-header">Incomes and Expenses</h1>
                        <canvas id="incomes-expenses" class="chart-item"></canvas> 
                        <hr class="memo-card-divider">
                        <div id="incomes-expenses-keys"></div>     
                      </div>

                      <div  id="right-side-bottom" >
                        <h1 class="section-header">
                          Other Notifications
                        <h1>

                        <div class="notification-card">
                          <span class="notification-counts"  id="store_req-counts">-</span>
                          <span class="notification-desc">Store Requisitions</span>
                        </div>
                        <div class="notification-card">
                          <span class="notification-counts"  id="purchase_req-counts">-</span>
                          <span class="notification-desc">Purchase Requisitions</span>
                        </div>
                      </div>
                    </div>
                  </div>

                </div>

              </td>
            </tr>
          </table></td>
      </tr>
    </table></td>
  </tr>
</table>


<style>


  #arrivals-counts {
    background-color: red;
    color: #fbfbfb;
  }
  #events-counts {
    background-color: orange;
    color: #fbfbfb;
  }
  #pos-reservations-counts {
    background-color: green;
    color: #fbfbfb;
  }


  #middle-section-bottom>table,
  #middle-section-top-top>table {
    width: 98%;
  }
  #middle-section-bottom>table>tbody>tr>td {
    width: 27%;
  }

  #middle-section-top {
    width: 100%;
    height: 70%;
    margin-top: 5px;
    border: 1px solid #bebdbd;
    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2);
  }

  #middle-section-bottom,
  #middle-section-top-top {
    margin-top: 7px;
    width: 100%;
    height: 13%;
    border: 1px solid #bebdbd;
    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2);
  }

  #middle-section-top-top {
    margin-top: 0px;
  }

  .notification-counts {
    font-size: 18px;
    display: block;
  }

  .notification-card {
    width: 90%;
    display: block;
    background-color: #efeeee;
    height: 33px;
    margin-left: 10px;
    margin-top: 4px;
    padding: 4px;
  }

  #room-occupancy-keys>table {
    margin-left: 54px;
  }
  .color-dot {
    background-color: red;
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 16px;
  }

  .category-name {
    margin: 0px;
  }

  .section-header {
    color: #75a4ce;
    font-size: 16px;
    margin: 0px;
    margin-top: 5px;
  }

  #left-side-top,
  #right-side-top {
    border: 1px solid gray;
    width: 100%;
    height: 50%;
    border: 1px solid #bebdbd;
    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2);
  }

  #left-side-bottom,
  #right-side-bottom {
    margin-top: 7px;
    border: 1px solid gray;
    width: 100%;
    height: 48%;
    border: 1px solid #bebdbd;
    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2);
  }

  #dashboard-wrapper {
    margin-top: 5px;
  }

  #left-side,
  #right-side {
    width: 22%;
    border:none;
    box-shadow:none;
  }

  #middle-side {
    width: 54%;
    border: none;
    box-shadow: none;
  }
  

  .sections {
    display: block;
    background-color: white;
    height: 69px;
    border: 1px solid #bebdbd;
    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2);
    font-size: 37px;
    text-align: center;
    /* color: #5e6161; */
    color: black;
    float: left;
    height: 482px;
    margin: 3px;
  }

  #dashboard-header {
    width: 99%;
    display: block;
    background-color: white;
    height: 20px;
    font-size: 21px;
    padding-left: 10px;
    /* color: #5e6161; */
    color: black;
  }

  .chart-item-title {
    text-align: center;
    color: gray;
    margin: 0px;
    /* width: 200px; */
    height: 173px;
  }

  .chart-card {
    display: inline-block;
    /* width: 400px;
    height: 150px; */
    background-color: #FFF;
  }

  .chart-item {
    display: inline-block;
    float: left;
    width: 500px;
    height: 250px;
    margin-top: 10px;
  }

  .memo-card-divider {
    width: 50%;
    color: #ccd2d8;
    /* border-color: #ccd2d8; */
    border: none;
    border-top: 1px solid rgba(160,160,160,0.2);
  }

  .memo-title {
    font-size: 12px;
    text-align: center;
    padding: 0px;
    margin: 0px;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .memo-content {
    padding-left: 1px;
    padding-right: 1px;
    margin: 0px;
    /* white-space: nowrap; */
    overflow: hidden;
    text-overflow: ellipsis;
    height: 34px;
  }

  .memo-section {
    margin-top: 5px;
    display: block;
    width: inherit;
    height: 186px;
    border: 1px solid #ABC;
  }

</style>


<style>
  .bithday-card {
    background: linear-gradient(90deg, rgb(4, 5, 5) 35%, rgba(177,190,189,1) 61%, rgba(244,254,253,1) 100%);
    width: 190px;
    height: 70px;
    box-shadow: 3px 3px 5px 6px #0561a9; 
    margin-right: 4px;
    display: inline-flex;
    
  }


  .bithday-card:hover {
    box-shadow: none; 
  }

  .bd-avatar {
    background-image: url("../hr/avatars/download.jpg");
    display: inline-block;
    width: 70px;
    height: 70px;
    background-size: 119px 77px;
  }

  .bd-divider {
    background: black;
  }

  .bd-content {
    display: inline-block;
    vertical-align: top;
  }

  .bd-name {
    color: white;
    font-weight: bold;
    margin: 1px;
  }

  .birthday-section {
    margin-top: 7px;
    width: inherit;
    height: 113px;
    padding: 10px;
    display: none;
    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2);
    border-radius: 2px; 
    border: 1px solid #e3e3e3;
  }

  .birthday-section:hover {
    box-shadow: none;
  }

  .chart-section {
    margin-top: 7px;
    /* background-color: #e2fbf9; */
    height: 400px;
    padding: 10px;
    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2);
    border-radius: 2px; 
    border: 1px solid #e3e3e3;
    width: inherit;
    /* overflow: auto;
    white-space: nowrap; */
  }


  .chart-section:hover {
    box-shadow: none;
  }

  .bd-content-title {
    font-weight: bold;
    /* color: white; */
  }

  .birthday-header {
    color: #AAA;
    font-weight: 900;
    font-size: large;
    padding: 0px;
    margin: 0px;
  }

  #birthdays, 
  #memos 
  {
    width: 99%;
    overflow: auto;
    white-space: nowrap;
    display: inline-block;
    float:left;
  }



  .modules-section {
    margin-top: 7px;
    height: 143px;
    padding: 10px;
    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2);
    border-radius: 2px; 
    border: 1px solid #cad6d5;
    width: inherit;
    white-space: nowrap;
  }

  .modules-section:hover {
    box-shadow: none;
  }

  .module-card {
    display: inline-block;
    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2);
    border: 1px solid #cad6d5;
    width: 160px;
    height: 44px;
    float: left;
    margin-top: 10px;
    margin-left: 10px;
    cursor: pointer;
  }

  .module-card:hover {
    box-shadow: none;
    background-color: #035899;
    border: 1px solid #3c4d5b;
    /* border: none; */
  }
  .module-card:hover .module-name {
    color: white;
  }

  .module-icon {
    margin-top: 3%;
    margin-left: 6%;
    width: 36px;
  }

  .home-module ul {
    display: none;
    list-style: none;
  }

  
  .module-card:hover .module-icon {
    width: 37px;
  }
    
  .module-card:hover .home-module>ul {
    display: block;
    position: absolute;
    z-index: 1;
    padding: 0px;
    margin-top: -4px !important;
    margin-left: -4px;
    width: 200px;
  }

  .home-module ul li .subsubmenu {
    position: absolute;
    margin-left: 161px;
    min-width: 200px;
  }

  

  .module-name {
    font-size: 18px;
    display: inline-block;
    position: relative;
    font-weight: 100;
    vertical-align: top;
    padding-top: 0px;
    padding-left: 2px;
    color: #111;
  }


  #content-wrapper {
    margin: 0px;
    width: 100%;
    background-color: #FFF;
    min-height: 500px;
  }

  #dashboard-content {
    width: 100%;
  }

  .vertical-menu a, .home-module a {
    width: 80%;
    display: inline-block;
  }


  /* width */
  /* #content-wrapper ::-webkit-scrollbar {
    width: 1px;
  } */

  /* Track */
  /* #content-wrapper ::-webkit-scrollbar-track {
    box-shadow: inset 0 0 1px #ABC;
    border-radius: 10px;
  } */

  /* Handle */
  /* #content-wrapper ::-webkit-scrollbar-thumb {
    background: #ABC;
    border-radius: 1px;
  } */


  #content-wrapper::-webkit-scrollbar {
    width: 1em;
  }
  
  #content-wrapper::-webkit-scrollbar-track {
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  }
  
  #content-wrapper::-webkit-scrollbar-thumb {
    background-color: darkgrey;
    outline: 1px solid slategrey;
  }




</style>


<script>

  $(function () {
    getBirthdayNotifications();
  });

  function getBirthdayNotifications () {
    $.post('../hr/getStaff.php?birthday_notifications_check', {}, function (response) {
      if (response.length) {
        $('#bd-counts').html(response.length);
        $('#bd-counts').parent().show();
      } else;
    }, 'JSON');
  }

  function changeDataDate (that) {
    let value = $(that).val();
    generateCharts(value);
  }


  function getSystemMemos () {
    $.post('../includes/get_memos.php?user_id=1&active_status=1', {}, function (response){
      $('#memo-counts').html(response.length);
    }, 'JSON');
  }

  function getJobCardsCounts () {
    $.post('../includes/get_memos.php?get_job_cards', {}, function (response){
      $('#job-card-counts').html(response.length);
    }, 'JSON');
  }

  function getMaintenaceCounts () {
    $.post('../includes/MaitenanceNotifications/get_maintenace_notifications.php', {}, function (response){
      $('#maintence-counts').html(response.length);
    }, 'JSON');
  }

  let isCurrencyGotten = false;
  function getOtherCounts (dateFilter) {
    $.post('../includes/system-graphs.php?get_system_data=get_module_counts', {dateFilter: dateFilter}, function (response){
      $('#arrivals-counts').html(response.expected_arrivals);
      $('#events-counts').html(response.on_going_events);
      $('#pos-reservations-counts').html(response.pos_reservations);
      $('#blocked-rooms-counts').html(response.blocked_rooms);

      if (!isCurrencyGotten) {
        showSlides (response.currencies);
      }
      isCurrencyGotten = true;

      $('#stock-counts').html(response.running_low_in_stock);
      $('#store_req-counts').html(response.store_requisitions);
      $('#purchase_req-counts').html(response.purchase_requisitions);
    }, 'JSON');
  }


  function setCurrencyData (currencies) {
    // let startTime = 2000;
    currencies.forEach ((currency, position) => {
      setInterval(() => {
        $('#usd-rate').html(`${currency.currency} ${currency.rate}`);
      },1000 );
    });
   
    
  }


  /* Begin section slide show*/
  function showSlides(currencies, currencyOnIndex = 0) {
    if (currencies.length == 0) {
      return false;
    }
    
    setTimeout(() => {
      currencyOnIndex = (currencyOnIndex >= currencies.length) ? 0 : currencyOnIndex;
      $('#usd-rate')
        .html(`${currencies[currencyOnIndex].currency} ${currencies[currencyOnIndex].rate}`)
        // .hide()
        .show('slow');
      showSlides(currencies, currencyOnIndex+= 1)
    }, 2000);
  }
  /* End section slide show*/

  $(function () {
    setTimeout(() => {
      generateCharts('today');
    }, 1000);
  });


  let generatedCharts = [];
  function generateCharts (dateFilter = 'today') {
    // Get charts data
    destroyGeneratedCharts();
    generateRoomOccupancy(dateFilter);
    generateRevenues(dateFilter);
    generateIncomesExpenses(dateFilter);
    getSystemMemos(dateFilter);
    getJobCardsCounts(dateFilter);
    getMaintenaceCounts(dateFilter);
    getOtherCounts(dateFilter);
  }

  function generateRoomOccupancy (dateFilter) {
    // Get charts data
    $.get('../includes/system-graphs.php', {get_system_data:'room_occupancy', dateFilter: dateFilter}, resp => {
      try {
        resp = JSON.parse(resp);
        resp.forEach (item => {
          createRoomOccupancyChart(item);
        });
      } catch (e) {

      }
    });
  }

  function generateIncomesExpenses (dateFilter) {
    // Get charts data
    $.get('../includes/system-graphs.php', {get_system_data:'incomes_expenses', dateFilter: dateFilter}, resp => {
      try {
        resp = JSON.parse(resp);
        resp.forEach (item => {
          createIncomesExpensesChart(item);
        });
      } catch (e) {

      }
    });
  }


  function generateRevenues (dateFilter) {
    // Get charts data
    $.get('../includes/system-graphs.php', {get_system_data:'revenues', dateFilter: dateFilter}, resp => {
      try {
        resp = JSON.parse(resp);
        resp.forEach (item => {
          createRevenuesBarGraph(item);
        });
      } catch (e) {

      }
    });
  }



  function getLabelsFromData (data) {
    let labels = [];
    let values = [];
    data.forEach((item, key) => {
      labels.push(item.label);
      values.push(item.value);
    });
    return {
      labels: labels,
      values: values
    };
  }

  let colors = ['yellow', '#006dbf', '#75d03a', 
                'red', 'orange', 'purple', 'grey',
                  'purple',
                  'mauve',
                  'violet',
                  'boysenberry',
                  'lavender',
                  'plum',
                  'magenta',
                  'lilac'];


  function createRoomOccupancyChart (data) {
    let labelData = getLabelsFromData(data);
    var ctx = document.getElementById('room-occupancy').getContext('2d');
    var myPieChart = new Chart(ctx, {
        type: 'pie',
        data: {
            datasets: [{
                data: labelData.values,
                backgroundColor: colors,
            }],
            // These labels appear in the legend and in the tooltips when hovering different arcs
            labels: labelData.labels
        },
        options: {
          legend: {
            display: false,
            maintainAspectRatio: false,
            responsive: false,
          },
        }
    });
    generatedCharts.push(myPieChart);
    setRoomOccupancyKeys (data)
  }

  function destroyGeneratedCharts () {
    generatedCharts.forEach (item => {
      item.destroy();
    });
    generatedCharts = [];
  }

  function createIncomesExpensesChart (data) {
    let labelData = getLabelsFromData(data);
    var ctx = document.getElementById('incomes-expenses').getContext('2d');
    var myPieChart = new Chart(ctx, {
        type: 'pie',
        data: {
            datasets: [{
                data: labelData.values,
                backgroundColor: colors,
            }],
            // These labels appear in the legend and in the tooltips when hovering different arcs
            labels: labelData.labels
        },
        options: {
          legend: {
            display: false,
            maintainAspectRatio: false,
            responsive: false,
          },
        }
    });
    generatedCharts.push(myPieChart);
    setIncomesExpensesKeys (data)
  }


  function createRevenuesBarGraph (data) {
    let labelData = getLabelsFromData(data);
    var ctx = document.getElementById('revenues').getContext('2d');
    var myPieChart = new Chart(ctx, {
        type: 'bar',
        data: {
            datasets: [{
                data: labelData.values,
                backgroundColor: colors,
            }],
            // These labels appear in the legend and in the tooltips when hovering different arcs
            labels: labelData.labels
        },
        options: {
          legend: {
            display: false,
            maintainAspectRatio: false,
            responsive: false,
          },
          scales: {
              yAxes: [{
                  ticks: {
                      beginAtZero:true
                  }
              }]
          }
        }
    });
    generatedCharts.push(myPieChart);
    // setRevenuesKeys (data)
  }

  function setRevenuesKeys (data) {
    let html_str = ``;
    data.forEach((item, key) => {
      html_str += `<td><span class="color-dot" style="background-color:${colors[key]}"></span></td>
            <td>${item.label}</td>`;
    });
    $('#revenues-keys').html(`
        <table>
          <tr>
            ${html_str}
          </tr>
        </table>
      `);
  }

  function setIncomesExpensesKeys (data) {
    let html_str = ``;
    data.forEach((item, key) => {
      html_str += `<td><span class="color-dot" style="background-color:${colors[key]}"></span></td>
            <td>${item.label}</td>`;
    });
    $('#incomes-expenses-keys').html(`
        <table>
          <tr>
            ${html_str}
          </tr>
        </table>
      `);
  }


  function setRoomOccupancyKeys (data) {
    let html_str = ``;
    let occupancy_color = '';
    let available_color = '';
    data.forEach((item, key) => {
      if (item.label == "Occupied") {
        occupancy_color = colors[key];
      } else {
        available_color = colors[key];
      }
    });
    $('#room-occupancy-keys').html(`
        <table>
          <tr>
            <td><span class="color-dot" style="background-color:${occupancy_color}"></span></td>
            <td>Occupied</td>
            <td><span class="color-dot" style="background-color:${available_color}"></span></td>
            <td>Available</td>
          </tr>
        </table>
      `);
  }

</script>








    <!-- begin Dialog Create a new Job Card -->
    <div class="easyui-dialog" id="dlg_jobcard" style="width:780px;height:500px;top:100px; padding:10px;" buttons="#buttons-dlg_jobcard" closed="true" closable="false" modal="true">
        
        <h1 id="my_job_card_title" style=" display:none; text-align: center; font-size: x-large; margin: 1px;">Job Card 1</h1>

        <form method='POST' id="work_job_form">


            <table style="width: 100%;">
                <tr>

                    <!-- begin left side content -->
                    <td>
                        <table>
                            <tr>
                                <td>
                                    <label for="type"><b>Type</b></label>
                                </td>
                                <td>
                                    <input type="text" id="type" name="type"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <label for="applies_type"><b>Applies To</b></label>
                                </td>
                                <td>
                                    <input type="text" id="applies_type" name="applies_type"/>
                                </td>
                            </tr>
                            

                            <tr>
                                <td>
                                    <label for="location"><b>Location</b></label>
                                </td>
                                <td>
                                    <input type="text" id="location" name="location" required/>
                                </td>
                            </tr>

                            <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            
                        </table>
                    </td>
                    <!-- end left side content -->

                    <!-- begin right side content -->
                    <td style="vertical-align: top;float: right;margin-right: 40px;">
                        <table>

                            <tr>
                                <td>
                                    <label for="priority"><b>Priority</b></label>
                                </td>
                                <td>
                                    <input type="text" id="priority" name="priority"/>
                                </td>
                            </tr>
                            
                            <tr>
                                <td>
                                    <label for="required_before"><b>Required Before</b></label>
                                </td>
                                <td>
                                    <input type="text" id="required_before" name="required_before"/>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <!-- end right side content -->
                </tr>
            </table>

            <div>
                <label for="description"><b style="vertical-align: top;">Description:</b></label>
                <textarea name="description" id="description" style="margin: 0px; width: 700px; height: 200px;" required></textarea>
            </div>
            <div>
                <span>Created By: </span>
                &nbsp;&nbsp;&nbsp;
                <span id="job_card_creator"></span>
                &nbsp;&nbsp;&nbsp;on  
                &nbsp;&nbsp;&nbsp;
                <span id="job_card_create_date"></span>
                &nbsp;&nbsp;&nbsp;
                <span id="job_card_create_time"></span>
            </div>

            <div>
                <span>Completed by: </span>
                &nbsp;&nbsp;&nbsp;
                <span id="job_card_completed_by"></span>
                &nbsp;&nbsp;&nbsp;
                on 
                &nbsp;&nbsp;&nbsp;
                <span id="job_card_complete_date"></span>
                &nbsp;&nbsp;&nbsp
                <span id="job_card_complete_time"></span>
            </div>

        </form>
        
    </div>
    <div id="buttons-dlg_jobcard">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printMaintainance"  onclick="printDlgJobCard()">Print</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel"  onclick="closeDlgJobCard()">Close</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-save" id="btn-job_save"  onclick="SaveDlgJobCard()">Save</a>
    </div>
    <!-- end Dialog Create a new Job Card -->
</div>
<!-- End Job card section -->



<script>



$(function () {
    $('#work_job_form').form({
        url: '',
        onSubmit: function(param){

        },
        succes: function(response){

        }
    });
    $('#priority').combobox({
        valueField: 'priority',
        textField: 'priority',
        panelHeight: 'auto',
        required: true,
        editable: false,
        data: [
            {
                priority: 'Normal'
            },
            {
                priority: 'Urgent'
            }
        ]
    });
});


var job_url = "";
function SaveDlgJobCard() {
    $('#work_job_form').form('submit', {
        url: job_url,
        onSubmit: function(param){

            param.description2 = nicEditors.findEditor('description').getContent();

            var is_data = $(this).form('validate');

            if(!is_data){
                show_messager('Warning', 'Something\'s not right');
            }
            return is_data;
        },
        success: function(response){
            response = JSON.parse(response);
            if(response.success){
                $('#maintenance_dg').datagrid('reload');
                show_messager("Info", "Update Successful");
                $('#dlg_jobcard').dialog('close');
            }else{
                show_messager("Update Successful", response);
            }
        }
    });
}

 function viewJobCard(row){
    editJobCard(row);
    $('#btn-job_save').hide();
}

function clearJobCardForm(){
    $('#work_job_form').form('clear');
    $('#job_card_creator').html('');
    try {
        nicEditors.findEditor('description').setContent('');
    } catch (e) {

    }
    

    $('#job_card_completed_by').html('');
    $('#job_card_complete_date').html('');

}

function closeDlgJobCard(){
    $('#dlg_jobcard').dialog('close');
    if(my_motifications.length){
        readNotifications();
    }else{
        
    }
    
}


function editJobCard(row){
    
    $('#type').combobox({
        valueField: 'work_type',
        textField: 'work_type',
        panelHeight: 'auto',
        required: true,
        editable: false,
        data: [
            {
                work_type: 'Repair'
            },
            {
                work_type: 'Installation'
            },
            {
                work_type: 'Replacement'
            },
            {
                work_type: 'Others'
            }
        ]
    });

    $('#applies_type').combobox({
        valueField: 'applies_type',
        textField: 'applies_type',
        panelHeight: 'auto',
        required: true,
        editable: false,
        data: [
            {
                applies_type: 'Electrical Fixing and Wiring'
            },
            {
                applies_type: 'Building and Construction'
            },
            {
                applies_type: 'Computer Accessories'
            },
            {
                applies_type: 'Furniture'
            },
            {
                applies_type: 'Networking and Software'
            },
            {
                applies_type: 'Plumbing'
            },
            {
                applies_type: 'Others'
            }
        ]
    });


    var row = row ? row : $('#maintenance_dg').datagrid('getSelected');//from auto read job cards
    
    print_data = JSON.stringify(row);
    if(!row){
        show_messager('Info', 'Please select a row');
        return;
    }
    job_url = "update_maintenance.php?update_job="+row.id;
    clearJobCardForm();
    $('#work_job_form').form('clear');

    $('#work_job_form').form('load', row);

    setTimeout(() => {
        nicEditors.findEditor('description').setContent(row.description);
    }, 1000);

    

    
    try { 
        $('#job_card_creator').html(row.created_by);
        $('#job_card_create_date').html(row.created_on);
        $('#job_card_create_time').html('at&nbsp;&nbsp;&nbsp;' + row.create_time.split(' ')[1]);
    } catch (e) {
        
    }
    


    
    try {
        $('#job_card_completed_by').html(row.completor);
        $('#job_card_complete_date').html(row.complete_date_time.split(' ')[0]);
        $('#job_card_complete_time').html('at&nbsp;&nbsp;&nbsp;&nbsp;' + row.complete_date_time.split(' ')[1]);
    } catch (e) {

    }
    


    $('#dlg_jobcard').dialog('open').dialog('setTitle', 'Edit Job Card');
    $('#btn-job_save').show();
}
</script>






<style>
    .search-results-item:hover {
        background-color: #c5d3df;
        cursor: pointer;
    }
    .search-results-item {
        text-align: left;
    }
</style>

<div style="display:none;">
    <div id="dlg-user-guide" class="easyui-dialog" style="width:1200px;height:600px;top:10px; padding:0px; margin:0px;" 
        title="User-guide"  closed="true" closable="true" toolbar="#tb-user-guide">

        <div id="search-results-section" style=" 
                    position: absolute;
                    z-index: 10;
                    background-color: #fff;
                    width: 800px;
                    text-align: center;
                    max-height: 400px;
                    overflow-y: auto;
                    margin-left: 171px;
                    border: 0;
                    border-radius: 0 0 24px 24px;
                    box-shadow: 0 4px 6px 0 rgba(32,33,36,0.28);
                    padding-bottom: 4px;
                    
                    ">
            <h3>Search results are displayed here</h3>
            <div id="search-results">
            
            </div>
        </div>
        <table id="dg-user-guide">
        </table>
    </div>


    <div id="tb-user-guide">
        <div style="width:100%; text-align:center">
            <input style="margin:0px; padding: 0px;" id="search-user-guide" type="search" placeholder="Search... " onKeyUp="
                openUserGuideSearch($('#search-user-guide').val());
            " >

            <a href="../hr/tooltips_setup.php" target="_blank">Edit User Guide</a>
        </div>
    </div>



    <div id="dgmemo" class="easyui-dialog" style="width:820px;height:500px;top:100px" toolbar="#toolbar-memo" buttons="#buttons-memo" title="Memos"  closed="true" closable="false">
        <table id="memo_list"></table>
    </div>

    <div id="toolbar-memo">
        <span class="tooltip-icon-remove tooltip-create-memo"></span>
        <a href="javascript:undefined" class="easyui-linkbutton" iconCls="icon-add" id="create_memo_btn"  onclick="$('#memo_header').hide();openCreateMemo()">Create</a>
        <a href="javascript:undefined" class="easyui-linkbutton" iconCls="icon-ok"  onclick="$('#memo_header').hide();openViewMemo()">View</a>
        <a href="javascript:undefined" class="easyui-linkbutton" iconCls="icon-edit"  id="edit_memo_btn" onclick="$('#memo_header').hide();openEditMemo()">Edit</a>
        <a href="javascript:undefined" class="easyui-linkbutton" iconCls="icon-remove" id="delete_memo_btn"  onclick="deleteMemo()">Delete</a>
        &nbsp;&nbsp;&nbsp;
        <span>
            <label for="memo_status">Status</label>
            <input type="text" id="memo_status" name="memo_status">
        </span>
        <span>
            <label for="memo_search">Search</label>
            <input type="text" id="memo_search" name="memo_search" onKeyUp="searchMemo(this)" placeholder="search...">
        </span>
    </div>

    <div id="buttons-memo">
        <a href="javascript:undefined" class="easyui-linkbutton" iconCls="icon-cancel"  onclick="closeCreateMemo()">Close</a>
    </div>


    <div id="add_memo" class="easyui-dialog" style="width:780px;height:520px;top:80px" buttons="#buttons-add_memo" title="Add Memo"  closed="true" closable="false" modal="true">
        <br />
        <h1 id="memo_header" style="text-align: center; font-size: 20px; margin: 0px; font-family: cursive; font-weight: lighter;">Memo 1</h1>
        <form method="POST" id="memo-form">
            <table style="width: 100%">
                <tr>
                    <td style="width: 5%">
                        <label for="memo_title"><b>Title</b></label>
                    </td>
                    <td style="width: 60%">
                        <input type="text" id="memo_title" name="memo_title" style="width: 90%" required/>
                        <input type="number" id="edit_no" name="edit_no"  style="display:none;"/>
                    </td>
                </tr>

            </table>
            <table style="width: 100%;">
                <tr>
                    <td> <!-- left side-->
                        <table>
                            <tr>
                                <td>
                                    <label for="memo_priority"> <b>Priority</b></label>
                                </td>
                                <td>
                                    <input type="text" id="memo_priority" name="memo_priority" required/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <label for="memo_department"><b>Department:</b> </label>
                                </td>
                                <td>
                                    <input type="text" id="memo_department" name="memo_department" required/>
                                </td>
                            </tr>
                            <tr style="display:none;">
                                <td>
                                    <label for="memo_creator"><b>Created by:</b> </label>
                                </td>
                                <td>
                                    <input type="number" id="memo_creator"  name="memo_creator"  value = "1" disabled="false"  />
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td style="vertical-align: top;float: right;margin-right: 68px;"><!-- right side-->
                        <table>
                            <tr>
                                <td>
                                    <label for="memo_create_date"><b>Start Date</b></label>
                                </td>
                                <td>
                                    <input type="text" id="memo_create_date" name="memo_create_date" required/>
                                </td>
                            </tr>

                            <tr>
                                <td>
                                    <label for="memo_expirely_date"><b>End date</b></label>
                                </td>
                                <td>
                                    <input type="text" id="memo_expirely_date" name="memo_expirely_date" required/>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <br />
            <div style="margin: 10px; " >&nbsp;&nbsp;<b>Memo notes:</b>
                <textarea name="notice_memo" id="notice_memo" style="width: 733px; height: 200px" ></textarea>

                <div>
                    <span>Created by: </span>
                    <span id="memo-creator"></span>
                    <span id="memo_create_date_view">
                        
                    </span>
                </div>

            </div><br />
                
            
        </form>
        
    </div>
    <div id="buttons-add_memo">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="closeMemoDlg()">Close</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-save" id="save_memo" onclick="saveMemo()">Save</a>
    </div>
</div>




<!--Start of the loading dialog-->
<div class="easyui-dialog" id="dlg-loading-tooltips" style="width: 290px; height: 220px; top: 50px;" closable="false" modal="true"   title="Please wait..." closed="true">
    <span style="margin-left: 40px;" id="load-msg">Loading User guide</span>
    <span style="margin-left: 50px; align-content: center;"><img src="../images/spinner.gif" height="160px" width="160px"/></span>
</div>
<!--End of the loading dialog-->




<div style="display:none">
    <!-- begin dialog for displaying active maintenance notifications -->
    <div id="dlgmaintenace_alerts" class="easyui-dialog" style="width:815px;height:472px;top:100px" 
        buttons="#buttons-dlgmaintenace_alerts" title="Maintenance Notifications"  closed="true" 
        closable="false" modal="true">
        <table id="dg_maintenance_alert"></table>
    </div>

    <div id="buttons-dlgmaintenace_alerts">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel"  onclick="closeMNotification()">Close</a>

    </div>
    <!-- end dialog for displaying  active maintenance notifications -->  


    <!-- begin dialog for displaying  active jobcards notifications -->
    <div id="dlgjob_card_alerts" class="easyui-dialog" style="width:820px;height:500px;top:100px" buttons="#buttons-dlgjob_card_alerts" title="Job Card Notifications"  closed="true" closable="false" modal="true">
        <table id="dg_job_card_alert"></table>
    </div>

    <div id="buttons-dlgjob_card_alerts">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel"  onclick="closeJCNotifications()">Close</a>

    </div>
    <!-- end dialog for displaying  active jobcards notifications -->  
</div>

<div id="dg_maintenance_alert-tb">
    <div style="padding:2px;">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print"  onclick="viewMaintenance()">View</a>
    </div>
</div>



<script>

    function viewMaintenance () {
        let row = $('#dg_job_card_alert').datagrid('getSelected');
        viewJobCard(row);
    }

    $('#dg_job_card_alert').datagrid({
        url: '../includes/MaitenanceNotifications/get_job_card_notifications.php?get_jobs',
        width: 800,
        height: 400,
        pagination: true,
        fitColumns: true,
        singleSelect: true,
        toolbar: '#dg_maintenance_alert-tb',
        columns:[
            [
                {field:'id', title:'No.', width:25 ,rowspan:"2"},
                {field:'location', title:'Location', width:50, rowspan:"2"},
                {field:'created_by', title:'Created By', width:50, align:'left', rowspan:"2"},
                {field:'required_before', title:'Due Date', width:50, align:'center', rowspan:"2"},
                {field:'priority', title:'Priority', width:30, align:'center', rowspan:"2"},
                {field:'status', title:'Status', width:30, align:'center', rowspan:"2", 
                    formatter: (val) => {
                        if (val === '') {
                            return 'Pending';
                        }
                        val = +val;
                        if (val === 1) {
                            return 'Approved';
                        } else if (val === 0) {
                            return 'Denied';
                        } else {
                            return 'Pending';
                        }
                    }
                },
                {field:'work_progress', title:'Work Progress', width:30, align:'center', rowspan:"2", 
                    formatter: (val, row, index) => {
                        if (+row.seen === 1) {
                            return 'Seen';
                        } else if (+row.progress === 1) {
                            return 'In Progress';
                        } else if (+row.complete === 1) {
                            return 'Complete';
                        } else {
                            return 'Not Seen';
                        }
                    }
                },
            ]
        ]
    });

    $('#dg_maintenance_alert').datagrid({
        url: '../includes/MaitenanceNotifications/get_maintenace_notifications.php',
        width: 800,
        height: 400,
        pagination: true,
        fitColumns: true,
        singleSelect: true,
        columns:[
            [
                {field:'id', title:'No.', width:10, hidden:true },
                {field:'asset_code', title:'Code', width:10, align:'left'},
                {field:'asset_name', title:'Asset Name', width:50},
                {field:'location', title:'Location', width:50, align:'left'},
                {field:'next_schedule', title:'Next Schedule', width:50, align:'left'},
                {field:'status', title:'Status', width:50, align:'left'}
            ]
        ]
    });


    

    $(function(){
        readNotificationsMantenaceNotificationsAndJobCards ();
    });


    function readNotificationsMantenaceNotificationsAndJobCards ()
    {
        //get notifications form here
                getMNotification2(JSON.stringify([]));

                getJCNotification(JSON.stringify([]));
    }


    function openNotifications () {
        localStorage.removeItem('is_seen_maintenance');
        getMNotification2(JSON.stringify([]));
    }

    
    function getMNotification2(data) {
        data = JSON.parse(data);
        if(localStorage.getItem('is_seen_maintenance') != "true"){
            // $('.window-mask').css('opacity', '1');
            if(data.length > 0){//means there are urgent notifications. hence display: them
                $('#dlgmaintenace_alerts').dialog('open');
                $.messager.alert('Info', 'There are '+data.length+' Maintenance Notifications');
            }
            localStorage.setItem('is_seen_maintenance', "true");
        } 
    }

    //job card notifications
    function getJCNotification(data) {
        data = JSON.parse(data);
        if(localStorage.getItem('is_seen_jobcards') != "true"){
            // $('.window-mask').css('opacity', '0.8');
            if(data.length > 0){//means there are urgent notifications. hence display: them
                $('#dlgjob_card_alerts').dialog('open');
                $.messager.alert('Info', 'There are '+data.length+' Job cards that need to be worked on.' );
            }
            localStorage.setItem('is_seen_jobcards', "true");
        } 
    }

    function closeMNotification(){
        // $('.window-mask').css('opacity', '0.4');
        $('#dlgmaintenace_alerts').dialog('close');
    }


    function closeJCNotifications(){
        // $('.window-mask').css('opacity', '0.4');
        $('#dlgjob_card_alerts').dialog('close');
    }

</script>


<!-- <script type="text/javascript">
    $(function () {
        bkLib.onDomLoaded(function() {
            new nicEditor().panelInstance('description');
        });
    });
    </script> -->
<script>
    var can_cerate_memo = 'false';
    

    $(function () {
        $('#memo_department').combogrid({
            url: '../includes/get_modules.php',
            width: 150,
            editable: false,
            multiple: true,
            idField: 'id',
            height: 'auto',
            textField: 'module_name',
            multivalue: true,
            method: 'get',
            columns: [[
                    {field: 'select', title: 'Select', checkbox: true, width: 10},
                    {field: 'module_name', title: 'All', width: 90},
                ]],
            fitColumns: true
        });
        setInterval(() => {
            checkClientThreadIsRunning();
        }, 60000);
    });


    function openSuggesstions ()
    {
        function getCurrentPageDesctruct () {
            var page_like = window.location.href.split('?');
            page_like = page_like[0].split('/');
            var page_str_length = page_like.length;

            var last_part = page_like[page_str_length - 1];
            var second_last_part = page_like[page_str_length - 2];

            return  `${second_last_part}/${last_part}`;
        }
        opensuggestionResults(getCurrentPageDesctruct());
    }


    function checkClientThreadIsRunning () {
        $.ajax({
            url: '../includes/intiate-client-thread.php?auto_start_cron_job',
            success: function(data){
            },
            timeout: 2000 //in milliseconds
        });
    }



    $(function(){
        setTimeout(() => {
            postDailyHotelOperations();
        }, 20000);

        var can_cerate_memo = 'false';

        if(can_cerate_memo == 'false'){//edit_memo_btn
            $('#create_memo_btn').linkbutton({disabled: true});
            $('#delete_memo_btn').linkbutton({disabled: true});
            $('#edit_memo_btn').linkbutton({disabled: true});
        }else{
            
        }
        $('#memo-form').form({

        });

        $('#memo_create_date').datebox({
            width: 150,
            formatter: myformatterx,
            parser: myparserx,
            required: true,
            editable: false
        });

        $('#memo_expirely_date').datebox({
            width: 150,
            formatter: myformatterx,
            parser: myparserx,
            required: true,
            editable: false,
            onSelect: function(data){
                date_to = Date(data);
                var memo_create_date = $('#memo_create_date').datebox('getValue');
                var memo_expirely_date = $('#memo_expirely_date').datebox('getValue');
                if(!memo_create_date){
                    $.messager.show({
                        title: 'Info',
                        msg: 'Please select a start ddate first'
                    });
                    $('#memo_expirely_date').datebox('setValue', '');
                    return false;
                }

                memo_create_date = new Date(memo_create_date);
                memo_expirely_date = new Date(memo_expirely_date);

                if(memo_expirely_date < memo_create_date){
                    $.messager.show({
                        title: 'Info',
                        msg: 'End date can not be less than start date'
                    });
                    $('#memo_expirely_date').datebox('setValue', '');
                    return;

                }

            }
        });


        $('#memo_list').datagrid({
            height: 400,
            url:'../includes/get_memos.php?user_id=1&active_status=1',
            pagination: true,
            fitColumns: true,
            singleSelect: true,
            columns:[[
                {field:'id', title:'No.', width:50 },
                {field:'created_date', title:'Date Created', width:200},
                {field:'title', title:'Title', width:500, align:'left'},
                {field:'priority_name', title:'Priority', width:100, align:'left', formatter: p_formatter},
            ]],
            onSelect: function(index, data){
                
                if(data.can_edit == '1'){
                    $('#delete_memo_btn').linkbutton({disabled: false});
                    $('#edit_memo_btn').linkbutton({disabled: false});
                }else{
                    $('#delete_memo_btn').linkbutton({disabled: true});
                    $('#edit_memo_btn').linkbutton({disabled: true});
                }
            }
        });


        function p_formatter(value, row){
            if(value == 'Urgent'){
                return '<span style="color:red;">Urgent</span>';
            }else{
                return value;
            }
        }

        $('#memo_status').combobox({
            width: 150,
            panelHeight: 'auto',
            editable: false,
            valueField: 'status_id',
            textField: 'status_description',
            data: [
                {
                    status_id: 0,
                    status_description: 'All'
                },
                {
                    status_id: 1,
                    status_description: 'Active'
                },
                {
                    status_id: 2,
                    status_description: 'Expired'
                }
            ],
            onSelect: function(row){
                var url_memo = '../includes/get_memos.php?user_id=1';
                if(row.status_id == 0){

                }else{
                    url_memo = '../includes/get_memos.php?user_id=1&active_status='+row.status_id; 
                }

                $('#memo_list').datagrid({
                    url: url_memo
                });
            }
        });


        $('#memo_priority').combobox({
            width: 150,
            panelHeight: 'auto',
            editable: false,
            valueField: 'priority_id',
            textField: 'priority_description',
            data: [
                {
                    priority_id: 1,
                    priority_description: 'Normal'
                },
                {
                    priority_id: 2,
                    priority_description: 'Urgent'
                }
            ]
        });

        setTimeout(() => {
            autoOpenMemo2();
        }, 1000);

        // setTimeout(() => {
        //     getMemoAccess();
        // }, 2000);
        getMemoAccess();

    });

    function searchMemo (elem) {
        var search_key = $(elem).val();

        $('#memo_list').datagrid('load',{
            search_key: search_key
        });

        $(elem).focus();
    }


    function closeMemoDlg(){
        if(memo_holder_counter){
            $.messager.confirm('Confirm', 'Are you sure you want to close this memo?', function (r) {
                if(r){
                    memo_holder_counter = false;
                    setTimeout(function(){
                        $('#add_memo').dialog('close');
                        openMemoOneByOne();
                    }, 0);
                }else{
                    return;
                }
              });
        }else{
            $('#add_memo').dialog('close');
        }
        // $('.window-mask').css('opacity', '0.5');
    }

    function autoOpenMemo(){
        $.post('../includes/get_memos.php?user_id=1&active_status=1', {}, function (response){
            if(response.length > 0){
                openMyMemos(response);
            }else{
                
            }
        }, 'JSON');
    }

    function autoOpenMemo2(){
        // alert();
        //get memos from here
        
                var memos = [];
        if (!localStorage.no_of_memos){
            localStorage.setItem('no_of_memos', memos.length);
        }
        
        $('#memos-count').html(` (${localStorage.no_of_memos}) `);


        if(memos.length > 0){
            openMyMemos(memos);
        }else{
        }
    }

    var memo_access = '';
    function getMemoAccess(){
        $.post('../includes/memo_access.php?get_memo_access', {}, function (response){
            
            if(response.access != '1'){//edit_memo_btn
                $('#create_memo_btn').linkbutton({disabled: true});
                $('#delete_memo_btn').linkbutton({disabled: true});
                $('#edit_memo_btn').linkbutton({disabled: true});
            }else{
                $('#create_memo_btn').linkbutton({disabled: false});
                $('#delete_memo_btn').linkbutton({disabled: false});
                $('#edit_memo_btn').linkbutton({disabled: false});
            }

            if(response.settings != 1) {
                $('#btn-settings').remove();
            }

            if(response.store_requisition_approval == 1 || response.more_accounts == 1){
                // $('.direct_transfer_setup').show();
                sessionStorage.setItem('access_to_main_store', true);
            }else{
                sessionStorage.setItem('access_to_main_store', false);
            }

        }, 'JSON');
    }


    var memo_holder = [];
    var memo_holder_counter = false;
    var stack_counter = 0;
    function openMyMemos(my_memos){
        memo_holder = my_memos;
        memo_holder_counter = memo_holder.length + 1;

        if(localStorage.getItem('is_seen_memo') != "true"){
            openMemoOneByOne();
            stack_counter = (memo_holder.length + 1 );
            $.messager.alert('Info', 'You Have (' + stack_counter + ') Active memos' );
            localStorage.setItem('is_seen_memo', "true");
        }  
    }

    function openMemoOneByOne(){
        var top_memo = memo_holder.pop();
        if(top_memo){
            
            // $('.window-mask').css('opacity', '1');
            memo_holder_counter = true;
            var my_val = (stack_counter - memo_holder.length) < 0 ? -1 * (stack_counter - memo_holder.length) : (stack_counter - memo_holder.length) ;
            my_val = my_val == 0 ? 1 : my_val;
            $('#memo_header').html('Memo ' + my_val);
            openViewMemo(top_memo);
            $.messager.alert('Info', 'Memo ' + my_val );
        }else{
            
        }
    }


    function toggleMore (id = 1) {
        $('.more-' + id).toggle('slow');
    }

    // function closeSugestionResult () {
    //     console.log('left');
    // }

    // $(function () {
    //     $('#search-sugesstion-guide').addEventListener("search", function(event) {
    //         // $(".resultingarticles").empty();  
    //         console.log('cleared search');
    //     });
    // });

    function opensuggestionResults (search = '') {
        let search_data = $('#search-sugesstion-guide').val().trim();
        let search_in_page = search_data ? 0: 1;
        search = search_data ? search_data : search;

        $('#sugesstion-results-section').show();
        if (!search) {
            $('#sugesstion-results-section').hide();
            return false;
        } else {
            $('#sugesstion-results-section').show();
        }

        $.get('../includes/user_guide.php?get_all_chapters_search', {  search: search, search_in_page: search_in_page  }, function (repsonse) {
            try {
                repsonse = JSON.parse(repsonse);
                let html_str = ``;
                repsonse.forEach(item => {
                    // format search
                    item.question_name = item.question_name.replace(search, `<span style="background-color:yellow">${search}</span>`)

                    html_str += `
                        <li class="search-results-item" onClick="loadTooltipOnUserSearchResults(${item.chapter_id}, ${item.question_id}, ${item.category_id})">
                            ${item.question_name}
                            <br>
                            <br>
                        </li>
                        
                    `;
                })
                $('#suggestion-results').html(`<ul style="list-style: none;">${html_str}</ul>`);
            } catch (e) {

            }
        }) 

    }


    function openUserGuideSearch (search = '') {

        if (!search) {
            $('#search-results-section').hide();
            return false;
        } else {
            $('#search-results-section').show();
        }

        $.get('../includes/user_guide.php?get_all_chapters_search', {  search: search }, function (repsonse) {
            try {
                repsonse = JSON.parse(repsonse);
                console.log(repsonse);
                let html_str = ``;
                repsonse.forEach(item => {

                    // format search
                    item.question_name = item.question_name.replace(search, `<span style="background-color:yellow">${search}</span>`)

                    html_str += `
                        <li class="search-results-item" onClick="loadTooltipOnUserSearchResults(${item.chapter_id}, ${item.question_id}, ${item.category_id})">
                            ${item.question_name}
                            <br>
                            <br>
                        </li>
                        
                    `;
                })
                $('#search-results').html(`<ul style="list-style: none;">${html_str}</ul>`);
            } catch (e) {

            }
        }) 

    }

    function loadTooltipOnUserSearchResults (chapter_id, question_id, category_id) {
        $.get('../includes/user_guide.php?load_next_tool_tip_steps', {from_search_results: '', question_id: +question_id, 
            chapter_id: +chapter_id, category_id: +category_id}, function (response) {
                $('#dlg-loading-tooltips').dialog('close');
                $('#search-results-section, #sugesstion-results-section').hide();
            try {
                response = JSON.parse(response);
                if (!response) {
                    $.messager.alert('Congratulations', 'You have reached the end of the chaptper questions');
                } else {
                    $('#search-results-section, #sugesstion-results-section').hide();
                    goToContent (0, response);
                }
            } catch (e) {
                $.messager.alert('Warning', 'Error Loading Next Question');
            }

        });
    }

    delete sessionStorage.hasOpenedUserGuide;
    function openUserGuide (search = '') {

        $('#search-results-section').hide();
        $('#dlg-user-guide').dialog('open');

        if (sessionStorage.hasOpenedUserGuide) {
            // return false;
        } else {
            sessionStorage.hasOpenedUserGuide = true;
        }



        //dg-user-guide
        $('#dg-user-guide').datagrid({
            view: detailview,
            url: '../includes/user_guide.php?get_all_chapters',
            height: 520,
            pagination: false,
            fitColumns: true,
            singleSelect: true,
            columns:[[
                {field:'chapter', title:'Chapter', width:200 }
            ]],
            detailFormatter: function (index, rowData) {
                return `<div style="padding:2px">
                            <table id="dg-chapter2-${index}"></table>
                        </div>`;
            },
            onSelect: function (index, row) {
                $(this).datagrid('expandRow', index);
            },
            onExpandRow: function (index, rowData) {
                var ddv = $('#dg-chapter2-' + index);
                ddv.datagrid({
                    url: '../includes/user_guide.php?get_all_chapter_tooltips=' + rowData.id,
                    height: 'auto',
                    pagination: false,
                    fitColumns: true,
                    singleSelect: true,
                    columns:[[
                        {field:'name', title: rowData.chapter,  width:200 }
                    ]],
                    onSelect: function (index, row) {
                        
                        if (row.steps) {
                            goToContent (index, row);
                        } else {
                            $.messager.alert('Warning', 'Please select a question')
                        }
  
                    },
                    rowStyler: function (index, row) {
                        if (row.type == 'category') {
                            // return `font-weight: bold;`;
                        } else if (row.type == 'question') {
                            // return `color: blue; padding-left:20px;`;
                        }
                    },
                    onResize: function () {
                        $('#dg-user-guide').datagrid('fixDetailRowHeight', index);
                    },
                    onLoadSuccess: function () {
                        setTimeout(function () {
                            $('#dg-user-guide').datagrid('fixDetailRowHeight', index);
                        }, 0);
                    },
                });
                
            },
            rowStyler: function (index, row) {
                return `font-weight: bold;`;
            }
        });

        return false;



        

        var conf = {
            options:{
                fitColumns:true,
                columns:[[
                    {field:'id',title:'ID',width:200, hidden: true},
                    {field:'chapter',title:'',width:200}
                ]],
                url: '../includes/user_guide.php?get_all_chapters',
                onSelect: function (index, row) {
                    $(this).datagrid('expandRow', index);
                    // $('.datagrid-header').hide();
                }
            },
            subgrid:{
                options:{
                    fitColumns:true,
                    foreignField:'id',
                    columns:[[
                        {field:'id',title:'ID',width:200, hidden: true},
                        {field:'category',title:'',width:200}
                    ]],
                    url: '../includes/user_guide.php?get_user_guide_chapter_items',
                    onSelect: function (index, row) {
                        $(this).datagrid('expandRow', index);
                    }
                },
                subgrid:{
                    options:{
                        fitColumns:true,
                        foreignField:'id',
                        columns:[[
                            {field:'id',title:'ID',width:200, hidden: true},
                            {field:'question',title:'',width:200}
                        ]],
                        url: '../includes/user_guide.php?get_all_chapter_tooltips',
                        onSelect: function (index, row) {
                            // $('.datagrid-header').hide();
                            if (row.steps) {
                                goToContent (index, row);
                            } else {
                                $.messager.alert('Warning', 'Please select a question')
                            }
                        },
                    }
                }
            }
        };
 
        $(function(){
            $('#dg-user-guide').datagrid({
                title:'',
                height: 520,
                pagination: false,
                fitColumns: true,
                singleSelect: true,
            }).datagrid('subgrid', conf);
        });
        

    }



    function toggleChapterContent (chapterIndex) {
        $('.chapter-category-question-' + chapterIndex).hide('slow');
        $('.chapter-category-' + chapterIndex).toggle('slow');
    }

    function toggleCategoryContent (chapter_index, categoryIndex) {
        $(`.category-${chapter_index}-${categoryIndex}`).toggle('slow');
    }


    function checkForTooltipPrerequisites (error_messages) {
        
        let found_errors = false;
        error_messages.forEach (item => {
            found_errors = true;
            $.messager.alert('Warning', item);
            return false;
        });

        return found_errors;
    }

    function goToContent (index, row) {
        // console.log(row);
        sessionStorage.setItem('currenct_story_line_question_details', JSON.stringify(row));
        sessionStorage.setItem('question_name', row.question ? row.question: row.name);

        steps = row.steps;
        steps.forEach (item => {
            if (item.trigger_action == "answer_click") {
                $('#dlg-user-guide').dialog('close');
                try {
                    if (+item.is_last_step) {
                        sessionStorage.isLastStep = true;
                    } else {
                        delete sessionStorage.isLastStep;
                    }
                    setupModuleTooltip(item.tooltip, item.tooltip_answer, item.position, '', item.image_styles);
                } catch (e) {
                    
                }
                return false;
            }
        });
 

        sessionStorage.setItem('steps', JSON.stringify(steps));
        

        // Check If Tooltips are set
        if (sessionStorage.tooltip_mode) {

        } else {
            $.getJSON('../includes/user_guide.php?turn_on_tooltips', {}, function (response) {
                if (response.reload) {
                    $('#dlg-loading-tooltips').dialog('open');
                    sessionStorage.tooltip_mode = true;
                    window.location.reload();
                    sessionStorage.setOnHardReloadTooltips = true;
                } else {
                    sessionStorage.tooltip_mode = true;
                }
            });
        }


        try {
            hardLoadTooltips();
        } catch (e) {

        }

        
    }






    function saveMemo(){

        $('#memo-form').form('submit', {
            url: '../includes/save_memo.php',
            onSubmit: function(param){
                var title = $('#memo_title').val().trim();
                var create_date = $('#memo_create_date').datebox('getValue');
                var expirely_date = $('#memo_expirely_date').datebox('getValue');
                var priorities = $('#memo_priority').combobox('getValues');
                var departments = $('#memo_department').combobox('getValues');
                var creator = $('#memo_creator').val();

                param.notice_memo = nicEditors.findEditor('notice_memo').getContent();

                param.creator = creator;

                param.departments = departments;

                var message = '';
                var is_empty = false
                if(!title){
                    message = 'Enter valid memo title';
                    is_empty = true;
                }
                if(!create_date){
                    message = 'Enter valid memo create date';
                    is_empty = true;
                }
                if(!expirely_date){
                    message = 'Enter valid memo expirely date';
                    is_empty = true;
                }
                if(!priorities){
                    message = 'Enter valid memo priority';
                    is_empty = true;
                }
                if(!departments){
                    message = 'Select atleast on department';
                    is_empty = true;
                }
                if(!creator){
                    message = 'Enter Valid memo creator';
                    is_empty = true;
                }

                if(is_empty){
                    $.messager.show({
                        title: 'Warning',
                        msg: message
                    });
                    is_empty = true;
                }

                var validate = $(this).form('validate');

                if(!validate){
                    $.messager.show({
                        title: 'Warning',
                        msg: "Something's not right"
                    });
                }

                return validate;

            },
            success: function(response){
                response = JSON.parse(response);

                if(response.success){
                    $('#add_memo').dialog('close');
                    $('#memo_list').datagrid('reload');
                }
            }
        });
    }

    function openMemoDlg() {
        $('#dgmemo').dialog('open');
        clearMyForm();
        var create_date = '2020-05-01';
        $('#memo_create_date').html(create_date);
        $('#memo_status').combobox('setValue', '1');
    }

    function deleteMemo(){
        $.messager.confirm('Confirm', 'Are you sure you want to delete this memo?', function(r){
            if(r){
                var row = $('#memo_list').datagrid('getSelected');

                if(!row){
                    $.messager.show({
                        title: 'Warning',
                        msg: 'Please select a memo'
                    });
                    return;
                }

                var id = row.id;

                $.post('../includes/delete_memo.php', {id: id}, function(response){
                    if(response.success){
                        $('#memo_list').datagrid('reload');
                    }
                }, 'JSON');
            }
        });
        
    }

    function openEditMemo(row){

        var row = row ? row : $('#memo_list').datagrid('getSelected');

        if(!row){
            $.messager.show({
                title: 'Warning',
                msg: 'Please select a memo'
            });
            return;
        }
        row.memo_title = row.title;
        row.notice_memo = row.note;
        row.memo_expirely_date = row.expirely_date;
        row.memo_priority = row.priority;
        row.memo_create_date = row.created_date;//start_date

        

        clearMyForm();

        nicEditors.findEditor('notice_memo').setContent(row.note);
        $('#memo_create_date_view').html(row.start_date);
        $('#memo-creator').html(row.creator_name);
        $('#memo_department').combogrid('setValues', '');
        $('#memo_department').combogrid('setValues', row.departments.split(','));

        $('#edit_no').val(row.id);

        $('#memo-form').form('load', row);

        $('#add_memo').dialog('open').dialog('setTitle', 'Memo');
        $('#save_memo').linkbutton({disabled: false});
        $('#save_memo').show();
    }

    function openViewMemo(row){
        openEditMemo(row);
        $('#save_memo').linkbutton({disabled: true});
        $('#save_memo').hide();
    }


    function clearMyForm(){
        var user_id = '1';
        $('#memo-form').form('clear');
        $('#memo_creator').val(user_id);
        $('#edit_no').val('0');
        nicEditors.findEditor('notice_memo').setContent('');
    }

    function openCreateMemo(){
        var creator = 'admin';
        $('#add_memo').dialog('open').dialog('setTitle', 'Create Memo');
        clearMyForm();
        $('#save_memo').linkbutton({disabled: false});
        $('#save_memo').show();
        $('#memo-creator').html(creator);
    }

    function closeCreateMemo(){
        $('#dgmemo').dialog('close');
    }

     /* These two functions are used to format the data to YYYY-MM-DD
            * ***************************************************************/
    function myformatterx(date) {
        var y = date.getFullYear();
        var m = date.getMonth() + 1;
        var d = date.getDate();
        return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
    }

    function myparserx(s) {
        if (!s)
            return new Date();
        var ss = (s.split('-'));
        var y = parseInt(ss[0], 10);
        var m = parseInt(ss[1], 10);
        var d = parseInt(ss[2], 10);
        if (!isNaN(y) && !isNaN(m) && !isNaN(d)) {
            return new Date(y, m - 1, d);
        } else {
            return new Date();
        }
    }


    let postDailyHotelOperations = function () {
        $.get('../emailing/accounts_daily_posting.php');
    }


    

</script>


<script src="../texteditor/nicEdit-latest.js" type="text/javascript"></script>
<script type="text/javascript">
    bkLib.onDomLoaded(function() {
        new nicEditor().panelInstance('notice_memo');
        // new nicEditor().panelInstance('description');
    });
</script>
<script type="text/javascript">
  try {
    bkLib.onDomLoaded(function() {
      new nicEditor().panelInstance('description');
    });
  } catch (e)  {

  }
  
</script>

<script>
  



var OPEN_MESSAGER = {};

var back_slash_counts = window.location.href.split('/').length - 5;
var relative_directory_path = '../'.repeat(back_slash_counts);

function cloud_messager_on_load(title, message) {
    var display_next = 'display:none;'; 
    
    OPEN_MESSAGER = $.messager.show({ 
        title: title,
        msg: `<div class="content-wrapper-for-messager" style="height:'auto'">${message}</div>
            <!--<img src="${relative_directory_path}includes/tutorials/images/teacher.jpg" style="height: 100px;
                float: right;"> -->
            <div style="clear:both;" >
                <div  style="cursor: pointer; ${display_next}" >
                    <b> Goto Next Lesson</b>
                    <span class="next-lesson_name"></span>
                    <br>
                </div>
            </div>
            
            `,
        showType: 'show',
        timeout:0,
        style: {
            left: '',
            right: 0,
            bottom: '',
            top: 150,
            height: 'auto'
        }
    });

    setTimeout(() => {

        function makeDraggable (overallSelector) {
            dragElement(overallSelector);
        }

        
        function dragElement(elmnt) {
            var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
            if ( false && document.getElementById(elmnt.id + "header")) {
            // if present, the header is where you move the DIV from:
            document.getElementById(elmnt.id + "header").onmousedown = dragMouseDown;
            } else {
            // otherwise, move the DIV from anywhere inside the DIV:
            elmnt.onmousedown = dragMouseDown;
            }
        
            function dragMouseDown(e) {
            e = e || window.event;
            e.preventDefault();
            // get the mouse cursor position at startup:
            pos3 = e.clientX;
            pos4 = e.clientY;
            document.onmouseup = closeDragElement;
            // call a function whenever the cursor moves:
            document.onmousemove = elementDrag;
            }
        
            function elementDrag(e) {
            e = e || window.event;
            e.preventDefault();
            // calculate the new cursor position:
            pos1 = pos3 - e.clientX;
            pos2 = pos4 - e.clientY;
            pos3 = e.clientX;
            pos4 = e.clientY;
            // set the element's new position:
            elmnt.style.top = (elmnt.offsetTop - pos2) + "px";
            elmnt.style.left = (elmnt.offsetLeft - pos1) + "px";
            }
        
            function closeDragElement() {
            // stop moving when mouse button is released:
            document.onmouseup = null;
            document.onmousemove = null;
            }
        }


        $($('.content-wrapper-for-messager').parent()).css({height: 'auto', 'background-color': '#feeebd'});
        $($('.teacher-header')).parent().css({height: 'auto', 'color': 'white', 'border-color': 'white'});
        $($($('.content-wrapper-for-messager').parent())).parent()
            .css({'background': 'linear-gradient(to bottom,#a69e8d 0,#817865 20%)', position: 'absolute'});
        makeDraggable($($($('.content-wrapper-for-messager').parent())).parent().get(0));
        setTimeout(() => {
            makeDraggable($($($('.content-wrapper-for-messager').parent())).parent().get(0));
            $($($('.content-wrapper-for-messager').parent())).parent().find('.panel-tool-close').hide();
        }, 1000);
    }, 0);

}


$(function () {

    if (!localStorage.first_page_landing) {
        setToolTipHelp();
        localStorage.first_page_landing = true;
    }
    // delete localStorage.first_page_landing;
 
});

function openNextAction (val = 0) {
    OPEN_MESSAGER.dialog('close');
    try {
        $(`#tooltip-userguide`).tooltip('destroy');
        $('#tooltip-userguide').tooltip('hide');
        $('#tooltip-userguide').remove();
    } catch (e) {

    }
    try {
        $(`#tooltip-help`).tooltip('destroy');
        $('#tooltip-help').tooltip('hide');
        $('#tooltip-help').remove();

    } catch (e) {

    }
    let msg = `
        Type here and search for any help and the system will guide you
        <br>
        <br>
        <button onClick="openNextAction(1)">Ok</button>
        `;
    if (val) {
        return;
    } else;
    setToolTipHelp ( msg, 'tooltip-help');
}


function setToolTipHelp (msg = '', pointer = '') {
    let position = 'bottom';
    let target_class = pointer ? pointer : 'tooltip-userguide';
    let image_styles  =  pointer ? '' : 'position: absolute; left: 69px;';
    let title = msg ? msg : `For help and the user guide, click the help button above.
        <br>
        <br>
        <button onClick="openNextAction(0)">Ok</button>
    `;

    cloud_messager_on_load('Info', title);

    if (position == 'top') {
        title = `<img style="height:90px; margin-bottom: -10px; ${image_styles}" src="${relative_directory_path}includes/tutorials/images/arrow-bottom.png">`;
    } else if (position == 'right') {
        title = `<img style="height:45px; margin-left: -40px; ${image_styles}" src="${relative_directory_path}includes/tutorials/images/arrow-left.png">`;
    } else if (position == 'left') {
        title = `<img style="height:45px; margin-right: -40px; ${image_styles}" src="${relative_directory_path}includes/tutorials/images/arrow-right.png">`;
    } else {
        title = `<img style="height:90px; margin-top: -10px; ${image_styles}" src="${relative_directory_path}includes/tutorials/images/arrow-top.png">`;
    }


    let tooltip = '<a id="'+target_class+'" href="javascript:void(0)"></a>';
    $('#' + target_class).remove();
    $('.' + target_class).wrap('<div style="display: inline-block;">');
    $('.' + target_class).after(tooltip);

    $('#'+target_class).tooltip({
        position: position,
        onShow: function(){
            $('#'+target_class).tooltip('tip').css({
                backgroundColor: '#fffccc',
                borderColor: '#cf9f46',
                color: '#000',
                padding: 8,
                trackMouse: true,
                background: 'rgba(0,0,0,0)',
                border:'none'
            });
        }
    });

    $('#'+target_class+'').tooltip({
        content: title
    });
    $('#'+target_class+'').tooltip('show');
    
    


    $('.tooltip-content').css({
        fontSize: '14px',
        maxWidth: '200px',
        // textAlign: 'justify'
    });


    $('.tooltip-content-text').css({
        fontSize: '14px',
        maxWidth: '200px',
        // textAlign: 'justify'
    });


    $('.tooltip-arrow-outer').hide()
    

}  $(function () {
    $('#printMaintainance').hide();
  });
</script>


</body>
</html>
