/** * mixed Test(int $idProblem = 0, int $idTest = 0) * * Constructor * * @param int $idProblem (optional) medical problem identificator * @param int $idTest (optional) medical test identificator * @return mixed void if not argument, null if not exists problem, object otherwise * @access public */ public function Test($idProblem = 0, $idTest = 0) { $this->_trans = array_flip(get_html_translation_table(HTML_SPECIALCHARS)); if ($idProblem && $idTest) { $_testQ = new Query_Test(); if (!$_testQ->select($idProblem, $idTest)) { return null; } foreach (get_object_vars($_testQ->fetch()) as $key => $value) { $this->{$key} = $value; } $_testQ->freeResult(); $_testQ->close(); } }
echo Msg::info(_("No medical tests defined for this medical problem.")); include_once "../layout/footer.php"; exit; } echo HTML::section(2, _("Medical Tests List:")); $thead = array(_("Function") => array('colspan' => $_SESSION['auth']['is_administrative'] ? 3 : 1), _("Document Type"), _("Path Filename")); $tbody = array(); while ($test = $testQ->fetch()) { $temp = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); $temp = substr($temp, 0, strrpos($temp, "/")) . "/tests/" . String::translateBrowser($test->getPathFilename(false)); $row = HTML::link(HTML::image('../img/action_view.png', _("view")), $temp, null, array('class' => 'popup')); $row .= OPEN_SEPARATOR; if ($_SESSION['auth']['is_administrative']) { $row .= HTML::link(HTML::image('../img/action_edit.png', _("edit")), '../medical/test_edit_form.php', array('id_problem' => $idProblem, 'id_patient' => $idPatient, 'id_test' => $test->getIdTest())); $row .= OPEN_SEPARATOR; $row .= HTML::link(HTML::image('../img/action_delete.png', _("delete")), '../medical/test_del_confirm.php', array('id_problem' => $idProblem, 'id_patient' => $idPatient, 'id_test' => $test->getIdTest())); $row .= OPEN_SEPARATOR; } // end if $row .= $test->getDocumentType(); $row .= OPEN_SEPARATOR; $row .= $test->getPathFilename(); $tbody[] = explode(OPEN_SEPARATOR, $row); } // end while $testQ->freeResult(); $testQ->close(); unset($testQ); unset($test); echo HTML::table($thead, $tbody); require_once "../layout/footer.php";