2 // Copyright (C) 2010 OpenEMR Support LLC
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
9 $sanitize_all_escapes=true;
11 //STOP FAKE REGISTER GLOBALS
12 $fake_register_globals=false;
14 require_once("../../globals.php");
15 require_once("$srcdir/patient.inc");
16 require_once("$srcdir/acl.inc");
17 require_once("$srcdir/classes/Address.class.php");
18 require_once("$srcdir/classes/InsuranceCompany.class.php");
19 require_once("./patient_picture.php");
20 require_once("$srcdir/options.inc.php");
21 require_once("../history/history.inc.php");
24 if ($GLOBALS['concurrent_layout'] && $_GET['set_pid']) {
25 include_once("$srcdir/pid.inc");
26 setpid($_GET['set_pid']);
29 $pid = htmlspecialchars($_GET['pid'], ENT_QUOTES
);
31 function print_as_money($money) {
32 preg_match("/(\d*)\.?(\d*)/",$money,$moneymatches);
33 $tmp = wordwrap(strrev($moneymatches[1]),3,",",1);
34 $ccheck = strrev($tmp);
35 if ($ccheck[0] == ",") {
36 $tmp = substr($ccheck,1,strlen($ccheck)-1);
38 if ($moneymatches[2] != "") {
39 return "$ " . strrev($tmp) . "." . $moneymatches[2];
41 return "$ " . strrev($tmp);
48 <?php
html_header_show();?
>
49 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
50 <link rel
="stylesheet" type
="text/css" href
="../../../library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
51 <style type
="text/css">@import
url(../../../library
/dynarch_calendar
.css
);</style
>
52 <script type
="text/javascript" src
="../../../library/textformat.js"></script
>
53 <script type
="text/javascript" src
="../../../library/dynarch_calendar.js"></script
>
54 <?php
include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?
>
55 <script type
="text/javascript" src
="../../../library/dynarch_calendar_setup.js"></script
>
56 <script type
="text/javascript" src
="../../../library/dialog.js"></script
>
57 <script type
="text/javascript" src
="../../../library/js/jquery.1.3.2.js"></script
>
58 <script type
="text/javascript" src
="../../../library/js/common.js"></script
>
59 <script type
="text/javascript" src
="../../../library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
60 <script language
="JavaScript">
62 var mypcc
= '<?php echo htmlspecialchars($GLOBALS['phone_country_code
'], ENT_QUOTES) ?>';
64 function oldEvt(eventid
) {
65 dlgopen('../../main/calendar/add_edit_event.php?eid=' + eventid
, '_blank', 550, 270);
68 function advdirconfigure() {
69 dlgopen('advancedirectives.php', '_blank', 500, 450);
72 function refreshme() {
77 // Process click on Delete link.
79 dlgopen('../deleter.php?patient=<?php echo $pid ?>', '_blank', 500, 450);
83 // Called by the deleteme.php window on a successful delete.
84 function imdeleted() {
85 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
86 parent
.left_nav
.clearPatient();
89 top
.location
.href
= '../main/main_screen.php';
94 var f
= document
.forms
[0];
96 if ($GLOBALS['athletic_team']) {
97 echo " if (f.form_userdate1.value != f.form_original_userdate1.value) {\n";
98 $irow = sqlQuery("SELECT id, title FROM lists WHERE " .
99 "pid = ? AND enddate IS NULL ORDER BY begdate DESC LIMIT 1", array($pid));
102 if (confirm('Do you wish to also set this new return date in the issue titled "<?php echo addslashes(htmlspecialchars($irow['title
'], ENT_QUOTES)) ?>"?')) {
103 f
.form_issue_id
.value
= '<?php echo htmlspecialchars($irow['id
'], ENT_QUOTES) ?>';
105 alert('OK, you will need to manually update the return date in any affected issue(s).');
108 alert('You have changed the return date but there are no open issues. You probably need to create or modify one.');
112 } // end athletic team
118 dlgopen('../../main/calendar/add_edit_event.php?patientid=<?php echo $pid ?>', '_blank', 550, 270);
122 function sendimage(pid
, what
) {
123 // alert('Not yet implemented.'); return false;
124 dlgopen('../upload_dialog.php?patientid=' + pid +
'&file=' + what
,
131 <script type
="text/javascript">
133 function toggle( target
, div
) {
135 $mode = $
(target
).find(".indicator").text();
136 if ( $mode == "<?php echo htmlspecialchars(xl('collapse'), ENT_QUOTES); ?>" ) {
137 $
(target
).find(".indicator").text( "<?php echo htmlspecialchars(xl('expand'), ENT_QUOTES); ?>" );
140 $
(target
).find(".indicator").text( "<?php echo htmlspecialchars(xl('collapse'), ENT_QUOTES); ?>" );
146 $
(document
).ready(function(){
148 $
("#dem_view").click( function() {
149 toggle( $
(this
), "#DEM" );
152 $
("#his_view").click( function() {
153 toggle( $
(this
), "#HIS" );
156 $
("#ins_view").click( function() {
157 toggle( $
(this
), "#INSURANCE" );
160 $
("#notes_view").click( function() {
161 toggle( $
(this
), "#notes_div" );
165 $
("#stats_div").load("stats.php");
166 $
("#notes_div").load("pnotes_fragment.php");
174 $
(".large_modal").fancybox( {
175 'overlayOpacity' : 0.0,
176 'showCloseButton' : true,
179 'centerOnScroll' : false
183 $
(".medium_modal").fancybox( {
184 'overlayOpacity' : 0.0,
185 'showCloseButton' : true,
188 'centerOnScroll' : false
193 $
(".rx_modal").fancybox( {
194 'overlayOpacity' : 0.0,
195 'showCloseButton' : true,
198 'centerOnScroll' : false,
199 'callbackOnClose' : function() {
208 <style type
="css/text">
217 <body
class="body_top">
218 <table cellspacing
='0' cellpadding
='0' border
='0'>
221 $result = getPatientData($pid, "*, DATE_FORMAT(DOB,'%Y-%m-%d') as DOB_YMD");
222 $result2 = getEmployerData($pid);
224 $thisauth = acl_check('patients', 'demo');
226 if ($result['squad'] && ! acl_check('squads', $result['squad']))
231 echo "<p>(" . htmlspecialchars(xl('Demographics not authorized'), ENT_QUOTES
) . ")</p>\n";
232 echo "</body>\n</html>\n";
236 if ($thisauth == 'write') {
237 foreach (pic_array() as $var) {print $var;}
238 echo "<td><a href='demographics_full.php'";
239 if (! $GLOBALS['concurrent_layout']) echo " target='Main'";
240 echo " onclick='top.restoreSession()'><span class='title'>" .
241 htmlspecialchars(getPatientName($pid), ENT_QUOTES
) . "</span></a> </td>";
243 echo "<td><a class='css_button' href='demographics_full.php'";
244 if (! $GLOBALS['concurrent_layout']) echo " target='Main'";
245 echo " onclick='top.restoreSession()'><span>" . htmlspecialchars(xl("Edit" ), ENT_QUOTES
). "</span></a></td>";
247 if (acl_check('admin', 'super')) {
248 echo "<td><a class='css_button iframe' href='../deleter.php?patient=" . $pid . "'>" .
249 "<span>".htmlspecialchars(xl('Delete'), ENT_QUOTES
)."</span></a></td>";
251 if ($GLOBALS['oer_config']['ws_accounting']['enabled']) {
252 // Show current balance and billing note, if any.
253 echo "<td> <span class='bold'><font color='#ee6600'>" . htmlspecialchars(xl('Balance Due'), ENT_QUOTES
) . ": " . htmlspecialchars(xl('$'), ENT_QUOTES
) .
254 htmlspecialchars(get_patient_balance($pid), ENT_QUOTES
) . "</font><br />";
255 if ($result['genericname2'] == 'Billing') {
256 htmlspecialchars(xl('Billing Note'), ENT_QUOTES
) . ":";
257 echo "<span class='bold'><font color='red'>" .
258 htmlspecialchars($result['genericval2'], ENT_QUOTES
) . "</font></span>";
265 // Get the document ID of the patient ID card if access to it is wanted here.
267 if ($GLOBALS['patient_id_category_name']) {
268 $tmp = sqlQuery("SELECT d.id, d.date, d.url FROM " .
269 "documents AS d, categories_to_documents AS cd, categories AS c " .
270 "WHERE d.foreign_id = ? " .
271 "AND cd.document_id = d.id " .
272 "AND c.id = cd.category_id " .
273 "AND c.name LIKE ? " .
274 "ORDER BY d.date DESC LIMIT 1", array($pid, $GLOBALS['patient_id_category_name']));
275 if ($tmp) $document_id = htmlspecialchars($tmp['id'], ENT_QUOTES
);
281 <td
class="small" colspan
='4'>
282 <a href
="rx_frameset.php" class='iframe rx_modal' onclick
='top.restoreSession()'><?php
echo htmlspecialchars(xl('Rx'), ENT_QUOTES
); ?
></a
>
284 <a href
="../history/history.php" onclick
='top.restoreSession()'><?php
echo htmlspecialchars(xl('History'), ENT_QUOTES
); ?
></a
>
286 <a href
="../report/patient_report.php" class='iframe medium_modal' onclick
='top.restoreSession()'><?php
echo htmlspecialchars(xl('Report'), ENT_QUOTES
); ?
></a
>
288 <a href
="../../../controller.php?document&list&patient_id=<?php echo $pid;?>" class='iframe medium_modal' onclick
='top.restoreSession()'><?php
echo htmlspecialchars(xl('Documents'), ENT_QUOTES
); ?
></a
>
290 <a href
="../transaction/transactions.php" class='iframe large_modal' onclick
='top.restoreSession()'><?php
echo htmlspecialchars(xl('Transactions'), ENT_QUOTES
); ?
></a
>
293 </table
> <!-- end header
-->
295 <div style
='margin-top:10px'> <!-- start main content div
-->
296 <table border
="0" cellspacing
="0" cellpadding
="0" width
="100%">
298 <td align
="left" valign
="top">
299 <!-- start left column div
-->
300 <div style
='float:left; margin-right:20px'>
301 <table cellspacing
=0 cellpadding
=0>
304 <div
class="section-header">
305 <a href
='javascript:;' class='small' id
='dem_view'><span
class='text'><b
><?php
echo htmlspecialchars(xl("Demographics"), ENT_QUOTES
)?
></b
></span
> (<span
class="indicator"><?php
echo htmlspecialchars(xl('collapse'), ENT_QUOTES
); ?
></span
>)</a
>
308 <!-- Demographics
-->
311 <?php
display_layout_tabs('DEM', $result, $result2); ?
>
313 <div
class="tabContainer">
314 <?php
display_layout_tabs_data('DEM', $result, $result2); ?
>
324 $insurance_count = 0;
325 foreach (array('primary','secondary','tertiary') as $instype) {
326 $enddate = 'Present';
328 $query = "SELECT * FROM insurance_data WHERE " .
329 "pid = ? AND type = ? " .
330 "ORDER BY date DESC";
331 $res = sqlStatement($query, array($pid, $instype));
332 while( $row = sqlFetchArray($res) ) {
333 if ($row['provider'] ) $insurance_count++
;
337 if ( $insurance_count > 0 ) {
340 <div
class="section-header">
341 <a href
='javascript:;' class='small' id
='ins_view'><span
class='text'><b
><?php
echo htmlspecialchars(xl("Insurance"), ENT_QUOTES
)?
></b
></span
> (<span
class="indicator"><?php
echo htmlspecialchars(xl('collapse'), ENT_QUOTES
); ?
></span
>)</a
>
347 if ( $insurance_count > 1 ) {
349 ?
><ul
class="tabNav"><?php
351 ///////////////////////////////// INSURANCE SECTION
353 foreach (array('primary','secondary','tertiary') as $instype) {
355 $query = "SELECT * FROM insurance_data WHERE " .
356 "pid = ? AND type = ? " .
357 "ORDER BY date DESC";
358 $res = sqlStatement($query, array($pid, $instype));
360 $enddate = 'Present';
362 while( $row = sqlFetchArray($res) ) {
363 if ($row['provider'] ) {
365 $ins_description = ucfirst($instype);
366 $ins_description .= strcmp($enddate, 'Present') != 0 ?
" (Old)" : "";
368 <li
<?php
echo $first ?
'class="current"' : '' ?
>><a href
="/play/javascript-tabbed-navigation/"><?php
echo htmlspecialchars(ucfirst($ins_description), ENT_QUOTES
); ?
></a
></li
>
372 $enddate = $row['date'];
380 <div
class="tabContainer">
383 foreach (array('primary','secondary','tertiary') as $instype) {
384 $enddate = 'Present';
386 $query = "SELECT * FROM insurance_data WHERE " .
387 "pid = ? AND type = ? " .
388 "ORDER BY date DESC";
389 $res = sqlStatement($query, array($pid, $instype));
390 while( $row = sqlFetchArray($res) ) {
391 if ($row['provider'] ) {
393 <div
class="tab <?php echo $first ? 'current' : '' ?>">
394 <table border
='0' cellpadding
='0' width
='100%'>
396 $icobj = new InsuranceCompany($row['provider']);
397 $adobj = $icobj->get_address();
398 $insco_name = trim($icobj->get_name());
401 <td valign
='top' colspan
='3'>
403 <?php
if (strcmp($enddate, 'Present') != 0) echo "Old "; ?
>
404 <?php
echo htmlspecialchars(ucfirst($instype)." ". xl('Insurance'), ENT_QUOTES
); ?
>
405 <?php
if (strcmp($row['date'], '0000-00-00') != 0) { ?
>
406 <?php
echo htmlspecialchars(" ".xl('from','e')." ". $row['date'], ENT_QUOTES
); ?
>
408 <?php
; echo " ".htmlspecialchars(xl('until')." ".$enddate, ENT_QUOTES
); ?
>:</span
>
416 echo htmlspecialchars($insco_name, ENT_QUOTES
) . '<br>';
417 if (trim($adobj->get_line1())) {
418 echo htmlspecialchars($adobj->get_line1(), ENT_QUOTES
) . '<br>';
419 echo htmlspecialchars($adobj->get_city() . ', ' . $adobj->get_state() . ' ' . $adobj->get_zip(), ENT_QUOTES
);
422 echo "<font color='red'><b>Unassigned</b></font>";
426 <?php
echo htmlspecialchars(xl('Policy Number'), ENT_QUOTES
); ?
>: <?php
echo htmlspecialchars($row['policy_number'], ENT_QUOTES
) ?
><br
>
427 <?php
echo htmlspecialchars(xl('Plan Name').": ".$row['plan_name'], ENT_QUOTES
); ?
><br
>
428 <?php
echo htmlspecialchars(xl('Group Number').": ".$row['group_number'], ENT_QUOTES
); ?
></span
>
431 <span
class='bold'><?php
echo htmlspecialchars(xl('Subscriber'), ENT_QUOTES
); ?
>: </span
><br
>
432 <span
class='text'><?php
echo htmlspecialchars($row['subscriber_fname'] . ' ' . $row['subscriber_mname'] . ' ' . $row['subscriber_lname'], ENT_QUOTES
); ?
>
434 if ($row['subscriber_relationship'] != "") {
435 echo "(" . htmlspecialchars($row['subscriber_relationship'], ENT_QUOTES
) . ")";
439 <?php
echo htmlspecialchars(xl('S.S.').": ".$row['subscriber_ss'], ENT_QUOTES
); ?
><br
>
440 <?php
echo htmlspecialchars(xl('D.O.B.'), ENT_QUOTES
); ?
>:
441 <?php
if ($row['subscriber_DOB'] != "0000-00-00 00:00:00") echo htmlspecialchars($row['subscriber_DOB'], ENT_QUOTES
); ?
><br
>
442 <?php
echo htmlspecialchars(xl('Phone').": ".$row['subscriber_phone'], ENT_QUOTES
); ?
>
446 <span
class='bold'><?php
echo htmlspecialchars(xl('Subscriber Address'), ENT_QUOTES
); ?
>: </span
><br
>
447 <span
class='text'><?php
echo htmlspecialchars($row['subscriber_street'], ENT_QUOTES
); ?
><br
>
448 <?php
echo htmlspecialchars($row['subscriber_city'], ENT_QUOTES
); ?
>
449 <?php
if($row['subscriber_state'] != "") echo ", "; echo htmlspecialchars($row['subscriber_state'], ENT_QUOTES
); ?
>
450 <?php
if($row['subscriber_country'] != "") echo ", "; echo htmlspecialchars($row['subscriber_country'], ENT_QUOTES
); ?
>
451 <?php
echo " " . htmlspecialchars($row['subscriber_postal_code'], ENT_QUOTES
); ?
></span
>
453 <?php
if (trim($row['subscriber_employer'])) { ?
>
454 <br
><span
class='bold'><?php
echo htmlspecialchars(xl('Subscriber Employer'), ENT_QUOTES
); ?
>: </span
><br
>
455 <span
class='text'><?php
echo htmlspecialchars($row['subscriber_employer'], ENT_QUOTES
); ?
><br
>
456 <?php
echo htmlspecialchars($row['subscriber_employer_street'], ENT_QUOTES
); ?
><br
>
457 <?php
echo htmlspecialchars($row['subscriber_employer_city'], ENT_QUOTES
); ?
>
458 <?php
if($row['subscriber_employer_city'] != "") echo ", "; echo htmlspecialchars($row['subscriber_employer_state'], ENT_QUOTES
); ?
>
459 <?php
if($row['subscriber_employer_country'] != "") echo ", "; echo htmlspecialchars($row['subscriber_employer_country'], ENT_QUOTES
); ?
>
460 <?php
echo " " . htmlspecialchars($row['subscriber_employer_postal_code'], ENT_QUOTES
); ?
>
468 <?php
if ($row['copay'] != "") { ?
>
469 <span
class='bold'><?php
echo htmlspecialchars(xl('CoPay'), ENT_QUOTES
); ?
>: </span
>
470 <span
class='text'><?php
echo htmlspecialchars($row['copay'], ENT_QUOTES
); ?
></span
>
473 <span
class='bold'><?php
echo htmlspecialchars(xl('Accept Assignment'), ENT_QUOTES
); ?
>:</span
>
474 <span
class='text'><?php
if($row['accept_assignment'] == "TRUE") echo "YES"; ?
>
475 <?php
if($row['accept_assignment'] == "FALSE") echo "NO"; ?
></span
>
477 <td valign
='top'></td
>
478 <td valign
='top'></td
>
485 } // end if ($row['provider'])
486 $enddate = $row['date'];
491 ///////////////////////////////// END INSURANCE SECTION
502 <div
class="section-header">
503 <a href
='javascript:;' class='small' id
='notes_view'><span
class='text'><b
><?php
echo htmlspecialchars(xl("Notes"), ENT_QUOTES
);?
></b
></span
> (<span
class="indicator"><?php
echo htmlspecialchars(xl('collapse'), ENT_QUOTES
); ?
></span
>)</a
>
505 <!-- Demographics
-->
506 <div id
='notes_div' class='tab current' style
='height:auto; width:100%' >
508 <div style
='margin-left:10px' class='text'><image src
='../../pic/ajax-loader.gif'/></div
><br
/>
519 <!-- end left column div
-->
521 <!-- start right column div
-->
527 if ($GLOBALS['advance_directives_warning']) { ?
>
529 <span
class="text"><b
><?php
echo htmlspecialchars(xl('Advance Directives'), ENT_QUOTES
) ?
></b
></span
>
530 <a href
="#" class="small" onClick
="return advdirconfigure();">
531 (<b
><?php
echo htmlspecialchars(xl('Manage'), ENT_QUOTES
) ?
></b
>)
536 $counterFlag = false; //flag to record whether any categories contain ad records
537 $query = "SELECT id FROM categories WHERE name='Advance Directive'";
538 $myrow2 = sqlQuery($query);
540 $parentId = $myrow2['id'];
541 $query = "SELECT id, name FROM categories WHERE parent=?";
542 $resNew1 = sqlStatement($query, array($parentId));
543 while ($myrows3 = sqlFetchArray($resNew1)) {
544 $categoryId = $myrows3['id'];
545 $nameDoc = $myrows3['name'];
546 $query = "SELECT documents.date, documents.id " .
548 "INNER JOIN categories_to_documents " .
549 "ON categories_to_documents.document_id=documents.id " .
550 "WHERE categories_to_documents.category_id=? " .
551 "AND documents.foreign_id=? " .
552 "ORDER BY documents.date DESC";
553 $resNew2 = sqlStatement($query, array($categoryId, $pid));
554 $limitCounter = 0; // limit to one entry per category
555 while (($myrows4 = sqlFetchArray($resNew2)) && ($limitCounter == 0)) {
556 $dateTimeDoc = $myrows4['date'];
557 // remove time from datetime stamp
558 $tempParse = explode(" ",$dateTimeDoc);
559 $dateDoc = htmlspecialchars($tempParse[0], ENT_QUOTES
);
560 $idDoc = htmlspecialchars($myrows4['id'], ENT_QUOTES
);
561 echo "<a href='$web_root/controller.php?document&retrieve&patient_id=$pid&document_id=" .
562 $idDoc . "&as_file=true'>" . htmlspecialchars(xl_document_category($nameDoc), ENT_QUOTES
) . "</a> " . $dateDoc;
564 $limitCounter = $limitCounter +
1;
570 echo htmlspecialchars(xl('None.'), ENT_QUOTES
);
575 // This is a feature for a specific client. -- Rod
576 if ($GLOBALS['cene_specific']) {
579 $imagedir = "$webserver_root/documents/$pid/demographics";
580 $imagepath = "$web_root/documents/$pid/demographics";
582 echo " <a href='' onclick=\"return sendimage($pid, 'photo');\" " .
583 "title='".htmlspecialchars(xl('Click to attach patient image'), ENT_QUOTES
)."'>\n";
584 if (is_file("$imagedir/photo.jpg")) {
585 echo " <img src='$imagepath/photo.jpg' /></a>\n";
587 echo " ".htmlspecialchars(xl('Attach Patient Image'), ENT_QUOTES
)."</a><br />\n";
589 echo " <br /> <br />\n";
591 echo " <a href='' onclick=\"return sendimage($pid, 'fingerprint');\" " .
592 "title='".htmlspecialchars(xl('Click to attach fingerprint'), ENT_QUOTES
)."'>\n";
593 if (is_file("$imagedir/fingerprint.jpg")) {
594 echo " <img src='$imagepath/fingerprint.jpg' /></a>\n";
596 echo " ".htmlspecialchars(xl('Attach Biometric Fingerprint'), ENT_QUOTES
)."</a><br />\n";
598 echo " <br /> <br />\n";
601 // This stuff only applies to athletic team use of OpenEMR. The client
602 // insisted on being able to quickly change fitness and return date here:
604 if (false && $GLOBALS['athletic_team']) {
605 // blue green yellow red orange
606 $fitcolors = array('#6677ff','#00cc00','#ffff00','#ff3333','#ff8800','#ffeecc','#ffccaa');
607 if (!empty($GLOBALS['fitness_colors'])) $fitcolors = $GLOBALS['fitness_colors'];
608 $fitcolor = $fitcolors[0];
609 $form_fitness = $_POST['form_fitness'];
610 $form_userdate1 = fixDate($_POST['form_userdate1'], '');
611 $form_issue_id = $_POST['form_issue_id'];
613 $returndate = $form_userdate1 ?
"'$form_userdate1'" : "NULL";
614 sqlStatement("UPDATE patient_data SET fitness = '$form_fitness', " .
615 "userdate1 = $returndate WHERE pid = ?", array($pid));
616 // Update return date in the designated issue, if requested.
617 if ($form_issue_id) {
618 sqlStatement("UPDATE lists SET returndate = $returndate WHERE " .
619 "id = ?", array($form_issue_id));
622 $form_fitness = $result['fitness'];
623 if (! $form_fitness) $form_fitness = 1;
624 $form_userdate1 = $result['userdate1'];
626 $fitcolor = $fitcolors[$form_fitness - 1];
627 echo " <form method='post' action='demographics.php' onsubmit='return validate()'>\n";
628 echo " <span class='bold'>.".htmlspecialchars(xl('Fitness to Play'), ENT_QUOTES
).":</span><br />\n";
629 echo " <select name='form_fitness' style='background-color:$fitcolor'>\n";
630 $res = sqlStatement("SELECT * FROM list_options WHERE " .
631 "list_id = 'fitness' ORDER BY seq");
632 while ($row = sqlFetchArray($res)) {
633 $key = htmlspecialchars($row['option_id'], ENT_QUOTES
);
634 echo " <option value='$key'";
635 if ($key == $form_fitness) echo " selected";
636 echo ">" . htmlspecialchars($row['title'], ENT_QUOTES
) . "</option>\n";
639 echo " <br /><span class='bold'>".htmlspecialchars(xl('Return to Play'), ENT_QUOTES
).":</span><br>\n";
640 echo " <input type='text' size='10' name='form_userdate1' id='form_userdate1' " .
641 "value='".htmlspecialchars($form_userdate1, ENT_QUOTES
)."' " .
642 "title='" . htmlspecialchars(xl('yyyy-mm-dd Date of return to play'), ENT_QUOTES
) . "' " .
643 "onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />\n" .
644 " <img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22' " .
645 "id='img_userdate1' border='0' alt='[?]' style='cursor:pointer' " .
646 "title='" . htmlspecialchars(xl('Click here to choose a date'), ENT_QUOTES
) . "'>\n";
647 echo " <input type='hidden' name='form_original_userdate1' value='".htmlspecialchars($form_userdate1, ENT_QUOTES
)."' />\n";
648 echo " <input type='hidden' name='form_issue_id' value='' />\n";
649 echo "<p><input type='submit' name='form_submit' value='Change' /></p>\n";
653 // If there is a patient ID card, then show a link to it.
655 echo "<a href='" . $web_root . "/controller.php?document&retrieve" .
656 "&patient_id=$pid&document_id=$document_id' style='color:#00cc00' " .
657 "onclick='top.restoreSession()'>Click for ID card</a><br />";
660 // Show current and upcoming appointments.
661 if (isset($pid) && !$GLOBALS['disable_calendar']) {
662 $query = "SELECT e.pc_eid, e.pc_aid, e.pc_title, e.pc_eventDate, " .
663 "e.pc_startTime, e.pc_hometext, u.fname, u.lname, u.mname, " .
665 "FROM openemr_postcalendar_events AS e, users AS u, " .
666 "openemr_postcalendar_categories AS c WHERE " .
667 "e.pc_pid = ? AND e.pc_eventDate >= CURRENT_DATE AND " .
668 "u.id = e.pc_aid AND e.pc_catid = c.pc_catid " .
669 "ORDER BY e.pc_eventDate, e.pc_startTime";
670 $res = sqlStatement($query, array($pid));
672 if (isset($res) && $res != null) { ?
>
674 <span
class="text"><b
><?php
echo htmlspecialchars(xl('Appointments'), ENT_QUOTES
) ?
></b
></span
>
675 <a href
="#" class="small" onClick
="return newEvt();" >
676 (<b
><?php
echo htmlspecialchars(xl('Add'), ENT_QUOTES
) ?
></b
>)
683 while($row = sqlFetchArray($res)) {
685 $dayname = date("l", strtotime($row['pc_eventDate']));
687 $disphour = substr($row['pc_startTime'], 0, 2) +
0;
688 $dispmin = substr($row['pc_startTime'], 3, 2);
689 if ($disphour >= 12) {
691 if ($disphour > 12) $disphour -= 12;
693 $etitle = xl('(Click to edit)');
694 if ($row['pc_hometext'] != "") {
695 $etitle = xl('Comments').": ".addslashes($row['pc_hometext'])."\r\n".$etitle;
697 echo "<a href='javascript:oldEvt(" . htmlspecialchars($row['pc_eid'], ENT_QUOTES
) . ")' title='".htmlspecialchars($etitle, ENT_QUOTES
)."'>";
698 echo "<b>" . htmlspecialchars(xl($dayname), ENT_QUOTES
) . ", " . htmlspecialchars($row['pc_eventDate'], ENT_QUOTES
) . "</b><br>";
699 echo htmlspecialchars("$disphour:$dispmin " . xl($dispampm) . " " . xl_appt_category($row['pc_catname']), ENT_QUOTES
) . "<br>\n";
700 echo htmlspecialchars($row['fname'] . " " . $row['lname'], ENT_QUOTES
) . "</a><br>\n";
702 if (isset($res) && $res != null) {
703 if ( $count < 1 ) { echo htmlspecialchars(xl('None.'), ENT_QUOTES
); }
710 <div id
='stats_div' style
='float:left'>
712 <div style
='margin-left:10px' class='text'><image src
='../../pic/ajax-loader.gif'/></div
><br
/>
719 </div
> <!-- end right column div
-->
726 </div
> <!-- end main content div
-->
728 <?php
if ($GLOBALS['concurrent_layout'] && $_GET['set_pid']) { ?
>
729 <script language
='JavaScript'>
730 parent
.left_nav
.setPatient(<?php
echo "'" . addslashes(htmlspecialchars($result['fname'], ENT_QUOTES
)) . " " . addslashes(htmlspecialchars($result['lname'], ENT_QUOTES
)) . "',$pid,'" . addslashes(htmlspecialchars($result['pubpid'], ENT_QUOTES
)) . "','', ' ".htmlspecialchars(xl('DOB'), ENT_QUOTES
).": ".htmlspecialchars($result['DOB_YMD'], ENT_QUOTES
) ." ".htmlspecialchars(xl('Age'), ENT_QUOTES
).": ".htmlspecialchars(getPatientAge($result['DOB_YMD']), ENT_QUOTES
)."'"; ?
>);
731 parent
.left_nav
.setRadio(window
.name
, 'dem');
735 <?php
if (false && $GLOBALS['athletic_team']) { ?
>
736 <script language
='JavaScript'>
737 Calendar
.setup({inputField
:"form_userdate1", ifFormat
:"%Y-%m-%d", button
:"img_userdate1"});