<?php
    // お問い合わせ入力画面のURL
    define("CONTACT_URL", "https://tradehosting.xyz");

    // 設定
    require_once (dirname(__FILE__). '/mail_common/confirm.php');

    // ファイルのアップロード
    //fileUpload($_FILES);
    $title = 'BitRush Application Form';
    $title_data_lang = 'h1';
    require_once (dirname(__FILE__). '/_parts/header.php');
?>
        <form class="needs-validation row g-3" action="thanks.php" method="post" enctype="multipart/form-data" novalidate>
          <input type="hidden" name="token" value="<?php echo $_SESSION['token'];?>">

          <!-- fullName -->
          <div class="col-md-12">
            <label class="fw-bold d-flex align-items-center" data-lang="fullName" for="fullName">User　ID<span class="badge bg-danger ms-1">Required</span></label>
            <div><?php echo $_POST['fullName']; ?></div>
            <input type="hidden" name="fullName" value="<?php echo $_POST['fullName']; ?>">
          </div>

          <!-- country -->
          <div class="col-md-12">
            <label class="fw-bold d-flex align-items-center" for="country">Country<span class="badge bg-danger ms-1">Required</span></label>
            <div><?php echo $_POST['country']; ?></div>
            <input type="hidden" name="country" value="<?php echo $_POST['country']; ?>">
          </div>

          <!-- tell -->
          <div class="col-md-12">
            <label class="fw-bold" data-lang="tell" for="tell">Phone number<span class="badge bg-danger ms-1">Required</span></label>
            <div><?php echo $_POST['tell']; ?></div>
            <input type="hidden" name="tell" value="<?php echo $_POST['tell']; ?>">
          </div>

          <!-- introducer -->
          <div class="col-md-12">
            <label class="fw-bold d-flex align-items-center" data-lang="introducer" for="introducer">Referrer User ID<span class="badge bg-danger ms-1">Required</span></label>
            <div><?php echo $_POST['introducer']; ?></div>
            <input type="hidden" name="introducer" aria-describedby="introducerHelp" value="<?php echo $_POST['introducer']; ?>">
          </div>

          <!-- Connection User ID -->
          <div class="col-md-12">
            <label class="fw-bold d-flex align-items-center" for="connUserId">Connection User ID</label>
            <div><?php echo $_POST['connUserId']; ?></div>
            <input type="hidden" name="connUserId" aria-describedby="connUserIdHelp" value="<?php echo $_POST['connUserId']; ?>">
            <small id="connUserIdHelp" class="form-text">If not filled in, it will be positioned to the left of the left group of the referrer.</small>
          </div>

          <!-- RIGHT or LEFT -->
          <div class="col-md-12">
            <label class="fw-bold d-flex align-items-center" for="connGroup">RIGHT or LEFT</label>
            <div><?php echo $_POST['connGroup']; ?></div>
            <input type="hidden" name="connGroup" aria-describedby="connGroupHelp" value="<?php echo $_POST['connGroup']; ?>">
            <small id="connGroupHelp" class="form-text">If not selected, it will be positioned to the left of the connected user.</small>
          </div>

          <!-- Gmail address for Bustabit -->
          <div class="col-md-12">
            <label class="fw-bold d-flex align-items-center" for="email">Gmail address for Bustabit<span class="badge bg-danger ms-1">Required</span></label>
            <div><?php echo $_POST['email']; ?></div>
            <input type="hidden" name="email" aria-describedby="emailHelp" value="<?php echo $_POST['email']; ?>">
          </div>

          <!-- Gmail password for Bustabit -->
          <div class="col-md-12">
            <label class="fw-bold d-flex align-items-center" for="gmailPassBustabit">Gmail password for Bustabit<span class="badge bg-danger ms-1">Required</span></label>
            <div><?php echo $_POST['gmailPassBustabit']; ?></div>
            <input type="hidden" name="gmailPassBustabit" aria-describedby="gmailPassBustabitHelp" value="<?php echo $_POST['gmailPassBustabit']; ?>">
          </div>

          <!-- Application Plans -->
          <div class="col-md-12">
            <label class="fw-bold d-flex align-items-center" for="applicationPlans">Application Plans<span class="badge bg-danger ms-1">Required</span></label>
            <div><?php echo $_POST['applicationPlans']; ?></div>
            <input type="hidden" name="applicationPlans" aria-describedby="applicationPlansHelp" value="<?php echo $_POST['applicationPlans']; ?>">
          </div>

          <!-- text:usdt_address -->
          <div class="col-md-12">
            <label class="fw-bold" data-lang="usdtAddressLabel" for="usdt_address">Your USDT address<span class="badge bg-danger ms-1">Required</span></label>
            <div><?php echo $_POST['usdt_address']; ?></div>
            <input type="hidden" name="usdt_address" value="<?php echo $_POST['usdt_address']; ?>">
          </div>

          <!-- radio:usdtNet -->
          <div class="col-md-12">
            <label class="fw-bold" data-lang="usdtAddressNet">USDT Network</label>
            <div><?php if (!empty($_POST['usdtNet'])) echo $_POST['usdtNet']; ?></div>
            <input type="hidden" name="usdtNet" value="<?php if(!empty($_POST['usdtNet'])) echo $_POST['usdtNet']; ?>">
          </div>

          <!-- text:transaction -->
          <div class="col-md-12">
            <label class="fw-bold" for="transaction">If you have already paid the setup fee, please list the transaction.</label>
            <div><?php echo $_POST['transaction']; ?></div>
            <input type="hidden" name="transaction" value="<?php echo $_POST['transaction']; ?>">
          </div>

          <?php /*
          <!-- radio:senninPlan -->
          <div class="col-md-12">
            <label class="fw-bold">パートナー会員２を選択された方は、下記の割引プランのどちらかを選択してください。</label>
            <div><?php echo $_POST['senninPlan']; ?></div>
            <input type="hidden" name="senninPlan" value="<?php echo $_POST['senninPlan']; ?>">
          </div>
          */ ?>

          <?php /*
          <div data-lang="personalReg">＜個人登録＞</div>

          <!-- file:selfie -->
          <div class="col-md-12">
            <label class="fw-bold" data-lang="selfie">①セルフィー（本人と身分証明書を持った写真、写真部分が映るようにしてください）</label>
            <div><?php echo $_FILES['selfie']['name']; ?></div>
            <input type="hidden" name="files[selfie]" value="<?php if(!empty($file_names['selfie'])) echo $file_names['selfie']; ?>">
          </div>

          <!-- file:idCard -->
          <div class="col-md-12">
            <label class="fw-bold" data-lang="idCard">②身分証明書（免許証表面 or パスポート）</label>
            <div><?php echo $_FILES['idCard']['name']; ?></div>
            <input type="hidden" name="files[idCard]" value="<?php if(!empty($file_names['idCard'])) echo $file_names['idCard']; ?>">
          </div>

          <!-- file:idCard2 -->
          <div class="col-md-12">
            <label class="fw-bold" data-lang="idCard2">③身分証明書（免許証裏面）</label>
            <div><?php echo $_FILES['idCard2']['name']; ?></div>
            <input type="hidden" name="files[idCard2]" value="<?php if(!empty($file_names['idCard2'])) echo $file_names['idCard2']; ?>">
          </div>

          <div data-lang="corprateReg">＜法人登録＞</div>

          <!-- file:corporationSelfie -->
          <div class="col-md-12">
            <label class="fw-bold" data-lang="selfie">①セルフィー（本人と身分証明書を持った写真、写真部分が映るようにしてください）</label>
            <div><?php echo $_FILES['corporationSelfie']['name']; ?></div>
            <input type="hidden" name="files[corporationSelfie]" value="<?php if(!empty($file_names['corporationSelfie'])) echo $file_names['corporationSelfie']; ?>">
          </div>

          <!-- file:corporationIdCard -->
          <div class="col-md-12">
            <label class="fw-bold" data-lang="idCard">②身分証明書（免許証表面 or パスポート）</label>
            <div><?php echo $_FILES['corporationIdCard']['name']; ?></div>
            <input type="hidden" name="files[corporationIdCard]" value="<?php if(!empty($file_names['corporationIdCard'])) echo $file_names['corporationIdCard']; ?>">
          </div>

          <!-- file:corporationIdCard2 -->
          <div class="col-md-12">
            <label class="fw-bold" data-lang="idCard2">③身分証明書（免許証裏面）</label>
            <div><?php echo $_FILES['corporationIdCard2']['name']; ?></div>
            <input type="hidden" name="files[corporationIdCard2]" value="<?php if(!empty($file_names['corporationIdCard2'])) echo $file_names['corporationIdCard2']; ?>">
          </div>

          <!-- file:allHistoryCertificate -->
          <div class="col-md-12">
            <label class="fw-bold" data-lang="allHistoryCertificate">④全部履歴証明書</label>
            <div><?php echo $_FILES['allHistoryCertificate']['name']; ?></div>
            <input type="hidden" name="files[allHistoryCertificate]" value="<?php if(!empty($file_names['allHistoryCertificate'])) echo $file_names['allHistoryCertificate']; ?>">
          </div>

          <!-- text:allHistoryCertificate -->
          <div class="col-md-12">
            <label class="fw-bold" data-lang="companyUrl" for="companyUrl">⑤法人番号公表サイトなど（法人URLページを貼り付け）</label>
            <div><?php echo $_POST['companyUrl']; ?></div>
            <input type="hidden" name="companyUrl" value="<?php if(!empty($_POST['companyUrl'])) echo $_POST['companyUrl']; ?>">
          </div>

          */ ?>

          <p>If there is no mistake in the content, click the “Send” button.</p>
          <div class="d-grid gap-2 col-6 mx-auto mb-3">
            <button class="c-btn btn btn-lg btn-block my-5 w-100" data-lang="submit" type="submit">Send</button>
          </div>

          <input type="hidden" name="action" value="submit">
        </form>

      </div>

    </main>

    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" ></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" ></script>

<script>
    // 無効なフィールドがある場合にフォーム送信を無効にするスターターJavaScriptの例
    (function() {
        'use strict';

        window.addEventListener('load', function() {
            // カスタムブートストラップ検証スタイルを適用するすべてのフォームを取得
            var forms = document.getElementsByClassName('needs-validation');
            // ループして帰順を防ぐ
            var validation = Array.prototype.filter.call(forms, function(form) {
                // submitボタンを押したら以下を実行
                form.addEventListener('submit', function(event) {
                    if (form.checkValidity() === false) {
                        event.preventDefault();
                        event.stopPropagation();
                    }
                    form.classList.add('was-validated');
                }, false);
            });
        }, false);
    })();
</script>

  </body>
</html>
