Example #1
0
 function _consult_schedule() {
 //
 // appointments for today
 //
     if (func_num_args()>0) {
         $arg_list = func_get_args();
         $menu_id = $arg_list[0];
         $post_vars = $arg_list[1];
         $get_vars = $arg_list[2];
         $validuser = $arg_list[3];
         $isadmin = $arg_list[4];
     }
     if ($post_vars["submitsked"]) {
         appointment::process_appointment_record($menu_id, $post_vars, $get_vars);
     }
     print "<span class='patient'>".FTITLE_APPOINTMENTS_TODAY."</span><br/><br/>";
     $base_url = $_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"];
     if ($get_vars["year"] && $get_vars["month"] && $get_vars["day"]) {
         $date = $get_vars["year"]."-".$get_vars["month"]."-".$get_vars["day"];
     } else {
         $date = date("Y-m-d");
     }
     print "<table><tr valign='top'><td>";
     calendar::display_calendar($menu_id, $post_vars, $get_vars, $validuser, $isadmin, $base_url);
     print "</td><td>";
     print "<span class='tinylight'>";
     print "<ol><b>APPOINTMENT HOWTO:</b></ol>";
     print "<ol>";
     print "<li>THIS PAGE SHOWS THE APPOINTMENTS FOR TODAY.</li>";
     print "<li>TO SEE APPOINTMENTS OTHER THAN TODAY CLICK ON DESIRED CALENDAR DATE.</li>";
     print "<li>YOU CAN ALSO USE THE CALENDAR NAVIGATION BUTTONS TO GO TO A DIFFERENT MONTH OR YEAR.</li>";
     print "<li>CLICK ON PATIENT NAME TO SEE APPOINTMENT RECORD. HIGHLIGHTED NAME MEANS THE PATIENT FOLLOWED UP ALREADY.</li>";
     print "</ol>";
     print "</span>";
     print "</td></tr></table>";
     $sql = "select a.schedule_id, a.patient_id, p.patient_lastname, p.patient_firstname, ".
            "p.patient_dob, p.patient_gender, l.appointment_name, ".
            "round((to_days(now())-to_days(p.patient_dob))/365 , 1) computed_age, actual_date ".
            "from m_patient p, m_consult_appointments a, m_lib_appointment l ".
            "where p.patient_id = a.patient_id and ".
            "a.appointment_id = l.appointment_id and ".
            "to_days(a.visit_date) = to_days('$date') ".
            "order by p.patient_lastname, p.patient_firstname";
     if ($result = mysql_query($sql)) {
         print "<br/><table width=600 bgcolor='#FFFFFF' cellpadding='3' cellspacing='0' style='border: 2px solid black'>";
         print "<tr><td>";
         print "<span class='tinylight'><b>".LBL_EXPECTED_TO_ARRIVE_TODAY." ".$date.":</b></span><br/><br/>";
         if (mysql_num_rows($result)) {
             $i=0;
             while (list($sid, $pid, $plast, $pfirst, $pdob, $pgender, $appname, $p_age, $actual_date) = mysql_fetch_array($result)) {
                 if ($prev_app<>$appname) {
                     $patient_array[$i] .= "<span class='boxtitle'><font color='red'>".strtoupper($appname)."</font></span><br/>";
                 }
                 $patient_array[$i] .= "<a href='".$_SERVER["PHP_SELF"]."?page=CONSULTS&menu_id=$menu_id&patient_id=$pid&schedule_id=$sid&year=".$get_vars["year"]."&month=".$get_vars["month"]."&day=".$get_vars["day"]."&s=0#detail' style='".($actual_date<>"0000-00-00"?"background-color: #FFFF00":"")."'><b>$plast, $pfirst</b></a> [$p_age/$pgender] $pdob";
                 if (class_exists("family")) {
                     // show family icon if patient has a family
                     $family_id = family::get_family_id($pid);
                     if ($family_id<>0) {
                         $family_menu_id = module::get_menu_id("_family");
                         $patient_array[$i] .= " <a href='".$_SERVER["PHP_SELF"]."?page=PATIENTS&menu_id=$family_menu_id&family_id=$family_id' title='GO TO FAMILY'><img src='../images/family.gif' border='0'/></a>";
                     }
                 }
                 if (class_exists("healthcenter")) {
                     $consult_menu_id = module::get_menu_id("_consult");
                     // show link only if today
                     if ($date == date("Y-m-d")) {
                         $patient_array[$i] .= " <a href='".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=$consult_menu_id&enter_consult=$pid&appt_date=$date&sked_id=$sid' title='LOAD PATIENT RECORD'><img src='../images/records.gif' border='0'/></a>";
                     }
                 }
                 $i++;
                 $prev_app = $appname;
             }
             print $this->columnize_list($patient_array);
         } else {
             print "<font color='red'>No patients scheduled today.</font><br/>";
         }
         print "</td></tr>";
         print "</table><br/>";
         if ($get_vars["schedule_id"]) {
             appointment::display_appointment_details($menu_id, $post_vars, $get_vars);
         }
         // consult patient list based on appointment date
         appointment::consult_info($menu_id, $post_vars, $get_vars);
         // consult patient list today
         healthcenter::consult_info($menu_id, $post_vars, $get_vars);
     }
 }
Example #2
0
    $CorePage = $_GET['p'];
}
$CoreModulesMap = array(1 => 'alter_view.php', 2 => 'comments_view.php', 3 => 'comments_add.php', 4 => 'category_view.php', 5 => 'pages_view.php', 6 => 'articles_view.php', 7 => 'newsletter.php', 8 => 'search.php', 9 => 'date_view.php');
require_once pathjoin(PATH_TO_MODULES_USER, array_key_exists($CorePage, $CoreModulesMap) ? $CoreModulesMap[$CorePage] : 'main_view.php');
// wyznaczamy szablon jaki ma byc parsowany, sprawdzajac
// czy faktycznie znajduje sie on w katalogu z szablonami
if (!isset($assigned_tpl) || !file_exists(pathjoin(ROOT, 'templates', $lang, $theme, 'tpl', $assigned_tpl . '_page.tpl'))) {
    $assigned_tpl = 'main_page';
}
$ft->define_dynamic('alternate_design_row', $assigned_tpl);
while ($d = $read_dir->read()) {
    if ($d[0] != '.') {
        $ft->assign(array('ALTERNATE_TEMPLATE' => $d, 'TEMPLATE_LINK' => $CoreRewrite->template_switch($d, $rewrite)));
        $ft->parse('ALTERNATE_DESIGN_ROW', '.alternate_design_row');
    }
}
// tablica includowanych modulow
$modules = array('category_list', 'pages_list', 'links_list');
while (list($m) = each($modules)) {
    require_once PATH_TO_MODULES_USER . $modules[$m] . '.php';
}
if ((bool) $show_calendar) {
    $ft->assign(array('LINKED' => false, 'SHOW_CALENDAR' => true));
    $calendar = new calendar();
    $calendar->display_calendar();
} else {
    $ft->assign(array('LINKED' => false, 'SHOW_CALENDAR' => false));
}
$ft->parse('MAIN', $assigned_tpl);
$ft->FastPrint();
exit;
Example #3
0
 function _consult_ntp_followup()
 {
     //
     // main submodule for listing patients who
     // failed to followup by the day
     //
     // always check dependencies
     if ($exitinfo = $this->missing_dependencies('ntp')) {
         return print $exitinfo;
     }
     if (func_num_args() > 0) {
         $arg_list = func_get_args();
         $menu_id = $arg_list[0];
         $post_vars = $arg_list[1];
         $get_vars = $arg_list[2];
         $validuser = $arg_list[3];
         $isadmin = $arg_list[4];
         //print_r($arg_list);
     }
     print "<span class='patient'>" . FTITLE_NTP_FOLLOWUP_RECORD . "</span><br/><br/>";
     $base_url = $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"];
     if ($get_vars["year"] && $get_vars["month"] && $get_vars["day"]) {
         $date = $get_vars["year"] . "-" . $get_vars["month"] . "-" . $get_vars["day"];
     } else {
         $date = date("Y-m-d");
     }
     print "<table><tr valign='top'><td>";
     calendar::display_calendar($menu_id, $post_vars, $get_vars, $validuser, $isadmin, $base_url);
     print "</td><td>";
     print "<span class='tinylight'>";
     print "<ol><b>NTP FOLLOWUP HOWTO:</b></ol>";
     print "<ol>";
     print "<li>THIS PAGE SHOWS PATIENTS ENROLLED IN THE NTP PROGRAM WHO FAILED TO APPEAR ON THE SELECTED DATE.</li>";
     print "<li>TO SEE FAILED APPOINTMENTS OTHER THAN TODAY CLICK ON DESIRED CALENDAR DATE.</li>";
     print "<li>YOU CAN ALSO USE THE CALENDAR NAVIGATION BUTTONS TO GO TO A DIFFERENT MONTH OR YEAR.</li>";
     print "</ol>";
     print "</span>";
     print "</td></tr></table>";
     $sql = "select a.schedule_id, a.patient_id, p.patient_lastname, p.patient_firstname, " . "p.patient_dob, p.patient_gender, l.appointment_name, " . "round((to_days(now())-to_days(p.patient_dob))/365 , 1) computed_age " . "from m_patient p, m_consult_appointments a, m_lib_appointment l " . "where p.patient_id = a.patient_id and " . "a.appointment_id = l.appointment_id and " . "to_days(a.visit_date) = to_days('{$date}') and " . "actual_date = '0000-00-00' " . "order by p.patient_lastname, p.patient_firstname";
     if ($result = mysql_query($sql)) {
         print "<br/><table width=600 bgcolor='#FFFFFF' cellpadding='3' cellspacing='0' style='border: 2px solid black'>";
         print "<tr><td>";
         print "<span class='tinylight'><b>" . LBL_EXPECTED_TO_ARRIVE_TODAY . " " . $date . ":</b></span><br/><br/>";
         if (mysql_num_rows($result)) {
             $i = 0;
             while (list($sid, $pid, $plast, $pfirst, $pdob, $pgender, $appname, $p_age) = mysql_fetch_array($result)) {
                 if ($prev_app != $appname) {
                     $patient_array[$i] .= "<span class='boxtitle'><font color='red'>" . strtoupper($appname) . "</font></span><br/>";
                 }
                 $patient_array[$i] .= "<a href='" . $_SERVER["PHP_SELF"] . "?page=PATIENTS&menu_id={$menu_id}&patient_id={$pid}'><b>{$plast}, {$pfirst}</b></a> [{$p_age}/{$pgender}] {$pdob}";
                 if (class_exists("family")) {
                     // show family icon if patient has a family
                     $family_id = family::get_family_id($pid);
                     if ($family_id != 0) {
                         $family_menu_id = module::get_menu_id("_family");
                         $patient_array[$i] .= " <a href='" . $_SERVER["PHP_SELF"] . "?page=PATIENTS&menu_id={$family_menu_id}&family_id={$family_id}' title='GO TO FAMILY'><img src='../images/family.gif' border='0'/></a>";
                     }
                 }
                 if (class_exists("healthcenter")) {
                     $consult_menu_id = module::get_menu_id("_consult");
                     $patient_array[$i] .= " <a href='" . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id={$consult_menu_id}&enter_consult={$pid}&appt_date={$date}&sked_id={$sid}' title='LOAD PATIENT RECORD'><img src='../images/records.gif' border='0'/></a>";
                 }
                 $i++;
                 $prev_app = $appname;
             }
             print $this->columnize_list($patient_array);
         } else {
             print "<font color='red'>No patients scheduled today.</font><br/>";
         }
         print "</td></tr>";
         print "</table>";
     }
 }