if ($history->getSpouseChildsStatusHealth()) {
    echo HTML::section(3, _("Spouse and Childs Status Health"));
    echo HTML::para(nl2br($history->getSpouseChildsStatusHealth()));
}
if ($history->getFamilyIllness()) {
    echo HTML::section(3, _("Family Illness"));
    echo HTML::para(nl2br($history->getFamilyIllness()));
}
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();
        }
Esempio n. 2
0
} elseif ($year) {
    LogStats::monthly($table, $year);
} else {
    LogStats::yearly($table);
}
if ($table == 'record') {
    include_once "../model/Query/Page/Record.php";
    $logQ = new Query_Page_Record();
} else {
    include_once "../model/Query/Page/Access.php";
    $logQ = new Query_Page_Access();
    $profiles = array(OPEN_PROFILE_ADMINISTRATOR => _("Administrator"), OPEN_PROFILE_ADMINISTRATIVE => _("Administrative"), OPEN_PROFILE_DOCTOR => _("Doctor"));
}
if (!$logQ->select($year, $month, $day)) {
    $logQ->close();
    echo Msg::info(_("No logs in this date."));
    include_once "../layout/footer.php";
    exit;
}
$thead = array(_("#"), _("Access Date"), _("Login"));
if ($table == 'record') {
    $thead[] = _("Table");
    $thead[] = _("Operation");
    $thead[] = _("Data");
} else {
    $thead[] = _("Profile");
}
$options = array('align' => 'center', 0 => array('align' => 'right'));
$tbody = array();
for ($i = 1; $log = $logQ->fetch(); $i++) {
    $row = $i . '.';
Esempio n. 3
0
        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;
    }
}
$setQ->close();
unset($setQ);
unset($set);
/**
 * Creating each table listed in the $tables array
 */
$tables = getTables();
foreach ($tables as $tableName) {
    $result = parseSqlFile("./sql/" . $tableName . ".sql", $tableName, true);
    if ($result) {
        $text = sprintf(_("Table %s dropped."), $tableName) . PHP_EOL;
        $text .= sprintf(_("Table %s created."), $tableName) . PHP_EOL;
        $text .= str_repeat(".", 50);
        echo HTML::para(nl2br($text));
    } else {
        echo Msg::error(_("Last instruction failed"));
        include_once "../layout/footer.php";
        exit;
    }
}
echo Msg::info(_("OpenClinic tables have been created successfully!"));
echo HTML::section(1, HTML::link(_("Start using OpenClinic"), '../home/index.php'));
require_once "../layout/footer.php";
Esempio n. 4
0
if (isset($isMd5) && $isMd5) {
    echo HTML::insertScript('md5.js');
    echo HTML::insertScript('password.php');
}
if (isset($focusFormField) && !empty($focusFormField)) {
    echo HTML::start('script', array('src' => '../js/focus.php?field=' . $focusFormField, 'type' => 'text/javascript'));
    echo HTML::end('script');
}
echo HTML::end('head');
echo HTML::start('body');
require_once "../layout/component.php";
echo HTML::start('div', array('id' => 'wrap'));
echo HTML::start('div', array('id' => 'header'));
echo appLogo();
echo HTML::para(HTML::link(_("Skip over navigation"), '#main', null, array('accesskey' => 2)), array('id' => 'skip_navigation'));
echo shortcuts(isset($tab) ? $tab : null, isset($nav) ? $nav : null);
if (isset($tab)) {
    echo menuBar($tab);
}
echo HTML::end('div');
// #header
echo HTML::rule();
echo HTML::start('div', array('id' => 'main'));
echo HTML::start('div', array('id' => 'content'));
if (defined("OPEN_DEMO") && OPEN_DEMO) {
    echo Msg::info(_("This is a demo version"));
}
/**
 * Display "public" message(s) from controller if available
 */
echo FlashMsg::get();
Esempio n. 5
0
$title = _("Themes");
require_once "../layout/header.php";
/**
 * Breadcrumb
 */
$links = array(_("Admin") => "../admin/index.php", $title => "");
echo HTML::breadcrumb($links, "icon icon_theme");
unset($links);
echo HTML::para(HTML::link(_("Add New Theme"), '../admin/theme_new_form.php'));
/**
 * Search in database
 */
$themeQ = new Query_Theme();
if (!$themeQ->selectWithStats()) {
    $themeQ->close();
    echo Msg::info(_("No results found."));
    include_once "../layout/footer.php";
    exit;
}
if ($themeQ->numRows() > 1) {
    $legend = _("Change Theme by default in application");
    $content = Form::label("id_theme", _("Choose a New Theme:"));
    $content .= Form::selectTable("theme_tbl", "id_theme", OPEN_THEME_ID, "theme_name");
    $body = array($content);
    $foot = array(Form::button("button1", _("Update")));
    /**
     * Theme use form
     */
    echo HTML::start('form', array('method' => 'post', 'action' => '../admin/theme_use.php'));
    echo Form::fieldset($legend, $body, $foot);
    echo HTML::end('form');
Esempio n. 6
0
 /**
  * void summary(string $table)
  *
  * Draws summary stats
  *
  * @param string $table
  * @return void
  * @access public
  * @static
  */
 public static function summary($table)
 {
     $logQ = new Query_LogStats($table);
     $total = $logQ->totalHits();
     if ($total == 0) {
         $logQ->close();
         echo Msg::info(_("There are not statistics"));
         return;
     }
     $today = date("Y-m-d");
     // calculated date
     $arrToday = explode("-", $today);
     $sectionTitle = _("Total") . ': ' . $total . ' ' . strtolower(_("Hits"));
     echo HTML::section(3, $sectionTitle);
     $array = $logQ->busiestYear();
     if (is_array($array)) {
         list($year, $hits) = $array;
         echo HTML::para(sprintf(_("Busiest Year: %d (%d hits)"), intval($year), $hits));
     }
     $array = $logQ->busiestMonth();
     if (is_array($array)) {
         list($year, $month, $hits) = $array;
         $months = self::getMonthName();
         echo HTML::para(sprintf(_("Busiest Month: %s %d (%d hits)"), $months[intval($month)], intval($year), $hits));
     }
     $array = $logQ->busiestDay();
     if (is_array($array)) {
         list($year, $month, $day, $hits) = $array;
         echo HTML::para(sprintf(_("Busiest Day: %d %s %d (%d hits)"), intval($day), $months[intval($month)], intval($year), $hits));
     }
     $array = $logQ->busiestHour();
     if (is_array($array)) {
         list($year, $month, $day, $hour, $hits) = $array;
         $hour = sprintf("%02d:00 - %02d:59", $hour, $hour);
         echo HTML::para(sprintf(_("Busiest Hour: %s on %s %d, %d (%d hits)"), $hour, $months[intval($month)], intval($day), intval($year), $hits));
     }
     $logQ->freeResult();
     $logQ->close();
     unset($logQ);
 }
Esempio n. 7
0
 * Breadcrumb
 */
$links = array(_("Medical Records") => "../medical/index.php", $patient->getName() => "../medical/patient_view.php", $title => "");
echo HTML::breadcrumb($links, "icon icon_patient");
unset($links);
echo $patient->getHeader();
$problemQ = new Query_Page_Problem();
$lastOrderNumber = $problemQ->getLastOrderNumber($idPatient);
if ($_SESSION['auth']['is_administrative']) {
    echo HTML::para(HTML::link(_("Iniciar novo atendimento"), '../medical/problem_new_form.php', array('id_patient' => $idPatient, 'order_number' => $lastOrderNumber)));
}
echo HTML::rule();
echo HTML::section(2, _("Lista de atendimentos:"));
if (!$problemQ->selectProblems($idPatient)) {
    $problemQ->close();
    echo Msg::info(_("Nenhum atendimento foi realizado para esse beneficiário."));
    include_once "../layout/footer.php";
    exit;
}
$thead = array(_("Código atendimento"), _("Ações") => array('colspan' => $_SESSION['auth']['is_administrative'] ? 5 : 3), _("Resumo"), _("Atendido em"), _("Alterado em"));
$options = array(0 => array('align' => 'right'));
$tbody = array();
while ($problem = $problemQ->fetch()) {
    $row = $problem->getOrderNumber();
    $row .= OPEN_SEPARATOR;
    if ($_SESSION['auth']['is_administrative']) {
        $row .= HTML::link(HTML::image('../img/action_edit.png', _("edit")), '../medical/problem_edit_form.php', array('id_problem' => $problem->getIdProblem(), 'id_patient' => $problem->getIdPatient()));
        $row .= OPEN_SEPARATOR;
        $row .= HTML::link(HTML::image('../img/action_delete.png', _("delete")), '../medical/problem_del_confirm.php', array('id_problem' => $problem->getIdProblem(), 'id_patient' => $problem->getIdPatient()));
        $row .= OPEN_SEPARATOR;
    }
Esempio n. 8
0
/**
 * 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", $title => "");
echo HTML::breadcrumb($links, "icon icon_patient");
unset($links);
echo $patient->getHeader();
echo $problem->getHeader();
if ($_SESSION['auth']['is_administrative']) {
    echo HTML::para(HTML::link(_("Add New Medical Test"), '../medical/test_new_form.php', array('id_problem' => $idProblem, 'id_patient' => $idPatient)));
    echo HTML::rule();
}
$testQ = new Query_Test();
if (!$testQ->select($idProblem)) {
    $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()));
Esempio n. 9
0
echo HTML::start('body', array('id' => 'top'));
echo HTML::start('div', array('id' => 'wrap'));
echo HTML::start('div', array('id' => 'header'));
echo appLogo();
$array = array(HTML::link(_("Close Window"), '#', null, array('onclick' => 'window.close(); return false;')));
echo HTML::itemList($array, array('id' => 'shortcuts'));
echo menuBar($tab);
echo HTML::end('div');
// #header
echo HTML::start('div', array('id' => 'main'));
echo HTML::start('div', array('id' => 'content'));
echo HTML::section(1, sprintf(_("This is a preview of the %s theme."), $_POST["theme_name"]));
echo HTML::para(HTML::link(_("Sample Link"), '#top'));
echo HTML::rule();
echo HTML::section(2, _("Subtitle Sample:"));
$thead = array(_("Table Heading") => array('colspan' => 2));
$tbody = array();
$tbody[] = array(sprintf(_("Sample data row %d"), 1));
$tbody[] = array(sprintf(_("Sample data row %d"), 2));
$row = Form::label("sample_text", _("Required Field") . ":", array('class' => 'required'));
$row .= OPEN_SEPARATOR;
$row .= Form::text("sample_text", _("Sample Input Text"), array('size' => 50, 'readonly' => true));
$tbody[] = explode(OPEN_SEPARATOR, $row);
$options = array('tfoot' => array('align' => 'center'), 'r0' => array('colspan' => 2), 'r1' => array('colspan' => 2));
$tfoot = array(Form::button("sample_button", _("Sample Button"), array('type' => 'button')));
echo HTML::table($thead, $tbody, $tfoot, $options);
echo Msg::error(_("Sample Error"));
echo Msg::warning(_("Sample Warning"));
echo Msg::info(_("Sample Info"));
echo Msg::hint(_("Sample Hint"));
require_once "../layout/footer.php";
Esempio n. 10
0
    echo Form::fieldset(_("Install file"), $body, $foot);
    echo HTML::end('form');
    echo HTML::para(HTML::link(_("Cancel"), './index.php'));
    include_once "../layout/footer.php";
    exit;
}
// end if
require_once "../model/Query.php";
$installQ = new Query();
$installQ->captureError(true);
if ($installQ->isError()) {
    echo HTML::para(_("The connection to the database failed with the following error:"));
    echo Msg::error($installQ->getDbError());
    echo HTML::rule();
    echo HTML::para(_("Please make sure the following has been done before running this install script."));
    $array = array(sprintf(_("Create OpenClinic database (%s of the install instructions)"), HTML::link(sprintf(_("step %d"), 4), '../install.html#step4')), sprintf(_("Create OpenClinic database user (%s of the install instructions)"), HTML::link(sprintf(_("step %d"), 5), '../install.html#step5')), sprintf(_("Update %s with your new database username and password (%s of the install instructions)"), HTML::tag('strong', 'openclinic/config/database_constants.php'), HTML::link(sprintf(_("step %d"), 8), '../install.html#step8')));
    echo HTML::itemList($array, null, true);
    echo HTML::para(sprintf(_("See %s for more details."), HTML::link(_("Install Instructions"), '../install.html')));
    include_once "../layout/footer.php";
    exit;
}
// end if
$installQ->close();
echo Msg::info(_("Database connection is good."));
echo HTML::start('form', array('method' => 'post', 'action' => $_SERVER['PHP_SELF'], 'enctype' => 'multipart/form-data'));
$body = array();
$body[] = Form::file("sql_file", null, array('size' => 50));
$foot = array(Form::button("view_file", _("View file")));
echo Form::fieldset(_("Install a SQL file"), $body, $foot);
echo HTML::end('form');
require_once "../layout/footer.php";
Esempio n. 11
0
    $localQuery = 'OPTIMIZE TABLE ' . $row['Name'];
    if (!$auxConn->exec($localQuery)) {
        $auxConn->close();
        Error::connection($auxConn);
    }
    $content = $row['Name'];
    $content .= OPEN_SEPARATOR;
    $content .= $total . ' KB';
    $content .= OPEN_SEPARATOR;
    if ($gain == 0) {
        $content .= _("Already optimized");
        $content .= OPEN_SEPARATOR;
        $content .= '0 KB';
    } else {
        $content .= _("Optimized!");
        $content .= OPEN_SEPARATOR;
        $content .= $gain . ' KB';
    }
    $tbody[] = explode(OPEN_SEPARATOR, $content);
}
$auxConn->close();
unset($auxConn);
unset($rows);
unset($row);
echo HTML::table($thead, $tbody, null, $options);
$totalGain = round($totalGain, 3);
echo HTML::section(3, _("Optimization Results") . ":");
echo Msg::info(sprintf(_("Total Database Size: %d KB"), $totalAll));
echo Msg::info(sprintf(_("Total Space Saved: %d KB"), $totalGain));
echo HTML::para(HTML::link(_("Back return"), '../admin/dump_view_form.php'));
require_once "../layout/footer.php";
Esempio n. 12
0
unset($links);
echo $patient->getHeader();
if ($_SESSION['auth']['is_administrative']) {
    $title = _("Search Relatives to add to list");
    /**
     * Search form
     */
    echo HTML::start('form', array('method' => 'post', 'action' => '../medical/relative_search.php'));
    echo Form::hidden("id_patient", $idPatient);
    require_once "../medical/patient_search_fields.php";
    echo HTML::end('form');
    echo Msg::hint('* ' . _("Note: Empty search to see all results."));
}
// end if
if (count($relArray) == 0) {
    echo Msg::info(_("No relatives defined for this patient."));
    include_once "../layout/footer.php";
    exit;
}
echo HTML::rule();
echo HTML::section(2, _("Relatives List:"));
$thead = array(_("#"), _("Function") => array('colspan' => $_SESSION['auth']['is_administrative'] ? 2 : 1), _("Surname 1"), _("Surname 2"), _("First Name"));
$options = array(0 => array('align' => 'right'));
$patQ = new Query_Page_Patient();
$patQ->captureError(true);
$tbody = array();
for ($i = 0; $i < count($relArray); $i++) {
    $patQ->select($relArray[$i]);
    if ($patQ->isError()) {
        Error::query($patQ, false);
        continue;
Esempio n. 13
0
echo $problem->getHeader();
if ($_SESSION['auth']['is_administrative']) {
    echo HTML::para(HTML::link(_("Add New Connection Problems"), '../medical/connection_new_form.php', array('id_problem' => $idProblem, 'id_patient' => $idPatient)));
}
$connQ = new Query_Connection();
$connArray = array();
if ($connQ->select($idProblem)) {
    while ($conn = $connQ->fetch()) {
        $connArray[] = $conn[1];
    }
    $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();
Esempio n. 14
0
echo HTML::section(1, $title);
echo HTML::para(sprintf(_("Finded version: %s"), $version));
foreach ($upgrades as $value) {
    $file = $value;
    // upgrade<initial_version>-<final_version>.sql
    $value = substr($value, strlen('upgrade'));
    // <initial_version>-<final_version>.sql
    $array = explode("-", $value);
    // 0 => <initial_version>, 1 => <final_version>.sql
    $initialVersion = $array[0];
    // <number>.<number>
    if (version_compare($version, $initialVersion, '<=')) {
        echo HTML::para(sprintf(_("Aplying %s file..."), HTML::tag('strong', $file)));
        if (!parseSqlFile('./upgrades/' . $file)) {
            //Error::debug($file); // debug
            echo Msg::error(sprintf(_("Error processing file: %s"), $file));
            include_once "../layout/footer.php";
            exit;
        }
    }
}
$setQ->captureError(false);
$setQ->select();
$set = $setQ->fetch();
echo HTML::para(sprintf(_("Upgraded to version: %s"), $set->getVersion()));
$setQ->close();
unset($setQ);
unset($set);
echo Msg::info(_("Database upgrade finished correctly!"));
echo HTML::para(HTML::link(_("Go to OpenClinic"), '../home/index.php'));
require_once "../layout/footer.php";
Esempio n. 15
0
$titlePage = $patient->getName() . ' (' . $title . ')';
require_once "../layout/header.php";
/**
 * Breadcrumb
 */
$links = array(_("Medical Records") => "../medical/index.php", $patient->getName() => "../medical/patient_view.php", $title => "");
echo HTML::breadcrumb($links, "icon icon_patient");
unset($links);
echo $patient->getHeader();
echo HTML::para(HTML::link(_("Ver antecedentes clínicos"), '../medical/history_personal_view.php', array('id_patient' => $idPatient)) . ' | ' . HTML::link(_("Ver antecedentes familiares"), '../medical/history_family_view.php', array('id_patient' => $idPatient)));
echo HTML::rule();
echo HTML::section(2, _("Lista de cenários clínicos do beneficiário:"));
$problemQ = new Query_Page_Problem();
if (!$problemQ->selectProblems($idPatient, true)) {
    $problemQ->close();
    echo Msg::info(_("Não há cenários clínicos encerrados para esse beneficiário."));
    include_once "../layout/footer.php";
    exit;
}
$thead = array(_("Order Number"), _("Function") => array('colspan' => $_SESSION['auth']['is_administrative'] ? 4 : 3), _("Wording"), _("Opening Date"), _("Closing Date"));
$options = array(0 => array('align' => 'right'));
$tbody = array();
while ($problem = $problemQ->fetch()) {
    $row = $problem->getOrderNumber();
    $row .= OPEN_SEPARATOR;
    // a closed medical problem is not editable
    $row .= HTML::link(HTML::image('../img/action_view.png', _("view")), '../medical/problem_view.php', array('id_problem' => $problem->getIdProblem(), 'id_patient' => $problem->getIdPatient()));
    $row .= OPEN_SEPARATOR;
    if ($_SESSION['auth']['is_administrative']) {
        $row .= HTML::link(HTML::image('../img/action_delete.png', _("delete")), '../medical/problem_del_confirm.php', array('id_problem' => $problem->getIdProblem(), 'id_patient' => $problem->getIdPatient()));
        $row .= OPEN_SEPARATOR;