<?php

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

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

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

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

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