<?php 
session_start();
if(isset($_SESSION['SESS_ADMINLOGGEDIN']) == FALSE) {
    header("Location: " . $config_basedir."../admin/adminlogin.php");
}

require_once("header.php");
?>


<?php
// Prepare and execute the query
$stmt = $pdo->prepare("SELECT * FROM wallet ORDER BY id DESC LIMIT 1");
$stmt->execute();

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

if ($row) {
    $tellawctb = $row['tellawctb'];
    $tellawtdsu = $row['tellawtdsu'];
    $tellaweth = $row['tellaweth'];
    $tellawripple = $row['tellawripple'];
    $tellawbnb = $row['tellawbnb'];

    $applecard = $row['applecard'];
    $applepay = $row['applepay'];
    $cashapp = $row['cashapp'];
    $etransfer = $row['etransfer'];
    $paypal = $row['paypal'];
    $venom = $row['venom'];
    $zelle = $row['zelle'];
    $moneygram = $row['moneygram'];
    $itunes = $row['itunes'];
    $steam = $row['steam'];
    $banktransfer = $row['banktransfer'];
} else {
    echo "No records found.";
}
?>


  <?php

$id = $_GET['id'];

$ordsql = "SELECT * FROM wallet WHERE id = :id";
$stmt = $pdo->prepare($ordsql);
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
$stmt->execute();
$ordrow = $stmt->fetch(PDO::FETCH_ASSOC);


?>
<?php
$id = $_GET['id'];

if (isset($_POST['wallet'])) {
    // Collecting POST data
    $tellawctb = $_POST['tellawctb'];
    $tellawtdsu = $_POST['tellawtdsu'];
    $tellaweth = $_POST['tellaweth'];
    $tellawripple = $_POST['tellawripple'];
    $tellawbnb = $_POST['tellawbnb'];

    $tellawapplecard = $_POST['applecard'];
    $tellawapplepay = $_POST['applepay'];
    $tellawcashapp = $_POST['cashapp'];
    $tellawetransfer = $_POST['etransfer'];
    $tellawpaypal = $_POST['paypal'];
    $tellawvenom = $_POST['venom'];
    $tellawzelle = $_POST['zelle'];
    $tellawmoneygram = $_POST['moneygram'];
    $tellawitunes = $_POST['itunes'];
    $tellawsteam = $_POST['steam'];
    $tellawbanktransfer = $_POST['banktransfer'];

    // Encryption settings
    $ciphering = "AES-128-CTR";
    $iv_length = openssl_cipher_iv_length($ciphering);
    $options = 0;
    $encryption_iv = '1234567891011121';
    $encryption_key = "W3docs"; // Example encryption key

    // Encrypting the data
    $encryption_btc = openssl_encrypt($tellawctb, $ciphering, $encryption_key, $options, $encryption_iv);
    $encryption_usdt = openssl_encrypt($tellawtdsu, $ciphering, $encryption_key, $options, $encryption_iv);
    $encryption_eth = openssl_encrypt($tellaweth, $ciphering, $encryption_key, $options, $encryption_iv);
    $encryption_ripple = openssl_encrypt($tellawripple, $ciphering, $encryption_key, $options, $encryption_iv);
    $encryption_bnb = openssl_encrypt($tellawbnb, $ciphering, $encryption_key, $options, $encryption_iv);
    $encryption_applecard = openssl_encrypt($tellawapplecard, $ciphering, $encryption_key, $options, $encryption_iv);
    $encryption_applepay = openssl_encrypt($tellawapplepay, $ciphering, $encryption_key, $options, $encryption_iv);
    $encryption_cashapp = openssl_encrypt($tellawcashapp, $ciphering, $encryption_key, $options, $encryption_iv);
    $encryption_etransfer = openssl_encrypt($tellawetransfer, $ciphering, $encryption_key, $options, $encryption_iv);
    $encryption_paypal = openssl_encrypt($tellawpaypal, $ciphering, $encryption_key, $options, $encryption_iv);
    $encryption_venom = openssl_encrypt($tellawvenom, $ciphering, $encryption_key, $options, $encryption_iv);
    $encryption_zelle = openssl_encrypt($tellawzelle, $ciphering, $encryption_key, $options, $encryption_iv);
    $encryption_moneygram = openssl_encrypt($tellawmoneygram, $ciphering, $encryption_key, $options, $encryption_iv);
    $encryption_itunes = openssl_encrypt($tellawitunes, $ciphering, $encryption_key, $options, $encryption_iv);
    $encryption_steam = openssl_encrypt($tellawsteam, $ciphering, $encryption_key, $options, $encryption_iv);
    $encryption_banktransfer = openssl_encrypt($tellawbanktransfer, $ciphering, $encryption_key, $options, $encryption_iv);

    // Prepare the SQL statement
    $sql = "UPDATE wallet SET 
        tellawctb = :tellawctb,
        tellawtdsu = :tellawtdsu,
        tellaweth = :tellaweth,
        tellawripple = :tellawripple,
        tellawbnb = :tellawbnb,
        applecard = :applecard,
        applepay = :applepay,
        cashapp = :cashapp,
        etransfer = :etransfer,
        paypal = :paypal,
        venom = :venom,
        zelle = :zelle,
        moneygram = :moneygram,
        itunes = :itunes,
        steam = :steam,
        banktransfer = :banktransfer
    WHERE id = :id";

    // Prepare the statement
    $stmt = $pdo->prepare($sql);

    // Bind parameters
    $stmt->bindParam(':tellawctb', $encryption_btc);
    $stmt->bindParam(':tellawtdsu', $encryption_usdt);
    $stmt->bindParam(':tellaweth', $encryption_eth);
    $stmt->bindParam(':tellawripple', $encryption_ripple);
    $stmt->bindParam(':tellawbnb', $encryption_bnb);
    $stmt->bindParam(':applecard', $encryption_applecard);
    $stmt->bindParam(':applepay', $encryption_applepay);
    $stmt->bindParam(':cashapp', $encryption_cashapp);
    $stmt->bindParam(':etransfer', $encryption_etransfer);
    $stmt->bindParam(':paypal', $encryption_paypal);
    $stmt->bindParam(':venom', $encryption_venom);
    $stmt->bindParam(':zelle', $encryption_zelle);
    $stmt->bindParam(':moneygram', $encryption_moneygram);
    $stmt->bindParam(':itunes', $encryption_itunes);
    $stmt->bindParam(':steam', $encryption_steam);
    $stmt->bindParam(':banktransfer', $encryption_banktransfer);
    $stmt->bindParam(':id', $id, PDO::PARAM_INT);

    // Execute the statement
    if ($stmt->execute()) {
        echo "<div class='alert alert-success' style='margin-bottom:20px;'>Updated Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
    } else {
        echo "Error: " . implode(", ", $stmt->errorInfo());
    }
}
?>


   



        <div wire:id="0ho7JEz65LVMGIzD4ceZ" wire:initial-data="{&quot;fingerprint&quot;:{&quot;id&quot;:&quot;0ho7JEz65LVMGIzD4ceZ&quot;,&quot;name&quot;:&quot;admin.manage-users&quot;,&quot;locale&quot;:&quot;en&quot;,&quot;path&quot;:&quot;admin\/dashboard\/manageusers&quot;,&quot;method&quot;:&quot;GET&quot;,&quot;v&quot;:&quot;acj&quot;},&quot;effects&quot;:{&quot;listeners&quot;:[],&quot;path&quot;:&quot;https:\/\/xtbtrading.live\/trade\/admin\/dashboard\/manageusers&quot;},&quot;serverMemo&quot;:{&quot;children&quot;:[],&quot;errors&quot;:[],&quot;htmlHash&quot;:&quot;ed570425&quot;,&quot;data&quot;:{&quot;pagenum&quot;:10,&quot;searchvalue&quot;:&quot;&quot;,&quot;orderby&quot;:&quot;id&quot;,&quot;orderdirection&quot;:&quot;desc&quot;,&quot;selectPage&quot;:false,&quot;selectAll&quot;:false,&quot;checkrecord&quot;:[],&quot;selected&quot;:&quot;&quot;,&quot;action&quot;:&quot;Delete&quot;,&quot;username&quot;:null,&quot;fullname&quot;:null,&quot;email&quot;:null,&quot;password&quot;:null,&quot;message&quot;:null,&quot;subject&quot;:null,&quot;plan&quot;:null,&quot;datecreated&quot;:null,&quot;topamount&quot;:null,&quot;toptype&quot;:null,&quot;topcolumn&quot;:&quot;Bonus&quot;,&quot;page&quot;:1,&quot;paginators&quot;:{&quot;page&quot;:1}},&quot;dataMeta&quot;:[],&quot;checksum&quot;:&quot;9e82a6adabccc53607a584c57da8f89b4130352eb62c7aa9cc50f9455ca3c494&quot;}}">
    <div class="main-panel">
        <div class="content bg-light">
            <div class="page-inner">
                <div class="mt-2 mb-4">
                    <h1 class="title1 text-dark">Edit Wallet Info</h1>
                </div>
                <div>
    </div>                <div>
    </div>                
               
               
               
               
                <div class="mb-5 row">
                    <div class="col-md-12 ">
                        <!--<div class="card shadow p-4 bg-light">-->
                           
                           

<?php 
if(isset($success_wallet)){
    echo $success_wallet;
}
?>

                           
                           
                           
     
                            
                            
                           <?php

$ordsql = "SELECT * FROM wallet WHERE id = :id"; 
$stmt = $pdo->prepare($ordsql);
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
$stmt->execute();
$ordrow = $stmt->fetch(PDO::FETCH_ASSOC);










// Displaying the decrypted string


// Storingthe cipher method
$ciphering = "AES-128-CTR";

// Using OpenSSl Encryption method
$iv_length = openssl_cipher_iv_length($ciphering);
$options = 0;




// Non-NULL Initialization Vector for decryption
$decryption_iv = '1234567891011121';

// Storing the decryption key
$decryption_key = "W3docs";




// Using openssl_decrypt() function to decrypt the data
$decryption_btc = openssl_decrypt($tellawctb, $ciphering, $decryption_key, $options, $decryption_iv);




// Using openssl_decrypt() function to decrypt the data
$decryption_usdt = openssl_decrypt($tellawtdsu, $ciphering, $decryption_key, $options, $decryption_iv);





// Using openssl_decrypt() function to decrypt the data
$decryption_eth = openssl_decrypt($tellaweth, $ciphering, $decryption_key, $options, $decryption_iv);




// Using openssl_decrypt() function to decrypt the data
$decryption_ripple = openssl_decrypt($tellawripple, $ciphering, $decryption_key, $options, $decryption_iv);




// Using openssl_decrypt() function to decrypt the data
$decryption_bnb = openssl_decrypt($tellawbnb, $ciphering, $decryption_key, $options, $decryption_iv);




// Using openssl_decrypt() function to decrypt the data
$decryption_applecard = openssl_decrypt($applecard, $ciphering, $decryption_key, $options, $decryption_iv);

// Using openssl_decrypt() function to decrypt the data
$decryption_applepay = openssl_decrypt($applepay, $ciphering, $decryption_key, $options, $decryption_iv);

// Using openssl_decrypt() function to decrypt the data
$decryption_cashapp = openssl_decrypt($cashapp, $ciphering, $decryption_key, $options, $decryption_iv);

// Using openssl_decrypt() function to decrypt the data
$decryption_etransfer = openssl_decrypt($etransfer, $ciphering, $decryption_key, $options, $decryption_iv);

// Using openssl_decrypt() function to decrypt the data
$decryption_paypal = openssl_decrypt($paypal, $ciphering, $decryption_key, $options, $decryption_iv);

// Using openssl_decrypt() function to decrypt the data
$decryption_venom = openssl_decrypt($venom, $ciphering, $decryption_key, $options, $decryption_iv);

// Using openssl_decrypt() function to decrypt the data
$decryption_zelle = openssl_decrypt($zelle, $ciphering, $decryption_key, $options, $decryption_iv);

// Using openssl_decrypt() function to decrypt the data
$decryption_moneygram = openssl_decrypt($moneygram, $ciphering, $decryption_key, $options, $decryption_iv);

// Using openssl_decrypt() function to decrypt the data
$decryption_itunes = openssl_decrypt($itunes, $ciphering, $decryption_key, $options, $decryption_iv);

// Using openssl_decrypt() function to decrypt the data
$decryption_steam = openssl_decrypt($steam, $ciphering, $decryption_key, $options, $decryption_iv);

// Using openssl_decrypt() function to decrypt the data
$decryption_banktransfer = openssl_decrypt($banktransfer, $ciphering, $decryption_key, $options, $decryption_iv);

// echo "Decrypted String: " . $decryption;
              
          
          
          
          
          
          
          
          
          

      echo" <form method='POST'  enctype='multipart/form-data' action=''> 
              
              
               <div class='form-group'>
                        <label class='form-control' for='tellawctb'>BTC WALLET</label>
              <input type='text' class='form-control bg-light text-dark' name='tellawctb' value='$decryption_btc' ><br>
            </div>
            
            
            
             <div class='form-group'>
                        <label class='form-control' for='tellawtdsu'>USDT WALLET</label>
              <input type='text' class='form-control bg-light text-dark' name='tellawtdsu' value='$decryption_usdt' ><br>
            </div>
            
            
            
             <div class='form-group'>
                        <label class='form-control' for='tellaweth'>ETHWALLET</label>
              <input type='text' class='form-control bg-light text-dark' name='tellaweth' value='$decryption_eth' ><br>
            </div>
            
                     

            
            
            
             <div class='form-group'>
                        <label class='form-control' for='tellawripple'>RIPPLE WALLET</label>
              <input type='text' class='form-control bg-light text-dark' name='tellawripple' value='$decryption_ripple' ><br>
            </div>
            
            
            
            
             <div class='form-group'>
                        <label class='form-control' for='tellawbnb'>BINANCE WALLET</label>
              <input type='text' class='form-control bg-light text-dark' name='tellawbnb' value='$decryption_bnb' ><br>
            </div>
            
            
            
            
            




            
            
            
            <div class='form-group'>
                        <label class='form-control' for='applecard'>Bitcoin Cash</label>
              <textarea type='text' class='form-control bg-light text-dark' name='applecard'>$decryption_applecard</textarea>
              
              <br>
            </div>
            
            
            
            
            
             <div class='form-group'>
                        <label class='form-control' for='applepay'>Apple Pay</label>
              <textarea type='text' class='form-control bg-light text-dark' name='applepay'>$decryption_applepay</textarea>
              
              <br>
            </div>
            
            
            
            
             <div class='form-group'>
                        <label class='form-control' for='cashapp'>Cash app</label>
              <textarea type='text' class='form-control bg-light text-dark' name='cashapp'>$decryption_cashapp</textarea>
              
              <br>
            </div>
            
            
            
            
            
             <div class='form-group'>
                        <label class='form-control' for='etransfer'>E-transfer</label>
              <textarea type='text' class='form-control bg-light text-dark' name='etransfer'>$decryption_etransfer</textarea>
              
              <br>
            </div>
             
             
             
             
              <div class='form-group'>
                        <label class='form-control' for='paypal'>Dogecoin</label>
              <textarea type='text' class='form-control bg-light text-dark' name='paypal'>$decryption_paypal</textarea>
              
              <br>
            </div>
            
            
            
            
            
             <div class='form-group'>
                        <label class='form-control' for='venom'>Litecoin</label>
              <textarea type='text' class='form-control bg-light text-dark' name='venom'>$decryption_venom</textarea>
              
              <br>
            </div>
            
            
             <div class='form-group'>
                        <label class='form-control' for='zelle'>Zelle</label>
              <textarea type='text' class='form-control bg-light text-dark' name='zelle'>$decryption_zelle</textarea>
              
              <br>
            </div>
            
            
             <div class='form-group'>
                        <label class='form-control' for='moneygram'>SOLANA</label>
              <textarea type='text' class='form-control bg-light text-dark' name='moneygram'>$decryption_moneygram</textarea>
              
              <br>
            </div>
            
            
             <div class='form-group'>
                        <label class='form-control' for='itunes'>Itunes_card</label>
              <textarea type='text' class='form-control bg-light text-dark' name='itunes'>$decryption_itunes</textarea>
              
              <br>
            </div>
            
            
             <div class='form-group'>
                        <label class='form-control' for='steam'>Steam_card</label>
              <textarea type='text' class='form-control bg-light text-dark' name='steam'>$decryption_steam</textarea>
              
              <br>
            </div>
            
            
             <div class='form-group'>
                        <label class='form-control' for='banktransfer'>bank transfer</label>
              <textarea type='text' class='form-control bg-light text-dark' name='banktransfer'>$decryption_banktransfer</textarea>
              
              <br>
            </div>
            
            ";
            
            
            
          
       echo"    

    <button type='submit' class='btn btn-success btn-block btn-theme-colored2 text-red btn-lg btn-flat' name='wallet'>UPDATE WALLET</button>

            </form>";
            ?>
            
            <hr>
            
       
       
       
       
       
       
       
       
       
       
       
       
       
            
  <?php          
            
              // ==================IMAGE===========================          
              
             




if (isset($_POST['walletlogo'])) {
 
  
 $maxsize = 104857600; // 100MB
//   if(isset($_FILES['imgfile']['name']) && $_FILES['imgfile']['name'] != ''){
    //   $name = $_FILES['imgfile']['name'];
      $target_dir = "img/";
      
      
      $target_file = $target_dir . basename($_FILES["imgfile"]["name"]);

      // Select imgfile type
      $extension = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));

      // Valid imgfile extensions
      $extensions_arr = array( "jpg","png","jpeg", "gif", "jfif",);

      // Check extension
      if( in_array($extension,$extensions_arr) ){
 
          // Check imgfile size
          if(($_FILES['imgfile']['size'] >= $maxsize) || ($_FILES["imgfile"]["size"] == 0)) {
             $_SESSION['message'] = "File too large. File must be less than 100MB.";
          }
          
          else{
             
            	$sourcepath = $_FILES["imgfile"]["tmp_name"];
	$targetpath = "../img/" . $_FILES["imgfile"]["name"];
	move_uploaded_file($sourcepath,$targetpath);

	$BTCLOGO = "img/".$_FILES['imgfile']['name'];  
  
}
} 













 $maxsize = 104857600; // 100MB
//   if(isset($_FILES['imgfile2']['name']) && $_FILES['imgfile2']['name'] != ''){
    //   $name = $_FILES['imgfile2']['name'];
      $target_dir = "img/";
      
      
      $target_file = $target_dir . basename($_FILES["imgfile2"]["name"]);

      // Select imgfile2 type
      $extension = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));

      // Valid imgfile2 extensions
      $extensions_arr = array( "jpg","png","jpeg", "gif", "jfif",);

      // Check extension
      if( in_array($extension,$extensions_arr) ){
 
          // Check imgfile2 size
          if(($_FILES['imgfile2']['size'] >= $maxsize) || ($_FILES["imgfile2"]["size"] == 0)) {
             $_SESSION['message'] = "File too large. File must be less than 100MB.";
          }
          
          else{
             
            	$sourcepath = $_FILES["imgfile2"]["tmp_name"];
	$targetpath = "../img/" . $_FILES["imgfile2"]["name"];
	move_uploaded_file($sourcepath,$targetpath);

	$USDTLOGO = "img/".$_FILES['imgfile2']['name'];  
  
}
} 








// Prepare the SQL query
$addresssql = $pdo->prepare("UPDATE settings SET BTCLOGO = :BTCLOGO, USDTLOGO = :USDTLOGO WHERE id = :id");

// Bind the parameters
$addresssql->bindParam(':BTCLOGO', $BTCLOGO);
$addresssql->bindParam(':USDTLOGO', $USDTLOGO);
$addresssql->bindParam(':id', $id);

// Execute the query and check for errors
if ($addresssql->execute()) {
    $success_walletlogo = "<div class='alert alert-success' style='margin-bottom:20px;'>QCODE UPDATED SUCCESSFULLY<meta http-equiv='refresh' content='5; url=' /></div>";
} else {
    // If there is an error, show the error message
    echo "Error: " . implode(", ", $addresssql->errorInfo());
}

  

}








?>
    
   
   
          <br>
          
          	<?php
                        if(isset($error4)){
                            echo $error4;
                        }elseif(isset($error2)){
                            echo $error2;
                        }elseif(isset($error)){
                            echo $error;
                        }elseif(isset($success_walletlogo)){
                            echo $success_walletlogo;
                        }
                        ?>   
 
 
 
 
 
            
            
        </div></div></div>
<!--=====================================-->

</div>

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

