/** * mixed Problem(int $id = 0) * * Constructor * * @param int $id (optional) * @return mixed void if not argument, null if not exists problem, object otherwise * @access public */ function Problem($id = 0) { $this->_trans = array_flip(get_html_translation_table(HTML_SPECIALCHARS)); if ($id) { $_problemQ = new Query_Page_Problem(); if (!$_problemQ->select($id)) { return null; } foreach (get_object_vars($_problemQ->fetch()) as $key => $value) { $this->{$key} = $value; } $_problemQ->freeResult(); $_problemQ->close(); } }
for ($i = 0; $i < $numRows; $i++) { $conn[] = $connQ->fetch(); } $connQ->freeResult(); while ($aux = array_shift($conn)) { $connQ->delete($idProblem, $aux[1]); } $connQ->close(); unset($connQ); unset($conn); /** * Delete problem */ $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);
$connQ->freeResult(); } $connQ->close(); unset($connQ); if (count($connArray) == 0) { echo Msg::info(_("No connections defined for this medical problem.")); include_once "../layout/footer.php"; exit; } echo HTML::section(2, _("Connection Problems List:")); $thead = array(_("#"), _("Function") => array('colspan' => $_SESSION['auth']['is_administrative'] ? 2 : 1), _("Opening Date"), _("Wording")); $problemQ = new Query_Page_Problem(); $problemQ->captureError(true); $tbody = array(); for ($i = 0; $i < count($connArray); $i++) { $problemQ->select($connArray[$i]); if ($problemQ->isError()) { Error::query($problemQ, false); continue; } $problem = $problemQ->fetch(); if (!$problem) { $problemQ->close(); Error::fetch($problemQ); } $row = $i + 1 . '.'; $row .= OPEN_SEPARATOR; $row .= HTML::link(HTML::image('../img/action_view.png', _("view")), '../medical/problem_view.php', array('id_problem' => $problem->getIdProblem(), 'id_patient' => $idPatient)); $row .= OPEN_SEPARATOR; if ($_SESSION['auth']['is_administrative']) { $row .= HTML::link(HTML::image('../img/action_delete.png', _("delete")), '../medical/connection_del_confirm.php', array('id_problem' => $idProblem, 'id_patient' => $idPatient, 'id_connection' => $problem->getIdProblem()));