/** * bool update(Test $test) * * Update a medical test in the medical tests table. * * @param Test $test medical test to update * @return boolean returns false, if error occurs * @access public */ function update($test) { if (!$test instanceof Test) { $this->_error = "Argument is an inappropriate object."; return false; } $sql = "UPDATE " . $this->_table . " SET " . "document_type=?, " . "path_filename=? " . "WHERE id_test=?;"; $params = array(urlencode($test->getDocumentType()), urlencode($test->getPathFilename()), $test->getIdTest()); return $this->exec($sql, $params); }
$title = _("Delete Medical Test"); $titlePage = $patient->getName() . ' [' . $problem->getWordingPreview() . '] (' . $title . ')'; require_once "../layout/header.php"; //$returnLocation = "../medical/test_list.php?id_problem=" . $idProblem . "&id_patient=" . $idPatient; // controlling var $returnLocation = "../medical/test_list.php"; // controlling var /** * Breadcrumb */ $links = array(_("Medical Records") => "../medical/index.php", $patient->getName() => "../medical/patient_view.php", _("Medical Problems Report") => "../medical/problem_list.php", $problem->getWordingPreview() => "../medical/problem_view.php", _("View Medical Tests") => $returnLocation, $title => ""); echo HTML::breadcrumb($links, "icon icon_patient"); unset($links); echo $patient->getHeader(); echo $problem->getHeader(); /** * Confirm form */ echo HTML::start('form', array('method' => 'post', 'action' => '../medical/test_del.php')); $tbody = array(); $tbody[] = Msg::warning(sprintf(_("Are you sure you want to delete medical test, %s, from list?"), $test->getPathFilename())); $row = Form::hidden("id_problem", $idProblem); $row .= Form::hidden("id_test", $idTest); $row .= Form::hidden("id_patient", $idPatient); $row .= Form::hidden("path_filename", $test->getPathFilename()); $tbody[] = $row; $tfoot = array(Form::button("delete", _("Delete")) . Form::generateToken()); $options = array('class' => 'center'); echo Form::fieldset($title, $tbody, $tfoot, $options); echo HTML::end('form'); echo HTML::para(HTML::link(_("Return"), $returnLocation)); require_once "../layout/footer.php";
exit; } $problem = new Problem($idProblem); if (!$problem) { FlashMsg::add(_("That medical problem does not exist."), OPEN_MSG_ERROR); header("Location: ../medical/patient_search_form.php"); exit; } $test = new Test($idProblem, $idTest); if (!$test) { FlashMsg::add(_("That medical test does not exist"), OPEN_MSG_ERROR); header("Location: ../medical/test_list.php"); exit; } $formVar["document_type"] = $test->getDocumentType(); $formVar["path_filename"] = $test->getPathFilename(); /** * Show page */ $title = _("Edit Medical Test"); $titlePage = $patient->getName() . ' [' . $problem->getWordingPreview() . '] (' . $title . ')'; $focusFormField = "document_type"; // to avoid JavaScript mistakes in demo version require_once "../layout/header.php"; //$returnLocation = "../medical/test_list.php?id_problem=" . $idProblem . "&id_patient=" . $idPatient; $returnLocation = "../medical/test_list.php"; /** * Breadcrumb */ $links = array(_("Medical Records") => "../medical/index.php", $patient->getName() => "../medical/patient_view.php", _("Medical Problems Report") => "../medical/problem_list.php", $problem->getWordingPreview() => "../medical/problem_view.php", _("View Medical Tests") => $returnLocation, $title => ""); echo HTML::breadcrumb($links, "icon icon_patient");