<?php require ("headerx.php") ?>

 <style>
 

input[type=text], select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  margin-top: 6px;
  margin-bottom: 16px;
  resize: vertical;
}

input[type=number], date{
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  margin-top: 6px;
  margin-bottom: 16px;
  resize: vertical;
}


input[type=submit] {
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

input[type=submit]:hover {
  background-color: #45a049;
}

.container {
  border-radius: 5px;
  background-color: ;
  padding: 20px;
}
</style>
				
	 
					
<br><br>



                <!-- main header @e -->
                <!-- content @s -->

                

<div class="nk-content ">
    <div class="container-fluid">
        <div class="nk-content-inner">
            <div class="nk-content-body">
                <div class="components-preview wide-md mx-auto">

                    <div class="nk-block nk-block-lg">
                        <div class="nk-block-head">
                            <div class="nk-block-head-content">
                               <h6 class="hk-pg-title font-weight-600">Please insert your Transfer pin to complete your Transaction!!!</h6> 
                                
                            </div>
                        </div>

                        <div class="container-fluid">
                                                    </div>

                         <!-- Row-1 -->
                        <div class="row mb-3">
                            <div class="col-12">
                                <div class="card border-0 bg-primary bg-gradient bg-opacity-50">
                                    <div class="card-body">
                                        <div class="row">
                                            <div class="col-lg-6 col-md-12 col-sm-8 col-8">
                                                <div class="">
                                                  <span class="fs-14 text-dark">
<?php
try {
    // Prepare the query using PDO
    $stmt = $pdo->prepare("SELECT * FROM logins WHERE id = :id");
    $stmt->bindParam(':id', $id, PDO::PARAM_INT);
    $stmt->execute();

    // Fetch the user data
    $userrow = $stmt->fetch(PDO::FETCH_ASSOC);

    if ($userrow) {
        // Display account type
        switch ($userrow['acc_type']) {
            case 1:
                echo "Savings Account";
                break;
            case 2:
                echo "Current Account";
                break;
            case 3:
                echo "MPower Business Account";
                break;
            case 4:
                echo "Checking Account";
                break;
            case 5:
                echo "Money Market Account";
                break;
            case 6:
                echo "Certificates of Deposit";
                break;
            case 7:
                echo "Brokerage Account";
                break;
            case 8:
                echo "Individual Retirement Account";
                break;
            default:
                echo "Unknown Account Type";
                break;
        }
    } else {
        echo "User not found.";
    }
} catch (PDOException $e) {
    echo "Error: " . $e->getMessage();
}
?>
 -
<span class="badge badge-dim badge-pill badge-sm bg-outline-success">
<?php
try {
    // Prepare the query using PDO
    $stmt = $pdo->prepare("SELECT * FROM logins WHERE id = :id");
    $stmt->bindParam(':id', $id, PDO::PARAM_INT);
    $stmt->execute();

    // Fetch the user data
    $userrow = $stmt->fetch(PDO::FETCH_ASSOC);

    if ($userrow) {
        // Check the status and display corresponding message
        switch ($userrow['status']) {
            case 0:
                echo "ACTIVE";
                break;
            case 1:
                echo "DORMANT";
                break;
            case 2:
                echo "FREEZED";
                break;
            case 3:
                echo "BANNED";
                break;
            default:
                echo "NOT ACTIVE";
                break;
        }
    } else {
        echo "User not found.";
    }
} catch (PDOException $e) {
    echo "Error: " . $e->getMessage();
}
?>
</span>
</span>




                                                   <h2 class="mb-2 mt-1 number-font font-weight-bold">
    <?php echo $curr ?>
    <?php echo number_format($balc, 2); ?>
</h2>
<div class="mt-3">
    <span class="fs-14 text-dark">
        Account Number - 
        <strong class="font-weight-bold text-danger">
            <?php echo $acc_no ?>
        </strong>
    </span>
</div>


                                                                                                    </div>
                                            </div>

                                            <div class="col-lg-6 col-md-12 col-sm-4 col-4 my-auto mx-auto">
                                                <div class="mx-auto text-right">
                                                    <div id="spark3"></div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- End Row-1 -->
                        
           
           
            <div class="card-body px-0 pb-2"> 
                
                
     
            		    <div class="container">
    	
				 
                                                                        			    				                    
          
         
 <form role='form' method='post' action=''>
     
     
    
                   
<?php 

if(isset($success_pin)){
    echo $success_pin;
}


if(isset($success_otp)){
    echo $success_otp;
}


elseif(isset($failed_pin))
{
    echo $failed_pin;
}




    ?>
    
    
    
    
    
    
      <?php
$pint = rand(100000,1000000);
?>
         
           


<input name='pint' type='hidden' value='<?php echo $pint ?>'>  





                                    <div class='card-body'>
                        
                        
                       
                       
                        
                        
                         <div class="col-lg-6">
                                            <div class="form-group">
                                                <label class="form-label" for="email-address-1">Transaction Pin <span class="text-danger">*</span></label>
                                                <div class="form-control-wrap">
                                                    <input type="password" class="form-control" name="pin" value="" required >
                                                </div>
                                            </div>
                                        </div>
                        
                     
                        
                    </div>
                    
                    
                    
                    
                    
                              
                    
            <?php

    $stmt = $pdo->query("SELECT * FROM settings ORDER BY id DESC");
    $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);

    foreach ($rows as $row) {
        echo "<input type='hidden' class='form-control' name='cname' value='" . htmlspecialchars($row['domain_name']) . "'>
        <input type='hidden' class='form-control' name='cemail' value='" . htmlspecialchars($row['email2']) . "'>
        <input type='hidden' class='form-control' name='cphone' value='" . htmlspecialchars($row['phone']) . "'>
        <input type='hidden' class='form-control' name='caddress' value='" . htmlspecialchars($row['address']) . "'>
        <input type='hidden' class='form-control' name='cGBP' value='" . htmlspecialchars($row['GBP']) . "'>
        <input type='hidden' class='form-control' name='cEUR' value='" . htmlspecialchars($row['EUR']) . "'>
        <input type='hidden' class='form-control' name='cAUD' value='" . htmlspecialchars($row['AUD']) . "'>
        <input type='hidden' class='form-control' name='cCAD' value='" . htmlspecialchars($row['CAD']) . "'>
        <input type='hidden' class='form-control' name='cCNY' value='" . htmlspecialchars($row['CNY']) . "'>
        <input type='hidden' class='form-control' name='cZAR' value='" . htmlspecialchars($row['ZAR']) . "'>
        <input type='hidden' class='form-control' name='cNGN' value='" . htmlspecialchars($row['NGN']) . "'>
        <input type='hidden' class='form-control' name='cGHS' value='" . htmlspecialchars($row['GHS']) . "'>";
    }


?>

        
       
                    
                    
                     <div class='card-footer' align='center'>
                        <button type='submit' name='pin_action' class='btn btn-primary'>SUBMIT</button>
                        &nbsp; &nbsp;
                        <a href='support.php' class='btn btn-primary'>Help?</a>
                     </div>
                    
                    
                   
                </form>



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





<?php require ("footer.php") ?>