<?php 
  $link_status1 = "";
  $link_status2 = "";
  $link_status3 = "active";

  include("includes/top-header.php"); 
  
  if(isset($_GET['account'])){
    $selected_account = $_GET['account'];
    
    $ssl = "select * from account where aNum='".$selected_account."'"; 
    $rs_t =  $conn->query($ssl); //run the query
    while($row = $rs_t->fetch_assoc()) { 
        $ab=$row['aBal'];
        $gotten_sym=$row['symbol'];
        $gotten_cur=$row['currency'];
    }
  }else{
    // header("Location: select-account.php");
  }
?>
  
  <!-- Content
  ============================================= -->
  <div id="content" class="py-4">
    <div class="container"> 
      
      <!-- Steps Progress bar -->
      <div class="row mt-4 mb-5">
        <div class="col-lg-11 mx-auto">
          <div class="row widget-steps">
          <div class="col-3 step active">
              <div class="step-name">Account</div>
              <div class="progress">
                <div class="progress-bar"></div>
              </div>
              <a href="#" class="step-dot"></a> </div> 
            <div class="col-3 step active">
              <div class="step-name">Details</div>
              <div class="progress">
                <div class="progress-bar"></div>
              </div>
              <a href="#" class="step-dot"></a> </div>
            <div class="col-3 step disabled">
              <div class="step-name">Confirm</div>
              <div class="progress">
                <div class="progress-bar"></div>
              </div>
              <a href="#" class="step-dot"></a> </div>
            <div class="col-3 step disabled">
              <div class="step-name">Success</div>
              <div class="progress">
                <div class="progress-bar"></div>
              </div>
              <a href="#" class="step-dot"></a> </div>
          </div>
        </div>
      </div>
      <h2 class="fw-400 text-center mt-3">Send Money</h2>
      <p class="lead text-center mb-4">Fill in the necessary details for this transaction</p>
      <div class="row">
        <div class="col-md-9 col-lg-7 col-xl-6 mx-auto">
          <div class="bg-white shadow-sm rounded p-3 pt-sm-4 pb-sm-5 px-sm-5 mb-4">
            <h3 class="text-5 fw-400 mb-3 mb-sm-4">Transaction Details</h3>
            <hr class="mx-n3 mx-sm-n5 mb-4">
            <!-- Send Money Form
            ============================ -->
            <form id="form-send-money" action="send-money-confirm.php" method="post">
              <div class="mb-3">
                <label for="bName" class="form-label">Bank</label>
                  <input type="hidden" name='pAcc' value="<?php echo $selected_account; ?>">
                <input type="text" value="" class="form-control" name="bName" id="bName" required placeholder="Enter Beneficiary's Bank Name">
              </div>
              <div class="mb-3">
                <label for="a" class="form-label">Beneficiary Account</label>
                <div class="input-group">
                  <input type="text" class="form-control" name="accNum" id="youSend" placeholder="Enter Account Number">
                </div>
              </div>
              <div class="mb-3">
                <label for="accName" class="form-label">Beneficiary Account Name</label>
                <input type="text" value="" class="form-control" name="accName" id="accName" required placeholder="Enter Account Name">
              </div>
              <div class="mb-3">
                <label for="youSend" class="form-label">Amount</label>
                <div class="input-group">
                  <span class="input-group-text"><?php echo $gotten_sym; ?></span>
                  <input type="number" class="form-control" name="amount" id="youSend" step="0.01" min="0" placeholder="0.00">
                    <input type="hidden" name="abal" value="<?php echo $ab; ?>">   
                    <input type="hidden" name='pAcc' value="<?php echo $selected_account; ?>"> 
                </div>
              </div>
              <div class="mb-3">
                <label for="recipientGets" class="form-label">Routing Number</label>
                <div class="input-group">
                  <input type="text" class="form-control" name="rout" id="recipientGets" placeholder="">
                </div>
              </div>
              <div class="mb-3">
                <label for="recipientGets" class="form-label">Swift Code</label>
                <div class="input-group">
                  <input type="text" class="form-control" name="swf" id="recipientGets" placeholder="">
                </div>
              </div>
              <div class="mb-4 mb-sm-5">
                <label for="description" class="form-label">Narration</label>
                <textarea class="form-control" rows="4" id="description" name="rem" required placeholder="Payment Description"></textarea>
              </div>
              <div class="d-grid"><button type="submit" name="mp" class="btn btn-primary">Continue</button></div>
            </form>
            <!-- Send Money Form end --> 
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- Content end --> 
  
  <!-- Footer
  ============================================= -->
  <?php include("includes/footer.php"); ?>
  <!-- Footer end --> 
  
</div>
<!-- Document Wrapper end --> 

<!-- Back to Top
============================================= --> 
<a id="back-to-top" data-bs-toggle="tooltip" title="Back to Top" href="javascript:void(0)"><i class="fa fa-chevron-up"></i></a> 

<!-- Styles Switcher -->

<!-- Styles Switcher End --> 

<!-- Script --> 
<script src="vendor/jquery/jquery.min.js"></script> 
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> 
<script src="vendor/bootstrap-select/js/bootstrap-select.min.js"></script> 
<!-- Style Switcher --> 
<script src="js/switcher.min.js"></script> 
<script src="js/theme.js"></script>
</body>
</html>