Beispiel #1
0
/**
 * Prevent user from aborting script
 */
$oldAbort = ignore_user_abort(true);
/**
 * Delete relatives
 */
$relQ = new Query_Relative();
$numRows = $relQ->select($idPatient);
$rel = array();
for ($i = 0; $i < $numRows; $i++) {
    $rel[] = $relQ->fetch();
}
$relQ->freeResult();
while ($aux = array_shift($rel)) {
    $relQ->delete($idPatient, $aux[1]);
}
$relQ->close();
unset($relQ);
unset($rel);
/**
 * Delete patient
 */
$patQ = new Query_Page_Patient();
if (defined("OPEN_DEMO") && !OPEN_DEMO) {
    if (!$patQ->select($idPatient)) {
        $patQ->close();
        FlashMsg::add(_("That patient does not exist."), OPEN_MSG_ERROR);
        header("Location: " . $returnLocation);
        exit;
    }
Beispiel #2
0
$relName = Check::safeText($_POST["name"]);
/**
 * Prevent user from aborting script
 */
$oldAbort = ignore_user_abort(true);
/**
 * Delete relative
 */
$relQ = new Query_Relative();
/**
 * Record log process (before deleting process)
 */
$recordQ = new Query_Page_Record();
$recordQ->log("Query_Relative", "DELETE", array($idPatient, $idRelative));
$recordQ->close();
unset($recordQ);
$relQ->delete($idPatient, $idRelative);
$relQ->close();
unset($relQ);
/**
 * Reset abort setting
 */
ignore_user_abort($oldAbort);
/**
 * Redirect to $returnLocation to avoid reload problem
 */
FlashMsg::add(sprintf(_("Relative, %s, has been deleted."), $relName));
//$returnLocation = "../medical/relative_list.php?id_patient=" . $idPatient; // controlling var
$returnLocation = "../medical/relative_list.php";
// controlling var
header("Location: " . $returnLocation);