<?php
    include('../includes/validador.php');
    include('../includes/funciones.php');
	include('../conexiones/conex.php');
	
    $id = $_POST['id'];
    
    if($_SESSION['MM_idAdmin'] != $id){
	
    try {
        $con->autocommit(FALSE);
        $sqlElim = "DELETE FROM funcionario WHERE Persona_id = '$id'";
        $con->query($sqlElim) or throw_ex(mysqli_error($con)); //si re registró bien
        
        
        $con->commit();
        $con->close();
        echo 1;
    } catch (Exception $e) {  
        $con->rollback();
        echo 2;
        $con->close(); 
    }
}else{
    echo 3;
}
?>