<?php

	include"../../connect/db.php"; 

	if( isset($_POST['id']) ){
        $id = mysqli_real_escape_string($con,$_POST['id']);
		$status = mysqli_real_escape_string($con,$_POST['status']);
		$desc = mysqli_real_escape_string($con,$_POST['desc']);
	

		$sql = mysqli_query($con,"UPDATE transactions2 SET status = '$status', description = '$desc' WHERE trans_id = '$id' ");



 $sqlqq = mysqli_query($con," SELECT * FROM transactions2 WHERE trans_id = '$id' ");
 $row = mysqli_fetch_assoc($sqlqq);
 
 $user = $row['user'];
 
		if( $sql ){

            header("Location:../../chairman/crypto-transaction.php?user=$user");
			
		}
		else{
			echo "error";
		}
	}
	else{
		echo "error";
	}
	
?>	