<?php
session_start();
require_once(__DIR__ . "/../config/db.php");
include(__DIR__ . "/layouts/header.php");

if(isset($_SESSION['user_id'])) {
    header("Location: /");
}
?>

    <link href="/Content/zelma-v2-beta-mobile-css" rel="stylesheet"/>
    <link href="/Content/Account/zelma-v2-beta-mobile-login-panel-css" rel="stylesheet"/>
    <link href="/Content/Theme/zelma-v2-beta-mobile-<?= $config['theme']; ?>-css" rel="stylesheet"/>

</head>

<body data-online-id=""
  data-route="login" style="--expand-icon-src: url(//d33egg70nrp50s.cloudfront.net/Images/icons/expand.gif?v=20241125);
  --collapse-icon-src: url(//d33egg70nrp50s.cloudfront.net/Images/icons/collapse.gif?v=20241125);
  --play-icon-src: url(//d33egg70nrp50s.cloudfront.net/Images/icons/play.png?v=20241125);
  --desktop-icon-src: url(//d33egg70nrp50s.cloudfront.net/Images/icons/desktop-white.png?v=20241125);
  --jquery-ui-444444-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_444444_256x240.png?v=20241125);
  --jquery-ui-555555-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_555555_256x240.png?v=20241125);
  --jquery-ui-ffffff-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_ffffff_256x240.png?v=20241125);
  --jquery-ui-777620-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_777620_256x240.png?v=20241125);
  --jquery-ui-cc0000-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_cc0000_256x240.png?v=20241125);
  --jquery-ui-777777-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_777777_256x240.png?v=20241125);">

      <input type="checkbox" id="site_menu_trigger_input" class="site-menu-trigger-input" />
      <div class="inner-body-container" id="inner_body_container">
        <div class="inner-body" id="scroll_container">
        
            <header class="site-header">
              <a href="/mobile/home" class="logo">
                <img alt="Logo" loading="lazy" src="/<?= $config['logo']; ?>" />
              </a>
              
              <?php if (isset($_SESSION['user_id'])): ?>
              <div class="header-info">
                <div class="unread-announcements-button" data-announcement-count="0" id="unread_announcements_button">
                  <a href="/mobile/messages/announcement">
                    <img loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/<?= $config['theme']; ?>/mobile/layout/bell.svg?v=20241125" />
                  </a>
                </div>
              </div>
              <?php endif; ?>
            
              <label class="site-menu-trigger" for="site_menu_trigger_input" data-new-notification="false">
                <i data-icon="menu"></i>
              </label>
            </header>

            <div class="standard-form-container login-outer-container">
              <div class="container">
                <div class="row">
                  <div class="col-sm-12">
                    <form action="/Account/Login" method="post">
                      <input type="hidden" name="csrf_token" value="<?= $csrf_token; ?>">
                      <div class="login-panel">
                        <div class="form-group">
                          <label>
                            Nama Pengguna
                          </label>
                          <input type="text" name="username" class="form-control" placeholder="Nama Pengguna" />
                        </div>
                        <div class="form-group standard-password-field">
                          <label>
                            Kata Sandi
                          </label>
                          <input type="password" name="password" class="form-control" placeholder="Kata Sandi" id="password_input" />
                          <i class="glyphicon glyphicon-eye-close" id="password_input_trigger"></i>
                        </div>
            
                        <div class="standard-button-group">
                          <a href="/mobile/forgot-password" class="forgot-password-link">
                            Lupa kata sandi Anda?
                          </a>
                        </div>
                        <div class="standard-button-group">
                          <input type="submit" class="standard-button" value="Masuk" />
                        </div>
                        <div class="standard-button-group register-field">
                          Belum punya akun?
                          <a href="/mobile/register" class="register-button">
                            Daftar Sekarang
                          </a>
                        </div>
                      </div>
                    </form>
                  </div>
                </div>
              </div>
            </div>

<?php 
include(__DIR__.'/layouts/footer.php');
include(__DIR__.'/layouts/sidebar.php');
?>

<div id="popup_modal" class="modal popup-modal" role="dialog" data-title="" aria-label="Popup Modal">
  <div class="modal-dialog">
    <div class="modal-content" style="--desktop-popup-alert-src: url(//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/<?= $config['theme']; ?>/desktop/layout/popup/alert.png?v=20241125);;--desktop-popup-notification-src: url(//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/<?= $config['theme']; ?>/desktop/layout/popup/notification.png?v=20241125);;--mobile-popup-alert-src: url(//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/<?= $config['theme']; ?>/mobile/layout/popup/alert.png?v=20241125);;--mobile-popup-notification-src: url(//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/<?= $config['theme']; ?>/mobile/layout/popup/notification.png?v=20241125);;--event-giveaway-popper-src: url(//d33egg70nrp50s.cloudfront.net/Images/giveaway/popper.png?v=20241125);">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
        <h4 class="modal-title" id="popup_modal_title">
        </h4>
      </div>
      <div class="modal-body" id="popup_modal_body">
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" data-dismiss="modal" id="popup_modal_dismiss_button">
          OK
        </button>
        <button type="button" class="btn btn-secondary" data-dismiss="modal" id="popup_modal_cancel_button" style="display: none">
          Tidak
        </button>
        <button type="button" class="btn btn-primary" id="popup_modal_confirm_button" style="display: none">
          Ya
        </button>
      </div>
    </div>
  </div>
</div>

<script src='/bundles/zelma-v2-beta-mobile-js' defer></script>
<script src='/bundles/Account/forgot-password-js' defer></script>

<script>
  window.addEventListener('DOMContentLoaded', () => {
    const passwordInputTrigger = document.querySelector('#password_input_trigger');
    const passwordInput = document.querySelector('#password_input');

    passwordInputTrigger.onclick = () => {
      if (passwordInput.type === 'password') {
        passwordInput.type = 'text';
        return;
      }

      passwordInput.type = 'password';
    };

    document.body.style.setProperty('--image-src', 'url(//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/<?= $config['theme']; ?>/mobile/layout/login/background.jpg?v=20241125)');

    initializeForgotPassword({
      platform: "Desktop",
      translations: {
        contactSupportToReset: "Jika Anda perlu mereset kata sandi Anda, silakan hubungi tim Dukungan Pelanggan kami untuk mendapatkan bantuan."
      }
    });
  });
</script>

<script type="text/javascript">
  navigator.serviceWorker.getRegistrations().then(registrations => {
    for (const registration of registrations) {
      registration.unregister();
    }
  });
</script>

<div class="search-popup-container" id="search_popup_container"></div>
<script src='/bundles/reserve-js' defer></script>

</body>
</html>
