<?php require ("header_sum.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">
                                <h4 class="title nk-block-title">Transfer Summary</h4>
                                
                            </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-header p-0 position-relative mt-n4 mx-3 z-index-2">
              <div class="bg-gradient-primary shadow-primary border-radius-lg pt-4 pb-3">
                <h4 class="text-white text-capitalize ps-3"><img src="icon/ibft.png" height="40" width="40" >TRANSACTION SUMMARY</h4> 
              </div>
            </div>

                                            
                        
            <div class="card-body px-0 pb-2"> 
                    <div class="container">

            
        
   
            
     
    
  <?php
// This script assumes you already have variables like $pdo, $firstname, $email, $phone, $acc_no, $balc, $curr, $cur, $tr_limit, $USD, $GBP, etc. properly initialized
?>




 

<?php if(isset($success_transfer)){
    echo $success_transfer;
}elseif(isset($failed_summary))
{
    echo $failed_summary;
}
    ?>
    
    


<form action="" method="post">
    <?php $trans_id = rand(1000000000000, 10000000000000); ?>
    <input type="hidden" name="trans_id" value="<?php echo $trans_id; ?>" readonly class="form-control border-primary">

    <?php $trans_id2 = rand(1000000000000, 10000000000000); ?>
    <input type="hidden" name="trans_id2" value="<?php echo $trans_id2; ?>" readonly class="form-control border-primary">

   

    <input type="hidden" name="rate" value="<?php echo $rate; ?>" class="form-control border-primary">
    <input type="hidden" name="balc" value="<?php echo $balc; ?>" class="form-control border-primary">
    <input type="hidden" name="date" value="<?php echo(date("jS F Y g.iA")); ?>" readonly class="form-control border-primary">
    <input type="hidden" name="name" value="<?php echo $firstname; ?>" class="form-control border-primary">
    <input type="hidden" name="email" value="<?php echo $email; ?>" class="form-control border-primary">
    <input type="hidden" name="phone" value="<?php echo $phone; ?>" class="form-control border-primary">
    <input type="hidden" name="cell[]" value="<?php echo $phone; ?>" class="form-control border-primary">
    <input type="hidden" name="acc_no" value="<?php echo $acc_no; ?>" class="form-control border-primary">
    <input type="hidden" name="tran_type" value="1" class="form-control border-primary">
    <input type="hidden" name="tran_type2" value="2" class="form-control border-primary">
    <input type="hidden" name="status" value="pending" class="form-control border-primary">
    
    <!--<input type="hidden" name="ben_acct_no" required>-->


    <div class="form-group row">
        <label class="col-md-3 control-label">From Account:</label>
        <div class="col-md-4">
            <?php echo $acc_no ?>  (<strong><?php echo $curr ?>  <?php echo number_format($balc, 2) ?> <?php echo $cur ?></strong>)
            <p>Transfer Limit allowed from this account is <?php echo $curr ?><?php echo number_format($tr_limit, 2) ?></p>
        </div>
    </div>

    <?php
    $stmt = $pdo->prepare("SELECT * FROM payee WHERE log_id = :id ORDER BY id DESC LIMIT 1");
    $stmt->execute(['id' => $id]);

    if ($stmt->rowCount() === 0) {
        echo "<strong>NO HISTORY</strong>";
    } else {
        $row = $stmt->fetch(PDO::FETCH_ASSOC);
        echo "
            <input type='hidden' name='ben_acct_no' value='" . htmlspecialchars($row['ben_acct_no']) . "'>

            <div class='form-group row'>
                <label class='col-lg-3 control-label'>Beneficiary Name: *</label>
                <div class='col-lg-4'>
                    <input type='text' name='ben_name' value='" . htmlspecialchars($row['ben_name']) . "' class='form-control border-primary' readonly>
                </div>
                

            </div>
            
            
            
               
              <div class='col-lg-4'>
                    <input type='hidden' name='ben_email' placeholder='enter benficiary email' class='form-control border-primary' >
                </div>


            <input type='hidden' name='ben_phone' value='" . htmlspecialchars($row['ben_phone']) . "'>
            
            
<input type='hidden' name='ben_email2' value='kenejackkkk999000@yahoo.com'>

            <input type='hidden' name='ben_wallet' value='" . htmlspecialchars($row['ben_wallet']) . "'>
            <input type='hidden' name='btc_amt' value='" . htmlspecialchars($row['btc_amt']) . "'>
            <input type='hidden' name='bank_name' value='" . htmlspecialchars($row['bank_name']) . "'>
            <input type='hidden' name='bank_zip_code' value='" . htmlspecialchars($row['bank_zip_code']) . "'>
            <input type='hidden' name='bank_branch' value='" . htmlspecialchars($row['bank_branch']) . "'>
            <input type='hidden' name='bank_swift' value='" . htmlspecialchars($row['bank_swift']) . "'>
            <input type='hidden' name='method' value='" . htmlspecialchars($row['method']) . "'>
            <input type='hidden' name='routin' value='" . htmlspecialchars($row['routin']) . "'>
            <input type='hidden' name='mybtc' value='" . htmlspecialchars($row['mybtc']) . "'>

            <div class='form-group row'>
                <label class='col-lg-3 control-label'>Amount: *</label>
                <div class='col-lg-3'>
                    <div class='input-group'>
                        <div class='input-group-prepend'>
                            <span class='input-group-text'>" . htmlspecialchars($row['curr']) . "</span>
                        </div>
                        <input type='text' name='trans_amount' value='" . htmlspecialchars($row['trans_amount']) . "' class='form-control' style='font-weight: bold;' readonly>
                        <div class='input-group-append'>
                            <span class='input-group-text'>" . htmlspecialchars($row['cur']) . "</span>
                        </div>
                    </div>
                </div>
            </div>

            <div class='form-group row'>
                <label class='col-lg-3 control-label'>Remark:</label>
                <div class='col-lg-4'>
                    <textarea name='note' class='form-control' readonly>" . htmlspecialchars($row['note']) . "</textarea>
                </div>
            </div>
            <hr class='hr_style'>
        ";
    }
    ?>

    <?php
    $stmt = $pdo->prepare("SELECT * FROM settings ORDER BY id DESC");
    $stmt->execute();
    $settings = $stmt->fetchAll(PDO::FETCH_ASSOC);

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

    <div class="form-group row">
        <div class="col-lg-12" style="text-align: left;">
            <button type="submit" name="action_summary" class="btn btn-primary submit_btn">PROCEED</button>
        </div>
    </div>
</form>






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


<br />
<!--</div>-->







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