File Manager

Path: /home/heznutpr/log.heznutprivate.com/dashboard/

Viewing File: btc.php

<?php
session_start();
include_once ('../include/session.php');
require_once '../include/class.user.php';
if(!isset($_SESSION['acc_no'])){
	
header("Location: login.php");
exit(); 
}



$reg_user = new USER();

$stmt = $reg_user->runQuery("SELECT * FROM account WHERE acc_no=:acc_no");
$stmt->execute(array(":acc_no"=>$_SESSION['acc_no']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);



$stat = $row['status'];
if($stat == 'DORMANT/INACTIVE'){
	header('Location: summary.php?dormant');
	exit();
}
	$stat = $row['status'];
	if($stat == 'NOT VERIFIED'){
	header('Location: summary.php?notverified');
	exit();
}$stat = $row['status'];
if($stat == 'ON HOLD'){
	header('Location: summary.php?hold');
	exit();
}

$id=$_SESSION['acc_no'];
//select data from database
$select="SELECT * FROM account WHERE acc_no='$id'";
$result=mysqli_query($connection,$select)or die("could not select");
while($row=mysqli_fetch_array($result)){
    $name=$row['kycname'];
     $fname=$row['fname']; 
      $lname=$row['lname'];
      $currency=$row['currency'];
     
    $kycdone=$row['cryptodone'];
    $file_name=$row['cryptopass'];
}



if(isset($_POST['update'])){
    $id=$_POST['u_id'];
    $name=$_POST['namet'];
    $cryptoamount=$_POST['cryptoamount'];
    $crypto_id=$_POST['crypto_id'];
    $cryptodone = $_POST['cryptodone'];
    $file_name=$_FILES['file']['name'];
    $tmp_name=$_FILES['file']['tmp_name'];
     
    // update image from folder
 // select data from database
 $id=$_SESSION['acc_no'];
$select="SELECT * FROM account WHERE acc_no='$id'";
$result=mysqli_query($connection,$select);
$row=mysqli_fetch_array($result);
//set path
$path="upload/".$row['cryptopass'];
unlink($path);
    //for image upload
    move_uploaded_file($tmp_name,"upload/".$file_name);
    //update query
    $update="UPDATE account SET cryptoname='$name', cryptoamount='$cryptoamount', crypto_id='$crypto_id', cryptopass='$file_name', cryptodone='$cryptodone' WHERE acc_no='$id'";
    $result=mysqli_query($connection,$update)or die("data could not update");

 


    $message = "
			<!DOCTYPE html>
<html lang='en' xmlns='http://www.w3.org/1999/xhtml' xmlns:v='urn:schemas-microsoft-com:vml' xmlns:o='urn:schemas-microsoft-com:office:office'>
<head>
    <meta charset='utf-8'>
    <meta name='viewport' content='width=device-width'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='x-apple-disable-message-reformatting'>
    <title></title>
    
    <link href='https://fonts.googleapis.com/css?family=Roboto:400,600' rel='stylesheet' type='text/css'>
    <!-- Web Font / @font-face : BEGIN -->
    <!--[if mso]>
        <style>
            * {
                font-family: 'Roboto', sans-serif !important;
            }
        </style>
    <![endif]-->

    <!--[if !mso]>
        <link href='https://fonts.googleapis.com/css?family=Roboto:400,600' rel='stylesheet' type='text/css'>
    <![endif]-->

    <!-- Web Font / @font-face : END -->

    <!-- CSS Reset : BEGIN -->
    
    
    <style>
        /* What it does: Remove spaces around the email design added by some email clients. */
        /* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */
        html,
        body {
            margin: 0 auto !important;
            padding: 0 !important;
            height: 100% !important;
            width: 100% !important;
            font-family: 'Roboto', sans-serif !important;
            font-size: 14px;
            margin-bottom: 10px;
            line-height: 24px;
            color:#8094ae;
            font-weight: 400;
        }
        * {
            -ms-text-size-adjust: 100%;
            -webkit-text-size-adjust: 100%;
            margin: 0;
            padding: 0;
        }
        table,
        td {
            mso-table-lspace: 0pt !important;
            mso-table-rspace: 0pt !important;
        }
        table {
            border-spacing: 0 !important;
            border-collapse: collapse !important;
            table-layout: fixed !important;
            margin: 0 auto !important;
        }
        table table table {
            table-layout: auto;
        }
        a {
            text-decoration: none;
        }
        img {
            -ms-interpolation-mode:bicubic;
        }
    </style>

</head>

<body width='100%' style='margin: 0; padding: 0 !important; mso-line-height-rule: exactly; background-color: #f5f6fa;'>
	<center style='width: 100%; background-color: #f5f6fa;'>
        <table width='100%' border='0' cellpadding='0' cellspacing='0' bgcolor='#f5f6fa'>
            <tr>
               <td style='padding: 40px 0;'>
                    <table style='width:100%;max-width:620px;margin:0 auto;'>
                        <tbody>
                            <tr>
                                <td style='text-align: center; padding-bottom:25px'>
                                    <a href='#'><img style='height: 40px' src='$site_url/dashboard/admin/logo/logo.png' alt='logo'></a>
                                    <p style='font-size: 14px; color: #6576ff; padding-top: 12px;'>--***--</p>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <table style='width:100%;max-width:620px;margin:0 auto;background-color:#ffffff;'>
                        <tbody>
                            <tr>
                            
                                <td style='padding: 30px 30px 20px'>
                                    <p style='margin-bottom: 10px;'>Hi $fname $lname,</p>
                                    <p style='margin-bottom: 10px;'>Your deposit of $cryptoamount has been successfully submitted  <br>
                                    Please wait few min for your deposit to get approval by the billing team.
                                    </p>
                                    
                                    <br>
                                    <p style='margin-bottom: 15px;'>Hope you'll enjoy the experience, we're here if you have any questions, drop us a line at <a style='color: #6576ff; text-decoration:none;' href='mailto:$site_email'>$site_email</a> anytime. </p>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <table style='width:100%;max-width:620px;margin:0 auto;'>
                        <tbody>
                            <tr>
                                <td style='text-align: center; padding:25px 20px 0;'>
                                    <p style='font-size: 13px;'>Copyright © 2023 $site_title. All rights reserved.</p>
                                    <ul style='margin: 10px -4px 0;padding: 0;'>
                                        <li style='display: inline-block; list-style: none; padding: 4px;'><a style='display: inline-block; height: 30px; width:30px;border-radius: 50%; background-color: #ffffff' href='#'><img style='width: 30px' src='$site_url/images/brand-b.png' alt='brand'></a></li>
                                        <li style='display: inline-block; list-style: none; padding: 4px;'><a style='display: inline-block; height: 30px; width:30px;border-radius: 50%; background-color: #ffffff' href='#'><img style='width: 30px' src='$site_url/images/brand-e.png' alt='brand'></a></li>
                                        <li style='display: inline-block; list-style: none; padding: 4px;'><a style='display: inline-block; height: 30px; width:30px;border-radius: 50%; background-color: #ffffff' href='#'><img style='width: 30px' src='$site_url/images/brand-d.png' alt='brand'></a></li>
                                        <li style='display: inline-block; list-style: none; padding: 4px;'><a style='display: inline-block; height: 30px; width:30px;border-radius: 50%; background-color: #ffffff' href='#'><img style='width: 30px' src='$site_url/images/brand-c.png' alt='brand'></a></li>
                                    </ul>
                                    <p style='padding-top: 15px; font-size: 12px;'>This email was sent to you as a registered user of <a style='color: #6576ff; text-decoration:none;' href='$site_url'>$site_title</a>. To update your emails preferences <a style='color: #6576ff; text-decoration:none;' href='$site_url/login.php'>click here</a>.</p>
                                </td>
                            </tr>
                        </tbody>
                    </table>
               </td>
            </tr>
        </table>
    </center>
</body>
</html>


";

$message2 = "
			<!DOCTYPE html>
<html lang='en' xmlns='http://www.w3.org/1999/xhtml' xmlns:v='urn:schemas-microsoft-com:vml' xmlns:o='urn:schemas-microsoft-com:office:office'>
<head>
    <meta charset='utf-8'>
    <meta name='viewport' content='width=device-width'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='x-apple-disable-message-reformatting'>
    <title></title>
    
    <link href='https://fonts.googleapis.com/css?family=Roboto:400,600' rel='stylesheet' type='text/css'>
    <!-- Web Font / @font-face : BEGIN -->
    <!--[if mso]>
        <style>
            * {
                font-family: 'Roboto', sans-serif !important;
            }
        </style>
    <![endif]-->

    <!--[if !mso]>
        <link href='https://fonts.googleapis.com/css?family=Roboto:400,600' rel='stylesheet' type='text/css'>
    <![endif]-->

    <!-- Web Font / @font-face : END -->

    <!-- CSS Reset : BEGIN -->
    
    
    <style>
        /* What it does: Remove spaces around the email design added by some email clients. */
        /* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */
        html,
        body {
            margin: 0 auto !important;
            padding: 0 !important;
            height: 100% !important;
            width: 100% !important;
            font-family: 'Roboto', sans-serif !important;
            font-size: 14px;
            margin-bottom: 10px;
            line-height: 24px;
            color:#8094ae;
            font-weight: 400;
        }
        * {
            -ms-text-size-adjust: 100%;
            -webkit-text-size-adjust: 100%;
            margin: 0;
            padding: 0;
        }
        table,
        td {
            mso-table-lspace: 0pt !important;
            mso-table-rspace: 0pt !important;
        }
        table {
            border-spacing: 0 !important;
            border-collapse: collapse !important;
            table-layout: fixed !important;
            margin: 0 auto !important;
        }
        table table table {
            table-layout: auto;
        }
        a {
            text-decoration: none;
        }
        img {
            -ms-interpolation-mode:bicubic;
        }
    </style>

</head>

<body width='100%' style='margin: 0; padding: 0 !important; mso-line-height-rule: exactly; background-color: #f5f6fa;'>
	<center style='width: 100%; background-color: #f5f6fa;'>
        <table width='100%' border='0' cellpadding='0' cellspacing='0' bgcolor='#f5f6fa'>
            <tr>
               <td style='padding: 40px 0;'>
                    <table style='width:100%;max-width:620px;margin:0 auto;'>
                        <tbody>
                            <tr>
                                <td style='text-align: center; padding-bottom:25px'>
                                    <a href='#'><img style='height: 40px' src='$site_url/logoblue.png' alt='logo'></a>
                                    <p style='font-size: 14px; color: #6576ff; padding-top: 12px;'>--***--</p>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <table style='width:100%;max-width:620px;margin:0 auto;background-color:#ffffff;'>
                        <tbody>
                            <tr>
                            
                                <td style='padding: 30px 30px 20px'>
                                    <p style='margin-bottom: 10px;'>Hi Admin,</p>
                                    <p style='margin-bottom: 10px;'> A users just make a deposit of $cryptoamount<br>
                                    Login to your dashboard to approve or decline deposit
                                    </p>
                                    
                                    <br>
                                    <p style='margin-bottom: 15px;'>Hope you'll enjoy the experience, we're here if you have any questions, drop us a line at <a style='color: #6576ff; text-decoration:none;' href='mailto:$site_email'>$site_email</a> anytime. </p>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <table style='width:100%;max-width:620px;margin:0 auto;'>
                        <tbody>
                            <tr>
                                <td style='text-align: center; padding:25px 20px 0;'>
                                    <p style='font-size: 13px;'>Copyright © 2023 $site_title. All rights reserved.</p>
                                    <ul style='margin: 10px -4px 0;padding: 0;'>
                                        <li style='display: inline-block; list-style: none; padding: 4px;'><a style='display: inline-block; height: 30px; width:30px;border-radius: 50%; background-color: #ffffff' href='#'><img style='width: 30px' src='$site_url/images/brand-b.png' alt='brand'></a></li>
                                        <li style='display: inline-block; list-style: none; padding: 4px;'><a style='display: inline-block; height: 30px; width:30px;border-radius: 50%; background-color: #ffffff' href='#'><img style='width: 30px' src='$site_url/images/brand-e.png' alt='brand'></a></li>
                                        <li style='display: inline-block; list-style: none; padding: 4px;'><a style='display: inline-block; height: 30px; width:30px;border-radius: 50%; background-color: #ffffff' href='#'><img style='width: 30px' src='$site_url/images/brand-d.png' alt='brand'></a></li>
                                        <li style='display: inline-block; list-style: none; padding: 4px;'><a style='display: inline-block; height: 30px; width:30px;border-radius: 50%; background-color: #ffffff' href='#'><img style='width: 30px' src='$site_url/images/brand-c.png' alt='brand'></a></li>
                                    </ul>
                                    <p style='padding-top: 15px; font-size: 12px;'>This email was sent to you as a registered user of <a style='color: #6576ff; text-decoration:none;' href='$site_url'>$site_title</a>. To update your emails preferences <a style='color: #6576ff; text-decoration:none;' href='$site_url/login.php'>click here</a>.</p>
                                </td>
                            </tr>
                        </tbody>
                    </table>
               </td>
            </tr>
        </table>
    </center>
</body>
</html>


";

  
    $acc_no = $_SESSION['acc_no'];

    $queri = " UPDATE account SET tmp_otp = '$codeq' WHERE acc_no ='$acc_no'";
    $resulti = mysqli_query($connection, $queri) or die(mysqli_error($connection));


$subject = "Deposit Payment Received ";
$subject2 = "Deposit Request Notification ";
  $reg_user->send_mail($row['email'], $message, $subject);
  $reg_user->send_mail($row['adminemail'], $message2, $subject2);
      $acc_no = $_SESSION['acc_no'];
$stmt = $reg_user->runQuery("SELECT * FROM account WHERE acc_no = '$acc_no'");
    $stmt->execute();
    $row = $stmt->fetch(PDO::FETCH_ASSOC);

	     
        $phone = preg_replace('/[^0-9]/', '', $row['phone']);
        $mobile_msg = "Dear " . $row['fname'] . ", Please use the One Time Passcode (OTP): " . $codeq . " to complete your Transfer process";
        $reg_user->otp($phone,$mobile_msg);
       
	header("Location: btcdone.php");
	
	
}
	

?>

<?php 

include_once ('../include/session.php');
require_once '../include/class.user.php';

$reg_user = new USER();

$stmt = $reg_user->runQuery("SELECT * FROM account WHERE acc_no=:acc_no");
$stmt->execute(array(":acc_no"=>$_SESSION['acc_no']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);


include 'mheader.php';
?>

<title>Deposit</title>
<!-- content @s -->
                <div class="nk-content nk-content-fluid">
                    <div class="container-xl wide-lg">
                        <div class="nk-content-body">
                            <div class="components-preview wide-md mx-auto">
                                <div class="nk-block-head nk-block-head-lg wide-sm"><br><br><br>
                                    <div class="nk-block-head-content">
                                        
                                        <h2 class="nk-block-title fw-normal">Bitcoin Deposit</h2>
                                        
                                    </div>
                                </div><!-- .nk-block-head -->
                                <div class="nk-block nk-block-lg">
                                     <?php 
							if(isset($_GET['success']))
								{
									?>
									<div class='alert alert-success'>
										<button class='close' data-dismiss='alert'>&times;</button>
										<strong>Your Deposit has been successfully submitted. <br> Please wait while we confirm deposit.</strong> 
									</div>
									<?php
								}
						?>
						<?php 
							if(isset($_GET['errorcot']))
								{
									?>
									<div class='alert alert-danger'>
										<button class='close' data-dismiss='alert'>&times;</button>
										<strong>Invalid COT Code! Transfer Failed.</strong> 
									</div>
									<?php
								}
						?>
						<?php 
							if(isset($_GET['errortax']))
								{
									?>
									<div class='alert alert-danger'>
										<button class='close' data-dismiss='alert'>&times;</button>
										<strong>Invalid Tax Code! Transfer Failed.</strong> 
									</div>
									<?php
								}
						?>
						<?php 
							if(isset($_GET['errorotp']))
								{
									?>
									<div class='alert alert-danger'>
										<button class='close' data-dismiss='alert'>&times;</button>
										<strong>Invalid TRANSFER OTP Code! Transfer Failed.</strong> 
									</div>
									<?php
								}
						?>
						<?php 
							if(isset($_GET['insufficient']))
								{
									?>
									<div class='alert alert-warning'>
										<button class='close' data-dismiss='alert'>&times;</button>
										<strong>Sorry, your balance is insufficient to make the transfer, please transfer a lower amount.</strong> 
									</div>
									<?php
								}
						?>
						<?php 
							if(isset($_GET['amounterror']))
								{
									?>
									<div class='alert alert-warning'>
										<button class='close' data-dismiss='alert'>&times;</button>
										<strong>Sorry, the amount is too little, please transfer a higher amount.</strong> 
									</div>
									<?php
								}
						?> 
                                    <div class="card card-preview">
                                        <div class="card-inner">
                                            <div class="preview-block">
                                                <span class="preview-title-lg overline-title">Transfer Form</span>
                        <form autocomplete="off" method="post" enctype="multipart/form-data" >
          
          <?php if(isset($success)){ echo $success;}?>
			    				<?php if(isset($errorcot)){ echo $errorcot;}?>
								<?php if(isset($errortax)){ echo $errortax;}?>
								<?php if(isset($errorpin)){ echo $errorpin;}?>
								<?php if(isset($insufficient)){ echo $insufficient;}?>
								<?php if(isset($amounterror)){ echo $amounterror;}?>
									<?php if(isset($errorotp)){ echo $errorotp;}?>                        
                                                <div class="row gy-4">
                                                    
                                          <div class="col-sm-12">
                                                        <div class="form-group">
                                                            <label class="form-label" for="default-05">Bitcoin Address (Copy*)</label>          
                                        <div class="form-control-wrap">
                                                <div class="input-group">
                                    
                                        <input type="text" class="form-control" value="<?php echo $btc;?>" id="text-to-copy" readonly>        <div class="input-group-append">            <button id="copy-button" class="btn btn-outline-primary btn-dim">Copy Address</button>        </div>    
                                        </div>
                                        </div></div>
                                        </div>
                                            <!-- JavaScript portion -->
<script>
  var copyButton = document.getElementById("copy-button");

  copyButton.addEventListener("click", function() {
    // Select the text to be copied
    var copyText = document.querySelector("#text-to-copy");
    copyText.select();

    // Copy the selected text
    document.execCommand("copy");
    // Display an alert message
    alert("Text copied to clipboard!");
  });
</script>
                                                    
                                                    
                                                    <div class="col-sm-6">
                                                        <div class="form-group">
                                                            <label class="form-label" for="default-05">Amount (<?php echo $currency; ?>)</label>
                                                            <div class="form-control-wrap">
                                                                <div class="form-text-hint">
                                                                    <span class="overline-title"><?php echo $currency; ?></span>
                                                                </div>
                                                                <input name="cryptoamount" type="number" required class="form-control" id="default-01" placeholder="Amount (<?php echo $currency; ?>)">
                                                            </div>
                                                        </div>
                                                    </div>
                                                    
                                                    <div class="col-sm-6">
                                                        <div class="form-group">
                                                            <label class="form-label" for="default-01"> Account Name</label>
                                                            <div class="form-control-wrap">
                                                                <input placeholder="<?php echo $fname; ?> <?php echo $lname; ?>"  disabled type="text" required class="form-control"  >
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="col-sm-6">
                                                        <div class="form-group">
                                                            <label class="form-label" for="default-01"> Account Number</label>
                                                            <div class="form-control-wrap">
                                                                <input value="<?php echo $id; ?>" disabled type="number" required class="form-control"  >
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="col-sm-6">
                                                        <div class="form-group">
                                                            <label class="form-label" for="default-01"> Proof Of Deposit</label>
                                                            <div class="form-control-wrap">
                                                                <input type="file"  name="file" required  class="form-control"  >
                                                              
                                                            </div>
                                                        </div>
                                                    </div>
                                    
                                    
                            <!-- hidden  -->                        
                       <input type="hidden" name="namet" hidden value="btc">
                       <input type="hidden" name="u_id" value="<?php echo $id;?>">
                       <input type="hidden" name="cryptodone" value="2">
                       <input type="hidden" name="crypto_id" value="Pending">
                                                    
                                                    
                                                    
                                                    
                                                
                                                    
                                                </div>
                                                <hr class="preview-hr">
                                                <button class="btn btn-primary" type="submit" name="update"> Confirm Deposit</button> 
                                                
                                            </div>
                                        </div>
                                    </div><!-- .card-preview -->
                                    
                                </div><!-- .nk-block -->
                                
                               
                            </div><!-- .components-preview -->
                        </div>
                    </div>
                </div>
                <!-- content @e -->
                
                
                <?php include 'mfooter.php';
?>