<!DOCTYPE html>
<html lang="de">
<?
require_once("../../mysyde/common/version_comment.inc.php");
require_once("intranet_functions.inc.php");

$translation = \DynCom\mysyde\common\classes\Registry::get('translation');
?>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="robots" content="noindex, nofollow" />
    <title>Kennwort vergessen - <?= $GLOBALS['language']["site_title_name"]?></title>
    <?
        $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="stylesheet" type="text/css" href="/plugins/formdesign/vendor/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/plugins/formdesign/vendor/animate/animate.css">
    <link rel="stylesheet" type="text/css" href="/plugins/formdesign/vendor/select2/select2.min.css">
    <link rel="stylesheet" type="text/css" href="/plugins/formdesign/css/util.css">
    <link type="text/css" rel="stylesheet" href="/plugins/bootstrap/css/bootstrap.min.css">
</head>

<body class="login_area">
        <div class="login_container">
            <div class="login_content">
                <div id="logo-area">
                    <? get_content("logo"); ?>
                    <div class="quote-box">
                        <div id="quote"></div>
                        <p class="author"></p>
                        <button id="refresh">neues Zitat laden</button>
                    </div>
                    <? get_content("login_bg"); ?>
                </div>
                <div id="login-area">
                <div id="login_form">
                <? get_content("icon_logo_login"); ?>

                <span><?= $GLOBALS['language']["site_title_name"]?> - <?php echo $translation->get("intranet"); ?> </span>
            <?php if ($_GET["action"] == 'intranet_forgot_password'){ ?>
            <h1>Gib deine E-Mail Adresse an, um ein neues Passwort zu vergeben</h1>
            <form class="contact2-form validate-form" name="form_admin_login" id="form_admin_login" action="?action=intranet_password_code" method="post">
                <div class="wrapper-login">
                    <span>E-Mail</span>
                    <div class="wrap-input2 validate-input" data-validate="Name is required">
                        <input class="input2" type="text" name="input_login" id="input_login">
                    </div>
                </div>
                <input class="button" name="" id="login-button" type="submit" />
              </form>
            <?php }else if ($_GET["action"] == 'intranet_password_code'){ ?>
            <h1>Gib den Code ein, welcher dir per<br> E-Mail gesendet wurde</h1>
            <form class="contact2-form validate-form" name="form_admin_login" id="form_admin_login" action="?action=intranet_set_password" method="post">
              <div class="wrapper-login">
                <span>Code</span>
                  <div class="wrap-input2 validate-input" data-validate="Name is required">
                      <input class="input2" type="text" name="password_recovery_code" id="password_recovery_code">
                  </div>
                </div>
                <input class="button" name="" id="login-button" type="submit" />
              </form>
            <?php }else if ($_GET["action"] == 'intranet_set_password' && $_SESSION['code_set'] == 1){ ?>
              <form class="contact2-form validate-form" name="form_admin_login" id="form_admin_login" action="?action=intranet_set_password_finished" method="post">
              <div class="wrapper-login">
                <span><?php echo $translation->get('backend_password_label'); ?></span>
                <div class="wrap-input2 validate-input" data-validate="Name is required">
                  <input class="input2" name="input_password" type="password" id="input_password">
                  </div>
                </div>
                <div class="wrapper-login">
                  <span><?php echo $translation->get('backend_password_label'); ?></span>
                  <div class="wrap-input2 validate-input" data-validate="Name is required">
                  <input class="input2" name="input_password_2" type="password" id="input_password_2">
                  </div>
                </div>
                <div class="login_button">
                    <a href="?action=">Zurück</a>
                    <input class="button" name="" id="login-button" type="submit" />
                </div>
              </form>
            <?php } ?>
            <div class="error"><?
              if (session_status() === PHP_SESSION_NONE) {
                session_start();
              }
              if (isset($_SESSION["login_error"])) {
                echo $_SESSION["login_error"];
              } else {
                echo $login_error;
              }
              ?></div>

          </div>
                    <div id="button-area">
                            <? get_content("extern_login_button"); ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        var colorWheel = ['#000'];

var quoteAuthor = "";
var quoteText = "";

function getQuote() {

  $.getJSON("https://api.forismatic.com/api/1.0/?method=getQuote&key=457653&format=jsonp&lang=en&jsonp=?", function(data) {
    quoteText = data.quoteText;

    if (data.quoteAuthor) {
      quoteAuthor = data.quoteAuthor;
    } else {
      quoteAuthor = "Anonymous"
    }

    $('#quote').animate({
      opacity: 0
    }, 500, function() {
      $('#quote').html(quoteText);
      $(this).animate({
        opacity: 1
      }, 500);
    });

    $('.author').animate({
      opacity: 0
    }, 500, function() {
      $('.author').html(" - " + quoteAuthor);
      $(this).animate({
        opacity: 1
      }, 500);
    });

    var choice = Math.floor(Math.random() * colorWheel.length);

    $('body').animate({
      backgroundColor: colorWheel[choice],
      color: colorWheel[choice],
    }, 1000);

    $('button').animate({
        opacity: 1
    }, 1000);
    
  }); 
}

$(document).ready(function() {
  var quoteInfo = [];
  $('#refresh').click(function(event) {
    event.preventDefault();
    getQuote();
  });
});

getQuote();
    </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>
</body>

</html>