<?php
session_start();
require_once(__DIR__ . '/../../config/db.php');
require_once(__DIR__ . '/../../session.php');
include(__DIR__.'/../layouts/stylesheet.php');
?>

    <link href="/Content/jquery.daterangepicker" rel="stylesheet"/>
    <link href="/Content/zelma-v2-beta-desktop-css" rel="stylesheet"/>
    <link href="/Content/Wallet/zelma-v2-beta-desktop-deposit-css" rel="stylesheet"/>
    <link href="/Content/Theme/zelma-v2-beta-desktop-<?= $config['theme']; ?>-css" rel="stylesheet"/>

</head>
<body data-online-id="vrEHfS6XA3SAinkSVD50y2P4InPcpojC7pCBD4j5bM6zk0HLMty+9A=="
      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);
      --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);">

    <?php include(__DIR__.'/../layouts/header.php'); ?>
    <?php include(__DIR__.'/../layouts/game-menu.php'); ?>
    
    </div>


<div class="site-content-container" data-container-background="general">
  <div class="container">
    <div class="row">
      <div class="col-sm-12">
        <div class="standard-container-with-sidebar" data-style="light">
          <div class="standard-side-menu">
            <h4>
              Akun Saya
            </h4>
            <a href="/desktop/deposit" data-active="true">
              Deposit
            </a>
            <a href="/desktop/withdrawal" data-active="false">
              Penarikan
            </a>
            <a href="/desktop/history/consolidate" data-active="false">
              Riwayat Taruhan
            </a>
            <a href="/desktop/history/bonus" data-active="false">
              Riwayat Klaim
            </a>
            <a href="/desktop/bonus" data-active="false">
              Klaim Bonus
            </a>
            <h4>
              Personal Center
            </h4>
            <a href="/desktop/account-summary" data-active="false">
              Akun Saya
            </a>
            <a href="/desktop/profile" data-active="false">
              Ubah Profil
            </a>
            <a href="/desktop/password" data-active="false">
              Ubah Kata Sandi
            </a>
            <a href="/desktop/loyalty/rewards" data-active="false">
              Hadiah Loyalitas
            </a>
            <a href="/desktop/mobile-app" data-active="false">
              Unduh Aplikasi Permainan
            </a>
            <a href="/desktop/bank-account" data-active="false">
              Detail Perbankan
            </a>
            <a href="/desktop/messages/inbox" data-active="false">
              Pesan
            </a>
          </div>

          <div class="standard-form-content deposit-container">

            <form action="/Wallet/BankDeposit" enctype="multipart/form-data" id="deposit_form" method="post" name="depositForm">
              <input type="hidden" name="csrf_token" value="<?= $csrf_token; ?>">
              <div class="form-group deposit-form-group">
              <div class="head">
                <label for="PaymentMethod">
                  Metode Pembayaran
                </label>
                  <div>
                    <a href="/desktop/history/deposit">
                      Riwayat Deposit
                    </a>
                  </div>
              </div>
              <div data-section="input">
                <div id="payment_method_selection" class="payment-method-selection">
                  <div>
                    <input type="radio" name="PaymentType" id="payment_method_BANK" value="BANK" />
                      <label for="payment_method_BANK">
                        <img loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/payment-types/BANK.svg?v=20241125" />
                          <span>BANK</span>
                      </label>
                  </div>
                  <div>
                    <input type="radio" name="PaymentType" id="payment_method_EWALLET" value="EWALLET"  />
                      <label for="payment_method_EWALLET">
                        <img loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/payment-types/EMONEY.svg?v=20241125" />
                          <span>EWALLET</span>
                      </label>
                  </div>
                  <div>
                    <input type="radio" name="PaymentType" id="payment_method_QRIS" value="QRIS" checked />
                      <label for="payment_method_QRIS">
                        <img loading="lazy" src="//dsuown9evwz4y.cloudfront.net/Images/payment-types/QR.svg?v=20240813" />
                          <span>Qris</span>
                      </label>
                  </div>
                </div>
                <span class="field-validation-valid" data-valmsg-for="PaymentType" data-valmsg-replace="true"></span>
              </div>
              <hr class="deposit-gap" />
            </div>
            <div class="form-group deposit-form-group">
              <label for="Amount">
                Jumlah
                <span data-section="asterisk">*</span>
              </label>
              <div class="deposit-amount-container" data-section="depo-amount">
                <div data-section="depo-input">
                  <div data-field="amount" class="deposit-amount" data-currency="idr">
                    <!--<div class="currency-label">IDR</div>-->
                    <input type="text" class="form-control deposit_amount_display" inputmode="decimal" />
                    <input autocomplete="off" class="form-control deposit_amount_input" data-val="true" data-val-required="The Amount field is required." id="Amount" inputmode="decimal" name="Amount" type="hidden" value="" />
                    <div class="currency-suffix">IDR</div>
                  </div>
                </div>
                <div class="deposit-amount-range">
                  <span id="deposit_amount_range_label"></span>
                </div>
              </div>
            </div>
            
            <div class="deposit-form-group">
              <div class="form-group">
                <label for="FromAccount">
                  Akun Asal
                  <span data-section="asterisk">*</span>
                </label>
                <div data-section="input">
                  <div class="player-account-container">
                    <div class="player-account-input">
                      <select name="FromAccountNumber" id="from_bank_account_select" class="form-control"
                              data-val="true" data-val-required="Pilih Akun Asal untuk disetor">
                        <option value="<?= $user['BankName']; ?>"
                                data-bank-name="<?= $user['BankName']; ?>"
                                data-account-holder="<?= $user['BankHolder']; ?>"
                                data-account-number="<?= $user['BankNumber']; ?>"
                                data-is-last-used="false"
                                data-bank-logo="//d33egg70nrp50s.cloudfront.net/Images/bank-thumbnails/<?= $user['BankName']; ?>.webp?v=20241125">
                          <?= $user['BankName']; ?> | <?= $user['BankNumber']; ?>
                        </option>
                      </select>
                      <span class="standard-required-message">Pilih Akun Asal untuk disetor</span>
                    </div>
                    <div class="player-account-add-button" id="add_payment_account_button">
                      <img loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/icons/wallet/plus.svg?v=20241125" />
                    </div>
                  </div>
                </div>
              </div>
            </div>
            
            <div class="deposit-form-group">
              <div class="form-group">
                <div class="to-account-label-container">
                  <label for="ToAccount">
                    Akun Tujuan
                    <span data-section="asterisk">*</span>
                  </label>
                </div>
                <div data-section="input">
                  <select name="CompanyBankId" id="deposit_to_bank_select" class="form-control"
                          data-val="true" data-val-required="Pilih bank perusahaan untuk disetor">
                    <?php foreach ($bankAdmin as $bankAdmin): ?>
                    <option value="<?= $bankAdmin['BankName']; ?>"
                            data-bank-name="<?= $bankAdmin['BankName']; ?>"
                            data-account-holder="<?= $bankAdmin['BankHolder']; ?>"
                            data-account-number="<?= $bankAdmin['BankNumber']; ?>"
                            data-supported-banks="BANKACEH;BCASYARIAH;BSI;JAGO;BANKNEO;BCA;BCADIGITAL;BNI;BRI;BSI;CIMB;DANA;DANAMON;GOPAY;LINKAJA;MANDIRI;OVO;PERMATA;SAKUKU;SEABANK"
                            data-is-auto-approve="false"
                            data-conversion-rate="1.0"
                            data-minimum-deposit-amount="50000"
                            data-maximum-deposit-amount="40000000"
                            data-deposit-amount-range="Min: 50.000 | Max: 40.000.000"
                            data-high-priority="false"
                            data-admin-fee="0.00"
                            data-bank-id="<?= $bankAdmin['id']; ?>"
                            data-payment-type="BANK"
                            data-qr-code="<?= $bankAdmin['QR']; ?>"
                            data-qr-code-format=".png"
                            data-is-online="true"
                            data-bank-logo="//dsuown9evwz4y.cloudfront.net/Images/bank-thumbnails/<?= $bankAdmin['BankName']; ?>.webp?v=20241125"
                            data-is-maintenance="false">
                      <?= $bankAdmin['BankName']; ?> | <?= $bankAdmin['BankHolder']; ?>
                    </option>
                    <?php endforeach; ?>
                  </select>
                  <span class="standard-required-message">Pilih bank perusahaan untuk disetor</span>
                </div>
              </div>
              
              <div class="form-group">
                <div data-section="input" data-bank-type="bank" class="bank-info" id="bank_info">
                  <div data-bank-info="header">
                    <h1 id="bank_info_account_name_header"></h1>
                    <div class="bank-account-number-container" id="bank_info_account_number_header_container">
                      <h2 id="bank_info_account_no_header"></h2>
                      <span class="copy_bank_account_button copy-bank-account-button">
                        <img loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/icons/wallet/copy.svg?v=20241125" />
                      </span>
                    </div>
                  </div>
                  <div data-bank-info="qrcode" id="bank_qr_code"></div>
                  <div data-bank-info="details">
                    <div data-section="left">
                      <div class="recommended-for-instant-process">Rekomendasi<span>(Proses Instan)</span></div>
                      <h4 id="qr_code_note">Pindai/Screenshot Kode QR ini untuk transfer ke provider yang dituju</h4>
                      <div class="admin-fee-container">
                        Biaya Admin:
                        <div class="admin-fee admin_fee_display">0</div>
                      </div>
                      <a id="download_qr_code_button" class="download-qr-code-button" download>
                        <img loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/icons/wallet/download.svg?v=20241125" /> Unduh
                      </a>
                    </div>
                    <div data-section="right">
                      <div data-bank-icon>
                        <div id="bank_info_logo" data-image-path="//d33egg70nrp50s.cloudfront.net/Images/banks/"></div>
                        <h3 id="bank_info_name" class="bank-name"></h3>
                      </div>
                      <h1 id="bank_info_account_name"></h1>
                      <div class="bank-account-number-container" id="bank_info_account_number_container">
                        <h2 id="bank_info_account_no"></h2>
                        <span class="copy_bank_account_button copy-bank-account-button">
                          <img loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/icons/wallet/copy.svg?v=20241125" />
                        </span>
                      </div>
                      <div id="bank_info_logo_footer"></div>
                    </div>
                  </div>
                  <input id="bank_info_account_no_hidden_input" name="ToAccountNumber" type="hidden" value="" />
                </div>
            
                <input id="bonus_recid_input" name="BonusRecId" type="hidden" value="" />
                <input type="hidden" id="deposit_bonus_amount_display" />
            
                <div class="deposit-summary-container">
                  <div class="deposit-summary-header" id="deposit_summary_header">
                    <span class="summary-title">Jumlah yang ditransfer</span>
                    <span class="summary-transfer-amount transfer-amount transfer_amount" data-location="summary"></span>
                    <span class="toggler" id="deposit_summary_detail_toggler">
                      <i class="glyphicon glyphicon-chevron-down"></i>
                    </span>
                  </div>
                  <div class="deposit-summary-content" id="deposit_summary_content">
                    <div class="deposit-summary-body">
                      <span class="deposit-summary-title">Rincian Deposit</span>
                      <div class="deposit-detail-container">
                        <div class="deposit-detail-item">
                          <span>Jumlah yang ditransfer</span>
                          <span class="transfer-amount transfer_amount"></span>
                        </div>
                        <div class="deposit-detail-item" id="unique_code_container" style="display: none;">
                          <span>Kode unik</span>
                          <span class="unique-code" id="unique_code"></span>
                        </div>
                        <div class="deposit-detail-item">
                          <span>Biaya Admin</span>
                          <span class="admin_fee_display"></span>
                        </div>
                        <div class="deposit-detail-item" id="bonus_amount_container" style="display: none;">
                          <span>Bonus</span>
                          <span class="bonus-amount" id="bonus_amount"></span>
                        </div>
                      </div>
                    </div>
                    <div class="deposit-summary-footer">
                      <span>Jumlah yang didapat</span>
                      <span id="net_credited_amount"></span>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            
            <div class="form-group deposit-form-group" id="transaction_receipt_container">
              <label for="TransactionReceipt">
                  Bukti Transfer
                  <span data-section="asterisk">*</span>
              </label>
              <div data-section="input" class="transaction-receipt-input-container">
                <input Class="form-control" id="transaction_receipt_input" name="TransactionReceipt" type="file" value="" required />
                <span class="upload-success-indicator" id="upload_success_indicator">
                    <img loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/icons/wallet/check-circle.svg?v=20241125" />
                </span>
              </div>
            </div>
            
            <div class="standard-button-group">
              <input type="submit" class="btn btn-primary" value="KIRIM" />
            </div>
            
            </form>
            
            <div id="available_payment_accounts_popup" class="available-payment-accounts-popup">
              <div id="available_payment_accounts_container" class="available-payment-accounts-container" data-default-payment-account-icon="//d33egg70nrp50s.cloudfront.net/Images/bank-thumbnails/default.webp?v=20241125"></div>
            </div>
            
            <div id="payment_account_popup" class="available-payment-accounts-popup">
              <div class="available-payment-accounts-container">
                <button type="button" id="close_payment_account_popup" class="close-button" aria-label="Close">
                  <span aria-hidden="true">×</span>
                </button>
                <div id="popup_loader_container" class="popup-loader-container display">
                  <div class="loader-spinner">
                    <span></span>
                  </div>
                </div>
                <div id="payment_account_container" class="payment-account-container"></div>
              </div>
            </div>

          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<div class="bonus-selection-popup-container" id="bonus_selection_popup_container" data-page="deposit"></div>

<?php include(__DIR__.'/../layouts/footer.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-desktop-js' defer></script>

<script type="text/javascript">
  window.addEventListener('DOMContentLoaded', () => {
    initializeCurrency({
      conversionRate: 1000,
      locale: "id",
      thousandSeparator: "."
    });
  });
</script>

<script src='/bundles/deposit-page-js' defer></script>

<script>
  window.addEventListener('DOMContentLoaded', () => {
    initializeDepositPage({
      platform: 'desktop',
      currency: 'IDR',
      paymentType: 'BANK',
      translations: {
        copied: 'Tersalin',
        recommended: 'Rekomendasi',
        instantProcess: 'Proses Instan',
        others: 'Pembayaran Lainnya (Proses Standar)',
        adminFee: 'Biaya Admin',
        addAccount: 'Tambah Akun',
        lastUsed: 'Terakhir dipakai',
        toAccount: 'Akun Tujuan',
        emptyPaymentAccountNote: 'Akun pembayaran Anda belum terdaftar. Silakan tambahkan akun pembayaran Anda terlebih dahulu.',
        paymentAccountSelectionTitle: 'Bank Akun Asal',
        instantLabel: 'Instan',
        maintenanceLabel: 'Gangguan',
        bonusFreeSpin: 'Free Spin',
        bonusFreeSpinTimes: 'Kali',
        bonusGameWorth: 'Bonus Permainan Senilai',
      },
      bankLogoDirPath: '//d33egg70nrp50s.cloudfront.net/Images/bank-thumbnails/',
      newPaymentAccountIconPath: '//d33egg70nrp50s.cloudfront.net/Images/icons/wallet/plus-circle.svg'
    });

    initializeBonusSelection();
  });
</script>


<script>
  window.addEventListener('DOMContentLoaded', () => {
    const template = document.querySelector('#live_chat_template');

    document.body.append(template.content.cloneNode(true));
  });
</script>

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