$problemQ->freeResult(); $problemQ->close(); unset($problemQ); $delProblemQ = new Query_DelProblem(); for ($i = 0; $i < $numRows; $i++) { $delProblemQ->insert($array[$i], $_SESSION['auth']['user_id'], $_SESSION['auth']['login_session']); } $delProblemQ->close(); unset($delProblemQ); $problemQ = new Query_Page_Problem(); /** * Record log process (before deleting process) */ $recordQ = new Query_Page_Record(); for ($i = 0; $i < $numRows; $i++) { $recordQ->log("Query_Page_Problem", "DELETE", array($array[$i]->getIdProblem())); } $recordQ->close(); unset($recordQ); for ($i = 0; $i < $numRows; $i++) { $problemQ->delete($array[$i]->getIdProblem()); } $problemQ->close(); unset($problemQ); unset($array); } /** * Update session variables */ require_once "../lib/LastViewedPatient.php"; LastViewedPatient::delete($idPatient);
} $problem = $problemQ->fetch(); if (!$problem) { $problemQ->close(); Error::fetch($problemQ); } $wording = $problem->getWording(); $delProblemQ = new Query_DelProblem(); $delProblemQ->insert($problem, $_SESSION['auth']['user_id'], $_SESSION['auth']['login_session']); unset($delProblemQ); unset($problem); } /** * Record log process (before deleting process) */ $recordQ = new Query_Page_Record(); $recordQ->log("Query_Page_Problem", "DELETE", array($idProblem)); $recordQ->close(); unset($recordQ); $problemQ->delete($idProblem); $problemQ->close(); unset($problemQ); /** * Reset abort setting */ ignore_user_abort($oldAbort); /** * Redirect to $returnLocation to avoid reload problem */ FlashMsg::add(sprintf(_("Medical problem, %s, has been deleted."), $wording)); header("Location: " . $returnLocation);
$oldAbort = ignore_user_abort(true); /** * Update patient */ $patQ = new Query_Page_Patient(); if ($patQ->existName($pat->getFirstName(), $pat->getSurname1(), $pat->getSurname2(), $pat->getIdPatient())) { $patQ->close(); FlashMsg::add(sprintf(_("O nome do beneficiário, %s, está em uso. As mudanças não terão efeito."), $patName), OPEN_MSG_WARNING); header("Location: " . $returnLocation); exit; } $patQ->update($pat); $patQ->close(); unset($patQ); unset($pat); /** * Record log process */ $recordQ = new Query_Page_Record(); $recordQ->log("Query_Page_Patient", "UPDATE", array($idPatient)); $recordQ->close(); unset($recordQ); /** * Reset abort setting */ ignore_user_abort($oldAbort); /** * Redirect to $returnLocation to avoid reload problem */ FlashMsg::add(_("Beneficiário atualizado com sucesso.")); header("Location: " . $returnLocation);
$idTest = intval($_POST["id_test"]); $idPatient = intval($_POST["id_patient"]); $file = Check::safeText($_POST["path_filename"]); /** * Prevent user from aborting script */ $oldAbort = ignore_user_abort(true); /** * Delete medical test */ $testQ = new Query_Test(); /** * Record log process (before deleting process) */ $recordQ = new Query_Page_Record(); $recordQ->log("Query_Test", "DELETE", array($idTest)); $recordQ->close(); unset($recordQ); $testQ->delete($idTest); $testQ->close(); unset($testQ); //@unlink($file); // do not remove the file because LORTAD /** * Reset abort setting */ ignore_user_abort($oldAbort); /** * Redirect to $returnLocation to avoid reload problem */ FlashMsg::add(sprintf(_("Medical test, %s, has been deleted."), $file)); // To header, without &
/** * Prevent user from aborting script */ $oldAbort = ignore_user_abort(true); /** * Update medical test */ $testQ = new Query_Test(); $testQ->update($test); FlashMsg::add(sprintf(_("Medical test, %s, has been updated."), $test->getPathFilename(false))); $testQ->close(); unset($testQ); /** * Record log process */ $recordQ = new Query_Page_Record(); $recordQ->log("Query_Test", "UPDATE", array($test->getIdTest())); $recordQ->close(); unset($recordQ); unset($test); /** * Reset abort setting */ ignore_user_abort($oldAbort); /** * Redirect to $returnLocation to avoid reload problem */ // To header, without & //$returnLocation = "../medical/test_list.php?id_problem=" . $idProblem . "&id_patient=" . $idPatient; // controlling var $returnLocation = "../medical/test_list.php"; header("Location: " . $returnLocation);
* Insert new patient */ $patQ = new Query_Page_Patient(); if ($patQ->existName($pat->getFirstName(), $pat->getSurname1(), $pat->getSurname2())) { $patQ->close(); FlashMsg::add(sprintf(_("Beneficiário %s, está em uso. As mudanças não serão realizadas."), $patName), OPEN_MSG_WARNING); header("Location: ../medical/patient_new_form.php"); exit; } $patQ->insert($pat); $idPatient = $patQ->getLastId(); $patQ->close(); unset($patQ); unset($pat); /** * Record log process */ $recordQ = new Query_Page_Record(); $recordQ->log("Query_Page_Patient", "INSERT", array($idPatient)); $recordQ->close(); unset($recordQ); /** * Reset abort setting */ ignore_user_abort($oldAbort); /** * Redirect to $returnLocation to avoid reload problem */ FlashMsg::add(_("Beneficiário cadastrado.")); $returnLocation = "../medical/patient_view.php?id_patient=" . $idPatient; header("Location: " . $returnLocation);
$idConnection = intval($_POST["id_connection"]); $idPatient = intval($_POST["id_patient"]); $wording = Check::safeText($_POST["wording"]); /** * Prevent user from aborting script */ $oldAbort = ignore_user_abort(true); /** * Delete relative */ $connQ = new Query_Connection(); /** * Record log process (before deleting process) */ $recordQ = new Query_Page_Record(); $recordQ->log("Query_Connection", "DELETE", array($idProblem, $idConnection)); $recordQ->close(); unset($recordQ); $connQ->delete($idProblem, $idConnection); $connQ->close(); unset($connQ); /** * Reset abort setting */ ignore_user_abort($oldAbort); /** * Redirect to $returnLocation to avoid reload problem */ FlashMsg::add(sprintf(_("Connection with medical problem, %s, has been deleted."), $wording)); // To header, without & //$returnLocation = "../medical/connection_list.php?id_problem=" . $idProblem . "&id_patient=" . $idPatient;
continue; // a patient can't be relative of himself } $relQ->insert($idPatient, $_POST["check"][$i]); if ($relQ->isError()) { if ($relQ->getDbErrno() == 1062) { $relQ->clearErrors(); } else { $relQ->close(); Error::query($relQ); } } else { /** * Record log process */ $recordQ->log("Query_Relative", "INSERT", array($idPatient, $_POST["check"][$i])); } } $recordQ->close(); unset($recordQ); $relQ->close(); unset($relQ); /** * Reset abort setting */ ignore_user_abort($oldAbort); /** * Redirect to $returnLocation to avoid reload problem */ FlashMsg::add(_("Relatives have been added.")); //$returnLocation = "../medical/relative_list.php?id_patient=" . $idPatient; // controlling var
$idPatient = intval($_POST["id_patient"]); $idRelative = intval($_POST["id_relative"]); $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";
* Destroy form values and errors */ Form::unsetSession(); /** * Prevent user from aborting script */ $oldAbort = ignore_user_abort(true); /** * Update personal antecedents */ $historyQ = new Query_History(); $historyQ->updatePersonal($history); $historyQ->close(); unset($historyQ); /** * Record log process */ $recordQ = new Query_Page_Record(); $recordQ->log("Query_History", "UPDATE", array($idPatient), "selectPersonal"); $recordQ->close(); unset($recordQ); /** * Reset abort setting */ ignore_user_abort($oldAbort); /** * Redirect to destiny to avoid reload problem */ FlashMsg::add(_("Personal Antecedents have been updated.")); //header("Location: ../medical/history_personal_view.php?id_patient=" . $idPatient); header("Location: ../medical/history_personal_view.php");
/** * Insert new medical problem */ $problemQ = new Query_Page_Problem(); $problemQ->insert($problem); $idProblem = $problemQ->getLastId(); if ($problem->getClosingDate(false)) { FlashMsg::add(sprintf(_("Medical problem, %s, has been added to closed medical problems list."), $problem->getWording())); } else { FlashMsg::add(sprintf(_("Medical problem, %s, has been added."), $problem->getWording())); } $problemQ->close(); unset($problemQ); unset($problem); /** * Record log process */ $recordQ = new Query_Page_Record(); $recordQ->log("Query_Page_Problem", "INSERT", array($idProblem)); $recordQ->close(); unset($recordQ); /** * Reset abort setting */ ignore_user_abort($oldAbort); /** * Redirect to $returnLocation to avoid reload problem */ //$returnLocation = "../medical/problem_view.php?id_patient=" . $idPatient; $returnLocation = "../medical/problem_view.php?id_patient=" . $idPatient . "&id_problem=" . $idProblem; header("Location: " . $returnLocation);
* Destroy form values and errors */ Form::unsetSession(); /** * Prevent user from aborting script */ $oldAbort = ignore_user_abort(true); /** * Update family antecedents */ $historyQ = new Query_History(); $historyQ->updateFamily($history); $historyQ->close(); unset($historyQ); /** * Record log process */ $recordQ = new Query_Page_Record(); $recordQ->log("Query_History", "UPDATE", array($idPatient), "selectFamily"); $recordQ->close(); unset($recordQ); /** * Reset abort setting */ ignore_user_abort($oldAbort); /** * Redirect to destiny to avoid reload problem */ FlashMsg::add(_("Family Antecedents have been updated.")); //header("Location: ../medical/history_family_view.php?id_patient=" . $idPatient); header("Location: ../medical/history_family_view.php");
* Prevent user from aborting script */ $oldAbort = ignore_user_abort(true); /** * Insert new medical test */ $testQ = new Query_Test(); $testQ->insert($test); $idTest = $testQ->getLastId(); FlashMsg::add(sprintf(_("Medical test, %s, has been added."), $test->getPathFilename(false))); $testQ->close(); unset($testQ); unset($test); /** * Record log process */ $recordQ = new Query_Page_Record(); $recordQ->log("Query_Test", "INSERT", array($idTest)); $recordQ->close(); unset($recordQ); /** * Reset abort setting */ ignore_user_abort($oldAbort); /** * Redirect to $returnLocation to avoid reload problem */ // To header, without & //$returnLocation = "../medical/test_list.php?id_problem=" . $idProblem . "&id_patient=" . $idPatient; // controlling var $returnLocation = "../medical/test_list.php"; header("Location: " . $returnLocation);
// a problem can't be connection of itself } $connQ->captureError(true); $connQ->insert($idProblem, $_POST["check"][$i]); if ($connQ->isError()) { if ($connQ->getDbErrno() == 1062) { $connQ->clearErrors(); } else { $connQ->close(); Error::query($connQ); } } else { /** * Record log process */ $recordQ->log("Query_Connection", "INSERT", array($idProblem, $_POST["check"][$i])); } } $recordQ->close(); unset($recordQ); $connQ->close(); unset($connQ); /** * Reset abort setting */ ignore_user_abort($oldAbort); /** * Redirect to $returnLocation to avoid reload problem */ FlashMsg::add(_("Connection problems have been added.")); // To header, without &