<?php

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

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

    $deleteID = $_GET['deleteID'];

    $doc_image = $_GET['docID'];

    $path = "../../dashboard/proof/".$doc_image;

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

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

    if($query_kyc){
        echo 'success';
        header('location:../../principal/proof_of_payment.php?DeletePOP=true&userID='.$user_view_id);
    }else{
        echo 'failed';
    }

?>