<?php
	session_start();
	include"../../connect/db.php"; 
?> 
 <?php
 $chap = $_SESSION['chap'];
        csrf_verify();
 	if( isset($_POST['amt3']) ){
       
        $amount = mysqli_real_escape_string($con,$_POST['amt3']);
        $d_o_t = date("Y-m-d");	
        $seed = str_split('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'); // and any other characters
        shuffle($seed); // probably optional since array_is randomized; this may be redundant
        $rand = '';
        foreach (array_rand($seed, 7) as $k) $rand .= $seed[$k];								            
        $transId =  $rand; 
        $sql = mysqli_query($con,"SELECT * FROM users WHERE email = '$chap' ");
	
        $row = mysqli_fetch_assoc($sql);

        $currency = $row['currency'];
        $kay = mysqli_query( $con,"INSERT INTO transactions (trans_id, user, description, d_o_t, type, status) VALUES ('$transId', '$chap', '$T deposit of $currency$amount  $transId  , $d_o_t ', '$d_o_t', 'Pending', 'Review' ) " );

 		if( $kay ){
 		    
            include'mailusdt.php';
 			echo "success";
 		}
 			else{
 				echo "error";
 			}
 		}
 		else{
 			echo"error";
 		}
 	

 ?>