Email change of a developer (#503)
[openemr.git] / interface / patient_file / summary / demographics.php
blob5719799368616c071e7a269213a4d8c16eeba565
1 <?php
2 /**
4 * Patient summary screen.
6 * LICENSE: This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 3
9 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
17 * @package OpenEMR
18 * @author Brady Miller <brady.g.miller@gmail.com>
19 * @link http://www.open-emr.org
22 //SANITIZE ALL ESCAPES
23 $sanitize_all_escapes=true;
26 //STOP FAKE REGISTER GLOBALS
27 $fake_register_globals=false;
30 require_once("../../globals.php");
31 require_once("$srcdir/patient.inc");
32 require_once("$srcdir/acl.inc");
33 require_once("$srcdir/options.inc.php");
34 require_once("../history/history.inc.php");
35 require_once("$srcdir/edi.inc");
36 require_once("$srcdir/invoice_summary.inc.php");
37 require_once("$srcdir/clinical_rules.php");
38 require_once("$srcdir/options.js.php");
39 require_once("$srcdir/group.inc");
40 ////////////
41 require_once(dirname(__FILE__)."/../../../library/appointments.inc.php");
43 if (isset($_GET['set_pid'])) {
44 include_once("$srcdir/pid.inc");
45 setpid($_GET['set_pid']);
48 $active_reminders = false;
49 $all_allergy_alerts = false;
50 if ($GLOBALS['enable_cdr']) {
51 //CDR Engine stuff
52 if ($GLOBALS['enable_allergy_check'] && $GLOBALS['enable_alert_log']) {
53 //Check for new allergies conflicts and throw popup if any exist(note need alert logging to support this)
54 $new_allergy_alerts = allergy_conflict($pid,'new',$_SESSION['authUser']);
55 if (!empty($new_allergy_alerts)) {
56 $pop_warning = '<script type="text/javascript">alert(\'' . xls('WARNING - FOLLOWING ACTIVE MEDICATIONS ARE ALLERGIES') . ':\n';
57 foreach ($new_allergy_alerts as $new_allergy_alert) {
58 $pop_warning .= addslashes($new_allergy_alert) . '\n';
60 $pop_warning .= '\')</script>';
61 echo $pop_warning;
64 if ((!isset($_SESSION['alert_notify_pid']) || ($_SESSION['alert_notify_pid'] != $pid)) && isset($_GET['set_pid']) && $GLOBALS['enable_cdr_crp']) {
65 // showing a new patient, so check for active reminders and allergy conflicts, which use in active reminder popup
66 $active_reminders = active_alert_summary($pid,"reminders-due",'','default',$_SESSION['authUser'],TRUE);
67 if ($GLOBALS['enable_allergy_check']) {
68 $all_allergy_alerts = allergy_conflict($pid,'all',$_SESSION['authUser'],TRUE);
73 function print_as_money($money) {
74 preg_match("/(\d*)\.?(\d*)/",$money,$moneymatches);
75 $tmp = wordwrap(strrev($moneymatches[1]),3,",",1);
76 $ccheck = strrev($tmp);
77 if ($ccheck[0] == ",") {
78 $tmp = substr($ccheck,1,strlen($ccheck)-1);
80 if ($moneymatches[2] != "") {
81 return "$ " . strrev($tmp) . "." . $moneymatches[2];
82 } else {
83 return "$ " . strrev($tmp);
87 // get an array from Photos category
88 function pic_array($pid,$picture_directory) {
89 $pics = array();
90 $sql_query = "select documents.id from documents join categories_to_documents " .
91 "on documents.id = categories_to_documents.document_id " .
92 "join categories on categories.id = categories_to_documents.category_id " .
93 "where categories.name like ? and documents.foreign_id = ?";
94 if ($query = sqlStatement($sql_query, array($picture_directory,$pid))) {
95 while( $results = sqlFetchArray($query) ) {
96 array_push($pics,$results['id']);
99 return ($pics);
101 // Get the document ID of the first document in a specific catg.
102 function get_document_by_catg($pid,$doc_catg) {
104 $result = array();
106 if ($pid and $doc_catg) {
107 $result = sqlQuery("SELECT d.id, d.date, d.url FROM " .
108 "documents AS d, categories_to_documents AS cd, categories AS c " .
109 "WHERE d.foreign_id = ? " .
110 "AND cd.document_id = d.id " .
111 "AND c.id = cd.category_id " .
112 "AND c.name LIKE ? " .
113 "ORDER BY d.date DESC LIMIT 1", array($pid, $doc_catg) );
116 return($result['id']);
119 // Display image in 'widget style'
120 function image_widget($doc_id,$doc_catg)
122 global $pid, $web_root;
123 $docobj = new Document($doc_id);
124 $image_file = $docobj->get_url_file();
125 $image_width = $GLOBALS['generate_doc_thumb'] == 1 ? '' : 'width=100';
126 $extension = substr($image_file, strrpos($image_file,"."));
127 $viewable_types = array('.png','.jpg','.jpeg','.png','.bmp','.PNG','.JPG','.JPEG','.PNG','.BMP'); // image ext supported by fancybox viewer
128 if ( in_array($extension,$viewable_types) ) { // extention matches list
129 $to_url = "<td> <a href = $web_root" .
130 "/controller.php?document&retrieve&patient_id=$pid&document_id=$doc_id&as_file=false&original_file=true&disable_exit=false&show_original=true" .
131 "/tmp$extension" . // Force image type URL for fancybo
132 " onclick=top.restoreSession(); class='image_modal'>" .
133 " <img src = $web_root" .
134 "/controller.php?document&retrieve&patient_id=$pid&document_id=$doc_id&as_file=false" .
135 " $image_width alt='$doc_catg:$image_file'> </a> </td> <td valign='center'>".
136 htmlspecialchars($doc_catg) . '<br />&nbsp;' . htmlspecialchars($image_file) .
137 "</td>";
139 else {
140 $to_url = "<td> <a href='" . $web_root . "/controller.php?document&retrieve" .
141 "&patient_id=$pid&document_id=$doc_id'" .
142 " onclick='top.restoreSession()' class='css_button_small'>" .
143 "<span>" .
144 htmlspecialchars( xl("View"), ENT_QUOTES )."</a> &nbsp;" .
145 htmlspecialchars( "$doc_catg - $image_file", ENT_QUOTES ) .
146 "</span> </td>";
148 echo "<table><tr>";
149 echo $to_url;
150 echo "</tr></table>";
153 // Determine if the Vitals form is in use for this site.
154 $tmp = sqlQuery("SELECT count(*) AS count FROM registry WHERE " .
155 "directory = 'vitals' AND state = 1");
156 $vitals_is_registered = $tmp['count'];
158 // Get patient/employer/insurance information.
160 $result = getPatientData($pid, "*, DATE_FORMAT(DOB,'%Y-%m-%d') as DOB_YMD");
161 $result2 = getEmployerData($pid);
162 $result3 = getInsuranceData($pid, "primary", "copay, provider, DATE_FORMAT(`date`,'%Y-%m-%d') as effdate");
163 $insco_name = "";
164 if ($result3['provider']) { // Use provider in case there is an ins record w/ unassigned insco
165 $insco_name = getInsuranceProvider($result3['provider']);
168 <html>
170 <head>
171 <?php html_header_show();?>
172 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
173 <link rel="stylesheet" type="text/css" href="../../../library/js/fancybox/jquery.fancybox-1.2.6.css" media="screen" />
174 <style type="text/css">@import url(../../../library/dynarch_calendar.css);</style>
175 <script type="text/javascript" src="../../../library/textformat.js"></script>
176 <script type="text/javascript" src="../../../library/dynarch_calendar.js"></script>
177 <?php include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?>
178 <script type="text/javascript" src="../../../library/dynarch_calendar_setup.js"></script>
179 <script type="text/javascript" src="../../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script>
180 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-6-4/index.js"></script>
181 <script type="text/javascript" src="../../../library/js/common.js"></script>
182 <script type="text/javascript" src="../../../library/js/fancybox/jquery.fancybox-1.2.6.js"></script>
183 <script type="text/javascript" language="JavaScript">
185 var mypcc = '<?php echo htmlspecialchars($GLOBALS['phone_country_code'],ENT_QUOTES); ?>';
186 //////////
187 function oldEvt(apptdate, eventid) {
188 dlgopen('../../main/calendar/add_edit_event.php?date=' + apptdate + '&eid=' + eventid, '_blank', 775, 500);
191 function advdirconfigure() {
192 dlgopen('advancedirectives.php', '_blank', 500, 450);
195 function refreshme() {
196 top.restoreSession();
197 location.reload();
200 // Process click on Delete link.
201 function deleteme() {
202 dlgopen('../deleter.php?patient=<?php echo htmlspecialchars($pid,ENT_QUOTES); ?>', '_blank', 500, 450);
203 return false;
206 // Called by the deleteme.php window on a successful delete.
207 function imdeleted() {
208 parent.left_nav.clearPatient();
211 function newEvt() {
212 dlgopen('../../main/calendar/add_edit_event.php?patientid=<?php echo htmlspecialchars($pid,ENT_QUOTES); ?>', '_blank', 775, 500);
213 return false;
216 function sendimage(pid, what) {
217 // alert('Not yet implemented.'); return false;
218 dlgopen('../upload_dialog.php?patientid=' + pid + '&file=' + what,
219 '_blank', 500, 400);
220 return false;
223 </script>
225 <script type="text/javascript">
227 function toggleIndicator(target,div) {
229 $mode = $(target).find(".indicator").text();
230 if ( $mode == "<?php echo htmlspecialchars(xl('collapse'),ENT_QUOTES); ?>" ) {
231 $(target).find(".indicator").text( "<?php echo htmlspecialchars(xl('expand'),ENT_QUOTES); ?>" );
232 $("#"+div).hide();
233 $.post( "../../../library/ajax/user_settings.php", { target: div, mode: 0 });
234 } else {
235 $(target).find(".indicator").text( "<?php echo htmlspecialchars(xl('collapse'),ENT_QUOTES); ?>" );
236 $("#"+div).show();
237 $.post( "../../../library/ajax/user_settings.php", { target: div, mode: 1 });
241 $(document).ready(function(){
242 var msg_updation='';
243 <?php
244 if($GLOBALS['erx_enable']){
245 //$soap_status=sqlQuery("select soap_import_status from patient_data where pid=?",array($pid));
246 $soap_status=sqlStatement("select soap_import_status,pid from patient_data where pid=? and soap_import_status in ('1','3')",array($pid));
247 while($row_soapstatus=sqlFetchArray($soap_status)){
248 //if($soap_status['soap_import_status']=='1' || $soap_status['soap_import_status']=='3'){ ?>
249 top.restoreSession();
250 $.ajax({
251 type: "POST",
252 url: "../../soap_functions/soap_patientfullmedication.php",
253 dataType: "html",
254 data: {
255 patient:<?php echo $row_soapstatus['pid']; ?>,
257 async: false,
258 success: function(thedata){
259 //alert(thedata);
260 msg_updation+=thedata;
262 error:function(){
263 alert('ajax error');
266 <?php
268 //elseif($soap_status['soap_import_status']=='3'){ ?>
269 top.restoreSession();
270 $.ajax({
271 type: "POST",
272 url: "../../soap_functions/soap_allergy.php",
273 dataType: "html",
274 data: {
275 patient:<?php echo $row_soapstatus['pid']; ?>,
277 async: false,
278 success: function(thedata){
279 //alert(thedata);
280 msg_updation+=thedata;
282 error:function(){
283 alert('ajax error');
286 <?php
287 if($GLOBALS['erx_import_status_message']){ ?>
288 if(msg_updation)
289 alert(msg_updation);
290 <?php
296 // load divs
297 $("#stats_div").load("stats.php", { 'embeddedScreen' : true }, function() {
298 // (note need to place javascript code here also to get the dynamic link to work)
299 $(".rx_modal").fancybox( {
300 'overlayOpacity' : 0.0,
301 'showCloseButton' : true,
302 'frameHeight' : 500,
303 'frameWidth' : 800,
304 'centerOnScroll' : false,
305 'callbackOnClose' : function() {
306 refreshme();
310 $("#pnotes_ps_expand").load("pnotes_fragment.php");
311 $("#disclosures_ps_expand").load("disc_fragment.php");
313 <?php if ($GLOBALS['enable_cdr'] && $GLOBALS['enable_cdr_crw']) { ?>
314 top.restoreSession();
315 $("#clinical_reminders_ps_expand").load("clinical_reminders_fragment.php", { 'embeddedScreen' : true }, function() {
316 // (note need to place javascript code here also to get the dynamic link to work)
317 $(".medium_modal").fancybox( {
318 'overlayOpacity' : 0.0,
319 'showCloseButton' : true,
320 'frameHeight' : 500,
321 'frameWidth' : 800,
322 'centerOnScroll' : false,
323 'callbackOnClose' : function() {
324 refreshme();
328 <?php } // end crw?>
330 <?php if ($GLOBALS['enable_cdr'] && $GLOBALS['enable_cdr_prw']) { ?>
331 top.restoreSession();
332 $("#patient_reminders_ps_expand").load("patient_reminders_fragment.php");
333 <?php } // end prw?>
335 <?php if ($vitals_is_registered && acl_check('patients', 'med')) { ?>
336 // Initialize the Vitals form if it is registered and user is authorized.
337 $("#vitals_ps_expand").load("vitals_fragment.php");
338 <?php } ?>
340 // Initialize track_anything
341 $("#track_anything_ps_expand").load("track_anything_fragment.php");
344 // Initialize labdata
345 $("#labdata_ps_expand").load("labdata_fragment.php");
346 <?php
347 // Initialize for each applicable LBF form.
348 $gfres = sqlStatement("SELECT option_id FROM list_options WHERE " .
349 "list_id = 'lbfnames' AND option_value > 0 AND activity = 1 ORDER BY seq, title");
350 while($gfrow = sqlFetchArray($gfres)) {
352 $("#<?php echo $gfrow['option_id']; ?>_ps_expand").load("lbf_fragment.php?formname=<?php echo $gfrow['option_id']; ?>");
353 <?php
357 // fancy box
358 enable_modals();
360 tabbify();
362 // modal for dialog boxes
363 $(".large_modal").fancybox( {
364 'overlayOpacity' : 0.0,
365 'showCloseButton' : true,
366 'frameHeight' : 600,
367 'frameWidth' : 1000,
368 'centerOnScroll' : false
371 // modal for image viewer
372 $(".image_modal").fancybox( {
373 'overlayOpacity' : 0.0,
374 'showCloseButton' : true,
375 'centerOnScroll' : false,
376 'autoscale' : true
379 $(".iframe1").fancybox( {
380 'left':10,
381 'overlayOpacity' : 0.0,
382 'showCloseButton' : true,
383 'frameHeight' : 300,
384 'frameWidth' : 350
386 // special size for patient portal
387 $(".small_modal").fancybox( {
388 'overlayOpacity' : 0.0,
389 'showCloseButton' : true,
390 'frameHeight' : 200,
391 'frameWidth' : 380,
392 'centerOnScroll' : false
395 <?php if ($active_reminders || $all_allergy_alerts) { ?>
396 // show the active reminder modal
397 $("#reminder_popup_link").fancybox({
398 'overlayOpacity' : 0.0,
399 'showCloseButton' : true,
400 'frameHeight' : 500,
401 'frameWidth' : 500,
402 'centerOnScroll' : false
403 }).trigger('click');
404 <?php } ?>
408 // JavaScript stuff to do when a new patient is set.
410 function setMyPatient() {
411 // Avoid race conditions with loading of the left_nav or Title frame.
412 if (!parent.allFramesLoaded()) {
413 setTimeout("setMyPatient()", 500);
414 return;
416 <?php if (isset($_GET['set_pid'])) { ?>
417 parent.left_nav.setPatient(<?php echo "'" . addslashes($result['fname']) . " " . addslashes($result['lname']) .
418 "'," . addslashes($pid) . ",'" . addslashes($result['pubpid']) .
419 "','', ' " . xls('DOB') . ": " . addslashes(oeFormatShortDate($result['DOB_YMD'])) . " " . xls('Age') . ": " . addslashes(getPatientAgeDisplay($result['DOB_YMD'])) . "'"; ?>);
420 var EncounterDateArray = new Array;
421 var CalendarCategoryArray = new Array;
422 var EncounterIdArray = new Array;
423 var Count = 0;
424 <?php
425 //Encounter details are stored to javacript as array.
426 $result4 = sqlStatement("SELECT fe.encounter,fe.date,openemr_postcalendar_categories.pc_catname FROM form_encounter AS fe ".
427 " left join openemr_postcalendar_categories on fe.pc_catid=openemr_postcalendar_categories.pc_catid WHERE fe.pid = ? order by fe.date desc", array($pid));
428 if(sqlNumRows($result4)>0) {
429 while($rowresult4 = sqlFetchArray($result4)) {
431 EncounterIdArray[Count] = '<?php echo addslashes($rowresult4['encounter']); ?>';
432 EncounterDateArray[Count] = '<?php echo addslashes(oeFormatShortDate(date("Y-m-d", strtotime($rowresult4['date'])))); ?>';
433 CalendarCategoryArray[Count] = '<?php echo addslashes(xl_appt_category($rowresult4['pc_catname'])); ?>';
434 Count++;
435 <?php
439 parent.left_nav.setPatientEncounter(EncounterIdArray,EncounterDateArray,CalendarCategoryArray);
440 <?php } // end setting new pid ?>
441 parent.left_nav.syncRadios();
442 <?php if ( (isset($_GET['set_pid']) ) && (isset($_GET['set_encounterid'])) && ( intval($_GET['set_encounterid']) > 0 ) ) {
443 $encounter = intval($_GET['set_encounterid']);
444 $_SESSION['encounter'] = $encounter;
445 $query_result = sqlQuery("SELECT `date` FROM `form_encounter` WHERE `encounter` = ?", array($encounter)); ?>
446 encurl = 'encounter/encounter_top.php?set_encounter=' + <?php echo attr($encounter);?> + '&pid=' + <?php echo attr($pid);?>;
447 <?php if ($GLOBALS['new_tabs_layout']) { ?>
448 parent.left_nav.setEncounter('<?php echo oeFormatShortDate(date("Y-m-d", strtotime($query_result['date']))); ?>', '<?php echo attr($encounter); ?>', 'enc');
449 top.restoreSession();
450 parent.left_nav.loadFrame('enc2', 'enc', 'patient_file/' + encurl);
451 <?php } else { ?>
452 var othername = (window.name == 'RTop') ? 'RBot' : 'RTop';
453 parent.left_nav.setEncounter('<?php echo oeFormatShortDate(date("Y-m-d", strtotime($query_result['date']))); ?>', '<?php echo attr($encounter); ?>', othername);
454 top.restoreSession();
455 parent.frames[othername].location.href = '../' + encurl;
456 <?php } ?>
457 <?php } // end setting new encounter id (only if new pid is also set) ?>
460 $(window).load(function() {
461 setMyPatient();
464 </script>
466 <style type="css/text">
467 #pnotes_ps_expand {
468 height:auto;
469 width:100%;
471 </style>
473 </head>
475 <body class="body_top patient-demographics">
477 <a href='../reminder/active_reminder_popup.php' id='reminder_popup_link' style='visibility: false;' class='iframe' onclick='top.restoreSession()'></a>
479 <?php
480 $thisauth = acl_check('patients', 'demo');
481 if ($thisauth) {
482 if ($result['squad'] && ! acl_check('squads', $result['squad'])) {
483 $thisauth = 0;
486 if (!$thisauth) {
487 echo "<p>(" . htmlspecialchars(xl('Demographics not authorized'),ENT_NOQUOTES) . ")</p>\n";
488 echo "</body>\n</html>\n";
489 exit();
491 if ($thisauth): ?>
493 <table class="table_header">
494 <tr>
495 <td>
496 <span class='title'>
497 <?php echo htmlspecialchars(getPatientName($pid),ENT_NOQUOTES); ?>
498 </span>
499 </td>
500 <?php if (acl_check('admin', 'super') && $GLOBALS['allow_pat_delete']) : ?>
501 <td style='padding-left:1em;' class="delete">
502 <a class='css_button iframe'
503 href='../deleter.php?patient="<?php echo htmlspecialchars($pid,ENT_QUOTES);?>'
504 onclick='top.restoreSession()'>
505 <span><?php echo htmlspecialchars(xl('Delete'),ENT_NOQUOTES);?></span>
506 </a>
507 </td>
508 <?php endif; // Allow PT delete
509 if($GLOBALS['erx_enable']): ?>
510 <td style="padding-left:1em;" class="erx">
511 <a class="css_button" href="../../eRx.php?page=medentry" onclick="top.restoreSession()">
512 <span><?php echo htmlspecialchars(xl('NewCrop MedEntry'),ENT_NOQUOTES);?></span>
513 </a>
514 </td>
515 <td style="padding-left:1em;">
516 <a class="css_button iframe1"
517 href="../../soap_functions/soap_accountStatusDetails.php"
518 onclick="top.restoreSession()">
519 <span><?php echo htmlspecialchars(xl('NewCrop Account Status'),ENT_NOQUOTES);?></span>
520 </a>
521 </td>
522 <td id='accountstatus'></td>
523 <?php endif; // eRX Enabled
524 //Patient Portal
525 $portalUserSetting = true; //flag to see if patient has authorized access to portal
526 if($GLOBALS['portal_onsite_enable'] && $GLOBALS['portal_onsite_address']):
527 $portalStatus = sqlQuery("SELECT allow_patient_portal FROM patient_data WHERE pid=?",array($pid));
528 if ($portalStatus['allow_patient_portal']=='YES'):
529 $portalLogin = sqlQuery("SELECT pid FROM `patient_access_onsite` WHERE `pid`=?", array($pid));?>
530 <td style='padding-left:1em;'>
531 <a class='css_button iframe small_modal'
532 href='create_portallogin.php?portalsite=on&patient=<?php echo htmlspecialchars($pid,ENT_QUOTES);?>'
533 onclick='top.restoreSession()'>
534 <?php $display = (empty($portalLogin)) ? xlt('Create Onsite Portal Credentials') : xlt('Reset Onsite Portal Credentials'); ?>
535 <span><?php echo $display; ?></span>
536 </a>
537 </td>
538 <?php
539 else:
540 $portalUserSetting = false;
541 endif; // allow patient portal
542 endif; // Onsite Patient Portal
543 if($GLOBALS['portal_offsite_enable'] && $GLOBALS['portal_offsite_address']):
544 $portalStatus = sqlQuery("SELECT allow_patient_portal FROM patient_data WHERE pid=?",array($pid));
545 if ($portalStatus['allow_patient_portal']=='YES'):
546 $portalLogin = sqlQuery("SELECT pid FROM `patient_access_offsite` WHERE `pid`=?", array($pid));
548 <td style='padding-left:1em;'>
549 <a class='css_button iframe small_modal'
550 href='create_portallogin.php?portalsite=off&patient=<?php echo htmlspecialchars($pid,ENT_QUOTES);?>'
551 onclick='top.restoreSession()'>
552 <span>
553 <?php $text = (empty($portalLogin)) ? xlt('Create Offsite Portal Credentials') : xlt('Reset Offsite Portal Credentials'); ?>
554 <?php echo $text; ?>
555 </span>
556 </a>
557 </td>
558 <?php
559 else:
560 $portalUserSetting = false;
561 endif; // allow_patient_portal
562 endif; // portal_offsite_enable
563 if (!($portalUserSetting)): // Show that the patient has not authorized portal access ?>
564 <td style='padding-left:1em;'>
565 <?php echo htmlspecialchars( xl('Patient has not authorized the Patient Portal.'), ENT_NOQUOTES);?>
566 </td>
567 <?php endif;
568 //Patient Portal
570 // If patient is deceased, then show this (along with the number of days patient has been deceased for)
571 $days_deceased = is_patient_deceased($pid);
572 if ($days_deceased != null): ?>
573 <td class="deceased" style="padding-left:1em;font-weight:bold;color:red">
574 <?php
575 if ($days_deceased == 0) {
576 echo xlt("DECEASED (Today)");
578 else if ($days_deceased == 1) {
579 echo xlt("DECEASED (1 day ago)");
581 else {
582 echo xlt("DECEASED") . " (" . text($days_deceased) . " " . xlt("days ago") . ")";
583 } ?>
584 </td>
585 <?php endif; ?>
586 </tr>
587 </table>
589 <?php
590 endif; // $thisauth
593 <?php
594 // Get the document ID of the patient ID card if access to it is wanted here.
595 $idcard_doc_id = false;
596 if ($GLOBALS['patient_id_category_name']) {
597 $idcard_doc_id = get_document_by_catg($pid, $GLOBALS['patient_id_category_name']);
601 <table cellspacing='0' cellpadding='0' border='0' class="subnav">
602 <tr>
603 <td class="small" colspan='4'>
604 <a href="../history/history.php" onclick='top.restoreSession()'>
605 <?php echo htmlspecialchars(xl('History'),ENT_NOQUOTES); ?></a>
607 <?php //note that we have temporarily removed report screen from the modal view ?>
608 <a href="../report/patient_report.php" onclick='top.restoreSession()'>
609 <?php echo htmlspecialchars(xl('Report'),ENT_NOQUOTES); ?></a>
611 <?php //note that we have temporarily removed document screen from the modal view ?>
612 <a href="../../../controller.php?document&list&patient_id=<?php echo $pid;?>" onclick='top.restoreSession()'>
613 <?php echo htmlspecialchars(xl('Documents'),ENT_NOQUOTES); ?></a>
615 <a href="../transaction/transactions.php" class='iframe large_modal' onclick='top.restoreSession()'>
616 <?php echo htmlspecialchars(xl('Transactions'),ENT_NOQUOTES); ?></a>
618 <a href="stats_full.php?active=all" onclick='top.restoreSession()'>
619 <?php echo htmlspecialchars(xl('Issues'),ENT_NOQUOTES); ?></a>
621 <a href="../../reports/pat_ledger.php?form=1&patient_id=<?php echo attr($pid);?>" onclick='top.restoreSession()'>
622 <?php echo xlt('Ledger'); ?></a>
624 <a href="../../reports/external_data.php" onclick='top.restoreSession()'>
625 <?php echo xlt('External Data'); ?></a>
627 <!-- DISPLAYING HOOKS STARTS HERE -->
628 <?php
629 $module_query = sqlStatement("SELECT msh.*,ms.menu_name,ms.path,m.mod_ui_name,m.type FROM modules_hooks_settings AS msh
630 LEFT OUTER JOIN modules_settings AS ms ON obj_name=enabled_hooks AND ms.mod_id=msh.mod_id
631 LEFT OUTER JOIN modules AS m ON m.mod_id=ms.mod_id
632 WHERE fld_type=3 AND mod_active=1 AND sql_run=1 AND attached_to='demographics' ORDER BY mod_id");
633 $DivId = 'mod_installer';
634 if (sqlNumRows($module_query)) {
635 $jid = 0;
636 $modid = '';
637 while ($modulerow = sqlFetchArray($module_query)) {
638 $DivId = 'mod_'.$modulerow['mod_id'];
639 $new_category = $modulerow['mod_ui_name'];
640 $modulePath = "";
641 $added = "";
642 if($modulerow['type'] == 0) {
643 $modulePath = $GLOBALS['customModDir'];
644 $added = "";
646 else{
647 $added = "index";
648 $modulePath = $GLOBALS['zendModDir'];
650 $relative_link = "../../modules/".$modulePath."/".$modulerow['path'];
651 $nickname = $modulerow['menu_name'] ? $modulerow['menu_name'] : 'Noname';
652 $jid++;
653 $modid = $modulerow['mod_id'];
656 <a href="<?php echo $relative_link; ?>" onclick='top.restoreSession()'>
657 <?php echo xlt($nickname); ?></a>
658 <?php
662 <!-- DISPLAYING HOOKS ENDS HERE -->
664 </td>
665 </tr>
666 </table> <!-- end header -->
668 <div style='margin-top:10px' class="main"> <!-- start main content div -->
669 <table border="0" cellspacing="0" cellpadding="0" width="100%">
670 <tr>
671 <td class="demographics-box" align="left" valign="top">
672 <!-- start left column div -->
673 <div style='float:left; margin-right:20px'>
675 <table cellspacing=0 cellpadding=0>
676 <?php if (!$GLOBALS['hide_billing_widget']) { ?>
677 <tr>
678 <td>
679 <?php
680 // Billing expand collapse widget
681 $widgetTitle = xl("Billing");
682 $widgetLabel = "billing";
683 $widgetButtonLabel = xl("Edit");
684 $widgetButtonLink = "return newEvt();";
685 $widgetButtonClass = "";
686 $linkMethod = "javascript";
687 $bodyClass = "notab";
688 $widgetAuth = false;
689 $fixedWidth = true;
690 if ($GLOBALS['force_billing_widget_open']) {
691 $forceExpandAlways = true;
693 else {
694 $forceExpandAlways = false;
696 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
697 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
698 $widgetAuth, $fixedWidth, $forceExpandAlways);
700 <br>
701 <?php
702 //PATIENT BALANCE,INS BALANCE naina@capminds.com
703 $patientbalance = get_patient_balance($pid, false);
704 //Debit the patient balance from insurance balance
705 $insurancebalance = get_patient_balance($pid, true) - $patientbalance;
706 $totalbalance=$patientbalance + $insurancebalance;
708 // Show current balance and billing note, if any.
709 echo "<table border='0'><tr><td>" .
710 "<table ><tr><td><span class='bold'><font color='red'>" .
711 xlt('Patient Balance Due') .
712 " : " . text(oeFormatMoney($patientbalance)) .
713 "</font></span></td></tr>".
714 "<tr><td><span class='bold'><font color='red'>" .
715 xlt('Insurance Balance Due') .
716 " : " . text(oeFormatMoney($insurancebalance)) .
717 "</font></span></td></tr>".
718 "<tr><td><span class='bold'><font color='red'>" .
719 xlt('Total Balance Due').
720 " : " . text(oeFormatMoney($totalbalance)) .
721 "</font></span></td></td></tr>";
722 if (!empty($result['billing_note'])) {
723 echo "<tr><td><span class='bold'><font color='red'>" .
724 xlt('Billing Note') . ":" .
725 text($result['billing_note']) .
726 "</font></span></td></tr>";
728 if ($result3['provider']) { // Use provider in case there is an ins record w/ unassigned insco
729 echo "<tr><td><span class='bold'>" .
730 xlt('Primary Insurance') . ': ' . text($insco_name) .
731 "</span>&nbsp;&nbsp;&nbsp;";
732 if ($result3['copay'] > 0) {
733 echo "<span class='bold'>" .
734 xlt('Copay') . ': ' . text($result3['copay']) .
735 "</span>&nbsp;&nbsp;&nbsp;";
737 echo "<span class='bold'>" .
738 xlt('Effective Date') . ': ' . text(oeFormatShortDate($result3['effdate'])) .
739 "</span></td></tr>";
741 echo "</table></td></tr></td></tr></table><br>";
744 </div> <!-- required for expand_collapse_widget -->
745 </td>
746 </tr>
747 <?php } ?>
748 <tr>
749 <td>
750 <?php
751 // Demographics expand collapse widget
752 $widgetTitle = xl("Demographics");
753 $widgetLabel = "demographics";
754 $widgetButtonLabel = xl("Edit");
755 $widgetButtonLink = "demographics_full.php";
756 $widgetButtonClass = "";
757 $linkMethod = "html";
758 $bodyClass = "";
759 $widgetAuth = acl_check('patients', 'demo', '', 'write');
760 $fixedWidth = true;
761 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
762 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
763 $widgetAuth, $fixedWidth);
765 <div id="DEM" >
766 <ul class="tabNav">
767 <?php display_layout_tabs('DEM', $result, $result2); ?>
768 </ul>
769 <div class="tabContainer">
770 <?php display_layout_tabs_data('DEM', $result, $result2); ?>
771 </div>
772 </div>
773 </div> <!-- required for expand_collapse_widget -->
774 </td>
775 </tr>
777 <tr>
778 <td>
779 <?php
780 $insurance_count = 0;
781 foreach (array('primary','secondary','tertiary') as $instype) {
782 $enddate = 'Present';
783 $query = "SELECT * FROM insurance_data WHERE " .
784 "pid = ? AND type = ? " .
785 "ORDER BY date DESC";
786 $res = sqlStatement($query, array($pid, $instype) );
787 while( $row = sqlFetchArray($res) ) {
788 if ($row['provider'] ) $insurance_count++;
792 if ( $insurance_count > 0 ) {
793 // Insurance expand collapse widget
794 $widgetTitle = xl("Insurance");
795 $widgetLabel = "insurance";
796 $widgetButtonLabel = xl("Edit");
797 $widgetButtonLink = "demographics_full.php";
798 $widgetButtonClass = "";
799 $linkMethod = "html";
800 $bodyClass = "";
801 $widgetAuth = acl_check('patients', 'demo', '', 'write');
802 $fixedWidth = true;
803 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
804 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
805 $widgetAuth, $fixedWidth);
807 if ( $insurance_count > 0 ) {
810 <ul class="tabNav"><?php
811 ///////////////////////////////// INSURANCE SECTION
812 $first = true;
813 foreach (array('primary','secondary','tertiary') as $instype) {
815 $query = "SELECT * FROM insurance_data WHERE " .
816 "pid = ? AND type = ? " .
817 "ORDER BY date DESC";
818 $res = sqlStatement($query, array($pid, $instype) );
820 $enddate = 'Present';
822 while( $row = sqlFetchArray($res) ) {
823 if ($row['provider'] ) {
825 $ins_description = ucfirst($instype);
826 $ins_description = xl($ins_description);
827 $ins_description .= strcmp($enddate, 'Present') != 0 ? " (".xl('Old').")" : "";
829 <li <?php echo $first ? 'class="current"' : '' ?>><a href="#">
830 <?php echo htmlspecialchars($ins_description,ENT_NOQUOTES); ?></a></li>
831 <?php
832 $first = false;
834 $enddate = $row['date'];
837 // Display the eligibility tab
838 echo "<li><a href='#'>" .
839 htmlspecialchars( xl('Eligibility'), ENT_NOQUOTES) . "</a></li>";
841 ?></ul><?php
843 } ?>
845 <div class="tabContainer">
846 <?php
847 $first = true;
848 foreach (array('primary','secondary','tertiary') as $instype) {
849 $enddate = 'Present';
851 $query = "SELECT * FROM insurance_data WHERE " .
852 "pid = ? AND type = ? " .
853 "ORDER BY date DESC";
854 $res = sqlStatement($query, array($pid, $instype) );
855 while( $row = sqlFetchArray($res) ) {
856 if ($row['provider'] ) {
858 <div class="tab <?php echo $first ? 'current' : '' ?>">
859 <table border='0' cellpadding='0' width='100%'>
860 <?php
861 $icobj = new InsuranceCompany($row['provider']);
862 $adobj = $icobj->get_address();
863 $insco_name = trim($icobj->get_name());
865 <tr>
866 <td valign='top' colspan='3'>
867 <span class='text'>
868 <?php if (strcmp($enddate, 'Present') != 0) echo htmlspecialchars(xl("Old"),ENT_NOQUOTES)." "; ?>
869 <?php $tempinstype=ucfirst($instype); echo htmlspecialchars(xl($tempinstype.' Insurance'),ENT_NOQUOTES); ?>
870 <?php if (strcmp($row['date'], '0000-00-00') != 0) { ?>
871 <?php echo htmlspecialchars(xl('from','',' ',' ').$row['date'],ENT_NOQUOTES); ?>
872 <?php } ?>
873 <?php echo htmlspecialchars(xl('until','',' ',' '),ENT_NOQUOTES);
874 echo (strcmp($enddate, 'Present') != 0) ? $enddate : htmlspecialchars(xl('Present'),ENT_NOQUOTES); ?>:</span>
875 </td>
876 </tr>
877 <tr>
878 <td valign='top'>
879 <span class='text'>
880 <?php
881 if ($insco_name) {
882 echo htmlspecialchars($insco_name,ENT_NOQUOTES) . '<br>';
883 if (trim($adobj->get_line1())) {
884 echo htmlspecialchars($adobj->get_line1(),ENT_NOQUOTES) . '<br>';
885 echo htmlspecialchars($adobj->get_city() . ', ' . $adobj->get_state() . ' ' . $adobj->get_zip(),ENT_NOQUOTES);
887 } else {
888 echo "<font color='red'><b>".htmlspecialchars(xl('Unassigned'),ENT_NOQUOTES)."</b></font>";
891 <br>
892 <?php echo htmlspecialchars(xl('Policy Number'),ENT_NOQUOTES); ?>:
893 <?php echo htmlspecialchars($row['policy_number'],ENT_NOQUOTES) ?><br>
894 <?php echo htmlspecialchars(xl('Plan Name'),ENT_NOQUOTES); ?>:
895 <?php echo htmlspecialchars($row['plan_name'],ENT_NOQUOTES); ?><br>
896 <?php echo htmlspecialchars(xl('Group Number'),ENT_NOQUOTES); ?>:
897 <?php echo htmlspecialchars($row['group_number'],ENT_NOQUOTES); ?></span>
898 </td>
899 <td valign='top'>
900 <span class='bold'><?php echo htmlspecialchars(xl('Subscriber'),ENT_NOQUOTES); ?>: </span><br>
901 <span class='text'><?php echo htmlspecialchars($row['subscriber_fname'] . ' ' . $row['subscriber_mname'] . ' ' . $row['subscriber_lname'],ENT_NOQUOTES); ?>
902 <?php
903 if ($row['subscriber_relationship'] != "") {
904 echo "(" . htmlspecialchars($row['subscriber_relationship'],ENT_NOQUOTES) . ")";
907 <br>
908 <?php echo htmlspecialchars(xl('S.S.'),ENT_NOQUOTES); ?>:
909 <?php echo htmlspecialchars($row['subscriber_ss'],ENT_NOQUOTES); ?><br>
910 <?php echo htmlspecialchars(xl('D.O.B.'),ENT_NOQUOTES); ?>:
911 <?php if ($row['subscriber_DOB'] != "0000-00-00 00:00:00") echo htmlspecialchars($row['subscriber_DOB'],ENT_NOQUOTES); ?><br>
912 <?php echo htmlspecialchars(xl('Phone'),ENT_NOQUOTES); ?>:
913 <?php echo htmlspecialchars($row['subscriber_phone'],ENT_NOQUOTES); ?>
914 </span>
915 </td>
916 <td valign='top'>
917 <span class='bold'><?php echo htmlspecialchars(xl('Subscriber Address'),ENT_NOQUOTES); ?>: </span><br>
918 <span class='text'><?php echo htmlspecialchars($row['subscriber_street'],ENT_NOQUOTES); ?><br>
919 <?php echo htmlspecialchars($row['subscriber_city'],ENT_NOQUOTES); ?>
920 <?php if($row['subscriber_state'] != "") echo ", "; echo htmlspecialchars($row['subscriber_state'],ENT_NOQUOTES); ?>
921 <?php if($row['subscriber_country'] != "") echo ", "; echo htmlspecialchars($row['subscriber_country'],ENT_NOQUOTES); ?>
922 <?php echo " " . htmlspecialchars($row['subscriber_postal_code'],ENT_NOQUOTES); ?></span>
924 <?php if (trim($row['subscriber_employer'])) { ?>
925 <br><span class='bold'><?php echo htmlspecialchars(xl('Subscriber Employer'),ENT_NOQUOTES); ?>: </span><br>
926 <span class='text'><?php echo htmlspecialchars($row['subscriber_employer'],ENT_NOQUOTES); ?><br>
927 <?php echo htmlspecialchars($row['subscriber_employer_street'],ENT_NOQUOTES); ?><br>
928 <?php echo htmlspecialchars($row['subscriber_employer_city'],ENT_NOQUOTES); ?>
929 <?php if($row['subscriber_employer_city'] != "") echo ", "; echo htmlspecialchars($row['subscriber_employer_state'],ENT_NOQUOTES); ?>
930 <?php if($row['subscriber_employer_country'] != "") echo ", "; echo htmlspecialchars($row['subscriber_employer_country'],ENT_NOQUOTES); ?>
931 <?php echo " " . htmlspecialchars($row['subscriber_employer_postal_code'],ENT_NOQUOTES); ?>
932 </span>
933 <?php } ?>
935 </td>
936 </tr>
937 <tr>
938 <td>
939 <?php if ($row['copay'] != "") { ?>
940 <span class='bold'><?php echo htmlspecialchars(xl('CoPay'),ENT_NOQUOTES); ?>: </span>
941 <span class='text'><?php echo htmlspecialchars($row['copay'],ENT_NOQUOTES); ?></span>
942 <br />
943 <?php } ?>
944 <span class='bold'><?php echo htmlspecialchars(xl('Accept Assignment'),ENT_NOQUOTES); ?>:</span>
945 <span class='text'><?php if($row['accept_assignment'] == "TRUE") echo xl("YES"); ?>
946 <?php if($row['accept_assignment'] == "FALSE") echo xl("NO"); ?></span>
947 <?php if (!empty($row['policy_type'])) { ?>
948 <br />
949 <span class='bold'><?php echo htmlspecialchars(xl('Secondary Medicare Type'),ENT_NOQUOTES); ?>: </span>
950 <span class='text'><?php echo htmlspecialchars($policy_types[$row['policy_type']],ENT_NOQUOTES); ?></span>
951 <?php } ?>
952 </td>
953 <td valign='top'></td>
954 <td valign='top'></td>
955 </tr>
957 </table>
958 </div>
959 <?php
961 } // end if ($row['provider'])
962 $enddate = $row['date'];
963 $first = false;
964 } // end while
965 } // end foreach
967 // Display the eligibility information
968 echo "<div class='tab'>";
969 show_eligibility_information($pid,true);
970 echo "</div>";
972 ///////////////////////////////// END INSURANCE SECTION
974 </div>
976 <?php } // ?>
978 </td>
979 </tr>
981 <tr>
982 <td width='650px'>
984 <?php
985 // Notes expand collapse widget
986 $widgetTitle = xl("Notes");
987 $widgetLabel = "pnotes";
988 $widgetButtonLabel = xl("Edit");
989 $widgetButtonLink = "pnotes_full.php?form_active=1";
990 $widgetButtonClass = "";
991 $linkMethod = "html";
992 $bodyClass = "notab";
993 $widgetAuth = true;
994 $fixedWidth = true;
995 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
996 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
997 $widgetAuth, $fixedWidth);
1000 <br/>
1001 <div style='margin-left:10px' class='text'><img src='../../pic/ajax-loader.gif'/></div><br/>
1002 </div>
1003 </td>
1004 </tr>
1005 <?php if ( (acl_check('patients', 'med')) && ($GLOBALS['enable_cdr'] && $GLOBALS['enable_cdr_prw']) ) {
1006 echo "<tr><td width='650px'>";
1007 // patient reminders collapse widget
1008 $widgetTitle = xl("Patient Reminders");
1009 $widgetLabel = "patient_reminders";
1010 $widgetButtonLabel = xl("Edit");
1011 $widgetButtonLink = "../reminder/patient_reminders.php?mode=simple&patient_id=".$pid;
1012 $widgetButtonClass = "";
1013 $linkMethod = "html";
1014 $bodyClass = "notab";
1015 $widgetAuth = true;
1016 $fixedWidth = true;
1017 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth); ?>
1018 <br/>
1019 <div style='margin-left:10px' class='text'><image src='../../pic/ajax-loader.gif'/></div><br/>
1020 </div>
1021 </td>
1022 </tr>
1023 <?php } //end if prw is activated ?>
1025 <tr>
1026 <td width='650px'>
1027 <?php
1028 // disclosures expand collapse widget
1029 $widgetTitle = xl("Disclosures");
1030 $widgetLabel = "disclosures";
1031 $widgetButtonLabel = xl("Edit");
1032 $widgetButtonLink = "disclosure_full.php";
1033 $widgetButtonClass = "";
1034 $linkMethod = "html";
1035 $bodyClass = "notab";
1036 $widgetAuth = true;
1037 $fixedWidth = true;
1038 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
1039 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
1040 $widgetAuth, $fixedWidth);
1042 <br/>
1043 <div style='margin-left:10px' class='text'><img src='../../pic/ajax-loader.gif'/></div><br/>
1044 </div>
1045 </td>
1046 </tr>
1047 <?php if ($GLOBALS['amendments']) { ?>
1048 <tr>
1049 <td width='650px'>
1050 <?php // Amendments widget
1051 $widgetTitle = xlt('Amendments');
1052 $widgetLabel = "amendments";
1053 $widgetButtonLabel = xlt("Edit");
1054 $widgetButtonLink = $GLOBALS['webroot'] . "/interface/patient_file/summary/main_frameset.php?feature=amendment";
1055 $widgetButtonClass = "iframe rx_modal";
1056 $linkMethod = "html";
1057 $bodyClass = "summary_item small";
1058 $widgetAuth = true;
1059 $fixedWidth = false;
1060 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
1061 $sql = "SELECT * FROM amendments WHERE pid = ? ORDER BY amendment_date DESC";
1062 $result = sqlStatement($sql, array($pid) );
1064 if (sqlNumRows($result) == 0) {
1065 echo " <table><tr>\n";
1066 echo " <td colspan='$numcols' class='text'>&nbsp;&nbsp;" . xlt('None') . "</td>\n";
1067 echo " </tr></table>\n";
1070 while ($row=sqlFetchArray($result)){
1071 echo "&nbsp;&nbsp;";
1072 echo "<a class= '" . $widgetButtonClass . "' href='" . $widgetButtonLink . "&id=" . attr($row['amendment_id']) . "' onclick='top.restoreSession()'>" . text($row['amendment_date']);
1073 echo "&nbsp; " . text($row['amendment_desc']);
1075 echo "</a><br>\n";
1076 } ?>
1077 </td>
1078 </tr>
1079 <?php } ?>
1080 <?php // labdata ?>
1081 <tr>
1082 <td width='650px'>
1083 <?php // labdata expand collapse widget
1084 $widgetTitle = xl("Labs");
1085 $widgetLabel = "labdata";
1086 $widgetButtonLabel = xl("Trend");
1087 $widgetButtonLink = "../summary/labdata.php";#"../encounter/trend_form.php?formname=labdata";
1088 $widgetButtonClass = "";
1089 $linkMethod = "html";
1090 $bodyClass = "notab";
1091 // check to see if any labdata exist
1092 $spruch = "SELECT procedure_report.date_collected AS date " .
1093 "FROM procedure_report " .
1094 "JOIN procedure_order ON procedure_report.procedure_order_id = procedure_order.procedure_order_id " .
1095 "WHERE procedure_order.patient_id = ? " .
1096 "ORDER BY procedure_report.date_collected DESC ";
1097 $existLabdata = sqlQuery($spruch, array($pid) );
1098 if ($existLabdata) {
1099 $widgetAuth = true;
1101 else {
1102 $widgetAuth = false;
1104 $fixedWidth = true;
1105 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
1106 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
1107 $widgetAuth, $fixedWidth);
1109 <br/>
1110 <div style='margin-left:10px' class='text'><img src='../../pic/ajax-loader.gif'/></div><br/>
1111 </div>
1112 </td>
1113 </tr>
1114 <?php // end labdata ?>
1119 <?php if ($vitals_is_registered && acl_check('patients', 'med')) { ?>
1120 <tr>
1121 <td width='650px'>
1122 <?php // vitals expand collapse widget
1123 $widgetTitle = xl("Vitals");
1124 $widgetLabel = "vitals";
1125 $widgetButtonLabel = xl("Trend");
1126 $widgetButtonLink = "../encounter/trend_form.php?formname=vitals";
1127 $widgetButtonClass = "";
1128 $linkMethod = "html";
1129 $bodyClass = "notab";
1130 // check to see if any vitals exist
1131 $existVitals = sqlQuery("SELECT * FROM form_vitals WHERE pid=?", array($pid) );
1132 if ($existVitals) {
1133 $widgetAuth = true;
1135 else {
1136 $widgetAuth = false;
1138 $fixedWidth = true;
1139 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
1140 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
1141 $widgetAuth, $fixedWidth);
1143 <br/>
1144 <div style='margin-left:10px' class='text'><img src='../../pic/ajax-loader.gif'/></div><br/>
1145 </div>
1146 </td>
1147 </tr>
1148 <?php } // end if ($vitals_is_registered && acl_check('patients', 'med')) ?>
1150 <?php
1151 // This generates a section similar to Vitals for each LBF form that
1152 // supports charting. The form ID is used as the "widget label".
1154 $gfres = sqlStatement("SELECT option_id, title FROM list_options WHERE " .
1155 "list_id = 'lbfnames' AND " .
1156 "option_value > 0 AND activity = 1 " .
1157 "ORDER BY seq, title");
1158 while($gfrow = sqlFetchArray($gfres)) {
1160 <tr>
1161 <td width='650px'>
1162 <?php // vitals expand collapse widget
1163 $vitals_form_id = $gfrow['option_id'];
1164 $widgetTitle = $gfrow['title'];
1165 $widgetLabel = $vitals_form_id;
1166 $widgetButtonLabel = xl("Trend");
1167 $widgetButtonLink = "../encounter/trend_form.php?formname=$vitals_form_id";
1168 $widgetButtonClass = "";
1169 $linkMethod = "html";
1170 $bodyClass = "notab";
1171 // check to see if any instances exist for this patient
1172 $existVitals = sqlQuery(
1173 "SELECT * FROM forms WHERE pid = ? AND formdir = ? AND deleted = 0",
1174 array($pid, $vitals_form_id));
1175 $widgetAuth = $existVitals ? true : false;
1176 $fixedWidth = true;
1177 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
1178 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
1179 $widgetAuth, $fixedWidth);
1181 <br/>
1182 <div style='margin-left:10px' class='text'>
1183 <image src='../../pic/ajax-loader.gif'/>
1184 </div>
1185 <br/>
1186 </div> <!-- This is required by expand_collapse_widget(). -->
1187 </td>
1188 </tr>
1189 <?php
1190 } // end while
1193 </table>
1195 </div>
1196 <!-- end left column div -->
1198 <!-- start right column div -->
1199 <div>
1200 <table>
1201 <tr>
1202 <td>
1204 <div>
1205 <?php
1207 // If there is an ID Card or any Photos show the widget
1208 $photos = pic_array($pid, $GLOBALS['patient_photo_category_name']);
1209 if ($photos or $idcard_doc_id )
1211 $widgetTitle = xl("ID Card") . '/' . xl("Photos");
1212 $widgetLabel = "photos";
1213 $linkMethod = "javascript";
1214 $bodyClass = "notab-right";
1215 $widgetAuth = false;
1216 $fixedWidth = false;
1217 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel ,
1218 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
1219 $widgetAuth, $fixedWidth);
1221 <br />
1222 <?php
1223 if ($idcard_doc_id) {
1224 image_widget($idcard_doc_id, $GLOBALS['patient_id_category_name']);
1227 foreach ($photos as $photo_doc_id) {
1228 image_widget($photo_doc_id, $GLOBALS['patient_photo_category_name']);
1233 <br />
1234 </div>
1235 <div>
1236 <?php
1237 // Advance Directives
1238 if ($GLOBALS['advance_directives_warning']) {
1239 // advance directives expand collapse widget
1240 $widgetTitle = xl("Advance Directives");
1241 $widgetLabel = "directives";
1242 $widgetButtonLabel = xl("Edit");
1243 $widgetButtonLink = "return advdirconfigure();";
1244 $widgetButtonClass = "";
1245 $linkMethod = "javascript";
1246 $bodyClass = "summary_item small";
1247 $widgetAuth = true;
1248 $fixedWidth = false;
1249 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
1250 $counterFlag = false; //flag to record whether any categories contain ad records
1251 $query = "SELECT id FROM categories WHERE name='Advance Directive'";
1252 $myrow2 = sqlQuery($query);
1253 if ($myrow2) {
1254 $parentId = $myrow2['id'];
1255 $query = "SELECT id, name FROM categories WHERE parent=?";
1256 $resNew1 = sqlStatement($query, array($parentId) );
1257 while ($myrows3 = sqlFetchArray($resNew1)) {
1258 $categoryId = $myrows3['id'];
1259 $nameDoc = $myrows3['name'];
1260 $query = "SELECT documents.date, documents.id " .
1261 "FROM documents " .
1262 "INNER JOIN categories_to_documents " .
1263 "ON categories_to_documents.document_id=documents.id " .
1264 "WHERE categories_to_documents.category_id=? " .
1265 "AND documents.foreign_id=? " .
1266 "ORDER BY documents.date DESC";
1267 $resNew2 = sqlStatement($query, array($categoryId, $pid) );
1268 $limitCounter = 0; // limit to one entry per category
1269 while (($myrows4 = sqlFetchArray($resNew2)) && ($limitCounter == 0)) {
1270 $dateTimeDoc = $myrows4['date'];
1271 // remove time from datetime stamp
1272 $tempParse = explode(" ",$dateTimeDoc);
1273 $dateDoc = $tempParse[0];
1274 $idDoc = $myrows4['id'];
1275 echo "<a href='$web_root/controller.php?document&retrieve&patient_id=" .
1276 htmlspecialchars($pid,ENT_QUOTES) . "&document_id=" .
1277 htmlspecialchars($idDoc,ENT_QUOTES) . "&as_file=true' onclick='top.restoreSession()'>" .
1278 htmlspecialchars(xl_document_category($nameDoc),ENT_NOQUOTES) . "</a> " .
1279 htmlspecialchars($dateDoc,ENT_NOQUOTES);
1280 echo "<br>";
1281 $limitCounter = $limitCounter + 1;
1282 $counterFlag = true;
1286 if (!$counterFlag) {
1287 echo "&nbsp;&nbsp;" . htmlspecialchars(xl('None'),ENT_NOQUOTES);
1288 } ?>
1289 </div>
1290 <?php } // close advanced dir block
1292 // This is a feature for a specific client. -- Rod
1293 if ($GLOBALS['cene_specific']) {
1294 echo " <br />\n";
1296 $imagedir = $GLOBALS['OE_SITE_DIR'] . "/documents/$pid/demographics";
1297 $imagepath = "$web_root/sites/" . $_SESSION['site_id'] . "/documents/$pid/demographics";
1299 echo " <a href='' onclick=\"return sendimage($pid, 'photo');\" " .
1300 "title='Click to attach patient image'>\n";
1301 if (is_file("$imagedir/photo.jpg")) {
1302 echo " <img src='$imagepath/photo.jpg' /></a>\n";
1303 } else {
1304 echo " Attach Patient Image</a><br />\n";
1306 echo " <br />&nbsp;<br />\n";
1308 echo " <a href='' onclick=\"return sendimage($pid, 'fingerprint');\" " .
1309 "title='Click to attach fingerprint'>\n";
1310 if (is_file("$imagedir/fingerprint.jpg")) {
1311 echo " <img src='$imagepath/fingerprint.jpg' /></a>\n";
1312 } else {
1313 echo " Attach Biometric Fingerprint</a><br />\n";
1315 echo " <br />&nbsp;<br />\n";
1318 // Show Clinical Reminders for any user that has rules that are permitted.
1319 $clin_rem_check = resolve_rules_sql('','0',TRUE,'',$_SESSION['authUser']);
1320 if ( (!empty($clin_rem_check)) && ($GLOBALS['enable_cdr'] && $GLOBALS['enable_cdr_crw']) ) {
1321 // clinical summary expand collapse widget
1322 $widgetTitle = xl("Clinical Reminders");
1323 $widgetLabel = "clinical_reminders";
1324 $widgetButtonLabel = xl("Edit");
1325 $widgetButtonLink = "../reminder/clinical_reminders.php?patient_id=".$pid;;
1326 $widgetButtonClass = "";
1327 $linkMethod = "html";
1328 $bodyClass = "summary_item small";
1329 $widgetAuth = true;
1330 $fixedWidth = false;
1331 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
1332 echo "<br/>";
1333 echo "<div style='margin-left:10px' class='text'><image src='../../pic/ajax-loader.gif'/></div><br/>";
1334 echo "</div>";
1335 } // end if crw
1338 // Show current and upcoming appointments.
1340 // Recurring appointment support and Appointment Display Sets
1341 // added to Appointments by Ian Jardine ( epsdky ).
1343 if (isset($pid) && !$GLOBALS['disable_calendar']) {
1345 $current_date2 = date('Y-m-d');
1346 $events = array();
1347 $apptNum = (int)$GLOBALS['number_of_appts_to_show'];
1348 if($apptNum != 0) $apptNum2 = abs($apptNum);
1349 else $apptNum2 = 10;
1351 $mode1 = !$GLOBALS['appt_display_sets_option'];
1352 $colorSet1 = $GLOBALS['appt_display_sets_color_1'];
1353 $colorSet2 = $GLOBALS['appt_display_sets_color_2'];
1354 $colorSet3 = $GLOBALS['appt_display_sets_color_3'];
1355 $colorSet4 = $GLOBALS['appt_display_sets_color_4'];
1357 if($mode1) $extraAppts = 1;
1358 else $extraAppts = 6;
1359 $events = fetchNextXAppts($current_date2, $pid, $apptNum2 + $extraAppts, true);
1360 //////
1361 if($events) {
1362 $selectNum = 0;
1363 $apptNumber = count($events);
1365 if($apptNumber <= $apptNum2) {
1366 $extraApptDate = '';
1368 } else if($mode1 && $apptNumber == $apptNum2 + 1) {
1369 $extraApptDate = $events[$apptNumber - 1]['pc_eventDate'];
1370 array_pop($events);
1371 --$apptNumber;
1372 $selectNum = 1;
1374 } else if($apptNumber == $apptNum2 + 6) {
1375 $extraApptDate = $events[$apptNumber - 1]['pc_eventDate'];
1376 array_pop($events);
1377 --$apptNumber;
1378 $selectNum = 2;
1380 } else { // mode 2 - $apptNum2 < $apptNumber < $apptNum2 + 6
1381 $extraApptDate = '';
1382 $selectNum = 2;
1386 $limitApptIndx = $apptNum2 - 1;
1387 $limitApptDate = $events[$limitApptIndx]['pc_eventDate'];
1389 switch ($selectNum) {
1391 case 2:
1392 $lastApptIndx = $apptNumber - 1;
1393 $thisNumber = $lastApptIndx - $limitApptIndx;
1394 for($i = 1; $i <= $thisNumber; ++$i) {
1395 if($events[$limitApptIndx + $i]['pc_eventDate'] != $limitApptDate) {
1396 $extraApptDate = $events[$limitApptIndx + $i]['pc_eventDate'];
1397 $events = array_slice($events, 0, $limitApptIndx + $i);
1398 break;
1402 case 1:
1403 $firstApptIndx = 0;
1404 for($i = 1; $i <= $limitApptIndx; ++$i) {
1405 if($events[$limitApptIndx - $i]['pc_eventDate'] != $limitApptDate) {
1406 $firstApptIndx = $apptNum2 - $i;
1407 break;
1413 if($extraApptDate) {
1414 if($extraApptDate != $limitApptDate) $apptStyle2 = " style='background-color:" . attr($colorSet3) . ";'";
1415 else $apptStyle2 = " style='background-color:" . attr($colorSet4) . ";'";
1418 //////
1420 // appointments expand collapse widget
1421 $widgetTitle = xl("Appointments");
1422 $widgetLabel = "appointments";
1423 $widgetButtonLabel = xl("Add");
1424 $widgetButtonLink = "return newEvt();";
1425 $widgetButtonClass = "";
1426 $linkMethod = "javascript";
1427 $bodyClass = "summary_item small";
1428 $widgetAuth = $resNotNull; // $resNotNull reflects state of query in fetchAppointments
1429 $fixedWidth = false;
1430 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
1431 $count = 0;
1433 $toggleSet = true;
1434 $priorDate = "";
1435 $therapyGroupCategories = array();
1436 $query = sqlStatement("SELECT pc_catid FROM openemr_postcalendar_categories WHERE pc_cattype = 3 AND pc_active = 1");
1437 while ($result = sqlFetchArray($query)){
1438 $therapyGroupCategories[] = $result['pc_catid'];
1442 foreach($events as $row) { //////
1443 $count++;
1444 $dayname = date("l", strtotime($row['pc_eventDate'])); //////
1445 $dispampm = "am";
1446 $disphour = substr($row['pc_startTime'], 0, 2) + 0;
1447 $dispmin = substr($row['pc_startTime'], 3, 2);
1448 if ($disphour >= 12) {
1449 $dispampm = "pm";
1450 if ($disphour > 12) $disphour -= 12;
1452 $etitle = xl('(Click to edit)');
1453 if ($row['pc_hometext'] != "") {
1454 $etitle = xl('Comments').": ".($row['pc_hometext'])."\r\n".$etitle;
1456 //////
1457 if($extraApptDate && $count > $firstApptIndx) {
1458 $apptStyle = $apptStyle2;
1459 } else {
1460 if($row['pc_eventDate'] != $priorDate) {
1461 $priorDate = $row['pc_eventDate'];
1462 $toggleSet = !$toggleSet;
1464 if($toggleSet) $apptStyle = " style='background-color:" . attr($colorSet2) . ";'";
1465 else $apptStyle = " style='background-color:" . attr($colorSet1) . ";'";
1467 //////
1468 echo "<div " . $apptStyle . ">";
1469 if(!in_array($row['pc_catid'], $therapyGroupCategories)){
1470 echo "<a href='javascript:oldEvt(" . htmlspecialchars(preg_replace("/-/", "", $row['pc_eventDate']),ENT_QUOTES) . ', ' . htmlspecialchars($row['pc_eid'],ENT_QUOTES) . ")' title='" . htmlspecialchars($etitle,ENT_QUOTES) . "'>";
1471 } else {
1472 echo "<span title='" . htmlspecialchars($etitle,ENT_QUOTES) . "'>";
1474 echo "<b>" . htmlspecialchars($row['pc_eventDate'],ENT_NOQUOTES) . ", ";
1475 echo htmlspecialchars(sprintf("%02d", $disphour) .":$dispmin " . xl($dispampm) . " (" . xl($dayname),ENT_NOQUOTES) . ")</b> ";
1476 if ($row['pc_recurrtype']) echo "<img src='" . $GLOBALS['webroot'] . "/interface/main/calendar/modules/PostCalendar/pntemplates/default/images/repeating8.png' border='0' style='margin:0px 2px 0px 2px;' title='".htmlspecialchars(xl("Repeating event"),ENT_QUOTES)."' alt='".htmlspecialchars(xl("Repeating event"),ENT_QUOTES)."'>";
1477 echo "<span title='" . generate_display_field(array('data_type'=>'1','list_id'=>'apptstat'),$row['pc_apptstatus']) . "'>";
1478 echo "<br>" . xlt('Status') . "( " . htmlspecialchars($row['pc_apptstatus'],ENT_NOQUOTES) . " ) </span>";
1479 echo htmlspecialchars(xl_appt_category($row['pc_catname']),ENT_NOQUOTES) . "\n";
1480 if(in_array($row['pc_catid'], $therapyGroupCategories)) echo "<br><span>" . xlt('Group name') .": " . text(getGroup($row['pc_gid'])['group_name']) . "</span>\n";
1481 if ($row['pc_hometext']) echo " <span style='color:green'> Com</span>";
1482 echo "<br>" . htmlspecialchars($row['ufname'] . " " . $row['ulname'],ENT_NOQUOTES);
1483 echo !in_array($row['pc_catid'], $therapyGroupCategories) ? '</a>' : '<span>';
1484 echo "</div>\n";
1485 //////
1487 if ($resNotNull) { //////
1488 if ( $count < 1 ) {
1489 echo "&nbsp;&nbsp;" . htmlspecialchars(xl('None'),ENT_NOQUOTES);
1490 } else { //////
1491 if($extraApptDate) echo "<div style='color:#0000cc;'><b>" . attr($extraApptDate) . " ( + ) </b></div>";
1492 else echo "<div><hr></div>";
1494 echo "</div>";
1496 } // End of Appointments.
1499 /* Widget that shows recurrences for appointments. */
1500 if (isset($pid) && !$GLOBALS['disable_calendar'] && $GLOBALS['appt_recurrences_widget']) {
1502 $widgetTitle = xl("Recurrent Appointments");
1503 $widgetLabel = "recurrent_appointments";
1504 $widgetButtonLabel = xl("Add");
1505 $widgetButtonLink = "return newEvt();";
1506 $widgetButtonClass = "";
1507 $linkMethod = "javascript";
1508 $bodyClass = "summary_item small";
1509 $widgetAuth = false;
1510 $fixedWidth = false;
1511 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel, $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
1512 $count = 0;
1513 $toggleSet = true;
1514 $priorDate = "";
1516 //Fetch patient's recurrences. Function returns array with recurrence appointments' category, recurrence pattern (interpreted), and end date.
1517 $recurrences = fetchRecurrences($pid);
1518 if($recurrences[0] == false){ //if there are no recurrent appointments:
1519 echo "<div>";
1520 echo "<span>" . xlt('None') . "</span>";
1521 echo "</div>";
1522 echo "<br>";
1524 else {
1525 foreach ($recurrences as $row) {
1526 //checks if there are recurrences and if they are current (git didn't end yet)
1527 if ($row == false || !recurrence_is_current($row['pc_endDate']))
1528 continue;
1529 echo "<div>";
1530 echo "<span>" . xlt('Appointment Category') . ': ' . xlt($row['pc_catname']) . "</span>";
1531 echo "<br>";
1532 echo "<span>" . xlt('Recurrence') . ': ' . text($row['pc_recurrspec']) . "</span>";
1533 echo "<br>";
1534 $red_text = ""; //if ends in a week, make font red
1535 if (ends_in_a_week($row['pc_endDate'])) {
1536 $red_text = " style=\"color:red;\" ";
1538 echo "<span" . $red_text . ">" . xlt('End Date') . ': ' . text($row['pc_endDate']) . "</span>";
1539 echo "</div>";
1540 echo "<br>";
1544 /* End of recurrence widget */
1547 // Show PAST appointments.
1548 // added by Terry Hill to allow reverse sorting of the appointments
1549 $direction = "ASC";
1550 if ($GLOBALS['num_past_appointments_to_show'] < 0) {
1551 $direction = "DESC";
1552 ($showpast = -1 * $GLOBALS['num_past_appointments_to_show'] );
1554 else
1556 $showpast = $GLOBALS['num_past_appointments_to_show'];
1559 if (isset($pid) && !$GLOBALS['disable_calendar'] && $showpast > 0) {
1560 $query = "SELECT e.pc_eid, e.pc_aid, e.pc_title, e.pc_eventDate, " .
1561 "e.pc_startTime, e.pc_hometext, u.fname, u.lname, u.mname, " .
1562 "c.pc_catname, e.pc_apptstatus " .
1563 "FROM openemr_postcalendar_events AS e, users AS u, " .
1564 "openemr_postcalendar_categories AS c WHERE " .
1565 "e.pc_pid = ? AND e.pc_eventDate < CURRENT_DATE AND " .
1566 "u.id = e.pc_aid AND e.pc_catid = c.pc_catid " .
1567 "ORDER BY e.pc_eventDate $direction , e.pc_startTime DESC " .
1568 "LIMIT " . $showpast;
1570 $pres = sqlStatement($query, array($pid) );
1572 // appointments expand collapse widget
1573 $widgetTitle = xl("Past Appointments");
1574 $widgetLabel = "past_appointments";
1575 $widgetButtonLabel = '';
1576 $widgetButtonLink = '';
1577 $widgetButtonClass = '';
1578 $linkMethod = "javascript";
1579 $bodyClass = "summary_item small";
1580 $widgetAuth = false; //no button
1581 $fixedWidth = false;
1582 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
1583 $count = 0;
1584 while($row = sqlFetchArray($pres)) {
1585 $count++;
1586 $dayname = date("l", strtotime($row['pc_eventDate']));
1587 $dispampm = "am";
1588 $disphour = substr($row['pc_startTime'], 0, 2) + 0;
1589 $dispmin = substr($row['pc_startTime'], 3, 2);
1590 if ($disphour >= 12) {
1591 $dispampm = "pm";
1592 if ($disphour > 12) $disphour -= 12;
1594 if ($row['pc_hometext'] != "") {
1595 $etitle = xl('Comments').": ".($row['pc_hometext'])."\r\n".$etitle;
1597 echo "<a href='javascript:oldEvt(" . htmlspecialchars(preg_replace("/-/", "", $row['pc_eventDate']),ENT_QUOTES) . ', ' . htmlspecialchars($row['pc_eid'],ENT_QUOTES) . ")' title='" . htmlspecialchars($etitle,ENT_QUOTES) . "'>";
1598 echo "<b>" . htmlspecialchars(xl($dayname) . ", " . $row['pc_eventDate'],ENT_NOQUOTES) . "</b>" . xlt("Status") . "(";
1599 echo " " . generate_display_field(array('data_type'=>'1','list_id'=>'apptstat'),$row['pc_apptstatus']) . ")<br>"; // can't use special char parser on this
1600 echo htmlspecialchars("$disphour:$dispmin ") . xl($dispampm) . " ";
1601 echo htmlspecialchars($row['fname'] . " " . $row['lname'],ENT_NOQUOTES) . "</a><br>\n";
1603 if (isset($pres) && $res != null) {
1604 if ( $count < 1 ) {
1605 echo "&nbsp;&nbsp;" . htmlspecialchars(xl('None'),ENT_NOQUOTES);
1607 echo "</div>";
1610 // END of past appointments
1613 </div>
1615 <div id='stats_div'>
1616 <br/>
1617 <div style='margin-left:10px' class='text'><img src='../../pic/ajax-loader.gif'/></div><br/>
1618 </div>
1619 </td>
1620 </tr>
1622 <?php // TRACK ANYTHING -----
1624 // Determine if track_anything form is in use for this site.
1625 $tmp = sqlQuery("SELECT count(*) AS count FROM registry WHERE " .
1626 "directory = 'track_anything' AND state = 1");
1627 $track_is_registered = $tmp['count'];
1628 if($track_is_registered){
1629 echo "<tr> <td>";
1630 // track_anything expand collapse widget
1631 $widgetTitle = xl("Tracks");
1632 $widgetLabel = "track_anything";
1633 $widgetButtonLabel = xl("Tracks");
1634 $widgetButtonLink = "../../forms/track_anything/create.php";
1635 $widgetButtonClass = "";
1636 $widgetAuth = ""; // don't show the button
1637 $linkMethod = "html";
1638 $bodyClass = "notab";
1639 // check to see if any tracks exist
1640 $spruch = "SELECT id " .
1641 "FROM forms " .
1642 "WHERE pid = ? " .
1643 "AND formdir = ? ";
1644 $existTracks = sqlQuery($spruch, array($pid, "track_anything") );
1646 $fixedWidth = false;
1647 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
1648 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
1649 $widgetAuth, $fixedWidth);
1651 <br/>
1652 <div style='margin-left:10px' class='text'><img src='../../pic/ajax-loader.gif'/></div><br/>
1653 </div>
1654 </td>
1655 </tr>
1656 <?php } // end track_anything ?>
1657 </table>
1659 </div> <!-- end right column div -->
1661 </td>
1663 </tr>
1664 </table>
1666 </div> <!-- end main content div -->
1668 <script language='JavaScript'>
1669 // Array of skip conditions for the checkSkipConditions() function.
1670 var skipArray = [
1671 <?php echo $condition_str; ?>
1673 checkSkipConditions();
1674 </script>
1676 </body>
1677 </html>