<!doctype html>
<?php 

use Jackiedo\DotenvEditor\Facades\DotenvEditor;
$editor = DotenvEditor::load(storage_path('app/settings.env'));

$notifications = \DB::table('notifications')->where('notifiable_id', \Auth::user()->getKey())->get();
$invoices = \Runtime::make('hwplus_invoices')->where('descriptor', '!=', 'Dauerauftrag')->whereNull('printed')->whereNull('mailed')->count();

$dunnings = \App\Models\PHPXPress\HwplusInvoices::with('_meta._doctype')
    ->whereNull('date_adjusted')
    ->whereNull('date_paid')
    ->whereNotNull('mailed')
    ->orWhereNotNull('printed')
    ->whereNotNull('invoice_number')
    ->whereHas('_meta._doctype', function($query) {
        $query->whereIn('identifier', ['invoice', 'standing_order','reverse_invoice', 'adjusted_invoice']);
    })->get();


?>
<html lang="en" class="h-100">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title>Startseite - {{$editor->getKey('APP_TITLE')['value']}}</title>
    <link rel="icon" type="image/vnd.microsoft.icon" href="/images/bürozeit.ico">

    <!-- JQuery -->
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
    
    <!-- Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@7.4.47/css/materialdesignicons.min.css">
    
    <!--Bootstrap Dialogs -->
    <link rel="stylesheet" href="{{url('/css/bootstrap/bootstrap.dialogs.css')}}">
    <script src="{{url('/js/bootstrap.dialogs.js')}}"></script>
    
    <!-- Bootstrap Table -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-table@1.21.1/dist/bootstrap-table.min.css">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap-table@1.21.1/dist/bootstrap-table.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap-table@1.21.1/dist/extensions/cookie/bootstrap-table-cookie.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap-table@1.21.1/dist/locale/bootstrap-table-de-DE.js"></script>

    
    <!-- Editable -->
    <script src="{{url('/js/bootstrap.editable.js')}}"></script>
   
   <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" rel="stylesheet">


    <!-- HWPLUS -->
    <link rel="stylesheet" href="{{url('css/hwplus.css')}}">
    <script src="{{url('js/hwplus.js?1')}}"></script>

  </head>

  <script>


  </script>

  <style>

        :root {
            --sidebar-width: 180px;
            --sidebar-width-collapsed: 70px;
            --rose: #D3819A;
            --skyblue: #ACB2B8;
        }

        body {
            overflow-x: hidden;
        }

        .sidebar {
            width: var(--sidebar-width);
            height: 100vh;
            transition: all 0.3s ease;
            overflow-y: scroll;

        }

        .sidebar.collapsed {
            width: var(--sidebar-width-collapsed);
            overflow-y:auto;
        }

        .sidebar-link {
            color: #a0a3bd;
            transition: all 0.2s ease;
            border-radius: 8px 0px 0px 8px;
            margin: 4px 16px;
            white-space: nowrap;
            overflow: hidden;
            padding:7px;
        }

        .sidebar-link:hover {
            color: #ffffff;
            background: rgba(255, 255, 255, 0.1);
            transform: translateX(5px);

        }

        .sidebar-link.active {
            color: #ffffff;
            background: rgba(255, 255, 255, 0.1);
            margin-left:50px;
        }

        .sidebar_button_toggle {

            display:none;

        }

        .logo-text {
            background: linear-gradient(45deg, #6b8cff, #8b9fff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            transition: opacity 0.3s ease;
        }

        .notification-badge {
            background: #ff6b6b;
            padding: 2px 6px;
            border-radius: 6px;
            font-size: 0.7rem;
        }

        .profile-section {
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }

        .main-content {
            margin-left: var(--sidebar-width);
            background: transparent;
            min-height: 100vh;
            transition: all 0.3s ease;
            width:100%;
        }

        .collapsed~.main-content {
            margin-left: var(--sidebar-width-collapsed);
        }

        .toggle-btn {
            position: absolute;
            left: 0px;
            top: 0px;
            __color:var(--white);
            __background: var(--white);
            __border-radius: 50%;
            width: 30px;
            height: 30px;
            border: none;
            __box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
            z-index: 100;
            cursor: pointer;
            font-size:20px;
            __transition: transform 0.3s ease;
        }

        .collapsed .toggle-btn {
            transform: rotate(180deg);
            display:none;
        }

        .collapsed .hide-on-collapse {
            opacity: 0;
            visibility: hidden;
        }

        .collapsed .logo-text {
            opacity: 0;
        }

        .collapsed .profile-info {
            opacity: 0;
            display:none;
        }

        .collapsed .sidebar-link {
            width:40px;
        }

        .collapsed .sidebar-link.active {
            width:30px;
            margin-left:auto;
        }1

        .collapsed .profile-section {
            display:none;
        }

        .collapsed .home-button {
            display:
        }

        .collapsed .sidebar_button_toggle {

            display:inline;
            __font-size:x-large;
            __border:1px solid white;
            __border-right:none;

        }

        .profile-info {
            transition: opacity 0.2s ease;
        }

        iframe {

            width:100%;
            height:100%;
            border:none;
            display:none;

        }

        #frame_busy {
            width:100%;
            height:100%;
        }

  </style>
  
  <script>

    function logout() {
    
        let postData = {
            _token:'{{csrf_token()}}',
            _method: 'POST',
            data: {}
        }
                           
        $.post("logout", postData)
                
            .done(function(data) { 
            
                window.location="{{url('login')}}";
            
            })
                
            .fail(function(xhr, status, error) {
            
                alertException(xhr);
            
            
            })
    
    }


    function load_frame(doctype, url, force = null) {

        let frame = "";

        switch(doctype) {

            case "settings":
            case "home":
            case "tracking":
            case "search":
            case "dunning":
            case "calendar":
            case "lot":
                frame = "#frame_main";
                break;
            case "material":
                frame = "#frame_material_master";
                break;
            case "standing_orders":
                frame = "#frame_main";
                break;
            case "clients":
                frame = "#frame_clients";
                break;
            case "invoices":
                frame ="#frame_invoices";
                break;
            case "open_tickets":
                frame = "#frame_open_tickets";
                break;
            case "closed_tickets":
                frame ="#frame_closed_tickets";
                break;
            case "offers":
                frame = "#frame_offers";
                break;
        }

        $('.sidebar-link').removeClass('active');
        $('.sidebar_button_' + doctype).addClass('active');

        if(!frame || !(frame = $(frame)));
        else if(force) {
            $('#frame_busy').show();
            $('iframe').hide();
            frame.on("load", function() {  frame.off(); $('#frame_busy').hide(); frame.show(); }).attr('src', url);
        }
        else if(frame.is(":visible")) {
            frame.on('load', function() { frame.off(); $('#frame_busy').hide(); frame.show(); }).attr('src', frame.attr('src'));
        }
        else if(!frame.attr('src')) {
            $('#frame_busy').show();
            $('iframe').hide();
            frame.on('load', function() { frame.off(); $('#frame_busy').hide(); frame.show(); }).attr('src', url);
        } else {
            $('iframe').hide();
            frame.show();
        }
    }

    function toggleSidebar() {
        const sidebar = document.querySelector('.sidebar');
        sidebar.classList.toggle('collapsed');
    }
    
    function create_new_ticket() {
    
        
            dialog = BootstrapDialog.show({
                message: $('<div></div>').load('89b3986fdff3cfda9add109aaf6455410375f499/b00957668764b5f7b0ed77f1de905d2a1ef066ad'),
                title:'Neues Dokument erstellen',
                type:BootstrapDialog.TYPE_LIGHT,
                buttons: [{
                    label: 'Weiter',
                    cssClass:'btn-success',
                    action: function(dialogItself) {

                        $('#spinner').removeClass('d-none');
                        
                        let type = $('#createTicket select[name="data[_type]"]').val();
                        let client = $('#createTicket input[name="data[_client]"]').val();
                        let customer_id = $('#createTicket input[name="data[customer_id]"]').val();
                        //let date = $('#createTicket input[name="data[date]"]').val();
                        let postData = $('#createTicket').serialize();
                        
                        if(!client) {
                            BootstrapDialog.alert({title:'Hinweis', message: 'Bitte wählen Sie einen Kunden aus', type:BootstrapDialog.TYPE_DANGER});
                        }
                        
                        $.post("createTicket", postData)                
                        
                            .done(function(data) {
                                                  
                                dialogItself.getModalBody().html(data);

                                 $('#spinner').hide();
                                
                                switch(type) {
                                
                                    case "RG":
                                    
                                    dialog.getModalHeader().find('.bootstrap-dialog-title').html('Neue Rechnung - Rechnungsadresse auswählen');
                                    dialog.getModalFooter().find('.btn-success').off('click').on('click', function() { 
                                
                                        var option = $('#new_invoice [name="recipient"]:checked').val();
                        
                                        switch(option) {
                                        
                                            case "new": 
                                                
                                                dialogItself.close();
                                                
                                                dialog = BootstrapDialog.show({
                                                    message: $('<div></div>').load('bee81541cb1e85aa6f48a7ec8f590b5e2a4b0c28/86343e16c8551a46bdd6560814444580b3833a53/' + client),
                                                    title:'Neue Rechnung - Rechnungsadresse erfassen',
                                                    type:BootstrapDialog.TYPE_LIGHT,
                                                    buttons: [{
                                                        label: 'Speichern',
                                                        cssClass:'btn-success',
                                                        action: function(dialogItself) {
                                                        
                                                            $('#spinner').removeClass('d-none');
                                                        
                                                            let postData = $('#new_recipient').serialize();
                                                                postData._token = '{{csrf_token()}}';
                                                            
                                                            $.post("/api/hwplus/86343e16c8551a46bdd6560814444580b3833a53/bee81541cb1e85aa6f48a7ec8f590b5e2a4b0c28", postData)
                                        
                                                                .done(function(data) { 

                                                                    postData  += "&data%5Bdescriptor%5D=Rechnung";
                                                                    postData  += "&data%5Bcustomer_id%5D=" + data[0].customer_id;
                                                                    //postData  += "&data%5Bdate%5D=" + encodeURIComponent(date);
                                                                    postData += "&data%5Bclient%5D=" + encodeURIComponent(data[0].descriptor);
                                                                    postData += "&data%5B_client%5D=" + encodeURIComponent(data[0].ID);
                                                                    
                                                                    $.post("/api/hwplus/27b96af59ee924f9ec98cf9c44b54e06219636c1/5dfe19c87715ed4ca89abb9f4eb4da4dc060c8bd", postData)
                        
                                                                        .done(function(data) { 
                                                                            $('#spinner').addClass('d-none');

                                                                            load_frame(
                                                                                'invoices',
                                                                                "2fc25ddce687403194c3995a6f3bcdcebb62968d/27b96af59ee924f9ec98cf9c44b54e06219636c1/" + data[0].ID,
                                                                                true
                                                                            );

                                                                            dialog.close();
                                                                        })
                                                                        
                                                                        .fail(function(xhr){
                                                                        
                                                                            alertException(xhr);
                                                                        
                                                                        });
                                                                    
                                                                })
                                                                
                                                                .fail(function(xhr, status, error) {
                                                                
                                                                    $('#spinner').addClass('d-none');
                                                                    
                                                                    if(422 == xhr.status) {
                                
                                                                        $('#new_recipient').find('.is-invalid').removeClass('is-invalid');
                                                                        $.each(xhr.responseJSON, function(index, item) {
                                                                            let array = index.split('.');
                                                                            $('#new_recipient').find('[name="data['+array[1]+']"]').addClass('is-invalid'); 
                                                                        });
                                                                    
                                                                        alertValidationError();
                                                                            
                                                                        }
                                                        
                                                                    else alertException(xhr);
                                                                
                                                                });
                                                        }
                                                    }]
                                                });
                                            
                                            
                                                break;
                                                
                                                
                                            case "": alert('Fehler! Keine Auswahl getroffen'); 
                                                break;
                                                
                                                
                                                
                                            default:
                                            $.get("/api/hwplus/86343e16c8551a46bdd6560814444580b3833a53/" + option)
                                            
                                                .done(function(data) {
                                                               
                                                    let cdata = {};
                                                        cdata.data = {};
                                                    $.each(data, function(index, value) { cdata["data"][index] = value; })
                                                    

                                                    postData = $.param(cdata);
                                                    postData  += "&data%5Bdescriptor%5D=Rechnung";
                                                    postData  += "&data%5Bcustomer_id%5D=" + data.customer_id;
                                                    //postData  += "&data%5Bdate%5D=" + encodeURIComponent(date);
                                                    postData += "&data%5Bclient%5D=" + encodeURIComponent(data.descriptor);
                                                    postData += "&data%5B_client%5D=" + encodeURIComponent(data.ID);

                                                    $.post("/api/hwplus/27b96af59ee924f9ec98cf9c44b54e06219636c1/5dfe19c87715ed4ca89abb9f4eb4da4dc060c8bd", postData)

                                                        .done(function(data) { 

                                                            load_frame(
                                                                'invoices',
                                                                "2fc25ddce687403194c3995a6f3bcdcebb62968d/27b96af59ee924f9ec98cf9c44b54e06219636c1/" + data[0].ID,
                                                                true
                                                            );

                                                            $('#spinner').addClass('d-none');
                                                            dialog.close();
                                                        })
                                                
                                                    .fail(function(xhr) {
                                                    
                                                        alertException(xhr);
                                                
                                                });
                                                
                                                })
                                                .fail(function(xhr) {
                                                    $('#spinner').addClass('d-none');
                                                    alertException(xhr);
                                                
                                                });

                                                

                                                break;
                                        
                                        }   
                                
                                    });
                                    break;
                                    case "LS":
                                    
                                        dialog.getModalHeader().find('.bootstrap-dialog-title').html('Neuer Lieferschein');
                                        dialog.getModalFooter().find('.btn-success').html('Speichern').off('click').on('click', function() {
                                        
                                        let postData = $('#new_shipping_order').serialize();
                        
                                            postData._token = '{{csrf_token()}}';
                                            
                                            
                                            
                                            $.post("/api/hwplus/afe4f16263308b092d15e04719f202efe1326813/b47ffbb6d10b344b0ad4e1f1bf5526e246b917ce", postData)
                                            .done(function(data) { 

                                                $('#spinner').addClass('d-none');
                                            
                                                dialogItself.close();

                                                load_frame(
                                                    'open_tickets',
                                                    "0ff1bb77a9de65eac6621c9c5a983da7a37ed3bf/afe4f16263308b092d15e04719f202efe1326813/" + data[0].ID,
                                                    true
                                                );
                                            })
                                            .fail(function(xhr) {
                                                
                                                if(422 == xhr.status) {
                                                    $('#new_shipping_order').find('.is-invalid').removeClass('is-invalid');
                                                    $.each(xhr.responseJSON, function(index, item) {
                                                        let array = index.split('.');
                                                        $('#new_shipping_order').find('[name="data['+array[1]+']"]').addClass('is-invalid'); 
                                                    
                                                    });

                                                    alertValidationError();
                                                
                                                
                                                } else alertException(xhr);
                                            
                                            });
                                            
                                        
                                        });
                                        break;
                                    
                                    case "AF":
                                    
                                        dialog.getModalHeader().find('.bootstrap-dialog-title').html('Neuer Auftrag');
                                        dialog.getModalFooter().find('.btn-success').html('Speichern').off('click').on('click', function() {
                                        
                                            let postData = $('#new_order').serialize();
                        
                                            postData._token = '{{csrf_token()}}';
                                                                    
                                            $.post("/api/hwplus/afe4f16263308b092d15e04719f202efe1326813/b1454e7841ee1d49f594494b0eaa35748029280a", postData)
                                            .done(function(data) { 

                                                dialogItself.close();

                                                $('#spinner').addClass('d-none');

                                                load_frame(
                                                    'open_tickets',
                                                    "0ff1bb77a9de65eac6621c9c5a983da7a37ed3bf/afe4f16263308b092d15e04719f202efe1326813/" + data[0].ID,
                                                    true
                                                );
                                            })
                                            .fail(function(xhr) {
                                            
                                            
                                            
                                                if(422 == xhr.status) {
                                                    $('#new_order').find('.is-invalid').removeClass('is-invalid');
                                                    $.each(xhr.responseJSON, function(index, item) {
                                                        let array = index.split('.');
                                                        $('#new_order').find('[name="data['+array[1]+']"]').addClass('is-invalid'); 
                                                    });
                                                
                                                    alertValidationError();
                                                
                                                } else alertException(xhr);
                                            
                                            });
                                            
                                        
                                        });
                                        break;
                                        
                                    case "MB":
                                    
                                        dialog.getModalHeader().find('.bootstrap-dialog-title').html('Neues Baustellen-Material');
                                        dialog.getModalFooter().find('.btn-success').html('Speichern').off('click').on('click', function() {
                                        
                                            let postData = $('#new_lot').serialize();
                            
                                            $.post("/api/hwplus/afe4f16263308b092d15e04719f202efe1326813/e394996c8ffecef4efa6840e207181ee6bdf85d2", postData)
                                            .done(function(data) {

                                                dialogItself.close();

                                                $('#spinner').addClass('d-none');

                                                load_frame(
                                                    'material',
                                                    "0ff1bb77a9de65eac6621c9c5a983da7a37ed3bf/afe4f16263308b092d15e04719f202efe1326813/" + data[0].ID,
                                                    true
                                                );

                                            })
                                            .fail(function(xhr) {
                                                
                                                if(422 == xhr.status) {
                                                    $('#new_lot').find('.is-invalid').removeClass('is-invalid');
                                                    $.each(xhr.responseJSON, function(index, item) {
                                                        let array = index.split('.');
                                                        $('#new_lot').find('[name="data['+array[1]+']"]').addClass('is-invalid'); 
                                                    
                                                    });

                                                    alertValidationError();
                                                
                                                
                                                } else alertException(xhr);
                                            
                                            });
                                            
                                        
                                        });
                                        break;
                                    
                                        case "AN":
                                        
                                            dialog.getModalHeader().find('.bootstrap-dialog-title').html('Neues Angebot');
                                            dialog.getModalFooter().find('.btn-success').html('Speichern').off('click').on('click', function() {
                                            
                                                let postData = $('#new_offer').serialize();

                                                //dialogItself.close();

                                                postData._token = '{{csrf_token()}}';
                                                                        
                                                $.post("/api/hwplus/afe4f16263308b092d15e04719f202efe1326813/d239e7cfd1029e141e34d4a8d724158e9032aced", postData)
                                                .done(function(data) { 

                                                    dialogItself.close();

                                                    $('#spinner').addClass('d-none');

                                                    load_frame(
                                                        'offers',
                                                        "d774d83528528c1bb8aa3f8a18d6bd66a9c76e66/afe4f16263308b092d15e04719f202efe1326813/" + data[0].ID,
                                                        true
                                                    );

                                                })
                                                .fail(function(xhr) {
                                                
                                                    if(422 == xhr.status) {
                                                        $('#new_offer').find('.is-invalid').removeClass('is-invalid');
                                                        $.each(xhr.responseJSON, function(index, item) {
                                                            let array = index.split('.');
                                                            $('#new_offer').find('[name="data['+array[1]+']"]').addClass('is-invalid'); 
                                                        });

                                                        alertValidationError();
                                                    
                                                    
                                                    } else alertException(xhr);
                                                
                                                });
                                                
                                            
                                            });
                                        break;

                                        case "MA":

                                            dialog.getModalHeader().find('.bootstrap-dialog-title').html('Neues Material-Angebot');
                                            dialog.getModalFooter().find('.btn-success').html('Speichern').off('click').on('click', function() {

                                                let postData = $('#new_offer').serialize();

                                                postData._token = '{{csrf_token()}}';

                                                $.post("/api/hwplus/afe4f16263308b092d15e04719f202efe1326813/d3bcca67e8f5c508feaff813de03a789feecaec8", postData)
                                                .done(function(data) {

                                                    dialogItself.close();

                                                    $('#spinner').addClass('d-none');

                                                    load_frame(
                                                        'offers',
                                                        "d774d83528528c1bb8aa3f8a18d6bd66a9c76e66/afe4f16263308b092d15e04719f202efe1326813/" + data[0].ID,
                                                        true
                                                    );

                                                 })
                                                .fail(function(xhr) {

                                                    if(422 == xhr.status) {
                                                        $('#new_offer').find('.is-invalid').removeClass('is-invalid');
                                                        $.each(xhr.responseJSON, function(index, item) {
                                                            let array = index.split('.');
                                                            $('#new_offer').find('[name="data['+array[1]+']"]').addClass('is-invalid');
                                                        });

                                                        alertValidationError();

                                                    } else alertException(xhr);

                                                });


                                            });
                                        break;
                                }
                            })
                            .fail(function(xhr) {

                                $('#spinner').addClass('d-none');
                            
                                if(422 == xhr.status) {
                                    $('#createTicket').find('.is-invalid').removeClass('is-invalid');
                                    $.each(xhr.responseJSON["errors"], function(index, item) {
                                        let array = index.split('.');
                                        $('#createTicket').find('[name="'+array[0]+'"]').addClass('is-invalid'); 
                                    
                                    });
                                }
                            
                                else alertException(xhr);      
                            });
                    }
                }, {
                    label: 'Abbrechen',
                    action: function(dialogItself){
                        dialogItself.close();
                    }
                }]
            });
   
    }
  </script>


  <body class="h-100 bg-dark">



    <div class="d-flex" style="overflow:scroll;">



        <nav class="sidebar d-flex flex-column _flex-shrink-0 position-fixed">
            <!--div class="toggle-btn text-white" onclick="toggleSidebar()">
                <i class="mdi mdi-arrow-left-box"></i>
            </div -->

            <!-- div class="profile-section mt-auto p-4">
                <div class="d-flex align-items-center">
                    <div class="ms-3 profile-info">
                        <h6 class="text-white mb-0">{{auth()->user()->name}}</h6>
                        <small class="text-muted">{{$editor->getKey('APP_TITLE')['value']}}</small>
                    </div>
                </div>
            </div -->

            <div class="nav flex-column" style="">

                <!--a href="#" class="sidebar-link mt-3 text-decoration-none bg-white text-dark sidebar_button_toggle" onclick="toggleSidebar()">
                    <i class="mdi mdi-close-box"></i>
                </a -->
                <a href="#" class="sidebar-link text-decoration-none bg-white text-dark sidebar_button_new mt-2" onclick="create_new_ticket()">
                    <i class="mdi mdi-plus-box"></i>
                    <span class="hide-on-collapse">Neu..</span>
                </a>
                <a href="#" class="sidebar-link active text-decoration-none text-dark sidebar_button_home" style="background-color:#FFFF00" onclick="load_frame('home', '668307f34317ba8fb4dbba556b92204f2a18e3ee/b00957668764b5f7b0ed77f1de905d2a1ef066ad', true)">
                    <i class="fas fa-home me-3"></i>
                    <span class="hide-on-collapse">Start</span>
                </a>
                <a href="#" class="sidebar-link text-decoration-none bg-warning text-white sidebar_button_clients" onclick="load_frame('clients', '50ff624844395b2f159817b978fd53a4a533a739/86343e16c8551a46bdd6560814444580b3833a53')">
                    <i class="mdi mdi-account-group"></i>
                    <span class="hide-on-collapse">Kunden</span>
                </a>

                <a href="#" class="sidebar-link text-decoration-none bg-danger text-white sidebar_button_invoices" onclick="load_frame('invoices', '759549c6ca5f53b6c47699785cbd2ca0aa8438e4/afe4f16263308b092d15e04719f202efe1326813')">
                    <i class="mdi mdi-invoice-text-outline"></i>
                    <span class="hide-on-collapse">Rechnungen</span>
                </a>
                <a href="#" class="sidebar-link text-decoration-none bg-info text-white sidebar_button_open_tickets" onclick="load_frame('open_tickets', '7596f11cd8b4f79e81ac81fae42f45e5281c8b2c/afe4f16263308b092d15e04719f202efe1326813')">
                    <i class="mdi mdi-book-open-page-variant-outline"></i>
                    <span class="hide-on-collapse">offene Zettel</span>
                </a>
                <a href="#" class="sidebar-link text-decoration-none bg-success text-white sidebar_button_closed_tickets" onclick="load_frame('closed_tickets', '9091a37cb9e8b180ccb080d530d3aead3012a64c/afe4f16263308b092d15e04719f202efe1326813')">
                    <i class="mdi mdi-book-variant"></i>
                    <span class="hide-on-collapse">fertige Zettel</span>
                </a>
                <a href="#" class="sidebar-link text-decoration-none bg-primary text-white sidebar_button_offers" onclick="load_frame('offers', '2077b82edbd2ffc1c8dc27880d101b975bd444b8/afe4f16263308b092d15e04719f202efe1326813')">
                    <i class="mdi mdi-offer"></i>
                    <span class="hide-on-collapse">Angebote</span>
                </a>
                <a href="#" class="sidebar-link text-decoration-none bg-secondary text-white sidebar_button_material" style="background-color:var(--skyblue)" onclick="load_frame('material', 'd14d351154ba9707f6a1cad20d9f25dc29f6da28/5a7dfc613be971ac442fff63b73ecd1b2ebd9594', true)">
                    <i class="mdi mdi-palette-swatch-variant"></i>
                    <span class="hide-on-collapse">Materialstamm</span>
                </a>
                <a href="#" class="sidebar-link text-decoration-none text-white sidebar_button_tracking" style="background-color:var(--rose)" onclick="load_frame('tracking', '9fc66b7e47269b60348557814c297de4cb2d8d12/afe4f16263308b092d15e04719f202efe1326813', true)">
                    <i class="mdi mdi-timelapse"></i>
                    <span class="hide-on-collapse">Zeiterfassung</span>
                </a>
                <a href="#" class="sidebar-link text-decoration-none text-white sidebar_button_settings" style="background-color:var(--indigo)" onclick="load_frame('settings', '1faf0aaa6dd4f9bdbde29349c1c829175516baf5', true)">
                    <i class="mdi mdi-cog-box"></i>
                    <span class="hide-on-collapse">Einstellungen</span>
                </a>
                <a href="#" class="sidebar-link text-decoration-none text-white sidebar_button_lot" style="background-color:var(--skyblue)" onclick="load_frame('lot', '10b95e81e70e76f2ea16de73333966f0385810d3/afe4f16263308b092d15e04719f202efe1326813', true)">
                    <i class="mdi mdi-account-hard-hat-outline"></i>
                    <span class="hide-on-collapse">Materialliste</span>
                </a>
                <a href="#" class="sidebar-link text-decoration-none text-white sidebar_button_standing_orders" style="background-color:var(--orange)" onclick="load_frame('standing_orders', '0a56f0b9ca13e60447b5bea936fcb6d841ccf746/27b96af59ee924f9ec98cf9c44b54e06219636c1', true)">
                    <i class="mdi mdi-book-clock"></i>
                    <span class="hide-on-collapse">Daueraufträge</span>
                </a>
                <a href="#" class="sidebar-link text-decoration-none text-white sidebar_button_dunning" style="background-color:var(--pink)" onclick="load_frame('dunning', 'd32440f095831b1caac7fb01939bde8933da116b/27b96af59ee924f9ec98cf9c44b54e06219636c1', true)">
                    <i class="mdi mdi-reminder"></i>
                    <span class="hide-on-collapse">Mahnwesen</span>
                </a>
                <a href="#" class="sidebar-link text-decoration-none text-white sidebar_button_calendar" style="background-color:var(--teal)" onclick="load_frame('calendar', '83dcbe4b5bd40948dbd8e1bad5fcff148cce9af2/b901231a330d256e30a16ceb5474bf2ae4962bc3', true)">
                    <i class="mdi mdi-calendar-month"></i>
                    <span class="hide-on-collapse">Planung</span>
                </a>
                <a href="#" class="sidebar-link text-decoration-none text-white sidebar_button_search" style="background-color:var(--purple)" onclick="load_frame('search', 'e70bb886fb255af220e6c8fcae62fc7297757416/27b96af59ee924f9ec98cf9c44b54e06219636c1', true)">
                    <i class="mdi mdi-card-search"></i>
                    <span class="hide-on-collapse">Suche & Prüfung</span>
                </a>
            </div>


        </nav>

            <main class="main-content pl-3 pr-3">
                <div id="frame_busy" style="display:none">
                    <div id="spinner" class="spinner spinner-border" role="status">
                        <span class="sr-only">Loading...</span>
                    </div>
                </div>
                <iframe id="frame_main"></iframe>
                <iframe id="frame_clients"></iframe>
                <iframe id="frame_invoices"></iframe>
                <iframe id="frame_open_tickets"></iframe>
                <iframe id="frame_closed_tickets"></iframe>
                <iframe id="frame_offers"></iframe>
                <iframe id="frame_material_master"></iframe>
            </main>

        </div>
    </body>

    <script>
    load_frame('home', '668307f34317ba8fb4dbba556b92204f2a18e3ee/b00957668764b5f7b0ed77f1de905d2a1ef066ad', true);
    </script>

</html>


