<?php

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

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

    $doc_image = $_GET['file_name'];

    $path = "../../../user/profile_img/".$doc_image;

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

    // now we will update the database 
    $sql_kyc = "UPDATE personal_identification SET passport = '' WHERE id = '$user_view_id'";
    $query_kyc = $db_conx->query($sql_kyc);

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

?>