<?php
require_once __DIR__ . '/../../src/client/config/boot_global.php';
require_once __DIR__ . '/../../src/client/config/boot_local.php';
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

    <!-- ****** faviconit.com Favicons ****** -->
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="icon" sizes="16x16 32x32 64x64" href="/favicon.ico">
    <link rel="icon" type="image/png" sizes="196x196" href="/favicon-192.png">
    <link rel="icon" type="image/png" sizes="160x160" href="/favicon-160.png">
    <link rel="icon" type="image/png" sizes="96x96" href="/favicon-96.png">
    <link rel="icon" type="image/png" sizes="64x64" href="/favicon-64.png">
    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16.png">
    <link rel="apple-touch-icon" href="/favicon-57.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/favicon-114.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/favicon-72.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/favicon-144.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/favicon-60.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/favicon-120.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/favicon-76.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/favicon-152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/favicon-180.png">
    <meta name="msapplication-TileColor" content="#FFFFFF">
    <meta name="msapplication-TileImage" content="/favicon-144.png">
    <meta name="msapplication-config" content="/browserconfig.xml">
    <!-- ****** faviconit.com Favicons ****** -->


    <div id="fb-root"></div>
    <script>(function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/de_DE/sdk.js#xfbml=1&version=v2.5";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>
    <!-- Facebook Pixel Code -->
    <script>
        !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
            n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
            n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
            t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
            document,'script','//connect.facebook.net/en_US/fbevents.js');

        fbq('init', '716475571820221');
        fbq('track', "PageView");</script>
    <noscript><img height="1" width="1" style="display:none"
                   src="https://www.facebook.com/tr?id=716475571820221&ev=PageView&noscript=1"
            /></noscript>
    <!-- End Facebook Pixel Code -->
    <title>TBuddy | Einfacher für&#039;s Team.</title>
    <link rel="shortcut icon" href="https://tbuddy.de/wp-content/uploads/2015/09/Unbenannt.png" type="image/x-icon"/>
    <script src="js/libs/jquery-2.2.0.min.js"></script>
    <?php

    // Determine current version
    $version = '0.0';
    $versionArr = json_decode( file_get_contents( Francis_Utils_Config::get( 'path.root' ) . '/version.json' ), true );
    if ( is_array( $versionArr ) && isset( $versionArr[ 'version' ] ) ) {
        $version = $versionArr[ 'version' ];
    }
    ?>
    <? // Web Client ONLY ?>

    <!--
    <script src="js/libs/pace.min.js"></script>
    -->
    <link rel="stylesheet" href="css/pace.css?<?= $version ?>" />

    <?php
        // Include
        $csses = TB_Client_Core_View::getAllCss( $version );
        foreach( $csses  as $css ):
    ?>
            <link rel="stylesheet" href="<?= $css ?>" />
    <?php
        endforeach;
    ?>


    <?php
        $jsses = TB_Client_Core_View::getAllJs( $version );
        foreach( $jsses as $js ) :
    ?>
            <script src="<?= $js ?>"></script>
    <?php
        endforeach;
    ?>

    <script type="text/javascript">
        $(document).ready( function(){
            TB.Client.VERSION = '<?= $version; ?>';
            TB.Client.BRAINTREE_CLIENT_TOKEN = '<?= Francis_Utils_Config::get( 'braintree.clientToken' ); ?>';
            TB.Client.init( '<?= Francis_Utils_Config::get( 'url.service' ); ?>', '<?= Francis_Utils_Config::get( 'url.client' ); ?>' );
        });
    </script>

</head>
<body>
    <!--
    <div id="pace-cover"></div>
    -->
    <? // Layout will be added right after the pace-cover element ?>

    <!-- start: Footer -->
    <?php
    /*
    <div id="footer" class="clearfix">
        <div class="container">
            <div class="row">
                <div class="col-lg-6 text-left">
                    <div class="fb-like" data-href="https://www.facebook.com/tbuddy.de" data-layout="button_count" data-action="recommend" data-show-faces="true" data-share="true"></div>
                    <br />
                    <small>Version: <?= $version; ?></small>
                </div>
                <div class="col-lg-6 text-right">
                    <a href="http://tbuddy.de/agb/" target="_blank">AGB</a> | <a href="http://tbuddy.de/datenschutz/" target="_blank">Datenschutz</a> | <a href="http://tbuddy.de/621-2/" target="_blank">Impressum</a> | <a href="http://tbuddy.de/disclaimer/" target="_blank">Disclaimer</a>
                    <br /><small><strong>&copy; 2o14-2o16 TBuddy UG</strong></small><br />
                </div>
            </div>
        </div>
    </div>
    */
    ?>
    <!-- end: Footer -->

    <?php
        // Include basic layout and all page templates
        echo TB_Client_Core_View::getAllPageTemplates();
    ?>

    <!-- Google Code for TBuddy General Conversion Page
    In your html page, add the snippet and call
    goog_report_conversion when someone clicks on the
    chosen link or button. -->
    <script type="text/javascript">
        // DISBALED FOR NOW DO NOT CHANGE THE CODE BELOW.
        goog_report_conversion = function(url) {
            /*
            goog_snippet_vars();
            window.google_conversion_format = "3";
            var opt = new Object();
            opt.onload_callback = function() {
                if (typeof(url) != 'undefined') {
                    window.location = url;
                }
            }
            var conv_handler = window['google_trackConversion'];
            if (typeof(conv_handler) == 'function') {
                conv_handler(opt);
            }
            */
        }
        /* ]]> */
    </script>
    <script type="text/javascript"
            src="//www.googleadservices.com/pagead/conversion_async.js">
    </script>
    <script src="https://js.braintreegateway.com/js/braintree-2.32.1.min.js"></script>
</body>
</html>