Esempio n. 1
0
    exit;
}
/**
 * Show page
 */
$title = _("Clinic History");
$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(_("View Personal Antecedents"), '../medical/history_personal_view.php', array('id_patient' => $idPatient)) . ' | ' . HTML::link(_("View Family Antecedents"), '../medical/history_family_view.php', array('id_patient' => $idPatient)));
echo HTML::rule();
echo HTML::section(2, _("Closed Medical Problems List:"));
$problemQ = new Query_Page_Problem();
if (!$problemQ->selectProblems($idPatient, true)) {
    $problemQ->close();
    echo Msg::info(_("No closed medical problems defined for this patient."));
    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;
Esempio n. 2
0
/**
 * 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");
unset($links);
echo $patient->getHeader();
if ($_SESSION['auth']['is_administrative']) {
    echo HTML::para(HTML::link(_("Editar antecedentes familiares"), '../medical/history_family_edit_form.php', array('id_patient' => $idPatient)));
}
/**
 * Show family antecedents
 */
echo HTML::section(2, _("Antecedentes Familiares"));
if ($history->getParentsStatusHealth()) {
    echo HTML::section(3, _("Estado atual de saúde dos pais"));
    echo HTML::para(nl2br($history->getParentsStatusHealth()));
}
if ($history->getBrothersStatusHealth()) {
    echo HTML::section(3, _("Estado geral da saúde dos irmãos"));
    echo HTML::para(nl2br($history->getBrothersStatusHealth()));
}
if ($history->getSpouseChildsStatusHealth()) {
    echo HTML::section(3, _("Histórico de problemas degenerativos ou de doenças crônicas"));
    echo HTML::para(nl2br($history->getSpouseChildsStatusHealth()));
}
if ($history->getFamilyIllness()) {
    echo HTML::section(3, _("Histórico visitas domiciliares"));
    echo HTML::para(nl2br($history->getFamilyIllness()));
}
require_once "../layout/footer.php";
/**
 * 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";
/**
 * Breadcrumb
 */
$links = array(_("Medical Records") => "../medical/index.php", $patient->getName() => "../medical/patient_view.php", _("Clinic History") => "../medical/history_list.php", _("View Personal Antecedents") => $returnLocation, $title => "");
echo HTML::breadcrumb($links, "icon icon_patient");
unset($links);
echo $patient->getHeader();
echo Form::errorMsg();
/**
 * Edit form
 */
echo HTML::start('form', array('method' => 'post', 'action' => '../medical/history_personal_edit.php'));
echo Form::hidden("id_patient", $idPatient);
require_once "../medical/history_personal_fields.php";
echo HTML::end('form');
echo HTML::para(HTML::link(_("Voltar"), $returnLocation));
/**
 * Destroy form values and errors
 */
Form::unsetSession();
require_once "../layout/footer.php";
Esempio n. 4
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. 5
0
 * Show page
 */
$title = _("Medical Problems Report");
$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();
$problemQ = new Query_Page_Problem();
$lastOrderNumber = $problemQ->getLastOrderNumber($idPatient);
if ($_SESSION['auth']['is_administrative']) {
    echo HTML::para(HTML::link(_("Add New Medical Problem"), '../medical/problem_new_form.php', array('id_patient' => $idPatient, 'order_number' => $lastOrderNumber)));
}
echo HTML::rule();
echo HTML::section(2, _("Medical Problems List:"));
if (!$problemQ->selectProblems($idPatient)) {
    $problemQ->close();
    echo Msg::info(_("No medical problems defined for this patient."));
    include_once "../layout/footer.php";
    exit;
}
$thead = array(_("Order Number"), _("Function") => array('colspan' => $_SESSION['auth']['is_administrative'] ? 5 : 3), _("Wording"), _("Opening Date"), _("Last Update Date"));
$options = array(0 => array('align' => 'right'));
$tbody = array();
while ($problem = $problemQ->fetch()) {
    $row = $problem->getOrderNumber();
    $row .= OPEN_SEPARATOR;
Esempio n. 6
0
echo HTML::section(2, sprintf(_("Access Logs List for user %s"), $login) . ":");
// Printing result stats and page nav
echo HTML::para(HTML::tag('strong', sprintf(_("%d accesses."), $accessQ->getRowCount())));
$params = array('id_user='******'login='******'&', $params);
$pageCount = $accessQ->getPageCount();
$pageLinks = Search::pageLinks($currentPage, $pageCount, $_SERVER['PHP_SELF'] . '?' . $params);
echo $pageLinks;
$profiles = array(OPEN_PROFILE_ADMINISTRATOR => _("Administrator"), OPEN_PROFILE_ADMINISTRATIVE => _("Administrative"), OPEN_PROFILE_DOCTOR => _("Doctor"));
$thead = array(_("Access Date") => array('colspan' => 2), _("Login"), _("Profile"));
$options = array(0 => array('align' => 'right'), 2 => array('align' => 'center'), 3 => array('align' => 'center'));
$tbody = array();
while ($access = $accessQ->fetch()) {
    $row = $accessQ->getCurrentRow() . ".";
    $row .= OPEN_SEPARATOR;
    $row .= I18n::localDate($access["access_date"]);
    $row .= OPEN_SEPARATOR;
    $row .= $access["login"];
    $row .= OPEN_SEPARATOR;
    $row .= $profiles[$access["id_profile"]];
    $tbody[] = explode(OPEN_SEPARATOR, $row);
}
$accessQ->freeResult();
$accessQ->close();
echo HTML::table($thead, $tbody, null, $options);
echo $pageLinks;
unset($accessQ);
unset($access);
unset($profiles);
echo HTML::para(HTML::link(_("Return to users list"), $returnLocation));
require_once "../layout/footer.php";
Esempio n. 7
0
require_once "../layout/header.php";
echo HTML::section(1, $title, array('class' => 'icon icon_admin'));
echo HTML::para(_("Use the following functions located in the left hand navigation area to manage your clinic's staff and administrative records."));
echo HTML::section(2, HTML::link(_("Config settings"), '../admin/setting_edit_form.php'), array('class' => 'icon icon_config'));
echo HTML::para(_("Update config settings."));
echo HTML::rule();
echo HTML::section(2, HTML::link(_("Staff Members"), '../admin/staff_list.php'), array('class' => 'icon icon_staff'));
echo HTML::para(_("View the clinic staff member list.") . ' ' . _("From this list you can:"));
$array = array(_("build a new staff member"), _("edit the staff member information"), _("build or edit the clinic user associated"), _("delete a staff member"));
echo HTML::itemList($array);
echo HTML::rule();
echo HTML::section(2, HTML::link(_("Users"), '../admin/user_list.php'), array('class' => 'icon icon_user'));
echo HTML::para(_("View the list of clinic users.") . ' ' . _("From this list you can:"));
$array = array(_("build a new clinic user"), _("edit a existing clinic user"), _("edit the staff member information"), _("reset a user's password"), _("delete a clinic user"));
echo HTML::itemList($array);
echo HTML::rule();
echo HTML::section(2, HTML::link(_("Themes"), '../admin/theme_list.php'), array('class' => 'icon icon_theme'));
echo HTML::para(_("View the list of site look and feel themes.") . ' ' . _("From this list you can:"));
$array = array(_("set the theme in use by default for your site"), _("build a new site theme"), _("edit an existing theme"), _("delete a theme"));
echo HTML::itemList($array);
echo HTML::rule();
echo HTML::section(2, HTML::link(_("Dumps"), '../admin/dump_view_form.php'), array('class' => 'icon icon_dump'));
echo HTML::para(_("From this option you can:"));
$array = array(_("install dump from file"), sprintf(_("export database dump to %s format"), "MySQL"), sprintf(_("export database dump to %s format"), "XML"), sprintf(_("export database dump to %s format"), "CSV"), _("optimize database"));
echo HTML::itemList($array);
echo HTML::rule();
echo HTML::section(2, HTML::link(_("Logs"), '../admin/log_stats.php'), array('class' => 'icon icon_log'));
echo HTML::para(_("View logs generated by the program:"));
$array = array(_("user's accesses logs"), _("operations with medical records logs"), _("statistics for years, months, days and hours"));
echo HTML::itemList($array);
require_once "../layout/footer.php";
Esempio n. 8
0
 /**
  * string getHeader(void)
  *
  * Returns a header with medical problem information
  *
  * @return string
  * @access public
  * @since 0.8
  */
 function getHeader()
 {
     $_html = HTML::start('div', array('id' => 'problem_header', 'class' => 'clearfix'));
     $_html .= HTML::para(_("Wording") . ': ' . $this->getWordingPreview());
     $_html .= HTML::para(_("Opening Date") . ': ' . I18n::localDate($this->getOpeningDate()), array('class' => 'right'));
     $_html .= HTML::para(_("Last Update Date") . ': ' . I18n::localDate($this->getLastUpdateDate()), array('class' => 'right'));
     $_html .= HTML::end('div');
     return $_html;
 }
Esempio n. 9
0
echo HTML::end('style');
echo HTML::insertScript('pop_window.js');
echo HTML::end('head');
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"));
Esempio n. 10
0
 */
$tab = "home";
$nav = "summary";
require_once "../config/environment.php";
if (isset($_SESSION['auth']['token'])) {
    /**
     * Checking permissions
     */
    include_once "../auth/login_check.php";
    loginCheck();
}
require_once "../lib/Check.php";
/**
 * Show page
 */
$title = _("Welcome to OpenClinic");
require_once "../layout/header.php";
echo HTML::section(1, $title);
echo HTML::para(_("OpenClinic is an easy to use, open source, medical records system."));
echo HTML::para(_("When you select any of the following tabs you will be prompted to login."));
echo HTML::section(2, HTML::link(_("Social"), '../medical/index.php'), array('class' => 'icon icon_medical'));
echo HTML::para(_("Utilize essa área para gerenciar e realizar os atendimentos aos beneficiários."));
echo HTML::para(_("Administração de pacientes:"));
$array = array(_("Pesquise, cadastre, apague ou edite seus beneficiários"), _("Dados Sociais"), _("Histórico dos atendimentos"), _("Histórico dos problemas e diagnósticos"));
echo HTML::itemList($array);
echo HTML::rule();
echo HTML::section(2, HTML::link(_("Admin"), '../admin/index.php'), array('class' => 'icon icon_admin'));
echo HTML::para(_("Utilize essa aba para administrar usuários e outras configurações do sistema."));
$array = array(_("Membros de atendimento"), _("Configurações do sistema"), _("Editor de temas (não utilizar)"), _("Usuários do sistema"), _("Dumps (uso restrito ao técnico)"), _("Logs (uso restrito ao técnico)"));
echo HTML::itemList($array);
require_once "../layout/footer.php";
Esempio n. 11
0
 sprintf(_("Under the %s"),
   HTML::link('GNU General Public License', '../home/license.php', null, array('rel' => 'license'))
 )
  );

  if (defined("OPEN_DEMO") && OPEN_DEMO)
  {
 echo Msg::info(_("This is a demo version"));
  }

  /**
* End server page generation time
*/
if (defined("OPEN_DEBUG") && OPEN_DEBUG) {
    $microTime = explode(" ", microtime());
    $endTime = $microTime[1] + $microTime[0];
    $totalTime = sprintf(_("Page generation: %s seconds"), substr($endTime - $startTime, 0, 6));
    echo HTML::para($totalTime);
}
echo HTML::end('div');
// #app_info
echo HTML::end('div');
// #footer
echo HTML::end('div');
// #wrap
echo HTML::end('body');
echo HTML::end('html');
if (defined("OPEN_BUFFER") && OPEN_BUFFER) {
    ob_end_flush();
    flush();
}
Esempio n. 12
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. 13
0
        $text .= HTML::para(_("Once made it, click in Next button."));
    } else {
        $text .= ' - ';
        $text .= HTML::tag('strong', _("ok"));
    }
    $itemArray[] = $text;
    unset($text);
    echo HTML::itemList($itemArray);
    unset($itemArray);
    echo HTML::para(sprintf(_("To install OpenClinic on a Windows machine for test, you just need to install %s before."), HTML::link("AppServ", 'http://academic.cmri.ac.th/appserv')));
    echo HTML::para(sprintf(_("For more details, see %s."), HTML::link(_("Install Instructions"), '../install.html')));
    if (!isset($notPHP)) {
        echo HTML::start('div', array('id' => 'buttons'));
        _showButton("next1", _("Next"));
        echo HTML::end('div');
        echo HTML::para(_("Press Next button to continue"), array('id' => 'status'));
    }
}
// end step 1: requirements
//echo "<!-- Footer -->\n";
echo HTML::end('div');
// #window
echo HTML::end('form');
if (isset($focusFormField) && !empty($focusFormField)) {
    echo HTML::insertScript('event.js');
    echo HTML::start('script', array('src' => '../js/focus.php?field=' . $focusFormField, 'type' => 'text/javascript'));
    echo HTML::end('script');
}
echo HTML::end('body');
echo HTML::end('html');
//echo "<!-- End Footer -->\n";
Esempio n. 14
0
echo HTML::para(HTML::link(_("Install dump from file"), '../install/index.php') . ' | ' . HTML::link(_("Optimize Database"), '../admin/dump_optimize_db.php'));
if ($numTables < 1) {
    // @todo message
    require_once "../layout/footer.php";
    exit;
}
echo HTML::insertScript('dump_functions.js');
echo HTML::start('form', array('method' => 'post', 'action' => './dump_process.php'));
$i = 0;
$table = null;
while ($i < $numTables) {
    DUMP_MYSQL_INT_VERSION >= 32303 ? $table[$tables[$i]['Name']] = $tables[$i]['Name'] : ($table[$tables[$i]] = $tables[$i]);
    $i++;
}
$fieldArray = array(Form::select("table_select", $table, null, array('size' => 15)));
unset($table);
$fieldFoot = array(HTML::link(_("Select all"), '#', null, array('id' => 'select_all')) . ' / ' . HTML::link(_("Unselect all"), '#', null, array('id' => 'unselect_all')));
echo Form::fieldset(_("View dump of database"), $fieldArray, $fieldFoot, array('id' => 'dump_tables'));
$fieldArray = null;
$fieldArray[] = Form::radioButton("what", "data", array('id' => 'radio_dump_data', 'checked' => true)) . Form::label("radio_dump_data", _("Structure and data"));
$fieldArray[] = Form::radioButton("what", "structure", array('id' => 'radio_dump_structure')) . Form::label("radio_dump_structure", _("Structure only"));
$fieldArray[] = Form::radioButton("what", "dataonly", array('id' => 'radio_dump_dataonly')) . Form::label("radio_dump_dataonly", _("Data only"));
$fieldArray[] = Form::radioButton("what", "xml", array('id' => 'radio_dump_xml')) . Form::label("radio_dump_xml", _("Export to XML format"));
$fieldArray[] = Form::radioButton("what", "excel", array('id' => 'radio_dump_csv')) . Form::label("radio_dump_csv", _("Export to CSV format (data only)"));
echo Form::fieldset(_("Options"), $fieldArray, null, array('id' => 'dump_options'));
$fieldArray = array(Form::checkBox("drop", "yes") . Form::label("drop", _("Add 'DROP TABLE'")), Form::checkBox("show_columns", "yes") . Form::label("show_columns", _("Complete 'INSERTs'")), Form::checkBox("extended_inserts", "yes") . Form::label("extended_inserts", _("Extended 'INSERTs'")), Form::checkBox("use_backquotes", "yes") . Form::label("use_backquotes", _("Enclose table and field names with backquotes")), Form::checkBox("add_delete", "yes") . Form::label("add_delete", _("Add 'DELETE * FROM __table__'")), Form::checkBox("use_dbname", "yes") . Form::label("use_dbname", _("Add 'USE __dbname__'")), Form::checkBox("create_db", "yes") . Form::label("create_db", _("Add 'CREATE DATABASE __dbname__'")), Form::checkBox("as_file", "sendit") . Form::label("as_file", _("Save as file")));
echo Form::fieldset(_("Extended options"), $fieldArray, null, array('id' => 'dump_extended'));
echo HTML::para(Form::button("dump", _("Submit")) . Form::generateToken(), array('class' => 'center'));
echo HTML::end('form');
echo Msg::hint(_("Note: Some check options are exclusive. Be carefully!"));
require_once "../layout/footer.php";
Esempio n. 15
0
 /**
  * string getHeader(void)
  *
  * Returns a header with patient information
  *
  * @return string
  * @access public
  * @since 0.8
  */
 public function getHeader()
 {
     $_html = HTML::start('div', array('id' => 'patient_header', 'class' => 'clearfix'));
     $_html .= HTML::para(_("Paciente") . ': <b>' . $this->getName()) . "</b>";
     $_html .= HTML::para(_("Sexo") . ': ' . ($this->getSex() == 'V' ? _("Male") : _("Female")));
     $_html .= HTML::para(_("Idade") . ': ' . $this->getAge(), array('class' => 'right'));
     $_html .= HTML::end('div');
     return $_html;
 }
Esempio n. 16
0
}
/**
 * Show page
 */
$title = _("Search Results");
require_once "../layout/header.php";
/**
 * Breadcrumb
 */
$links = array(_("Medical Records") => "../medical/index.php", _("Search Patient") => "../medical/patient_search_form.php", $title => "");
echo HTML::breadcrumb($links, "icon icon_search");
unset($links);
/**
 * Printing result stats and page nav
 */
echo HTML::para(HTML::tag('strong', sprintf(_("%d matches found."), $patQ->getRowCount())));
$pageCount = $patQ->getPageCount();
$pageLinks = Search::pageLinks($currentPage, $pageCount, $_SERVER['PHP_SELF']);
echo $pageLinks;
/**
 * Choose field
 */
$val = "";
switch ($searchType) {
    case OPEN_SEARCH_SURNAME1:
        $key = _("Surname 1");
        break;
    case OPEN_SEARCH_SURNAME2:
        $key = _("Surname 2");
        break;
    case OPEN_SEARCH_FIRSTNAME:
Esempio n. 17
0
require_once "../auth/login_check.php";
loginCheck(OPEN_PROFILE_ADMINISTRATOR);
require_once "../model/Query/Theme.php";
require_once "../lib/Form.php";
/**
 * Show page
 */
$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);
Esempio n. 18
0
 /**
  * string errorMsg(void)
  *
  * Returns message of form errors if it is necessary
  *
  * @return string
  * @access public
  * @static
  */
 public static function errorMsg()
 {
     $_formSession = self::getSession();
     if (isset($_formSession['error']) && count($_formSession['error']) > 0) {
         $_html = HTML::start('div', array('class' => 'error'));
         $_html .= HTML::para(_("ERROR: Some fields have been incorrectly filled. Please fix the fields and send the form again. Each incorrectly filled field is marked with specific error message."));
         $_array = null;
         foreach ($_formSession['error'] as $_key => $_value) {
             if ($_value) {
                 $_array[] = self::label($_key, $_value);
             }
         }
         if (is_array($_array)) {
             $_html .= HTML::itemList($_array);
         }
         $_html .= HTML::end('div');
         return $_html;
     }
 }
Esempio n. 19
0
/**
 * string clinicInfo(void)
 *
 * @return string div#clinic_info (microformat hCard)
 * @access public
 * @see OPEN_CLINIC_NAME
 * @see OPEN_CLINIC_URL
 * @see OPEN_CLINIC_HOURS
 * @see OPEN_CLINIC_ADDRESS
 * @see OPEN_CLINIC_PHONE
 */
function clinicInfo()
{
    if (!defined("OPEN_CLINIC_NAME") || !OPEN_CLINIC_NAME) {
        return;
    }
    $_html = HTML::start('div', array('id' => 'clinic_info', 'class' => 'vcard contact'));
    $_name = OPEN_CLINIC_NAME;
    if (defined("OPEN_CLINIC_URL") && OPEN_CLINIC_URL) {
        $_name = HTML::link($_name, OPEN_CLINIC_URL, null, array('class' => 'url'));
    }
    $_html .= HTML::para($_name, array('class' => 'fn org'));
    if (defined("OPEN_CLINIC_HOURS") && OPEN_CLINIC_HOURS) {
        $_html .= HTML::para(sprintf(_("Clinic hours: %s"), OPEN_CLINIC_HOURS));
    }
    if (defined("OPEN_CLINIC_ADDRESS") && OPEN_CLINIC_ADDRESS || defined("OPEN_CLINIC_PHONE") && OPEN_CLINIC_PHONE) {
        $_html .= HTML::start('address', array('class' => 'adr'));
        if (defined("OPEN_CLINIC_ADDRESS") && OPEN_CLINIC_ADDRESS) {
            $_html .= HTML::para(sprintf(_("Clinic address: %s"), HTML::tag('span', OPEN_CLINIC_ADDRESS, array('class' => 'street-address'))));
        }
        if (defined("OPEN_CLINIC_PHONE") && OPEN_CLINIC_PHONE) {
            $_html .= HTML::para(sprintf(_("Clinic phone: %s"), HTML::tag('span', OPEN_CLINIC_PHONE, array('class' => 'tel value'))));
        }
        $_html .= HTML::end('address');
    }
    $_html .= HTML::end('div');
    return $_html;
}
Esempio n. 20
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. 21
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. 22
0
} else {
    $relatedLinks .= _("View all staff members");
}
$relatedLinks .= ' | ';
if ($memberType != 'A') {
    $relatedLinks .= HTML::link(_("View only administratives"), '../admin/staff_list.php', array('type' => 'A'));
} else {
    $relatedLinks .= _("View only administratives");
}
$relatedLinks .= ' | ';
if ($memberType != 'D') {
    $relatedLinks .= HTML::link(_("View only doctors"), '../admin/staff_list.php', array('type' => 'D'));
} else {
    $relatedLinks .= _("View only doctors");
}
echo HTML::para($relatedLinks);
if (!$numRows) {
    $staffQ->close();
    echo Msg::info(_("No results found."));
    include_once "../layout/footer.php";
    exit;
}
$thead = array(_("#"), _("Function") => array('colspan' => 3), _("First Name"), _("Surname 1"), _("Surname 2"), _("Login"));
if ($viewType) {
    $thead[] = _("Type");
}
$tbody = array();
$i = 0;
while ($staff = $staffQ->fetch()) {
    // to protect admin users
    if ($staff->getIdMember() < 2) {
Esempio n. 23
0
echo HTML::insertScript('pop_window.js');
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
 */
Esempio n. 24
0
 * Show page
 */
$title = _("Central de atendimento Beneficiário");
$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();
$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 ($problem->getObjective()) {
        echo HTML::section(3, _("Objective"));
        echo HTML::para(nl2br($problem->getObjective()));
    }
    if ($problem->getAppreciation()) {
        echo HTML::section(3, _("Appreciation"));
        echo HTML::para(nl2br($problem->getAppreciation()));
    }
    if ($problem->getActionPlan()) {
        echo HTML::section(3, _("Action Plan"));
        echo HTML::para(nl2br($problem->getActionPlan()));
    }
    if ($problem->getPrescription()) {
        echo HTML::section(3, _("Prescription"));
        echo HTML::para(nl2br($problem->getPrescription()));
    }
    echo HTML::rule();
}
// end while
$problemQ->freeResult();
$problemQ->close();
unset($problemQ);
unset($problem);
/**
 * Do print the page
 */
echo HTML::start('script', array('type' => 'text/javascript'));
echo "\n<!--/*--><![CDATA[/*<!--*/\n";
echo 'if (typeof(window.print) != "undefined")' . "\n";
echo "{\n";
Esempio n. 26
0
/**
 * Show page
 */
$title = _("View Medical Tests");
$titlePage = $patient->getName() . ' [' . $problem->getWordingPreview() . '] (' . $title . ')';
require_once "../layout/header.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", $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));
    echo HTML::para(nl2br($history->getHabits()));
}
if ($history->getPeristalticConditions()) {
    echo HTML::section(3, _("Peristaltic Conditions"));
    echo HTML::para(nl2br($history->getPeristalticConditions()));
}
if ($history->getPsychological()) {
    echo HTML::section(3, _("Psychological Conditions"));
    echo HTML::para(nl2br($history->getPsychological()));
}
if ($history->getChildrenComplaint()) {
    echo HTML::section(3, _("Children Complaint"));
    echo HTML::para(nl2br($history->getChildrenComplaint()));
}
if ($history->getVenerealDisease()) {
    echo HTML::section(3, _("Venereal Disease"));
    echo HTML::para(nl2br($history->getVenerealDisease()));
}
if ($history->getAccidentSurgicalOperation()) {
    echo HTML::section(3, _("Accidents and Surgical Operations"));
    echo HTML::para(nl2br($history->getAccidentSurgicalOperation()));
}
if ($history->getMedicinalIntolerance()) {
    echo HTML::section(3, _("Medicinal Intolerance"));
    echo HTML::para(nl2br($history->getMedicinalIntolerance()));
}
if ($history->getMentalIllness()) {
    echo HTML::section(3, _("Mental Illness"));
    echo HTML::para(nl2br($history->getMentalIllness()));
}
require_once "../layout/footer.php";
Esempio n. 28
0
 */
$tab = "home";
$nav = "summary";
require_once "../config/environment.php";
if (isset($_SESSION['auth']['token'])) {
    /**
     * Checking permissions
     */
    include_once "../auth/login_check.php";
    loginCheck();
}
require_once "../lib/Check.php";
/**
 * Show page
 */
$title = _("Welcome to OpenClinic");
require_once "../layout/header.php";
echo HTML::section(1, $title);
echo HTML::para(_("OpenClinic is an easy to use, open source, medical records system."));
echo HTML::para(_("When you select any of the following tabs you will be prompted to login."));
echo HTML::section(2, HTML::link(_("Medical Records"), '../medical/index.php'), array('class' => 'icon icon_medical'));
echo HTML::para(_("Use this tab to manage your patient's medical records."));
echo HTML::para(_("Patient's Administration:"));
$array = array(_("Search, new, delete, edit"), _("Social Data"), _("Clinic History"), _("Problem Reports"));
echo HTML::itemList($array);
echo HTML::rule();
echo HTML::section(2, HTML::link(_("Admin"), '../admin/index.php'), array('class' => 'icon icon_admin'));
echo HTML::para(_("Use this tab to manage administrative options."));
$array = array(_("Staff members"), _("Config settings"), _("Clinic themes editor"), _("System users"), _("Dumps"), _("Logs"));
echo HTML::itemList($array);
require_once "../layout/footer.php";
Esempio n. 29
0
 * Retrieving get vars
 */
$idMember = intval($_GET["id_member"]);
$surname1 = Check::safeText($_GET["surname1"]);
$surname2 = Check::safeText($_GET["surname2"]);
$firstName = Check::safeText($_GET["first_name"]);
/**
 * Show page
 */
$title = _("Delete Staff Member");
require_once "../layout/header.php";
/**
 * Breadcrumb
 */
$links = array(_("Admin") => "../admin/index.php", _("Staff Members") => $returnLocation, $title => "");
echo HTML::breadcrumb($links, "icon icon_staff");
unset($links);
/**
 * Form
 */
echo HTML::start('form', array('method' => 'post', 'action' => '../admin/staff_del.php'));
$tbody = array();
$tbody[] = Msg::warning(sprintf(_("Are you sure you want to delete staff member, %s %s %s?"), $firstName, $surname1, $surname2));
$tbody[] = Form::hidden("id_member", $idMember);
$tfoot = array(Form::button("delete", _("Delete")) . Form::generateToken());
$options = array('class' => 'center');
echo Form::fieldset($title, $tbody, $tfoot, $options);
echo HTML::end('form');
echo Msg::hint('* ' . _("Note: The del function will delete the related user too (if exists)."));
echo HTML::para(HTML::link(_("Return"), $returnLocation));
require_once "../layout/footer.php";
Esempio n. 30
0
require_once "../auth/login_check.php";
loginCheck(OPEN_PROFILE_DOCTOR);
require_once "../lib/LastViewedPatient.php";
/**
 * Show page
 */
$title = _("Medical Records");
require_once "../layout/header.php";
echo HTML::section(1, $title, array('class' => 'icon icon_medical'));
echo HTML::para(_("Use the following functions located in the left hand navigation area to manage your medical records."));
echo HTML::section(2, HTML::link(_("Search Patient"), '../medical/patient_search_form.php'), array('class' => 'icon icon_search'));
echo HTML::para(_("Search and view patients. Once a patient is selected you can:"));
$array = array(_("manage social data"), _("manage clinic history"), _("manage problems report"), _("print medical record"));
echo HTML::itemList($array);
$viewedPatient = LastViewedPatient::get();
if ($viewedPatient) {
    echo HTML::rule();
    echo HTML::section(2, _("Last Viewed Patients"), array('class' => 'icon icon_patient'));
    $array = array();
    foreach ($viewedPatient as $key => $value) {
        $array[] = HTML::link($value, '../medical/patient_view.php', array('id_patient' => $key));
    }
    echo HTML::itemList($array);
}
if ($_SESSION['auth']['is_administrative']) {
    echo HTML::rule();
    echo HTML::section(2, HTML::link(_("New Patient"), '../medical/patient_new_form.php'), array('class' => 'icon icon_patient'));
    echo HTML::para(_("Build a new patient information in medical records system."));
}
// end if
require_once "../layout/footer.php";