$array[$i] = $problemQ->fetch(); } $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 */
loginCheck(OPEN_PROFILE_ADMINISTRATOR, false); // There are not logs in demo version require_once "../model/Query/Page/Record.php"; require_once "../lib/Form.php"; require_once "../lib/Search.php"; require_once "../lib/Check.php"; /** * Retrieving get vars */ $idUser = intval($_GET["id_user"]); $login = $_GET["login"]; $currentPage = isset($_GET["page"]) ? intval($_GET["page"]) : 1; /** * Search user operations */ $recordQ = new Query_Page_Record(); $recordQ->setItemsPerPage(OPEN_ITEMS_PER_PAGE); $recordQ->searchUser($idUser, $currentPage); if ($recordQ->getRowCount() == 0) { $recordQ->close(); FlashMsg::add(sprintf(_("No logs for user %s."), $login)); header("Location: " . $returnLocation); exit; } /** * Show page */ $title = _("Record Logs"); require_once "../layout/header.php"; /** * Breadcrumb
$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);
/** * 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);
} $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);
$idProblem = intval($_POST["id_problem"]); $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 &
$idProblem = intval($_POST["id_problem"]); $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));
*/ $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
require_once "../model/Query/Relative.php"; require_once "../model/Query/Page/Record.php"; /** * Retrieving post var */ $idPatient = intval($_POST["id_patient"]); /** * Prevent user from aborting script */ $oldAbort = ignore_user_abort(true); /** * Insert new relatives patient */ $relQ = new Query_Relative(); $relQ->captureError(true); $recordQ = new Query_Page_Record(); $n = count($_POST["check"]); for ($i = 0; $i < $n; $i++) { if ($idPatient == $_POST["check"][$i]) { 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 {
* 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");
* 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);
require_once "../model/Query/Connection.php"; require_once "../model/Query/Page/Record.php"; /** * Retrieving post vars */ $idPatient = intval($_POST["id_patient"]); $idProblem = intval($_POST["id_problem"]); /** * Prevent user from aborting script */ $oldAbort = ignore_user_abort(true); /** * Insert new connection problem */ $connQ = new Query_Connection(); $recordQ = new Query_Page_Record(); $n = count($_POST["check"]); for ($i = 0; $i < $n; $i++) { if ($idProblem == $_POST["check"][$i]) { continue; // 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); }