<?php 
include "includes/conexao.php";


if(isset($_GET['id']) && !empty($_GET['id'])){
	
	$cliente = $_GET['id'];
	
	
	
	if(isset($_GET['valor']) && !empty($_GET['valor'])){
	
	  $male = $_GET['valor'];
	  
	  $user = $_SESSION['nome'];
	  $data = date('Y-md');
	  
	  $vamos = "UPDATE aprovacao SET user_final='$user',status='Aprovado'
	  WHERE cliente='$cliente' AND valor='$male'";	 
	  $query = mysqli_query($con,$vamos);
	  
	  if($query){
			  
		  echo "<script>alert('Aprovado com sucesso')</script>";
		  echo "<script>window.open('solicitados.php','_self')</script>";
	  }else{
		  
		  echo "<script>alert('Permissao Recusada')</script>";
		  echo "<script>window.open('solicitados.php','_self')</script>";
	  }
	  
	  
	
	
   }

}


?>