function remove()
{
    extract($_REQUEST);
    removeTodayEntry("Leads", $id);
    return display();
}
function deleteAppointment()
{
    global $_GET;
    if (!isset($_GET["entry_id"])) {
        return 0;
    }
    // delete from the diary_entries table
    db_exec("DELETE FROM diary_entries WHERE entry_id='{$_GET['entry_id']}' ");
    // delete all diary entry details
    db_exec("DELETE FROM diary_entries_details WHERE entry_id='{$_GET['entry_id']}' ");
    removeTodayEntry("Diary", $_GET["entry_id"]);
    // only close the window when it is delete key, not modify, else errors wont get displayed
    if ($_GET["key"] == "delete") {
        $OUTPUT = "\n\t\t<script>\n\t\t\t\tobj = window.opener.location.reload();\n\t\t\t\twindow.close();\n\t\t\t\t//obj = obj.contentDocument.getElementById('diary_container');\n\t\t\t\t//ajaxRequest(\"diary-index.php\", obj, AJAX_OBJ | AJAX_CLS, \"{$get}\");\n\t\t</script>";
    } else {
        $OUTPUT = "";
    }
    return $OUTPUT;
}