unset($array); } /** * Afterwards: closed problems */ $problemQ = new Query_Page_Problem(); $numRows = $problemQ->selectProblems($idPatient, true); if ($numRows) { $array = array(); for ($i = 0; $i < $numRows; $i++) { $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);
*/ $problemQ = new Query_Page_Problem(); if (defined("OPEN_DEMO") && !OPEN_DEMO) { if (!$problemQ->select($idProblem)) { $problemQ->close(); FlashMsg::add(_("That medical problem does not exist."), OPEN_MSG_ERROR); header("Location: " . $returnLocation); exit; } $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); /**