<?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 = "INSERT INTO aprovacao(cliente,valor,data,hora,user,user_final,status)
	  VALUES('$cliente','$male','$data','$hora','$user','Admin','pendente')";
	  $query = mysqli_query($con,$vamos);
	  
	  if($query){
		  
		  echo "<script>alert('Permissao sucedida aguarde o ADMINISTRADOR')</script>";
		  echo "<script>window.open('solicitados.php','_self')</script>";
	  }else{
		  
		  echo "<script>alert('Permissao Recusada')</script>";
		  echo "<script>window.open('solicitados.php','_self')</script>";
	  }
	  
	  
	
	
   }

}


?>