unset($rel); /** * Delete patient */ $patQ = new Query_Page_Patient(); if (defined("OPEN_DEMO") && !OPEN_DEMO) { if (!$patQ->select($idPatient)) { $patQ->close(); FlashMsg::add(_("That patient does not exist."), OPEN_MSG_ERROR); header("Location: " . $returnLocation); exit; } $patient = $patQ->fetch(); if (!$patient) { $patQ->close(); Error::fetch($patQ); } $historyQ = new Query_History(); $historyQ->selectPersonal($idPatient); $historyP = $historyQ->fetch(); $historyQ->selectFamily($idPatient); $historyF = $historyQ->fetch(); //Error::debug($patient); Error::debug($historyP); Error::debug($historyF, "", true); $delPatientQ = new Query_DelPatient(); $delPatientQ->insert($patient, $historyP, $historyF, $_SESSION['auth']['user_id'], $_SESSION['auth']['login_session']); unset($delPatientQ); unset($patient); unset($historyQ); unset($historyP); unset($historyF); }
$history = $historyQ->fetch(); if ($history) { $formVar["id_patient"] = $history->getIdPatient(); $formVar["birth_growth"] = $history->getBirthGrowth(); $formVar["growth_sexuality"] = $history->getGrowthSexuality(); $formVar["feed"] = $history->getFeed(); $formVar["habits"] = $history->getHabits(); $formVar["peristaltic_conditions"] = $history->getPeristalticConditions(); $formVar["psychological"] = $history->getPsychological(); $formVar["children_complaint"] = $history->getChildrenComplaint(); $formVar["venereal_disease"] = $history->getVenerealDisease(); $formVar["accident_surgical_operation"] = $history->getAccidentSurgicalOperation(); $formVar["medicinal_intolerance"] = $history->getMedicinalIntolerance(); $formVar["mental_illness"] = $history->getMentalIllness(); } else { Error::fetch($historyQ, false); } $historyQ->freeResult(); $historyQ->close(); unset($historyQ); unset($history); /** * Show page */ $title = _("Editar antecedentes clínicos"); $titlePage = $patient->getName() . ' (' . $title . ')'; $focusFormField = "birth_growth"; // to avoid JavaScript mistakes in demo version require_once "../layout/header.php"; //$returnLocation = "../medical/history_personal_view.php?id_patient=" . $idPatient; $returnLocation = "../medical/history_personal_view.php";
* This is only used when copying an existing theme. */ if (isset($_GET["id_theme"])) { $idTheme = intval($_GET["id_theme"]); include_once "../model/Query/Theme.php"; $themeQ = new Query_Theme(); $themeQ->select($idTheme); $theme = $themeQ->fetch(); if ($theme) { $formVar["css_file"] = $theme->getCssFile(); $filename = "../css/" . $theme->getCssFile(); $fp = fopen($filename, 'r'); $formVar["css_rules"] = fread($fp, filesize($filename)); fclose($fp); } else { Error::fetch($themeQ, false); } $themeQ->freeResult(); $themeQ->close(); unset($themeQ); unset($theme); } elseif (!isset($formError)) { $filename = "../css/" . "scheme.css"; $fp = fopen($filename, 'r'); $formVar["css_rules"] = fread($fp, filesize($filename)); fclose($fp); } /** * Show page */ $title = _("Add New Theme");
* Testing connection and current version */ $setQ = new Query_Setting(); echo Msg::info(_("Database connection is good.")); /** * Show warning message if database exists */ $setQ->captureError(true); $setQ->select(); if ($setQ->isError()) { echo HTML::para(_("Building OpenClinic tables...")); } else { $set = $setQ->fetch(); if (!$set) { $setQ->close(); Error::fetch($setQ); } if (!isset($_GET["confirm"]) || $_GET["confirm"] != "yes") { echo HTML::para(sprintf(_("OpenClinic (version %s) is already installed."), $set->getVersion())); $setQ->close(); echo Msg::warning(_("Are you sure you want to delete all clinic data and create new OpenClinic tables?")); echo Msg::warning(_("If you continue all data will be lost.")); // @todo use fieldset echo HTML::start('form', array('method' => 'post', 'action' => $_SERVER['PHP_SELF'] . '?confirm=yes')); echo HTML::para(Form::button("continue", _("Continue")) . Form::generateToken()); echo HTML::end('form'); echo HTML::para(HTML::link(_("Cancel"), './index.php')); include_once "../layout/footer.php"; exit; } }
exit; } /** * Search database for problem */ $historyQ = new Query_History(); if (!$historyQ->selectPersonal($idPatient)) { $historyQ->close(); FlashMsg::add(_("That patient does not exist."), OPEN_MSG_ERROR); header("Location: ../medical/patient_search_form.php"); exit; } $history = $historyQ->fetch(); if (!$history) { $historyQ->close(); Error::fetch($historyQ); } $historyQ->freeResult(); $historyQ->close(); unset($historyQ); /** * Show page */ $title = _("View Personal Antecedents"); $titlePage = $patient->getName() . ' (' . $title . ')'; require_once "../layout/header.php"; /** * Breadcrumb */ $links = array(_("Medical Records") => "../medical/index.php", $patient->getName() => "../medical/patient_view.php", _("Clinic History") => "../medical/history_list.php", $title => ""); echo HTML::breadcrumb($links, "icon icon_patient");
Form::compareToken($returnLocation); require_once "../model/Query/Staff.php"; /** * Retrieving post var */ $idMember = intval($_POST["id_member"]); /** * Delete staff member */ $staffQ = new Query_Staff(); if (!$staffQ->select($idMember)) { $staffQ->close(); FlashMsg::add(_("That staff member does not exist."), OPEN_MSG_ERROR); header("Location: " . $returnLocation); exit; } $staff = $staffQ->fetch(); if (!$staff) { $staffQ->close(); Error::fetch($staffQ); } $staffQ->delete($staff->getIdMember(), $staff->getIdUser()); $info = trim($staff->getFirstName() . " " . $staff->getSurname1() . " " . $staff->getSurname2()); FlashMsg::add(sprintf(_("Staff member, %s, has been deleted."), $info)); $staffQ->close(); unset($staffQ); unset($staff); /** * Redirect to $returnLocation to avoid reload problem */ header("Location: " . $returnLocation);
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); } /** * 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);
/** * void log(string $class, string, $operation, array $key, string $method = "select") * * Inserts a new record in log operations table if it is possible * * @param string $class * @param string $operation one between INSERT, UPDATE, DELETE * @param array $key primary key of the record * @param string $method (optional) * @return void * @access public * @since 0.8 * @see OPEN_DEMO */ function log($class, $operation, $key, $method = "select") { if (defined("OPEN_DEMO") && OPEN_DEMO) { return; // disabled in demo version } $queryQ = new $class(); if (!call_user_func_array(array($queryQ, $method), $key)) { $queryQ->close(); return; } $data = $queryQ->fetchRow(); // obtains an array if (!$data) { $queryQ->close(); Error::fetch($queryQ); return; } $data = serialize($data); $table = $queryQ->getTableName(); $queryQ->close(); unset($queryQ); $this->insert($_SESSION['auth']['user_id'], $_SESSION['auth']['login_session'], $table, $operation, $data); }
unset($set); /** * i18n l10n (after OPEN_LANGUAGE is defined) */ require_once "../config/i18n.php"; if (isset($_GET["id_theme"]) && intval($_GET["id_theme"]) > 0) { include_once "../model/Query/Theme.php"; /** * Reading theme settings */ $themeQ = new Query_Theme(); $themeQ->select(intval($_GET["id_theme"])); $theme = $themeQ->fetch(); if (!$theme) { $themeQ->close(); Error::fetch($themeQ); } $themeQ->freeResult(); $themeQ->close(); unset($themeQ); $_POST["theme_name"] = $theme->getName(); $filename = '../css/' . $theme->getCssFile(); $size = filesize($filename); $fp = fopen($filename, 'r'); $_POST["css_rules"] = fread($fp, $size); fclose($fp); unset($theme); } if (isset($_POST["theme_name"]) && isset($_POST["css_rules"])) { /** * Theme related constants
include_once "../model/Query/Setting.php"; $setQ = new Query_Setting(); $setQ->select(); $set = $setQ->fetch(); if ($set) { $formVar["clinic_name"] = $set->getClinicName(); $formVar["clinic_hours"] = $set->getClinicHours(); $formVar["clinic_address"] = $set->getClinicAddress(); $formVar["clinic_phone"] = $set->getClinicPhone(); $formVar["clinic_url"] = $set->getClinicUrl(); $formVar["language"] = $set->getLanguage(); $formVar["id_theme"] = $set->getIdTheme(); $formVar["session_timeout"] = $set->getSessionTimeout(); $formVar["items_per_page"] = $set->getItemsPerPage(); } else { Error::fetch($setQ, false); } $setQ->freeResult(); $setQ->close(); unset($setQ); unset($set); } /** * Show page */ $title = _("Config settings"); $focusFormField = "session_timeout"; // to avoid JavaScript mistakes in demo version require_once "../layout/header.php"; /** * Breadcrumb
$userQ->close(); FlashMsg::add(_("That user does not exist."), OPEN_MSG_ERROR); header("Location: " . $returnLocation); exit; } $user = $userQ->fetch(); if ($user) { $formVar["id_user"] = $idUser; $formVar["id_member"] = $user->getIdMember(); $formVar["login"] = $user->getLogin(); $formVar["email"] = $user->getEmail(); $formVar["actived"] = $user->isActived() ? "checked" : ""; $formVar["id_theme"] = $user->getIdTheme(); $formVar["id_profile"] = $user->getIdProfile(); } else { Error::fetch($userQ, false); } $userQ->freeResult(); $userQ->close(); unset($userQ); unset($user); } /** * Show page */ $title = isset($_GET["all"]) ? _("Change User Data") : _("Edit User"); $focusFormField = "email"; // to avoid JavaScript mistakes in demo version require_once "../layout/header.php"; /** * Breadcrumb
exit; } $staff = $staffQ->fetch(); if ($staff) { $formVar["id_member"] = $idMember; $formVar["member_type"] = $staff->getMemberType(); $formVar["collegiate_number"] = $staff->getCollegiateNumber(); $formVar["nif"] = $staff->getNIF(); $formVar["first_name"] = $staff->getFirstName(); $formVar["surname1"] = $staff->getSurname1(); $formVar["surname2"] = $staff->getSurname2(); $formVar["address"] = $staff->getAddress(); $formVar["phone_contact"] = $staff->getPhone(); $formVar["login"] = $staff->getLogin(); } else { Error::fetch($staffQ, false); } $staffQ->freeResult(); $staffQ->close(); unset($staffQ); unset($staff); } /** * Show page */ switch (substr($formVar["member_type"], 0, 1)) { case "A": $title = _("Edit Administrative Information"); break; case "D": $title = _("Edit Doctor Information");