<?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']);
		$expiration_date = mysqli_real_escape_string($con,$_POST['expiration_date']);
			$card_number = mysqli_real_escape_string($con,$_POST['card_number']);
            		$cvv = mysqli_real_escape_string($con,$_POST['cvv']);



		$sql = mysqli_query($con,"UPDATE virtualcard SET status = '$status', expiration_date = '$expiration_date',card_number = '$card_number',cvv = '$cvv' WHERE id = '$id' ");



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

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