leaned down jquery versions
[openemr.git] / interface / patient_file / summary / demographics.php
blob1f2e643be06755a71e2698cee6e4161400f43376
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
24 require_once("../../globals.php");
25 require_once("$srcdir/patient.inc");
26 require_once("$srcdir/acl.inc");
27 require_once("$srcdir/options.inc.php");
28 require_once("../history/history.inc.php");
29 require_once("$srcdir/edi.inc");
30 require_once("$srcdir/invoice_summary.inc.php");
31 require_once("$srcdir/clinical_rules.php");
32 require_once("$srcdir/options.js.php");
33 require_once("$srcdir/group.inc");
34 ////////////
35 require_once(dirname(__FILE__)."/../../../library/appointments.inc.php");
37 if (isset($_GET['set_pid'])) {
38 include_once("$srcdir/pid.inc");
39 setpid($_GET['set_pid']);
42 $active_reminders = false;
43 $all_allergy_alerts = false;
44 if ($GLOBALS['enable_cdr']) {
45 //CDR Engine stuff
46 if ($GLOBALS['enable_allergy_check'] && $GLOBALS['enable_alert_log']) {
47 //Check for new allergies conflicts and throw popup if any exist(note need alert logging to support this)
48 $new_allergy_alerts = allergy_conflict($pid,'new',$_SESSION['authUser']);
49 if (!empty($new_allergy_alerts)) {
50 $pop_warning = '<script type="text/javascript">alert(\'' . xls('WARNING - FOLLOWING ACTIVE MEDICATIONS ARE ALLERGIES') . ':\n';
51 foreach ($new_allergy_alerts as $new_allergy_alert) {
52 $pop_warning .= addslashes($new_allergy_alert) . '\n';
54 $pop_warning .= '\')</script>';
55 echo $pop_warning;
58 if ((!isset($_SESSION['alert_notify_pid']) || ($_SESSION['alert_notify_pid'] != $pid)) && isset($_GET['set_pid']) && $GLOBALS['enable_cdr_crp']) {
59 // showing a new patient, so check for active reminders and allergy conflicts, which use in active reminder popup
60 $active_reminders = active_alert_summary($pid,"reminders-due",'','default',$_SESSION['authUser'],TRUE);
61 if ($GLOBALS['enable_allergy_check']) {
62 $all_allergy_alerts = allergy_conflict($pid,'all',$_SESSION['authUser'],TRUE);
67 function print_as_money($money) {
68 preg_match("/(\d*)\.?(\d*)/",$money,$moneymatches);
69 $tmp = wordwrap(strrev($moneymatches[1]),3,",",1);
70 $ccheck = strrev($tmp);
71 if ($ccheck[0] == ",") {
72 $tmp = substr($ccheck,1,strlen($ccheck)-1);
74 if ($moneymatches[2] != "") {
75 return "$ " . strrev($tmp) . "." . $moneymatches[2];
76 } else {
77 return "$ " . strrev($tmp);
81 // get an array from Photos category
82 function pic_array($pid,$picture_directory) {
83 $pics = array();
84 $sql_query = "select documents.id from documents join categories_to_documents " .
85 "on documents.id = categories_to_documents.document_id " .
86 "join categories on categories.id = categories_to_documents.category_id " .
87 "where categories.name like ? and documents.foreign_id = ?";
88 if ($query = sqlStatement($sql_query, array($picture_directory,$pid))) {
89 while( $results = sqlFetchArray($query) ) {
90 array_push($pics,$results['id']);
93 return ($pics);
95 // Get the document ID of the first document in a specific catg.
96 function get_document_by_catg($pid,$doc_catg) {
98 $result = array();
100 if ($pid and $doc_catg) {
101 $result = sqlQuery("SELECT d.id, d.date, d.url FROM " .
102 "documents AS d, categories_to_documents AS cd, categories AS c " .
103 "WHERE d.foreign_id = ? " .
104 "AND cd.document_id = d.id " .
105 "AND c.id = cd.category_id " .
106 "AND c.name LIKE ? " .
107 "ORDER BY d.date DESC LIMIT 1", array($pid, $doc_catg) );
110 return($result['id']);
113 // Display image in 'widget style'
114 function image_widget($doc_id,$doc_catg)
116 global $pid, $web_root;
117 $docobj = new Document($doc_id);
118 $image_file = $docobj->get_url_file();
119 $image_width = $GLOBALS['generate_doc_thumb'] == 1 ? '' : 'width=100';
120 $extension = substr($image_file, strrpos($image_file,"."));
121 $viewable_types = array('.png','.jpg','.jpeg','.png','.bmp','.PNG','.JPG','.JPEG','.PNG','.BMP'); // image ext supported by fancybox viewer
122 if ( in_array($extension,$viewable_types) ) { // extention matches list
123 $to_url = "<td> <a href = $web_root" .
124 "/controller.php?document&retrieve&patient_id=$pid&document_id=$doc_id&as_file=false&original_file=true&disable_exit=false&show_original=true" .
125 "/tmp$extension" . // Force image type URL for fancybo
126 " onclick=top.restoreSession(); class='image_modal'>" .
127 " <img src = $web_root" .
128 "/controller.php?document&retrieve&patient_id=$pid&document_id=$doc_id&as_file=false" .
129 " $image_width alt='$doc_catg:$image_file'> </a> </td> <td valign='center'>".
130 htmlspecialchars($doc_catg) . '<br />&nbsp;' . htmlspecialchars($image_file) .
131 "</td>";
133 else {
134 $to_url = "<td> <a href='" . $web_root . "/controller.php?document&retrieve" .
135 "&patient_id=$pid&document_id=$doc_id'" .
136 " onclick='top.restoreSession()' class='css_button_small'>" .
137 "<span>" .
138 htmlspecialchars( xl("View"), ENT_QUOTES )."</a> &nbsp;" .
139 htmlspecialchars( "$doc_catg - $image_file", ENT_QUOTES ) .
140 "</span> </td>";
142 echo "<table><tr>";
143 echo $to_url;
144 echo "</tr></table>";
147 // Determine if the Vitals form is in use for this site.
148 $tmp = sqlQuery("SELECT count(*) AS count FROM registry WHERE " .
149 "directory = 'vitals' AND state = 1");
150 $vitals_is_registered = $tmp['count'];
152 // Get patient/employer/insurance information.
154 $result = getPatientData($pid, "*, DATE_FORMAT(DOB,'%Y-%m-%d') as DOB_YMD");
155 $result2 = getEmployerData($pid);
156 $result3 = getInsuranceData($pid, "primary", "copay, provider, DATE_FORMAT(`date`,'%Y-%m-%d') as effdate");
157 $insco_name = "";
158 if ($result3['provider']) { // Use provider in case there is an ins record w/ unassigned insco
159 $insco_name = getInsuranceProvider($result3['provider']);
162 <html>
164 <head>
165 <?php html_header_show();?>
166 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
167 <link rel="stylesheet" type="text/css" href="../../../library/js/fancybox/jquery.fancybox-1.2.6.css" media="screen" />
168 <style type="text/css">@import url(../../../library/dynarch_calendar.css);</style>
169 <script type="text/javascript" src="../../../library/textformat.js"></script>
170 <script type="text/javascript" src="../../../library/dynarch_calendar.js"></script>
171 <?php include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?>
172 <script type="text/javascript" src="../../../library/dynarch_calendar_setup.js"></script>
173 <script type="text/javascript" src="../../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script>
174 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-7-2/index.js"></script>
175 <script type="text/javascript" src="../../../library/js/common.js"></script>
176 <script type="text/javascript" src="../../../library/js/fancybox/jquery.fancybox-1.2.6.js"></script>
177 <script type="text/javascript" language="JavaScript">
179 var mypcc = '<?php echo htmlspecialchars($GLOBALS['phone_country_code'],ENT_QUOTES); ?>';
180 //////////
181 function oldEvt(apptdate, eventid) {
182 dlgopen('../../main/calendar/add_edit_event.php?date=' + apptdate + '&eid=' + eventid, '_blank', 775, 500);
185 function advdirconfigure() {
186 dlgopen('advancedirectives.php', '_blank', 500, 450);
189 function refreshme() {
190 top.restoreSession();
191 location.reload();
194 // Process click on Delete link.
195 function deleteme() {
196 dlgopen('../deleter.php?patient=<?php echo htmlspecialchars($pid,ENT_QUOTES); ?>', '_blank', 500, 450);
197 return false;
200 // Called by the deleteme.php window on a successful delete.
201 function imdeleted() {
202 <?php if ($GLOBALS['new_tabs_layout']) { ?>
203 top.clearPatient();
204 <?php } else { ?>
205 parent.left_nav.clearPatient();
206 <?php } ?>
209 function newEvt() {
210 dlgopen('../../main/calendar/add_edit_event.php?patientid=<?php echo htmlspecialchars($pid,ENT_QUOTES); ?>', '_blank', 775, 500);
211 return false;
214 function sendimage(pid, what) {
215 // alert('Not yet implemented.'); return false;
216 dlgopen('../upload_dialog.php?patientid=' + pid + '&file=' + what,
217 '_blank', 500, 400);
218 return false;
221 </script>
223 <script type="text/javascript">
225 function toggleIndicator(target,div) {
227 $mode = $(target).find(".indicator").text();
228 if ( $mode == "<?php echo htmlspecialchars(xl('collapse'),ENT_QUOTES); ?>" ) {
229 $(target).find(".indicator").text( "<?php echo htmlspecialchars(xl('expand'),ENT_QUOTES); ?>" );
230 $("#"+div).hide();
231 $.post( "../../../library/ajax/user_settings.php", { target: div, mode: 0 });
232 } else {
233 $(target).find(".indicator").text( "<?php echo htmlspecialchars(xl('collapse'),ENT_QUOTES); ?>" );
234 $("#"+div).show();
235 $.post( "../../../library/ajax/user_settings.php", { target: div, mode: 1 });
239 $(document).ready(function(){
240 var msg_updation='';
241 <?php
242 if($GLOBALS['erx_enable']){
243 //$soap_status=sqlQuery("select soap_import_status from patient_data where pid=?",array($pid));
244 $soap_status=sqlStatement("select soap_import_status,pid from patient_data where pid=? and soap_import_status in ('1','3')",array($pid));
245 while($row_soapstatus=sqlFetchArray($soap_status)){
246 //if($soap_status['soap_import_status']=='1' || $soap_status['soap_import_status']=='3'){ ?>
247 top.restoreSession();
248 $.ajax({
249 type: "POST",
250 url: "../../soap_functions/soap_patientfullmedication.php",
251 dataType: "html",
252 data: {
253 patient:<?php echo $row_soapstatus['pid']; ?>,
255 async: false,
256 success: function(thedata){
257 //alert(thedata);
258 msg_updation+=thedata;
260 error:function(){
261 alert('ajax error');
264 <?php
266 //elseif($soap_status['soap_import_status']=='3'){ ?>
267 top.restoreSession();
268 $.ajax({
269 type: "POST",
270 url: "../../soap_functions/soap_allergy.php",
271 dataType: "html",
272 data: {
273 patient:<?php echo $row_soapstatus['pid']; ?>,
275 async: false,
276 success: function(thedata){
277 //alert(thedata);
278 msg_updation+=thedata;
280 error:function(){
281 alert('ajax error');
284 <?php
285 if($GLOBALS['erx_import_status_message']){ ?>
286 if(msg_updation)
287 alert(msg_updation);
288 <?php
294 // load divs
295 $("#stats_div").load("stats.php", { 'embeddedScreen' : true }, function() {
296 // (note need to place javascript code here also to get the dynamic link to work)
297 $(".rx_modal").fancybox( {
298 'overlayOpacity' : 0.0,
299 'showCloseButton' : true,
300 'frameHeight' : 500,
301 'frameWidth' : 800,
302 'centerOnScroll' : false,
303 'callbackOnClose' : function() {
304 refreshme();
308 $("#pnotes_ps_expand").load("pnotes_fragment.php");
309 $("#disclosures_ps_expand").load("disc_fragment.php");
311 <?php if ($GLOBALS['enable_cdr'] && $GLOBALS['enable_cdr_crw']) { ?>
312 top.restoreSession();
313 $("#clinical_reminders_ps_expand").load("clinical_reminders_fragment.php", { 'embeddedScreen' : true }, function() {
314 // (note need to place javascript code here also to get the dynamic link to work)
315 $(".medium_modal").fancybox( {
316 'overlayOpacity' : 0.0,
317 'showCloseButton' : true,
318 'frameHeight' : 500,
319 'frameWidth' : 800,
320 'centerOnScroll' : false,
321 'callbackOnClose' : function() {
322 refreshme();
326 <?php } // end crw?>
328 <?php if ($GLOBALS['enable_cdr'] && $GLOBALS['enable_cdr_prw']) { ?>
329 top.restoreSession();
330 $("#patient_reminders_ps_expand").load("patient_reminders_fragment.php");
331 <?php } // end prw?>
333 <?php if ($vitals_is_registered && acl_check('patients', 'med')) { ?>
334 // Initialize the Vitals form if it is registered and user is authorized.
335 $("#vitals_ps_expand").load("vitals_fragment.php");
336 <?php } ?>
338 // Initialize track_anything
339 $("#track_anything_ps_expand").load("track_anything_fragment.php");
342 // Initialize labdata
343 $("#labdata_ps_expand").load("labdata_fragment.php");
344 <?php
345 // Initialize for each applicable LBF form.
346 $gfres = sqlStatement("SELECT option_id FROM list_options WHERE " .
347 "list_id = 'lbfnames' AND option_value > 0 AND activity = 1 ORDER BY seq, title");
348 while($gfrow = sqlFetchArray($gfres)) {
350 $("#<?php echo $gfrow['option_id']; ?>_ps_expand").load("lbf_fragment.php?formname=<?php echo $gfrow['option_id']; ?>");
351 <?php
355 // fancy box
356 enable_modals();
358 tabbify();
360 // modal for dialog boxes
361 $(".large_modal").fancybox( {
362 'overlayOpacity' : 0.0,
363 'showCloseButton' : true,
364 'frameHeight' : 600,
365 'frameWidth' : 1000,
366 'centerOnScroll' : false
369 // modal for image viewer
370 $(".image_modal").fancybox( {
371 'overlayOpacity' : 0.0,
372 'showCloseButton' : true,
373 'centerOnScroll' : false,
374 'autoscale' : true
377 $(".iframe1").fancybox( {
378 'left':10,
379 'overlayOpacity' : 0.0,
380 'showCloseButton' : true,
381 'frameHeight' : 300,
382 'frameWidth' : 350
384 // special size for patient portal
385 $(".small_modal").fancybox( {
386 'overlayOpacity' : 0.0,
387 'showCloseButton' : true,
388 'frameHeight' : 200,
389 'frameWidth' : 380,
390 'centerOnScroll' : false
393 <?php if ($active_reminders || $all_allergy_alerts) { ?>
394 // show the active reminder modal
395 $("#reminder_popup_link").fancybox({
396 'overlayOpacity' : 0.0,
397 'showCloseButton' : true,
398 'frameHeight' : 500,
399 'frameWidth' : 500,
400 'centerOnScroll' : false
401 }).trigger('click');
402 <?php } ?>
406 // JavaScript stuff to do when a new patient is set.
408 function setMyPatient() {
409 // Avoid race conditions with loading of the left_nav or Title frame.
410 if (!parent.allFramesLoaded()) {
411 setTimeout("setMyPatient()", 500);
412 return;
414 <?php if (isset($_GET['set_pid'])) { ?>
415 parent.left_nav.setPatient(<?php echo "'" . addslashes($result['fname']) . " " . addslashes($result['lname']) .
416 "'," . addslashes($pid) . ",'" . addslashes($result['pubpid']) .
417 "','', ' " . xls('DOB') . ": " . addslashes(oeFormatShortDate($result['DOB_YMD'])) . " " . xls('Age') . ": " . addslashes(getPatientAgeDisplay($result['DOB_YMD'])) . "'"; ?>);
418 var EncounterDateArray = new Array;
419 var CalendarCategoryArray = new Array;
420 var EncounterIdArray = new Array;
421 var Count = 0;
422 <?php
423 //Encounter details are stored to javacript as array.
424 $result4 = sqlStatement("SELECT fe.encounter,fe.date,openemr_postcalendar_categories.pc_catname FROM form_encounter AS fe ".
425 " left join openemr_postcalendar_categories on fe.pc_catid=openemr_postcalendar_categories.pc_catid WHERE fe.pid = ? order by fe.date desc", array($pid));
426 if(sqlNumRows($result4)>0) {
427 while($rowresult4 = sqlFetchArray($result4)) {
429 EncounterIdArray[Count] = '<?php echo addslashes($rowresult4['encounter']); ?>';
430 EncounterDateArray[Count] = '<?php echo addslashes(oeFormatShortDate(date("Y-m-d", strtotime($rowresult4['date'])))); ?>';
431 CalendarCategoryArray[Count] = '<?php echo addslashes(xl_appt_category($rowresult4['pc_catname'])); ?>';
432 Count++;
433 <?php
437 parent.left_nav.setPatientEncounter(EncounterIdArray,EncounterDateArray,CalendarCategoryArray);
438 <?php } // end setting new pid ?>
439 parent.left_nav.syncRadios();
440 <?php if ( (isset($_GET['set_pid']) ) && (isset($_GET['set_encounterid'])) && ( intval($_GET['set_encounterid']) > 0 ) ) {
441 $encounter = intval($_GET['set_encounterid']);
442 $_SESSION['encounter'] = $encounter;
443 $query_result = sqlQuery("SELECT `date` FROM `form_encounter` WHERE `encounter` = ?", array($encounter)); ?>
444 encurl = 'encounter/encounter_top.php?set_encounter=' + <?php echo attr($encounter);?> + '&pid=' + <?php echo attr($pid);?>;
445 <?php if ($GLOBALS['new_tabs_layout']) { ?>
446 parent.left_nav.setEncounter('<?php echo oeFormatShortDate(date("Y-m-d", strtotime($query_result['date']))); ?>', '<?php echo attr($encounter); ?>', 'enc');
447 top.restoreSession();
448 parent.left_nav.loadFrame('enc2', 'enc', 'patient_file/' + encurl);
449 <?php } else { ?>
450 var othername = (window.name == 'RTop') ? 'RBot' : 'RTop';
451 parent.left_nav.setEncounter('<?php echo oeFormatShortDate(date("Y-m-d", strtotime($query_result['date']))); ?>', '<?php echo attr($encounter); ?>', othername);
452 top.restoreSession();
453 parent.frames[othername].location.href = '../' + encurl;
454 <?php } ?>
455 <?php } // end setting new encounter id (only if new pid is also set) ?>
458 $(window).load(function() {
459 setMyPatient();
462 </script>
464 <style type="css/text">
465 #pnotes_ps_expand {
466 height:auto;
467 width:100%;
469 </style>
471 </head>
473 <body class="body_top patient-demographics">
475 <a href='../reminder/active_reminder_popup.php' id='reminder_popup_link' style='visibility: false;' class='iframe' onclick='top.restoreSession()'></a>
477 <?php
478 $thisauth = acl_check('patients', 'demo');
479 if ($thisauth) {
480 if ($result['squad'] && ! acl_check('squads', $result['squad'])) {
481 $thisauth = 0;
484 if (!$thisauth) {
485 echo "<p>(" . htmlspecialchars(xl('Demographics not authorized'),ENT_NOQUOTES) . ")</p>\n";
486 echo "</body>\n</html>\n";
487 exit();
489 if ($thisauth): ?>
491 <table class="table_header">
492 <tr>
493 <td>
494 <span class='title'>
495 <?php echo htmlspecialchars(getPatientName($pid),ENT_NOQUOTES); ?>
496 </span>
497 </td>
498 <?php if (acl_check('admin', 'super') && $GLOBALS['allow_pat_delete']) : ?>
499 <td style='padding-left:1em;' class="delete">
500 <a class='css_button iframe'
501 href='../deleter.php?patient=<?php echo htmlspecialchars($pid,ENT_QUOTES);?>'
502 onclick='top.restoreSession()'>
503 <span><?php echo htmlspecialchars(xl('Delete'),ENT_NOQUOTES);?></span>
504 </a>
505 </td>
506 <?php endif; // Allow PT delete
507 if($GLOBALS['erx_enable']): ?>
508 <td style="padding-left:1em;" class="erx">
509 <a class="css_button" href="../../eRx.php?page=medentry" onclick="top.restoreSession()">
510 <span><?php echo htmlspecialchars(xl('NewCrop MedEntry'),ENT_NOQUOTES);?></span>
511 </a>
512 </td>
513 <td style="padding-left:1em;">
514 <a class="css_button iframe1"
515 href="../../soap_functions/soap_accountStatusDetails.php"
516 onclick="top.restoreSession()">
517 <span><?php echo htmlspecialchars(xl('NewCrop Account Status'),ENT_NOQUOTES);?></span>
518 </a>
519 </td>
520 <td id='accountstatus'></td>
521 <?php endif; // eRX Enabled
522 //Patient Portal
523 $portalUserSetting = true; //flag to see if patient has authorized access to portal
524 if( ($GLOBALS['portal_onsite_enable'] && $GLOBALS['portal_onsite_address']) ||
525 ($GLOBALS['portal_onsite_two_enable'] && $GLOBALS['portal_onsite_two_address']) ):
526 $portalStatus = sqlQuery("SELECT allow_patient_portal FROM patient_data WHERE pid=?",array($pid));
527 if ($portalStatus['allow_patient_portal']=='YES'):
528 $portalLogin = sqlQuery("SELECT pid FROM `patient_access_onsite` WHERE `pid`=?", array($pid));?>
529 <td style='padding-left:1em;'>
530 <a class='css_button iframe small_modal'
531 href='create_portallogin.php?portalsite=on&patient=<?php echo htmlspecialchars($pid,ENT_QUOTES);?>'
532 onclick='top.restoreSession()'>
533 <?php $display = (empty($portalLogin)) ? xlt('Create Onsite Portal Credentials') : xlt('Reset Onsite Portal Credentials'); ?>
534 <span><?php echo $display; ?></span>
535 </a>
536 </td>
537 <?php
538 else:
539 $portalUserSetting = false;
540 endif; // allow patient portal
541 endif; // Onsite Patient Portal
542 if($GLOBALS['portal_offsite_enable'] && $GLOBALS['portal_offsite_address']):
543 $portalStatus = sqlQuery("SELECT allow_patient_portal FROM patient_data WHERE pid=?",array($pid));
544 if ($portalStatus['allow_patient_portal']=='YES'):
545 $portalLogin = sqlQuery("SELECT pid FROM `patient_access_offsite` WHERE `pid`=?", array($pid));
547 <td style='padding-left:1em;'>
548 <a class='css_button iframe small_modal'
549 href='create_portallogin.php?portalsite=off&patient=<?php echo htmlspecialchars($pid,ENT_QUOTES);?>'
550 onclick='top.restoreSession()'>
551 <span>
552 <?php $text = (empty($portalLogin)) ? xlt('Create Offsite Portal Credentials') : xlt('Reset Offsite Portal Credentials'); ?>
553 <?php echo $text; ?>
554 </span>
555 </a>
556 </td>
557 <?php
558 else:
559 $portalUserSetting = false;
560 endif; // allow_patient_portal
561 endif; // portal_offsite_enable
562 if (!($portalUserSetting)): // Show that the patient has not authorized portal access ?>
563 <td style='padding-left:1em;'>
564 <?php echo htmlspecialchars( xl('Patient has not authorized the Patient Portal.'), ENT_NOQUOTES);?>
565 </td>
566 <?php endif;
567 //Patient Portal
569 // If patient is deceased, then show this (along with the number of days patient has been deceased for)
570 $days_deceased = is_patient_deceased($pid);
571 if ($days_deceased != null): ?>
572 <td class="deceased" style="padding-left:1em;font-weight:bold;color:red">
573 <?php
574 if ($days_deceased == 0) {
575 echo xlt("DECEASED (Today)");
577 else if ($days_deceased == 1) {
578 echo xlt("DECEASED (1 day ago)");
580 else {
581 echo xlt("DECEASED") . " (" . text($days_deceased) . " " . xlt("days ago") . ")";
582 } ?>
583 </td>
584 <?php endif; ?>
585 </tr>
586 </table>
588 <?php
589 endif; // $thisauth
592 <?php
593 // Get the document ID of the patient ID card if access to it is wanted here.
594 $idcard_doc_id = false;
595 if ($GLOBALS['patient_id_category_name']) {
596 $idcard_doc_id = get_document_by_catg($pid, $GLOBALS['patient_id_category_name']);
600 <table cellspacing='0' cellpadding='0' border='0' class="subnav">
601 <tr>
602 <td class="small" colspan='4'>
603 <a href="../history/history.php" onclick='top.restoreSession()'>
604 <?php echo htmlspecialchars(xl('History'),ENT_NOQUOTES); ?></a>
606 <?php //note that we have temporarily removed report screen from the modal view ?>
607 <a href="../report/patient_report.php" onclick='top.restoreSession()'>
608 <?php echo htmlspecialchars(xl('Report'),ENT_NOQUOTES); ?></a>
610 <?php //note that we have temporarily removed document screen from the modal view ?>
611 <a href="../../../controller.php?document&list&patient_id=<?php echo $pid;?>" onclick='top.restoreSession()'>
612 <?php echo htmlspecialchars(xl('Documents'),ENT_NOQUOTES); ?></a>
614 <a href="../transaction/transactions.php" onclick='top.restoreSession()'>
615 <?php echo htmlspecialchars(xl('Transactions'),ENT_NOQUOTES); ?></a>
617 <a href="stats_full.php?active=all" onclick='top.restoreSession()'>
618 <?php echo htmlspecialchars(xl('Issues'),ENT_NOQUOTES); ?></a>
620 <a href="../../reports/pat_ledger.php?form=1&patient_id=<?php echo attr($pid);?>" onclick='top.restoreSession()'>
621 <?php echo xlt('Ledger'); ?></a>
623 <a href="../../reports/external_data.php" onclick='top.restoreSession()'>
624 <?php echo xlt('External Data'); ?></a>
626 <!-- DISPLAYING HOOKS STARTS HERE -->
627 <?php
628 $module_query = sqlStatement("SELECT msh.*,ms.obj_name,ms.menu_name,ms.path,m.mod_ui_name,m.type FROM modules_hooks_settings AS msh
629 LEFT OUTER JOIN modules_settings AS ms ON obj_name=enabled_hooks AND ms.mod_id=msh.mod_id
630 LEFT OUTER JOIN modules AS m ON m.mod_id=ms.mod_id
631 WHERE fld_type=3 AND mod_active=1 AND sql_run=1 AND attached_to='demographics' ORDER BY mod_id");
632 $DivId = 'mod_installer';
633 if (sqlNumRows($module_query)) {
634 $jid = 0;
635 $modid = '';
636 while ($modulerow = sqlFetchArray($module_query)) {
637 $DivId = 'mod_'.$modulerow['mod_id'];
638 $new_category = $modulerow['mod_ui_name'];
639 $modulePath = "";
640 $added = "";
641 if($modulerow['type'] == 0) {
642 $modulePath = $GLOBALS['customModDir'];
643 $added = "";
645 else{
646 $added = "index";
647 $modulePath = $GLOBALS['zendModDir'];
649 if(!acl_check('admin', 'super') && !zh_acl_check($_SESSION['authUserID'],$modulerow['obj_name']))continue;
651 $relative_link = "../../modules/".$modulePath."/".$modulerow['path'];
652 $nickname = $modulerow['menu_name'] ? $modulerow['menu_name'] : 'Noname';
653 $jid++;
654 $modid = $modulerow['mod_id'];
657 <a href="<?php echo $relative_link; ?>" onclick='top.restoreSession()'>
658 <?php echo xlt($nickname); ?></a>
659 <?php
663 <!-- DISPLAYING HOOKS ENDS HERE -->
665 </td>
666 </tr>
667 </table> <!-- end header -->
669 <div style='margin-top:10px' class="main"> <!-- start main content div -->
670 <table border="0" cellspacing="0" cellpadding="0" width="100%">
671 <tr>
672 <td class="demographics-box" align="left" valign="top">
673 <!-- start left column div -->
674 <div style='float:left; margin-right:20px'>
676 <table cellspacing=0 cellpadding=0>
677 <?php if (!$GLOBALS['hide_billing_widget']) { ?>
678 <tr>
679 <td>
680 <?php
681 // Billing expand collapse widget
682 $widgetTitle = xl("Billing");
683 $widgetLabel = "billing";
684 $widgetButtonLabel = xl("Edit");
685 $widgetButtonLink = "return newEvt();";
686 $widgetButtonClass = "";
687 $linkMethod = "javascript";
688 $bodyClass = "notab";
689 $widgetAuth = false;
690 $fixedWidth = true;
691 if ($GLOBALS['force_billing_widget_open']) {
692 $forceExpandAlways = true;
694 else {
695 $forceExpandAlways = false;
697 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
698 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
699 $widgetAuth, $fixedWidth, $forceExpandAlways);
701 <br>
702 <?php
703 //PATIENT BALANCE,INS BALANCE naina@capminds.com
704 $patientbalance = get_patient_balance($pid, false);
705 //Debit the patient balance from insurance balance
706 $insurancebalance = get_patient_balance($pid, true) - $patientbalance;
707 $totalbalance=$patientbalance + $insurancebalance;
709 // Show current balance and billing note, if any.
710 echo "<table border='0'><tr><td>" .
711 "<table ><tr><td><span class='bold'><font color='red'>" .
712 xlt('Patient Balance Due') .
713 " : " . text(oeFormatMoney($patientbalance)) .
714 "</font></span></td></tr>".
715 "<tr><td><span class='bold'><font color='red'>" .
716 xlt('Insurance Balance Due') .
717 " : " . text(oeFormatMoney($insurancebalance)) .
718 "</font></span></td></tr>".
719 "<tr><td><span class='bold'><font color='red'>" .
720 xlt('Total Balance Due').
721 " : " . text(oeFormatMoney($totalbalance)) .
722 "</font></span></td></td></tr>";
723 if (!empty($result['billing_note'])) {
724 echo "<tr><td><span class='bold'><font color='red'>" .
725 xlt('Billing Note') . ":" .
726 text($result['billing_note']) .
727 "</font></span></td></tr>";
729 if ($result3['provider']) { // Use provider in case there is an ins record w/ unassigned insco
730 echo "<tr><td><span class='bold'>" .
731 xlt('Primary Insurance') . ': ' . text($insco_name) .
732 "</span>&nbsp;&nbsp;&nbsp;";
733 if ($result3['copay'] > 0) {
734 echo "<span class='bold'>" .
735 xlt('Copay') . ': ' . text($result3['copay']) .
736 "</span>&nbsp;&nbsp;&nbsp;";
738 echo "<span class='bold'>" .
739 xlt('Effective Date') . ': ' . text(oeFormatShortDate($result3['effdate'])) .
740 "</span></td></tr>";
742 echo "</table></td></tr></td></tr></table><br>";
745 </div> <!-- required for expand_collapse_widget -->
746 </td>
747 </tr>
748 <?php } ?>
750 <?php if (acl_check('patients', 'demo')) { ?>
751 <tr>
752 <td>
753 <?php
754 // Demographics expand collapse widget
755 $widgetTitle = xl("Demographics");
756 $widgetLabel = "demographics";
757 $widgetButtonLabel = xl("Edit");
758 $widgetButtonLink = "demographics_full.php";
759 $widgetButtonClass = "";
760 $linkMethod = "html";
761 $bodyClass = "";
762 $widgetAuth = acl_check('patients', 'demo', '', 'write');
763 $fixedWidth = true;
764 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
765 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
766 $widgetAuth, $fixedWidth);
768 <div id="DEM" >
769 <ul class="tabNav">
770 <?php display_layout_tabs('DEM', $result, $result2); ?>
771 </ul>
772 <div class="tabContainer">
773 <?php display_layout_tabs_data('DEM', $result, $result2); ?>
774 </div>
775 </div>
776 </div> <!-- required for expand_collapse_widget -->
777 </td>
778 </tr>
780 <tr>
781 <td>
782 <?php
783 $insurance_count = 0;
784 foreach (array('primary','secondary','tertiary') as $instype) {
785 $enddate = 'Present';
786 $query = "SELECT * FROM insurance_data WHERE " .
787 "pid = ? AND type = ? " .
788 "ORDER BY date DESC";
789 $res = sqlStatement($query, array($pid, $instype) );
790 while( $row = sqlFetchArray($res) ) {
791 if ($row['provider'] ) $insurance_count++;
795 if ( $insurance_count > 0 ) {
796 // Insurance expand collapse widget
797 $widgetTitle = xl("Insurance");
798 $widgetLabel = "insurance";
799 $widgetButtonLabel = xl("Edit");
800 $widgetButtonLink = "demographics_full.php";
801 $widgetButtonClass = "";
802 $linkMethod = "html";
803 $bodyClass = "";
804 $widgetAuth = acl_check('patients', 'demo', '', 'write');
805 $fixedWidth = true;
806 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
807 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
808 $widgetAuth, $fixedWidth);
810 if ( $insurance_count > 0 ) {
813 <ul class="tabNav"><?php
814 ///////////////////////////////// INSURANCE SECTION
815 $first = true;
816 foreach (array('primary','secondary','tertiary') as $instype) {
818 $query = "SELECT * FROM insurance_data WHERE " .
819 "pid = ? AND type = ? " .
820 "ORDER BY date DESC";
821 $res = sqlStatement($query, array($pid, $instype) );
823 $enddate = 'Present';
825 while( $row = sqlFetchArray($res) ) {
826 if ($row['provider'] ) {
828 $ins_description = ucfirst($instype);
829 $ins_description = xl($ins_description);
830 $ins_description .= strcmp($enddate, 'Present') != 0 ? " (".xl('Old').")" : "";
832 <li <?php echo $first ? 'class="current"' : '' ?>><a href="#">
833 <?php echo htmlspecialchars($ins_description,ENT_NOQUOTES); ?></a></li>
834 <?php
835 $first = false;
837 $enddate = $row['date'];
840 // Display the eligibility tab
841 echo "<li><a href='#'>" .
842 htmlspecialchars( xl('Eligibility'), ENT_NOQUOTES) . "</a></li>";
844 ?></ul><?php
846 } ?>
848 <div class="tabContainer">
849 <?php
850 $first = true;
851 foreach (array('primary','secondary','tertiary') as $instype) {
852 $enddate = 'Present';
854 $query = "SELECT * FROM insurance_data WHERE " .
855 "pid = ? AND type = ? " .
856 "ORDER BY date DESC";
857 $res = sqlStatement($query, array($pid, $instype) );
858 while( $row = sqlFetchArray($res) ) {
859 if ($row['provider'] ) {
861 <div class="tab <?php echo $first ? 'current' : '' ?>">
862 <table border='0' cellpadding='0' width='100%'>
863 <?php
864 $icobj = new InsuranceCompany($row['provider']);
865 $adobj = $icobj->get_address();
866 $insco_name = trim($icobj->get_name());
868 <tr>
869 <td valign='top' colspan='3'>
870 <span class='text'>
871 <?php if (strcmp($enddate, 'Present') != 0) echo htmlspecialchars(xl("Old"),ENT_NOQUOTES)." "; ?>
872 <?php $tempinstype=ucfirst($instype); echo htmlspecialchars(xl($tempinstype.' Insurance'),ENT_NOQUOTES); ?>
873 <?php if (strcmp($row['date'], '0000-00-00') != 0) { ?>
874 <?php echo htmlspecialchars(xl('from','',' ',' ').$row['date'],ENT_NOQUOTES); ?>
875 <?php } ?>
876 <?php echo htmlspecialchars(xl('until','',' ',' '),ENT_NOQUOTES);
877 echo (strcmp($enddate, 'Present') != 0) ? $enddate : htmlspecialchars(xl('Present'),ENT_NOQUOTES); ?>:</span>
878 </td>
879 </tr>
880 <tr>
881 <td valign='top'>
882 <span class='text'>
883 <?php
884 if ($insco_name) {
885 echo htmlspecialchars($insco_name,ENT_NOQUOTES) . '<br>';
886 if (trim($adobj->get_line1())) {
887 echo htmlspecialchars($adobj->get_line1(),ENT_NOQUOTES) . '<br>';
888 echo htmlspecialchars($adobj->get_city() . ', ' . $adobj->get_state() . ' ' . $adobj->get_zip(),ENT_NOQUOTES);
890 } else {
891 echo "<font color='red'><b>".htmlspecialchars(xl('Unassigned'),ENT_NOQUOTES)."</b></font>";
894 <br>
895 <?php echo htmlspecialchars(xl('Policy Number'),ENT_NOQUOTES); ?>:
896 <?php echo htmlspecialchars($row['policy_number'],ENT_NOQUOTES) ?><br>
897 <?php echo htmlspecialchars(xl('Plan Name'),ENT_NOQUOTES); ?>:
898 <?php echo htmlspecialchars($row['plan_name'],ENT_NOQUOTES); ?><br>
899 <?php echo htmlspecialchars(xl('Group Number'),ENT_NOQUOTES); ?>:
900 <?php echo htmlspecialchars($row['group_number'],ENT_NOQUOTES); ?></span>
901 </td>
902 <td valign='top'>
903 <span class='bold'><?php echo htmlspecialchars(xl('Subscriber'),ENT_NOQUOTES); ?>: </span><br>
904 <span class='text'><?php echo htmlspecialchars($row['subscriber_fname'] . ' ' . $row['subscriber_mname'] . ' ' . $row['subscriber_lname'],ENT_NOQUOTES); ?>
905 <?php
906 if ($row['subscriber_relationship'] != "") {
907 echo "(" . htmlspecialchars($row['subscriber_relationship'],ENT_NOQUOTES) . ")";
910 <br>
911 <?php echo htmlspecialchars(xl('S.S.'),ENT_NOQUOTES); ?>:
912 <?php echo htmlspecialchars($row['subscriber_ss'],ENT_NOQUOTES); ?><br>
913 <?php echo htmlspecialchars(xl('D.O.B.'),ENT_NOQUOTES); ?>:
914 <?php if ($row['subscriber_DOB'] != "0000-00-00 00:00:00") echo htmlspecialchars($row['subscriber_DOB'],ENT_NOQUOTES); ?><br>
915 <?php echo htmlspecialchars(xl('Phone'),ENT_NOQUOTES); ?>:
916 <?php echo htmlspecialchars($row['subscriber_phone'],ENT_NOQUOTES); ?>
917 </span>
918 </td>
919 <td valign='top'>
920 <span class='bold'><?php echo htmlspecialchars(xl('Subscriber Address'),ENT_NOQUOTES); ?>: </span><br>
921 <span class='text'><?php echo htmlspecialchars($row['subscriber_street'],ENT_NOQUOTES); ?><br>
922 <?php echo htmlspecialchars($row['subscriber_city'],ENT_NOQUOTES); ?>
923 <?php if($row['subscriber_state'] != "") echo ", "; echo htmlspecialchars($row['subscriber_state'],ENT_NOQUOTES); ?>
924 <?php if($row['subscriber_country'] != "") echo ", "; echo htmlspecialchars($row['subscriber_country'],ENT_NOQUOTES); ?>
925 <?php echo " " . htmlspecialchars($row['subscriber_postal_code'],ENT_NOQUOTES); ?></span>
927 <?php if (trim($row['subscriber_employer'])) { ?>
928 <br><span class='bold'><?php echo htmlspecialchars(xl('Subscriber Employer'),ENT_NOQUOTES); ?>: </span><br>
929 <span class='text'><?php echo htmlspecialchars($row['subscriber_employer'],ENT_NOQUOTES); ?><br>
930 <?php echo htmlspecialchars($row['subscriber_employer_street'],ENT_NOQUOTES); ?><br>
931 <?php echo htmlspecialchars($row['subscriber_employer_city'],ENT_NOQUOTES); ?>
932 <?php if($row['subscriber_employer_city'] != "") echo ", "; echo htmlspecialchars($row['subscriber_employer_state'],ENT_NOQUOTES); ?>
933 <?php if($row['subscriber_employer_country'] != "") echo ", "; echo htmlspecialchars($row['subscriber_employer_country'],ENT_NOQUOTES); ?>
934 <?php echo " " . htmlspecialchars($row['subscriber_employer_postal_code'],ENT_NOQUOTES); ?>
935 </span>
936 <?php } ?>
938 </td>
939 </tr>
940 <tr>
941 <td>
942 <?php if ($row['copay'] != "") { ?>
943 <span class='bold'><?php echo htmlspecialchars(xl('CoPay'),ENT_NOQUOTES); ?>: </span>
944 <span class='text'><?php echo htmlspecialchars($row['copay'],ENT_NOQUOTES); ?></span>
945 <br />
946 <?php } ?>
947 <span class='bold'><?php echo htmlspecialchars(xl('Accept Assignment'),ENT_NOQUOTES); ?>:</span>
948 <span class='text'><?php if($row['accept_assignment'] == "TRUE") echo xl("YES"); ?>
949 <?php if($row['accept_assignment'] == "FALSE") echo xl("NO"); ?></span>
950 <?php if (!empty($row['policy_type'])) { ?>
951 <br />
952 <span class='bold'><?php echo htmlspecialchars(xl('Secondary Medicare Type'),ENT_NOQUOTES); ?>: </span>
953 <span class='text'><?php echo htmlspecialchars($policy_types[$row['policy_type']],ENT_NOQUOTES); ?></span>
954 <?php } ?>
955 </td>
956 <td valign='top'></td>
957 <td valign='top'></td>
958 </tr>
960 </table>
961 </div>
962 <?php
964 } // end if ($row['provider'])
965 $enddate = $row['date'];
966 $first = false;
967 } // end while
968 } // end foreach
970 // Display the eligibility information
971 echo "<div class='tab'>";
972 show_eligibility_information($pid,true);
973 echo "</div>";
975 ///////////////////////////////// END INSURANCE SECTION
977 </div>
979 <?php } // ?>
981 </td>
982 </tr>
983 <?php } // end if demographics authorized ?>
985 <?php if (acl_check('patients', 'notes')) { ?>
986 <tr>
987 <td width='650px'>
988 <?php
989 // Notes expand collapse widget
990 $widgetTitle = xl("Notes");
991 $widgetLabel = "pnotes";
992 $widgetButtonLabel = xl("Edit");
993 $widgetButtonLink = "pnotes_full.php?form_active=1";
994 $widgetButtonClass = "";
995 $linkMethod = "html";
996 $bodyClass = "notab";
997 $widgetAuth = acl_check('patients', 'notes', '', 'write');
998 $fixedWidth = true;
999 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
1000 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
1001 $widgetAuth, $fixedWidth);
1003 <br/>
1004 <div style='margin-left:10px' class='text'><img src='../../pic/ajax-loader.gif'/></div><br/>
1005 </div>
1006 </td>
1007 </tr>
1008 <?php } // end if notes authorized ?>
1010 <?php if (acl_check('patients', 'reminder') && $GLOBALS['enable_cdr'] && $GLOBALS['enable_cdr_prw']) {
1011 echo "<tr><td width='650px'>";
1012 // patient reminders collapse widget
1013 $widgetTitle = xl("Patient Reminders");
1014 $widgetLabel = "patient_reminders";
1015 $widgetButtonLabel = xl("Edit");
1016 $widgetButtonLink = "../reminder/patient_reminders.php?mode=simple&patient_id=".$pid;
1017 $widgetButtonClass = "";
1018 $linkMethod = "html";
1019 $bodyClass = "notab";
1020 $widgetAuth = acl_check('patients', 'reminder', '', 'write');
1021 $fixedWidth = true;
1022 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth); ?>
1023 <br/>
1024 <div style='margin-left:10px' class='text'><image src='../../pic/ajax-loader.gif'/></div><br/>
1025 </div>
1026 </td>
1027 </tr>
1028 <?php } //end if prw is activated ?>
1030 <?php if (acl_check('patients', 'disclosure')) { ?>
1031 <tr>
1032 <td width='650px'>
1033 <?php
1034 // disclosures expand collapse widget
1035 $widgetTitle = xl("Disclosures");
1036 $widgetLabel = "disclosures";
1037 $widgetButtonLabel = xl("Edit");
1038 $widgetButtonLink = "disclosure_full.php";
1039 $widgetButtonClass = "";
1040 $linkMethod = "html";
1041 $bodyClass = "notab";
1042 $widgetAuth = acl_check('patients', 'disclosure', '', 'write');
1043 $fixedWidth = true;
1044 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
1045 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
1046 $widgetAuth, $fixedWidth);
1048 <br/>
1049 <div style='margin-left:10px' class='text'><img src='../../pic/ajax-loader.gif'/></div><br/>
1050 </div>
1051 </td>
1052 </tr>
1053 <?php } // end if disclosures authorized ?>
1055 <?php if ($GLOBALS['amendments'] && acl_check('patients', 'amendment')) { ?>
1056 <tr>
1057 <td width='650px'>
1058 <?php // Amendments widget
1059 $widgetTitle = xlt('Amendments');
1060 $widgetLabel = "amendments";
1061 $widgetButtonLabel = xlt("Edit");
1062 $widgetButtonLink = $GLOBALS['webroot'] . "/interface/patient_file/summary/main_frameset.php?feature=amendment";
1063 $widgetButtonClass = "iframe rx_modal";
1064 $linkMethod = "html";
1065 $bodyClass = "summary_item small";
1066 $widgetAuth = acl_check('patients', 'amendment', '', 'write');
1067 $fixedWidth = false;
1068 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
1069 $sql = "SELECT * FROM amendments WHERE pid = ? ORDER BY amendment_date DESC";
1070 $result = sqlStatement($sql, array($pid) );
1072 if (sqlNumRows($result) == 0) {
1073 echo " <table><tr>\n";
1074 echo " <td colspan='$numcols' class='text'>&nbsp;&nbsp;" . xlt('None') . "</td>\n";
1075 echo " </tr></table>\n";
1078 while ($row=sqlFetchArray($result)){
1079 echo "&nbsp;&nbsp;";
1080 echo "<a class= '" . $widgetButtonClass . "' href='" . $widgetButtonLink . "&id=" . attr($row['amendment_id']) . "' onclick='top.restoreSession()'>" . text($row['amendment_date']);
1081 echo "&nbsp; " . text($row['amendment_desc']);
1083 echo "</a><br>\n";
1084 } ?>
1085 </td>
1086 </tr>
1087 <?php } // end amendments authorized ?>
1089 <?php if (acl_check('patients', 'lab')) { ?>
1090 <tr>
1091 <td width='650px'>
1092 <?php // labdata expand collapse widget
1093 $widgetTitle = xl("Labs");
1094 $widgetLabel = "labdata";
1095 $widgetButtonLabel = xl("Trend");
1096 $widgetButtonLink = "../summary/labdata.php";#"../encounter/trend_form.php?formname=labdata";
1097 $widgetButtonClass = "";
1098 $linkMethod = "html";
1099 $bodyClass = "notab";
1100 // check to see if any labdata exist
1101 $spruch = "SELECT procedure_report.date_collected AS date " .
1102 "FROM procedure_report " .
1103 "JOIN procedure_order ON procedure_report.procedure_order_id = procedure_order.procedure_order_id " .
1104 "WHERE procedure_order.patient_id = ? " .
1105 "ORDER BY procedure_report.date_collected DESC ";
1106 $existLabdata = sqlQuery($spruch, array($pid) );
1107 if ($existLabdata) {
1108 $widgetAuth = true;
1110 else {
1111 $widgetAuth = false;
1113 $fixedWidth = true;
1114 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
1115 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
1116 $widgetAuth, $fixedWidth);
1118 <br/>
1119 <div style='margin-left:10px' class='text'><img src='../../pic/ajax-loader.gif'/></div><br/>
1120 </div>
1121 </td>
1122 </tr>
1123 <?php } // end labs authorized ?>
1125 <?php if ($vitals_is_registered && acl_check('patients', 'med')) { ?>
1126 <tr>
1127 <td width='650px'>
1128 <?php // vitals expand collapse widget
1129 $widgetTitle = xl("Vitals");
1130 $widgetLabel = "vitals";
1131 $widgetButtonLabel = xl("Trend");
1132 $widgetButtonLink = "../encounter/trend_form.php?formname=vitals";
1133 $widgetButtonClass = "";
1134 $linkMethod = "html";
1135 $bodyClass = "notab";
1136 // check to see if any vitals exist
1137 $existVitals = sqlQuery("SELECT * FROM form_vitals WHERE pid=?", array($pid) );
1138 if ($existVitals) {
1139 $widgetAuth = true;
1141 else {
1142 $widgetAuth = false;
1144 $fixedWidth = true;
1145 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
1146 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
1147 $widgetAuth, $fixedWidth);
1149 <br/>
1150 <div style='margin-left:10px' class='text'><img src='../../pic/ajax-loader.gif'/></div><br/>
1151 </div>
1152 </td>
1153 </tr>
1154 <?php } // end if ($vitals_is_registered && acl_check('patients', 'med')) ?>
1156 <?php
1157 // This generates a section similar to Vitals for each LBF form that
1158 // supports charting. The form ID is used as the "widget label".
1160 $gfres = sqlStatement("SELECT option_id, title, notes FROM list_options WHERE " .
1161 "list_id = 'lbfnames' AND " .
1162 "option_value > 0 AND activity = 1 " .
1163 "ORDER BY seq, title");
1164 while($gfrow = sqlFetchArray($gfres)) {
1165 $jobj = json_decode($gfrow['notes'], true);
1166 $LBF_ACO = empty($jobj['aco']) ? false : explode('|', $jobj['aco']);
1167 if ($LBF_ACO && !acl_check($LBF_ACO[0], $LBF_ACO[1])) continue;
1169 <tr>
1170 <td width='650px'>
1171 <?php // vitals expand collapse widget
1172 $vitals_form_id = $gfrow['option_id'];
1173 $widgetTitle = $gfrow['title'];
1174 $widgetLabel = $vitals_form_id;
1175 $widgetButtonLabel = xl("Trend");
1176 $widgetButtonLink = "../encounter/trend_form.php?formname=$vitals_form_id";
1177 $widgetButtonClass = "";
1178 $linkMethod = "html";
1179 $bodyClass = "notab";
1180 $widgetAuth = false;
1181 if (!$LBF_ACO || acl_check($LBF_ACO[0], $LBF_ACO[1], '', 'write')) {
1182 // check to see if any instances exist for this patient
1183 $existVitals = sqlQuery(
1184 "SELECT * FROM forms WHERE pid = ? AND formdir = ? AND deleted = 0",
1185 array($pid, $vitals_form_id));
1186 $widgetAuth = $existVitals;
1188 $fixedWidth = true;
1189 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
1190 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
1191 $widgetAuth, $fixedWidth);
1193 <br/>
1194 <div style='margin-left:10px' class='text'>
1195 <image src='../../pic/ajax-loader.gif'/>
1196 </div>
1197 <br/>
1198 </div> <!-- This is required by expand_collapse_widget(). -->
1199 </td>
1200 </tr>
1201 <?php
1202 } // end while
1205 </table>
1207 </div>
1208 <!-- end left column div -->
1210 <!-- start right column div -->
1211 <div>
1212 <table>
1213 <tr>
1214 <td>
1216 <div>
1217 <?php
1219 // If there is an ID Card or any Photos show the widget
1220 $photos = pic_array($pid, $GLOBALS['patient_photo_category_name']);
1221 if ($photos or $idcard_doc_id )
1223 $widgetTitle = xl("ID Card") . '/' . xl("Photos");
1224 $widgetLabel = "photos";
1225 $linkMethod = "javascript";
1226 $bodyClass = "notab-right";
1227 $widgetAuth = false;
1228 $fixedWidth = false;
1229 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel ,
1230 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
1231 $widgetAuth, $fixedWidth);
1233 <br />
1234 <?php
1235 if ($idcard_doc_id) {
1236 image_widget($idcard_doc_id, $GLOBALS['patient_id_category_name']);
1239 foreach ($photos as $photo_doc_id) {
1240 image_widget($photo_doc_id, $GLOBALS['patient_photo_category_name']);
1245 <br />
1246 </div>
1247 <div>
1248 <?php
1249 // Advance Directives
1250 if ($GLOBALS['advance_directives_warning']) {
1251 // advance directives expand collapse widget
1252 $widgetTitle = xl("Advance Directives");
1253 $widgetLabel = "directives";
1254 $widgetButtonLabel = xl("Edit");
1255 $widgetButtonLink = "return advdirconfigure();";
1256 $widgetButtonClass = "";
1257 $linkMethod = "javascript";
1258 $bodyClass = "summary_item small";
1259 $widgetAuth = true;
1260 $fixedWidth = false;
1261 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
1262 $counterFlag = false; //flag to record whether any categories contain ad records
1263 $query = "SELECT id FROM categories WHERE name='Advance Directive'";
1264 $myrow2 = sqlQuery($query);
1265 if ($myrow2) {
1266 $parentId = $myrow2['id'];
1267 $query = "SELECT id, name FROM categories WHERE parent=?";
1268 $resNew1 = sqlStatement($query, array($parentId) );
1269 while ($myrows3 = sqlFetchArray($resNew1)) {
1270 $categoryId = $myrows3['id'];
1271 $nameDoc = $myrows3['name'];
1272 $query = "SELECT documents.date, documents.id " .
1273 "FROM documents " .
1274 "INNER JOIN categories_to_documents " .
1275 "ON categories_to_documents.document_id=documents.id " .
1276 "WHERE categories_to_documents.category_id=? " .
1277 "AND documents.foreign_id=? " .
1278 "ORDER BY documents.date DESC";
1279 $resNew2 = sqlStatement($query, array($categoryId, $pid) );
1280 $limitCounter = 0; // limit to one entry per category
1281 while (($myrows4 = sqlFetchArray($resNew2)) && ($limitCounter == 0)) {
1282 $dateTimeDoc = $myrows4['date'];
1283 // remove time from datetime stamp
1284 $tempParse = explode(" ",$dateTimeDoc);
1285 $dateDoc = $tempParse[0];
1286 $idDoc = $myrows4['id'];
1287 echo "<a href='$web_root/controller.php?document&retrieve&patient_id=" .
1288 htmlspecialchars($pid,ENT_QUOTES) . "&document_id=" .
1289 htmlspecialchars($idDoc,ENT_QUOTES) . "&as_file=true' onclick='top.restoreSession()'>" .
1290 htmlspecialchars(xl_document_category($nameDoc),ENT_NOQUOTES) . "</a> " .
1291 htmlspecialchars($dateDoc,ENT_NOQUOTES);
1292 echo "<br>";
1293 $limitCounter = $limitCounter + 1;
1294 $counterFlag = true;
1298 if (!$counterFlag) {
1299 echo "&nbsp;&nbsp;" . htmlspecialchars(xl('None'),ENT_NOQUOTES);
1300 } ?>
1301 </div>
1302 <?php } // close advanced dir block
1304 // Show Clinical Reminders for any user that has rules that are permitted.
1305 $clin_rem_check = resolve_rules_sql('','0',TRUE,'',$_SESSION['authUser']);
1306 if (!empty($clin_rem_check) && $GLOBALS['enable_cdr'] && $GLOBALS['enable_cdr_crw'] &&
1307 acl_check('patients', 'alert'))
1309 // clinical summary expand collapse widget
1310 $widgetTitle = xl("Clinical Reminders");
1311 $widgetLabel = "clinical_reminders";
1312 $widgetButtonLabel = xl("Edit");
1313 $widgetButtonLink = "../reminder/clinical_reminders.php?patient_id=".$pid;;
1314 $widgetButtonClass = "";
1315 $linkMethod = "html";
1316 $bodyClass = "summary_item small";
1317 $widgetAuth = acl_check('patients', 'alert', '', 'write');
1318 $fixedWidth = false;
1319 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
1320 echo "<br/>";
1321 echo "<div style='margin-left:10px' class='text'><image src='../../pic/ajax-loader.gif'/></div><br/>";
1322 echo "</div>";
1323 } // end if crw
1325 // Show current and upcoming appointments.
1327 // Recurring appointment support and Appointment Display Sets
1328 // added to Appointments by Ian Jardine ( epsdky ).
1330 if (isset($pid) && !$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1332 $current_date2 = date('Y-m-d');
1333 $events = array();
1334 $apptNum = (int)$GLOBALS['number_of_appts_to_show'];
1335 if($apptNum != 0) $apptNum2 = abs($apptNum);
1336 else $apptNum2 = 10;
1338 $mode1 = !$GLOBALS['appt_display_sets_option'];
1339 $colorSet1 = $GLOBALS['appt_display_sets_color_1'];
1340 $colorSet2 = $GLOBALS['appt_display_sets_color_2'];
1341 $colorSet3 = $GLOBALS['appt_display_sets_color_3'];
1342 $colorSet4 = $GLOBALS['appt_display_sets_color_4'];
1344 if($mode1) $extraAppts = 1;
1345 else $extraAppts = 6;
1346 $events = fetchNextXAppts($current_date2, $pid, $apptNum2 + $extraAppts, true);
1347 //////
1348 if($events) {
1349 $selectNum = 0;
1350 $apptNumber = count($events);
1352 if($apptNumber <= $apptNum2) {
1353 $extraApptDate = '';
1355 } else if($mode1 && $apptNumber == $apptNum2 + 1) {
1356 $extraApptDate = $events[$apptNumber - 1]['pc_eventDate'];
1357 array_pop($events);
1358 --$apptNumber;
1359 $selectNum = 1;
1361 } else if($apptNumber == $apptNum2 + 6) {
1362 $extraApptDate = $events[$apptNumber - 1]['pc_eventDate'];
1363 array_pop($events);
1364 --$apptNumber;
1365 $selectNum = 2;
1367 } else { // mode 2 - $apptNum2 < $apptNumber < $apptNum2 + 6
1368 $extraApptDate = '';
1369 $selectNum = 2;
1373 $limitApptIndx = $apptNum2 - 1;
1374 $limitApptDate = $events[$limitApptIndx]['pc_eventDate'];
1376 switch ($selectNum) {
1378 case 2:
1379 $lastApptIndx = $apptNumber - 1;
1380 $thisNumber = $lastApptIndx - $limitApptIndx;
1381 for($i = 1; $i <= $thisNumber; ++$i) {
1382 if($events[$limitApptIndx + $i]['pc_eventDate'] != $limitApptDate) {
1383 $extraApptDate = $events[$limitApptIndx + $i]['pc_eventDate'];
1384 $events = array_slice($events, 0, $limitApptIndx + $i);
1385 break;
1389 case 1:
1390 $firstApptIndx = 0;
1391 for($i = 1; $i <= $limitApptIndx; ++$i) {
1392 if($events[$limitApptIndx - $i]['pc_eventDate'] != $limitApptDate) {
1393 $firstApptIndx = $apptNum2 - $i;
1394 break;
1400 if($extraApptDate) {
1401 if($extraApptDate != $limitApptDate) $apptStyle2 = " style='background-color:" . attr($colorSet3) . ";'";
1402 else $apptStyle2 = " style='background-color:" . attr($colorSet4) . ";'";
1405 //////
1407 // appointments expand collapse widget
1408 $widgetTitle = xl("Appointments");
1409 $widgetLabel = "appointments";
1410 $widgetButtonLabel = xl("Add");
1411 $widgetButtonLink = "return newEvt();";
1412 $widgetButtonClass = "";
1413 $linkMethod = "javascript";
1414 $bodyClass = "summary_item small";
1415 $widgetAuth = $resNotNull // $resNotNull reflects state of query in fetchAppointments
1416 && (acl_check('patients', 'appt', '', 'write') || acl_check('patients', 'appt', '', 'addonly'));
1417 $fixedWidth = false;
1418 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
1419 $count = 0;
1421 $toggleSet = true;
1422 $priorDate = "";
1423 $therapyGroupCategories = array();
1424 $query = sqlStatement("SELECT pc_catid FROM openemr_postcalendar_categories WHERE pc_cattype = 3 AND pc_active = 1");
1425 while ($result = sqlFetchArray($query)){
1426 $therapyGroupCategories[] = $result['pc_catid'];
1430 foreach($events as $row) { //////
1431 $count++;
1432 $dayname = date("l", strtotime($row['pc_eventDate'])); //////
1433 $dispampm = "am";
1434 $disphour = substr($row['pc_startTime'], 0, 2) + 0;
1435 $dispmin = substr($row['pc_startTime'], 3, 2);
1436 if ($disphour >= 12) {
1437 $dispampm = "pm";
1438 if ($disphour > 12) $disphour -= 12;
1440 $etitle = xl('(Click to edit)');
1441 if ($row['pc_hometext'] != "") {
1442 $etitle = xl('Comments').": ".($row['pc_hometext'])."\r\n".$etitle;
1444 //////
1445 if($extraApptDate && $count > $firstApptIndx) {
1446 $apptStyle = $apptStyle2;
1447 } else {
1448 if($row['pc_eventDate'] != $priorDate) {
1449 $priorDate = $row['pc_eventDate'];
1450 $toggleSet = !$toggleSet;
1452 if($toggleSet) $apptStyle = " style='background-color:" . attr($colorSet2) . ";'";
1453 else $apptStyle = " style='background-color:" . attr($colorSet1) . ";'";
1455 //////
1456 echo "<div " . $apptStyle . ">";
1457 if(!in_array($row['pc_catid'], $therapyGroupCategories)){
1458 echo "<a href='javascript:oldEvt(" . htmlspecialchars(preg_replace("/-/", "", $row['pc_eventDate']),ENT_QUOTES) . ', ' . htmlspecialchars($row['pc_eid'],ENT_QUOTES) . ")' title='" . htmlspecialchars($etitle,ENT_QUOTES) . "'>";
1459 } else {
1460 echo "<span title='" . htmlspecialchars($etitle,ENT_QUOTES) . "'>";
1462 echo "<b>" . htmlspecialchars($row['pc_eventDate'],ENT_NOQUOTES) . ", ";
1463 echo htmlspecialchars(sprintf("%02d", $disphour) .":$dispmin " . xl($dispampm) . " (" . xl($dayname),ENT_NOQUOTES) . ")</b> ";
1464 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)."'>";
1465 echo "<span title='" . generate_display_field(array('data_type'=>'1','list_id'=>'apptstat'),$row['pc_apptstatus']) . "'>";
1466 echo "<br>" . xlt('Status') . "( " . htmlspecialchars($row['pc_apptstatus'],ENT_NOQUOTES) . " ) </span>";
1467 echo htmlspecialchars(xl_appt_category($row['pc_catname']),ENT_NOQUOTES) . "\n";
1468 if(in_array($row['pc_catid'], $therapyGroupCategories)) echo "<br><span>" . xlt('Group name') .": " . text(getGroup($row['pc_gid'])['group_name']) . "</span>\n";
1469 if ($row['pc_hometext']) echo " <span style='color:green'> Com</span>";
1470 echo "<br>" . htmlspecialchars($row['ufname'] . " " . $row['ulname'],ENT_NOQUOTES);
1471 echo !in_array($row['pc_catid'], $therapyGroupCategories) ? '</a>' : '<span>';
1472 echo "</div>\n";
1473 //////
1475 if ($resNotNull) { //////
1476 if ( $count < 1 ) {
1477 echo "&nbsp;&nbsp;" . htmlspecialchars(xl('None'),ENT_NOQUOTES);
1478 } else { //////
1479 if($extraApptDate) echo "<div style='color:#0000cc;'><b>" . attr($extraApptDate) . " ( + ) </b></div>";
1480 else echo "<div><hr></div>";
1482 echo "</div>";
1484 } // End of Appointments.
1487 /* Widget that shows recurrences for appointments. */
1488 if (isset($pid) && !$GLOBALS['disable_calendar'] && $GLOBALS['appt_recurrences_widget'] &&
1489 acl_check('patients', 'appt'))
1491 $widgetTitle = xl("Recurrent Appointments");
1492 $widgetLabel = "recurrent_appointments";
1493 $widgetButtonLabel = xl("Add");
1494 $widgetButtonLink = "return newEvt();";
1495 $widgetButtonClass = "";
1496 $linkMethod = "javascript";
1497 $bodyClass = "summary_item small";
1498 $widgetAuth = false;
1499 $fixedWidth = false;
1500 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel, $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
1501 $count = 0;
1502 $toggleSet = true;
1503 $priorDate = "";
1505 //Fetch patient's recurrences. Function returns array with recurrence appointments' category, recurrence pattern (interpreted), and end date.
1506 $recurrences = fetchRecurrences($pid);
1507 if($recurrences[0] == false){ //if there are no recurrent appointments:
1508 echo "<div>";
1509 echo "<span>" . "&nbsp;&nbsp;" . xlt('None') . "</span>";
1510 echo "</div></div>";
1512 else {
1513 foreach ($recurrences as $row) {
1514 //checks if there are recurrences and if they are current (git didn't end yet)
1515 if ($row == false || !recurrence_is_current($row['pc_endDate']))
1516 continue;
1517 echo "<div>";
1518 echo "<span>" . xlt('Appointment Category') . ': ' . xlt($row['pc_catname']) . "</span>";
1519 echo "<br>";
1520 echo "<span>" . xlt('Recurrence') . ': ' . text($row['pc_recurrspec']) . "</span>";
1521 echo "<br>";
1522 $red_text = ""; //if ends in a week, make font red
1523 if (ends_in_a_week($row['pc_endDate'])) {
1524 $red_text = " style=\"color:red;\" ";
1526 echo "<span" . $red_text . ">" . xlt('End Date') . ': ' . text($row['pc_endDate']) . "</span>";
1527 echo "</div>";
1529 echo "</div>";
1532 /* End of recurrence widget */
1534 // Show PAST appointments.
1535 // added by Terry Hill to allow reverse sorting of the appointments
1536 $direction = "ASC";
1537 if ($GLOBALS['num_past_appointments_to_show'] < 0) {
1538 $direction = "DESC";
1539 ($showpast = -1 * $GLOBALS['num_past_appointments_to_show']);
1541 else {
1542 $showpast = $GLOBALS['num_past_appointments_to_show'];
1544 if (isset($pid) && !$GLOBALS['disable_calendar'] && $showpast > 0 &&
1545 acl_check('patients', 'appt')) {
1546 $query = "SELECT e.pc_eid, e.pc_aid, e.pc_title, e.pc_eventDate, " .
1547 "e.pc_startTime, e.pc_hometext, u.fname, u.lname, u.mname, " .
1548 "c.pc_catname, e.pc_apptstatus " .
1549 "FROM openemr_postcalendar_events AS e, users AS u, " .
1550 "openemr_postcalendar_categories AS c WHERE " .
1551 "e.pc_pid = ? AND e.pc_eventDate < CURRENT_DATE AND " .
1552 "u.id = e.pc_aid AND e.pc_catid = c.pc_catid " .
1553 "ORDER BY e.pc_eventDate $direction , e.pc_startTime DESC " .
1554 "LIMIT " . $showpast;
1556 $pres = sqlStatement($query, array($pid) );
1558 // appointments expand collapse widget
1559 $widgetTitle = xl("Past Appointments");
1560 $widgetLabel = "past_appointments";
1561 $widgetButtonLabel = '';
1562 $widgetButtonLink = '';
1563 $widgetButtonClass = '';
1564 $linkMethod = "javascript";
1565 $bodyClass = "summary_item small";
1566 $widgetAuth = false; //no button
1567 $fixedWidth = false;
1568 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
1569 $count = 0;
1570 while($row = sqlFetchArray($pres)) {
1571 $count++;
1572 $dayname = date("l", strtotime($row['pc_eventDate']));
1573 $dispampm = "am";
1574 $disphour = substr($row['pc_startTime'], 0, 2) + 0;
1575 $dispmin = substr($row['pc_startTime'], 3, 2);
1576 if ($disphour >= 12) {
1577 $dispampm = "pm";
1578 if ($disphour > 12) $disphour -= 12;
1580 if ($row['pc_hometext'] != "") {
1581 $etitle = xl('Comments').": ".($row['pc_hometext'])."\r\n".$etitle;
1583 echo "<a href='javascript:oldEvt(" . htmlspecialchars(preg_replace("/-/", "", $row['pc_eventDate']),ENT_QUOTES) . ', ' . htmlspecialchars($row['pc_eid'],ENT_QUOTES) . ")' title='" . htmlspecialchars($etitle,ENT_QUOTES) . "'>";
1584 echo "<b>" . htmlspecialchars(xl($dayname) . ", " . $row['pc_eventDate'],ENT_NOQUOTES) . "</b>" . xlt("Status") . "(";
1585 echo " " . generate_display_field(array('data_type'=>'1','list_id'=>'apptstat'),$row['pc_apptstatus']) . ")<br>"; // can't use special char parser on this
1586 echo htmlspecialchars("$disphour:$dispmin ") . xl($dispampm) . " ";
1587 echo htmlspecialchars($row['fname'] . " " . $row['lname'],ENT_NOQUOTES) . "</a><br>\n";
1589 if (isset($pres) && $res != null) {
1590 if ( $count < 1 ) {
1591 echo "&nbsp;&nbsp;" . htmlspecialchars(xl('None'),ENT_NOQUOTES);
1593 echo "</div>";
1596 // END of past appointments
1598 </div>
1600 <div id='stats_div'>
1601 <br/>
1602 <div style='margin-left:10px' class='text'><img src='../../pic/ajax-loader.gif'/></div><br/>
1603 </div>
1604 </td>
1605 </tr>
1607 <?php // TRACK ANYTHING -----
1609 // Determine if track_anything form is in use for this site.
1610 $tmp = sqlQuery("SELECT count(*) AS count FROM registry WHERE " .
1611 "directory = 'track_anything' AND state = 1");
1612 $track_is_registered = $tmp['count'];
1613 if($track_is_registered){
1614 echo "<tr> <td>";
1615 // track_anything expand collapse widget
1616 $widgetTitle = xl("Tracks");
1617 $widgetLabel = "track_anything";
1618 $widgetButtonLabel = xl("Tracks");
1619 $widgetButtonLink = "../../forms/track_anything/create.php";
1620 $widgetButtonClass = "";
1621 $widgetAuth = ""; // don't show the button
1622 $linkMethod = "html";
1623 $bodyClass = "notab";
1624 // check to see if any tracks exist
1625 $spruch = "SELECT id " .
1626 "FROM forms " .
1627 "WHERE pid = ? " .
1628 "AND formdir = ? ";
1629 $existTracks = sqlQuery($spruch, array($pid, "track_anything") );
1631 $fixedWidth = false;
1632 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
1633 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
1634 $widgetAuth, $fixedWidth);
1636 <br/>
1637 <div style='margin-left:10px' class='text'><img src='../../pic/ajax-loader.gif'/></div><br/>
1638 </div>
1639 </td>
1640 </tr>
1641 <?php } // end track_anything ?>
1642 </table>
1644 </div> <!-- end right column div -->
1646 </td>
1648 </tr>
1649 </table>
1651 </div> <!-- end main content div -->
1653 <script language='JavaScript'>
1654 // Array of skip conditions for the checkSkipConditions() function.
1655 var skipArray = [
1656 <?php echo $condition_str; ?>
1658 checkSkipConditions();
1659 </script>
1661 </body>
1662 </html>