<?php

    include('../db_conx.php');

    // now we will get the link...
    $deleteID = $_GET['deleteID'];

    $doc_image = $_GET['fileName'];

    $path = "../../principal/testimony-images/".$doc_image;

    // echo $doc_image;

    if(!unlink($path)) {
        echo "you have an error!";
    }else{
        echo "success document ";
    }

    // // now we will update the database 
    $sql_kyc = "DELETE from testimony WHERE id = '$deleteID' ";
    $query_kyc = $db_conx->query($sql_kyc);

    if($query_kyc){
        echo 'success';
        header('location:../../principal/testimony.php?DeleteTestimony=true');
    }else{
        echo 'failed';
    }

?>