<?php use DynCom\mysyde\common\interfaces\SessionFlashMessageBag;?>
<!doctype html>
<html lang="de" data-theme="light" data-fs="true">
<? require_once('../../module/intranet/intranet_functions.inc.php'); ?>
<? require_once("../common/version_comment.inc.php");?>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <style>

    </style>
    <?= get_canonical(); ?>
    <? create_meta_tags(); ?>
    
    <?
        $favivon = getFavicon($site['id']);
        get_gulp_sources('/layout/frontend/b2c/dist/','style','script');
        create_includes($GLOBALS["layout"]["id"], $GLOBALS["navigation"]["forward_page_id"], 'css');
        create_includes($GLOBALS["layout"]["id"], $GLOBALS["navigation"]["forward_page_id"], 'js');
        create_live_edit_includes();
    ?>
    <!-- <link rel="icon" type="image/x-icon" href="/layout/frontend/b2c/dist/favicons/<?php echo $favivon?>"> -->
    <!-- <link rel="shortcut icon" href="/layout/frontend/b2c/dist/favicons/<?php echo $favivon?>"> -->
    <link rel="icon" type="image/x-icon" href="/<?php get_mandant_favicon($GLOBALS['main_contact']['current_mandant_id']) ?>">
    <link rel="shortcut icon" href="/<?php get_mandant_favicon($GLOBALS['main_contact']['current_mandant_id']) ?>">


</head>
<?= get_mandant_variable($GLOBALS['main_contact']['current_mandant_id'])?>
<body id="body" class="<?= $GLOBALS['site']['code'] ." " ?> <?= ($GLOBALS['navigation']['code'] != '404') ? $GLOBALS['navigation']['code'] : 'not_found page_404' ?> <?= $_GET["level_1"]?>">
    <?php
    if(isset($_GET['action']) && $_GET['action'] == 'create_collection' && $_GET['setup_id'] != NULL){
        require_once(MODULE_PATH.'collection/edit_collection.inc.php');
        require_once MODULE_PATH. "collection/frontend_creation.inc.php";
    }
    
    if(isset($_GET['action']) && $_GET['action'] == 'new_line_gallery'){
        require_once(MODULE_PATH.'collection/edit_collection.inc.php');
        return;
    }
    ?>
    <script>
        document.addEventListener('DOMContentLoaded', function () {
            if (window.ReactNativeWebView && window.ReactNativeWebView.postMessage) {
                window.ReactNativeWebView.postMessage('load');
            }
        });
    </script>
    <div class="sidebuttons">
        <? get_content("sidebuttons",null,$IOCContainer); ?>
    </div>

    <nav>
        <div id="header">
            <div id="header_1" class="logo_<?= $GLOBALS['main_contact']['current_mandant_id'] ?>">
                <?= get_mandant_logo($GLOBALS['main_contact']['current_mandant_id']); ?>
            </div>
            <div id="header_2">
                <? navigation_full_menu_area($site, $language, $site, 2); ?>
            </div>
            <div id="log_out">
                <svg xmlns="https://www.w3.org/2000/svg" width="14.07" height="16.415" viewBox="0 0 14.07 16.415">
                    <g id="logout" transform="translate(-4.5 -2.25)">
                        <path id="Pfad_44" data-name="Pfad 44"
                            d="M5.673,18.665h7.035a1.174,1.174,0,0,0,1.173-1.173V15.734H12.708v1.759H5.673V3.423h7.035V5.181H13.88V3.423A1.174,1.174,0,0,0,12.708,2.25H5.673A1.174,1.174,0,0,0,4.5,3.423v14.07A1.174,1.174,0,0,0,5.673,18.665Z" />
                        <path id="Pfad_45" data-name="Pfad 45"
                            d="M17.456,17.456l2.1-2.1H11.25V14.181h8.309l-2.1-2.1.829-.829L21.8,14.768l-3.518,3.518Z"
                            transform="translate(-3.232 -4.31)" />
                    </g>
                </svg>
                <a href="https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri=https://awo-hamburg.breadcrumb-online.de/dev/de/logout/" onclick="delete_coockie()">Abmelden</a>
            </div>
            <script>
            function delete_coockie() {
                document.cookie = 'access_token=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
                var formData = new FormData();

                formData.append('user', <?php echo $_SESSION["login_id"]; ?>);
                fetch(getBaseUrl() * "/module/api/out_system.inc.php", {
                    method: 'POST',
                    body: formData
                });
                window.ReactNativeWebView.postMessage('logoutuser');
                localStorage.removeItem('uniquePostIdentifier');

            }

        </script>


            <div id="toggle_navigation">
                <label for="hamburg" class="hamburg">
                    <span class="line"></span>
                    <span class="line"></span>
                    <span class="line"></span>
                </label>
            </div>
            <div class="hamburger-menu">
                <? navigation_full_menu_area($site, $language, $site, 1); ?>
                <div class="mobile_submenu">
                    <? get_content("horizontal_nav_bar",null,$IOCContainer); ?>
                </div>
                <div id="log_out_mobile">
                    <svg xmlns="https://www.w3.org/2000/svg" width="14.07" height="16.415" viewBox="0 0 14.07 16.415">
                        <g id="logout" transform="translate(-4.5 -2.25)">
                            <path id="Pfad_44" data-name="Pfad 44"
                                d="M5.673,18.665h7.035a1.174,1.174,0,0,0,1.173-1.173V15.734H12.708v1.759H5.673V3.423h7.035V5.181H13.88V3.423A1.174,1.174,0,0,0,12.708,2.25H5.673A1.174,1.174,0,0,0,4.5,3.423v14.07A1.174,1.174,0,0,0,5.673,18.665Z" />
                            <path id="Pfad_45" data-name="Pfad 45"
                                d="M17.456,17.456l2.1-2.1H11.25V14.181h8.309l-2.1-2.1.829-.829L21.8,14.768l-3.518,3.518Z"
                                transform="translate(-3.232 -4.31)" />
                        </g>
                    </svg>
                    <a href="https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri=https://awo-hamburg.breadcrumb-online.de/dev/de/logout/" onclick="logout(<?php echo $_SESSION['login_id']; ?>)">Abmelden</a>
                </div>
            </div>
        </div>
    </nav>
    <script>
            function getBaseUrl() {
                return window.location.origin;
            }
            function logout(user) {
                var formData = new FormData();

                formData.append('user', user);
                fetch(getBaseUrl() + "/module/api/out_system.inc.php", {
                    method: 'POST',
                    body: formData
                });
                window.ReactNativeWebView.postMessage('logoutuser');
                localStorage.removeItem('uniquePostIdentifier');
                document.cookie = 'access_token=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
            }
        </script>
    <div id="horizontal_nav_bar" class="horizontal_nav_bar">
        <!-- <div class="hidden_toggle"><</div> -->
        <? get_content("horizontal_nav_bar",null,$IOCContainer); ?>
        <a href="/awo/de/profil/">
        <?php 
        $profile_image = 'platzhalter.png';
        if($GLOBALS['main_contact']['image'] != ""){
            $profile_image = $GLOBALS['main_contact']['image'];
        }
        ?>
        <img class='profil_img_nav_bar' src='/userdata/intranet/contact/<?= $profile_image ?>'>
        </a>
    </div>

    <div id="mandant_switch">
        <? mandant_switch() ?>
    </div>

    <main>
        <?php if(siteProtector($GLOBALS['navigation']['id']) != 0){ ?>
        <div class="main_content">


            <div id="hero_content" class="content-selector">
                <div class="container">
                    <? get_content("hero_content",null,$IOCContainer); ?>
                    <?= cust_curr_navigation_path($site, $language, $navigation, 3) ?>
                </div>
            </div>

            <div id="content" class="content-selector">
                <div class="container">
                    <? get_content("content-full",null,$IOCContainer); ?>
                </div>
            </div>

            <div id="area-2" class="main-screen grey content-selector">
                <? get_content("area-2_full",null,$IOCContainer); ?>
                <div class="container">
                    <? get_content("area-2",null,$IOCContainer); ?>
                </div>
            </div>
            <div id="area-3" class="main-screen content-selector">
                <div class="container">
                    <? get_content("area-3",null,$IOCContainer); ?>
                </div>
                <? get_content("area-3_full",null,$IOCContainer); ?>
            </div>
            <div id="area-4" class="main-screen grey content-selector">
                <div class="container">
                    <? get_content("area-4",null,$IOCContainer); ?>
                </div>
                <? get_content("area-4_full",null,$IOCContainer); ?>
            </div>
            <div id="area-5" class="main-screen content-selector">
                <div class="container">
                    <? get_content("area-5",null,$IOCContainer); ?>
                </div>
                <? get_content("area-5_full",null,$IOCContainer); ?>
            </div>
            <div id="area-6" class="main-screen grey content-selector">
                <div class="container">
                    <? get_content("area-6",null,$IOCContainer); ?>
                </div>
                <? get_content("area-6_full",null,$IOCContainer); ?>
            </div>
            <div id="area-7" class="main-screen content-selector">
                <div class="container">
                    <? get_content("area-7",null,$IOCContainer); ?>
                </div>
                <? get_content("area-7_full",null,$IOCContainer); ?>
            </div>
            <div id="area-8" class="main-screen grey content-selector">
                <div class="container">
                    <? get_content("area-8",null,$IOCContainer); ?>
                </div>
                <? get_content("area-8_full",null,$IOCContainer); ?>
            </div>
            <div id="area-9" class="main-screen content-selector">
                <div class="container">
                    <? get_content("area-9",null,$IOCContainer); ?>
                </div>
                <? get_content("area-9_full",null,$IOCContainer); ?>
            </div>

            <div id="footer-header">
                <div class="container">
                    <div class="footer-header_1 col-xs-12 col-sm-12 col-md-6">
                        <? get_content("footer-header_1", TRUE,$IOCContainer); ?>
                    </div>
                    <div class="footer-header_2 col-xs-12 col-sm-12 col-md-6">
                        <? get_content("footer-header_2", TRUE,$IOCContainer); ?>
                    </div>
                </div>
            </div>


            <?php
                //Get Flash Messages
                /**
                 * @var $flashMessageBag SessionFlashMessageBag
                 */
                $flashMessageBag = $GLOBALS['flashMessageBag'];

                $info_flashmsgs = $flashMessageBag->get(SessionFlashMessageBag::TYPE_INFO);
                $notice_flashmsgs = $flashMessageBag->get(SessionFlashMessageBag::TYPE_NOTICE);
                $warning_flashmsgs = $flashMessageBag->get(SessionFlashMessageBag::TYPE_WARNING);
                $error_flashmsgs = $flashMessageBag->get(SessionFlashMessageBag::TYPE_ERROR);
                $success_flashmsgs = $flashMessageBag->get(SessionFlashMessageBag::TYPE_SUCCESS);
                //$flashMessageBag->set(SessionFlashMessageBag::TYPE_INFO,'my first info');
                ?>
            <div id="flashMessages">
                <div id="flashMessages_info">
                    <?php
                        foreach ($info_flashmsgs as $msg) {
                            ?>
                    <div class="flashMessage flashMessage_info">
                        <i class="material-icons icon">&#xE90F;</i>
                        <?= $msg ?>
                        <i class="material-icons close_flash">&#xE14C;</i>
                    </div>
                    <?
                        }
                        ?>
                </div>
                <div id="flashMessages_notice">
                    <?php
                        foreach ($notice_flashmsgs as $msg) {
                            ?>
                    <div class="flashMessage flashMessage_notice">
                        <i class="material-icons icon">&#xE90F;</i>
                        <?= $msg ?>
                        <i class="material-icons close_flash">&#xE14C;</i>
                    </div>
                    <?
                        }
                        ?>
                </div>
                <div id="flashMessages_warning">
                    <?php
                        foreach ($warning_flashmsgs as $msg) {
                            ?>
                    <div class="flashMessage flashMessage_warning">
                        <i class="fa fa-info icon" aria-hidden="true"></i>
                        <?= $msg ?>
                        <i class="material-icons close_flash">&#xE14C;</i>
                    </div>
                    <?
                        }
                        ?>
                </div>
                <div id="flashMessages_error">
                    <?php
                        foreach ($error_flashmsgs as $msg) {
                            ?>
                    <div class="flashMessage flashMessage_error">
                        <i class="material-icons icon">&#xE14C;</i>
                        <?= $msg ?>
                        <i class="material-icons close_flash">&#xE14C;</i>
                    </div>
                    <?
                        }
                        ?>
                </div>
                <div id="flashMessages_success">
                    <?php
                        foreach ($success_flashmsgs as $msg) {
                            ?>
                    <div class="flashMessage flashMessage_success">
                        <i class="material-icons icon">&#xE5CA;</i>
                        <?= $msg ?>co
                        <i class="material-icons close_flash">&#xE14C;</i>
                    </div>
                    <?
                        }
                        ?>
                </div>
            </div>
        </div>

        <div id="mandant_switch_responsiv" class="responsiv_mandants">
            <? mandant_switch() ?>
        </div>
        <?php } ?>
    </main>


    <script
        src="/plugins/fslightbox/fslightbox.js">
    </script>


    <script
        src="/layout/frontend/b2c/dist/js/bc.min.js?time=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/layout/frontend/b2c/dist/js/bc.min.js')?>">
    </script>
<!-- MOBILE NAVIGATION -->
<div class="mobile_navigation">
    <div class="mobile_navigation_container">

        <!-- (1) AKTUELLES -->
        <a href="/awo/de/news/">
            <svg id="newspaper" xmlns="https://www.w3.org/2000/svg" width="15.876" height="14.884" viewBox="0 0 15.876 14.884">
                <path id="Pfad_33" data-name="Pfad 33"
                      d="M0,2.613A1.488,1.488,0,0,1,1.488,1.125H12.4a1.488,1.488,0,0,1,1.488,1.488V14.521A1.488,1.488,0,0,1,12.4,16.009H1.488A1.488,1.488,0,0,1,0,14.521Zm1.488-.5a.5.5,0,0,0-.5.5V14.521a.5.5,0,0,0,.5.5H12.4a.5.5,0,0,0,.5-.5V2.613a.5.5,0,0,0-.5-.5Z"
                      transform="translate(0 -1.125)" fill-rule="evenodd"></path>
                <path id="Pfad_34" data-name="Pfad 34"
                      d="M29.844,6.75a.5.5,0,0,1,.5.5V17.665a1.488,1.488,0,0,1-1.488,1.488H25.875v-.992h2.977a.5.5,0,0,0,.5-.5V7.246A.5.5,0,0,1,29.844,6.75Z"
                      transform="translate(-14.464 -4.269)" fill-rule="evenodd"></path>
                <path id="Pfad_35" data-name="Pfad 35"
                      d="M4.5,6.75h9.923V8.735H4.5Zm0,2.977H8.469V12.7H4.5Zm0,3.969H8.469v.992H4.5Zm0,1.985H8.469v.992H4.5ZM9.461,9.727h1.985v.992H9.461Zm2.977,0h1.985v.992H12.438ZM9.461,11.711h1.985V12.7H9.461Zm2.977,0h1.985V12.7H12.438ZM9.461,13.7h1.985v.992H9.461Zm2.977,0h1.985v.992H12.438ZM9.461,15.68h1.985v.992H9.461Zm2.977,0h1.985v.992H12.438Z"
                      transform="translate(-2.515 -4.269)"></path>
            </svg>
            Aktuelles
        </a>

        <!-- (2) QM -->
        <a href="/awo/de/qm-bereich/">
            <svg id="document" xmlns="https://www.w3.org/2000/svg" width="10.924" height="15.293" viewBox="0 0 10.924 15.293">
                <path id="Pfad_38" data-name="Pfad 38"
                      d="M17.51,6.238,13.686,2.415a.5.5,0,0,0-.382-.164H7.842A1.1,1.1,0,0,0,6.75,3.343V16.452a1.1,1.1,0,0,0,1.092,1.092h8.739a1.1,1.1,0,0,0,1.092-1.092V6.62a.5.5,0,0,0-.164-.382ZM13.3,3.561,16.363,6.62H13.3Zm3.277,12.89H7.842V3.343h4.369V6.62A1.1,1.1,0,0,0,13.3,7.712h3.277Z"
                      transform="translate(-6.75 -2.251)"></path>
                <path id="Pfad_39" data-name="Pfad 39"
                      d="M11.25,24.75H17.8v1.092H11.25Z"
                      transform="translate(-9.065 -13.827)"></path>
                <path id="Pfad_40" data-name="Pfad 40"
                      d="M11.25,18H17.8v1.092H11.25Z"
                      transform="translate(-9.065 -10.354)"></path>
            </svg>
            QM
        </a>

        <!-- (3) DASHBOARD -->
        <a href="/awo/de/dashboard/">
            <svg id="menu-grid-o" xmlns="https://www.w3.org/2000/svg" width="14.914" height="14.914" viewBox="0 0 14.914 14.914">
                <path id="Pfad_24" d="M9.729,7.864A1.864,1.864,0,1,1,7.864,6,1.864,1.864,0,0,1,9.729,7.864Z" transform="translate(-6 -6)"/>
                <path id="Pfad_25" d="M9.729,16.864A1.864,1.864,0,1,1,7.864,15,1.864,1.864,0,0,1,9.729,16.864Z" transform="translate(-6 -9.407)"/>
                <path id="Pfad_26" d="M7.864,27.729A1.864,1.864,0,1,0,6,25.864,1.864,1.864,0,0,0,7.864,27.729Z" transform="translate(-6 -12.814)"/>
                <path id="Pfad_27" d="M18.729,7.864A1.864,1.864,0,1,1,16.864,6,1.864,1.864,0,0,1,18.729,7.864Z" transform="translate(-9.407 -6)"/>
                <path id="Pfad_28" d="M16.864,18.729A1.864,1.864,0,1,0,15,16.864,1.864,1.864,0,0,0,16.864,18.729Z" transform="translate(-9.407 -9.407)"/>
                <path id="Pfad_29" d="M18.729,25.864A1.864,1.864,0,1,1,16.864,24,1.864,1.864,0,0,1,18.729,25.864Z" transform="translate(-9.407 -12.814)"/>
                <path id="Pfad_30" d="M25.864,9.729A1.864,1.864,0,1,0,24,7.864,1.864,1.864,0,0,0,25.864,9.729Z" transform="translate(-12.814 -6)"/>
                <path id="Pfad_31" d="M27.729,16.864A1.864,1.864,0,1,1,25.864,15,1.864,1.864,0,0,1,27.729,16.864Z" transform="translate(-12.814 -9.407)"/>
                <path id="Pfad_32" d="M25.864,27.729A1.864,1.864,0,1,0,24,25.864,1.864,1.864,0,0,0,25.864,27.729Z" transform="translate(-12.814 -12.814)"/>
            </svg>
            Dashboard
        </a>

        <!-- (4) TERMINE -->
        <a href="/awo/de/alle-termine/">
            <svg id="newspaper" xmlns="https://www.w3.org/2000/svg" width="15.876" height="14.884" viewBox="0 0 15.876 14.884">
                <path id="Pfad_33" d="M0,2.613A1.488,1.488,0,0,1,1.488,1.125H12.4a1.488,1.488,0,0,1,1.488,1.488V14.521A1.488,1.488,0,0,1,12.4,16.009H1.488A1.488,1.488,0,0,1,0,14.521Zm1.488-.5a.5.5,0,0,0-.5.5V14.521a.5.5,0,0,0,.5.5H12.4a.5.5,0,0,0,.5-.5V2.613a.5.5,0,0,0-.5-.5Z"
                      transform="translate(0 -1.125)" fill-rule="evenodd"/>
                <path id="Pfad_34" d="M29.844,6.75a.5.5,0,0,1,.5.5V17.665a1.488,1.488,0,0,1-1.488,1.488H25.875v-.992h2.977a.5.5,0,0,0,.5-.5V7.246A.5.5,0,0,1,29.844,6.75Z"
                      transform="translate(-14.464 -4.269)" fill-rule="evenodd"/>
                <path id="Pfad_35" d="M4.5,6.75h9.923V8.735H4.5Zm0,2.977H8.469V12.7H4.5Zm0,3.969H8.469v.992H4.5Zm0,1.985H8.469v.992H4.5ZM9.461,9.727h1.985v.992H9.461Zm2.977,0h1.985v.992H12.438ZM9.461,11.711h1.985V12.7H9.461Zm2.977,0h1.985V12.7H12.438ZM9.461,13.7h1.985v.992H9.461Zm2.977,0h1.985v.992H12.438ZM9.461,15.68h1.985v.992H9.461Zm2.977,0h1.985v.992H12.438Z"
                      transform="translate(-2.515 -4.269)"/>
            </svg>
            Termine
        </a>

        <!-- (5) PROFIL -->
        <a href="/awo/de/profil/">
            <svg xmlns="http://www.w3.org/2000/svg" width="27" height="27" viewBox="0 0 27 27">
                <g id="person" transform="translate(-4.5 -4.5)">
                    <path id="Pfad_17" data-name="Pfad 17" d="M29.25,31.5a2.2,2.2,0,0,0,2.25-2.25c0-2.25-2.25-9-13.5-9S4.5,27,4.5,29.25A2.2,2.2,0,0,0,6.75,31.5ZM6.761,29.376v0ZM6.8,29.25H29.2l.032-.005.018,0A6.007,6.007,0,0,0,27.378,25.5c-1.467-1.466-4.228-3-9.378-3s-7.911,1.53-9.378,3A6.025,6.025,0,0,0,6.75,29.241Zm22.442.126v0ZM18,15.75a4.5,4.5,0,1,0-4.5-4.5A4.5,4.5,0,0,0,18,15.75Zm6.75-4.5A6.75,6.75,0,1,1,18,4.5,6.75,6.75,0,0,1,24.75,11.25Z" fill-rule="evenodd"/>
                </g>
            </svg>
            Profil
        </a>

    </div>
</div>
<!-- END MOBILE NAVIGATION -->


</body>

</html>

<script>
  $("#input_date2").parent().hide();
  $("#input_ansprechpartner").parent().hide();
  $("#input_arbeitsunfaehigkeitsbescheinigung").change(function() {
      $("#input_date2").parent().toggle();
  });
  $("#input_besprechung").change(function() {
      $("#input_ansprechpartner").parent().toggle();
  });

  $("#input_user").parent().hide();
  $("#input_mandant").change(function() {
      $("#input_user").parent().show();
  });

  $("#input_mandant").change(function() {
    var mandant_id = $(this).val();

    $.ajax({
        type: 'POST',
        url: "/module/contactform/show_contactform_ajax.inc.php",
        data: { mandant_id : mandant_id }, 
        success: function(data){
            $('#input_user').html(data)
        }
    }); 
});
</script>