<script>
   

$(document).ready(function() {
    var UserID = '<?php echo $adminID; ?>';
    var InstitutionID = '<?php echo $GroupOfSchoolID; ?>';

    $.ajax({
        type: "POST",
        url: "../../controller/scripts/admin/pros-loadmenulock.php",
        data: {
            UserID: UserID,
            InstitutionID: InstitutionID
        },
        cache: false,
        success: function(result) {
            if (result == 'notfound') {
                $(".prosgerallismenu-disable").addClass("pros-disabled-menu");
            } else {
                var menuData = JSON.parse(result);

                for (var mainMenuId in menuData) {
                    if (menuData.hasOwnProperty(mainMenuId)) {
                        var allSubmenusEmpty = true;

                        for (var i = 0; i < menuData[mainMenuId].length; i++) {
                            var submenuStatus = menuData[mainMenuId][i].pros_menuper_status;

                            if (submenuStatus.length > 0) {
                                // At least one submenu has a non-empty pros_menuper_status array
                                allSubmenusEmpty = false;
                                break;
                            }
                        }

                        if (allSubmenusEmpty) {
                            // Do something when all submenus have empty pros_menuper_status array
                            $(".prosdisabledlist" + mainMenuId).addClass("pros-disabled-menu");
                            $(".pros-removemenuall-expos" + mainMenuId).fadeIn("");
                        } else {
                            // Do something else if needed
                            $(".prosdisabledlist" + mainMenuId).removeClass("pros-disabled-menu");
                            $(".pros-removemenuall-expos" + mainMenuId).fadeOut("");
                        }
                    }
                }
            }
        }
    });
});




    //   $('body').on('click','.pros-generalmenubtnclick', function(){

        //     var MenuID = $(this).data('id');
          

        //   localStorage.getItem("abba-stored-institution-id");

    //   });
   

</script>