} echo HTML::rule(); /** * Show closed medical problems */ echo HTML::section(2, _("Closed Medical Problems List:")); $problemQ = new Query_Page_Problem(); if (!$problemQ->selectProblems($idPatient, true)) { echo Msg::info(_("No closed medical problems defined for this patient.")); echo HTML::rule(); } while ($problem = $problemQ->fetch()) { echo HTML::section(3, _("Order Number")); echo HTML::para($problem->getOrderNumber()); if ($problem->getIdMember()) { $staffQ = new Query_Staff(); if ($staffQ->select($problem->getIdMember())) { $staff = $staffQ->fetch(); if ($staff) { echo HTML::section(3, _("Attending Physician")); echo HTML::para($staff->getSurname1() . ' ' . $staff->getSurname2() . ', ' . $staff->getFirstName()); } $staffQ->freeResult(); } $staffQ->close(); unset($staffQ); unset($staff); } echo HTML::section(3, _("Opening Date")); echo HTML::para(I18n::localDate($problem->getOpeningDate())); echo HTML::section(3, _("Last Update Date"));
$row = Form::label("nss", _("CPF") . ":"); $row .= Form::text("nss", isset($formVar["nss"]) ? $formVar["nss"] : null, array('size' => 30, 'error' => isset($formError["nss"]) ? $formError["nss"] : null)); $tbody[] = $row; $row = Form::label("family_situation", _("Informações complementares") . ":"); $row .= Form::textArea("family_situation", $formVar["family_situation"], array('rows' => 3, 'cols' => 30)); $tbody[] = $row; $row = Form::label("labour_situation", _("Trabalho dos familiares") . ":"); $row .= Form::textArea("labour_situation", $formVar["labour_situation"], array('rows' => 3, 'cols' => 30)); $tbody[] = $row; $row = Form::label("education", _("Procedência do encaminhamento") . ":"); $row .= Form::textArea("education", $formVar["education"], array('rows' => 3, 'cols' => 30)); $tbody[] = $row; $row = Form::label("insurance_company", _("CID") . ":"); $row .= Form::text("insurance_company", isset($formVar["insurance_company"]) ? $formVar["insurance_company"] : null, array('size' => 30, 'error' => isset($formError["insurance_company"]) ? $formError["insurance_company"] : null)); $tbody[] = $row; $staffQ = new Query_Staff(); $array = null; $array[0] = ""; // to permit null value if ($staffQ->selectType('D')) { while ($staff = $staffQ->fetch()) { $array[$staff->getIdMember()] = $staff->getFirstName() . " " . $staff->getSurname1() . " " . $staff->getSurname2(); } $staffQ->freeResult(); } $staffQ->close(); unset($staffQ); $row = Form::label("id_member", _("Atendente") . ":"); $row .= Form::select("id_member", $array, $formVar["id_member"]); unset($array); $tbody[] = $row;
*/ require_once "../auth/login_check.php"; loginCheck(OPEN_PROFILE_ADMINISTRATOR); /** * Validate data */ require_once "../model/Query/Staff.php"; $staff = new Staff(); require_once "../admin/staff_validate_post.php"; /** * Destroy form values and errors */ Form::unsetSession(); /** * Insert new staff member */ $staffQ = new Query_Staff(); if ($staffQ->existLogin($staff->getLogin())) { FlashMsg::add(sprintf(_("Login, %s, already exists. The changes have no effect."), $staff->getLogin()), OPEN_MSG_WARNING); } else { $staffQ->insert($staff); $info = $staff->getFirstName() . " " . $staff->getSurname1() . " " . $staff->getSurname2(); FlashMsg::add(sprintf(_("Staff member, %s, has been added."), $info)); } $staffQ->close(); unset($staffQ); unset($staff); /** * Redirect to $returnLocation to avoid reload problem */ header("Location: " . $returnLocation);
/** * Checking permissions */ require_once "../auth/login_check.php"; loginCheck(OPEN_PROFILE_ADMINISTRATOR); require_once "../lib/Form.php"; 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();
/** * Retrieving get vars */ $memberType = isset($_GET["type"]) ? Check::safeText($_GET["type"]) : ""; /** * Show page */ $title = _("Staff Members"); require_once "../layout/header.php"; /** * Breadcrumb */ $links = array(_("Admin") => "../admin/index.php", $title => ""); echo HTML::breadcrumb($links, "icon icon_staff"); unset($links); $staffQ = new Query_Staff(); if (!empty($memberType)) { $numRows = $staffQ->selectType($memberType); switch ($memberType) { case 'A': $listTitle = _("Administratives:"); break; case 'D': $listTitle = _("Doctors:"); break; } $viewType = false; } else { $numRows = $staffQ->select(); $listTitle = _("Staff Members") . ":"; $viewType = true;
require_once "../model/Query/Staff.php"; /** * Validate data */ $errorLocation = "../admin/staff_edit_form.php?id_member=" . intval($_POST["id_member"]); // controlling var $staff = new Staff(); $staff->setIdMember($_POST["id_member"]); require_once "../admin/staff_validate_post.php"; /** * Destroy form values and errors */ Form::unsetSession(); /** * Update staff member */ $staffQ = new Query_Staff(); if ($staffQ->existLogin($staff->getLogin(), $staff->getIdMember())) { FlashMsg::add(sprintf(_("Login, %s, already exists. The changes have no effect."), $staff->getLogin()), OPEN_MSG_WARNING); } else { $staffQ->update($staff); $info = $staff->getFirstName() . " " . $staff->getSurname1() . " " . $staff->getSurname2(); FlashMsg::add(sprintf(_("Staff member, %s, has been updated."), $info)); } $staffQ->close(); unset($staffQ); unset($staff); /** * Redirect to $returnLocation to avoid reload problem */ header("Location: " . $returnLocation);