4 $sanitize_all_escapes=true;
7 //STOP FAKE REGISTER GLOBALS
8 $fake_register_globals=false;
11 require_once("../../globals.php");
12 require_once("$srcdir/pnotes.inc");
13 require_once("$srcdir/acl.inc");
14 require_once("$srcdir/patient.inc");
15 require_once("$srcdir/options.inc.php");
16 require_once("$srcdir/classes/Document.class.php");
18 // form parameter docid can be passed to restrict the display to a document.
19 $docid = empty($_REQUEST['docid']) ?
0 : 0 +
$_REQUEST['docid'];
23 <?php
html_header_show();?
>
25 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.js"></script
>
26 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
29 <body
class="body_bottom">
32 $thisauth = acl_check('patients', 'notes');
34 $tmp = getPatientData($pid, "squad");
35 if ($tmp['squad'] && ! acl_check('squads', $tmp['squad']))
39 echo "<p>(" . htmlspecialchars( xl('Notes not authorized'), ENT_NOQUOTES
) . ")</p>\n";
40 echo "</body>\n</html>\n";
47 <?php
if ( acl_check('patients', 'notes','',array('write','addonly') )): ?
>
49 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
50 <a href
="pnotes_full.php?docid=<?php echo htmlspecialchars( $docid, ENT_QUOTES); ?>" onclick
="top.restoreSession()">
52 <a href
="pnotes_full.php?docid=<?php echo htmlspecialchars( $docid, ENT_QUOTES); ?>" target
="Main" onclick
="top.restoreSession()">
55 <span
class="title"><?php
echo htmlspecialchars( xl('Notes'), ENT_NOQUOTES
); ?
>
58 echo " " . htmlspecialchars( xl("linked to document"), ENT_NOQUOTES
) . " ";
59 $d = new Document($docid);
60 echo $d->get_url_file();
64 <span
class=more
><?php
echo htmlspecialchars( $tmore, ENT_NOQUOTES
);?
></span
>
73 //display all of the notes for the day, as well as others that are active from previous dates, up to a certain number, $N
76 // Get the billing note if there is one.
80 $sql = "select genericname2, genericval2 " .
81 "from patient_data where pid = ? limit 1";
82 $resnote = sqlQuery($sql, array($pid) );
83 if($resnote && $resnote['genericname2'] == 'Billing') {
84 $billing_note = $resnote['genericval2'];
85 $colorbeg = "<span style='color:red'>";
86 $colorend = "</span>";
89 //Display what the patient owes
90 $balance = get_patient_balance($pid);
91 if ($balance != "0") {
92 $formatted = sprintf((xl('$').'%01.2f'), $balance);
93 echo " <tr class='text billing'>\n";
94 echo " <td>" . $colorbeg . htmlspecialchars( xl('Balance Due'), ENT_NOQUOTES
) .
95 $colorend . "</td><td>" . $colorbeg .
96 htmlspecialchars( $formatted, ENT_NOQUOTES
) . $colorend."</td>\n";
101 echo " <tr class='text billing'>\n";
102 echo " <td>" . $colorbeg . htmlspecialchars( xl('Billing Note'), ENT_NOQUOTES
) .
103 $colorend . "</td><td>" . $colorbeg .
104 htmlspecialchars( $billing_note, ENT_NOQUOTES
) . $colorend . "</td>\n";
108 //retrieve all active notes
109 $result = getPnotesByDate("", 1, "id,date,body,user,title,assigned_to",
110 $pid, "all", 0, '', $docid);
112 if ($result != null) {
113 $notes_count = 0;//number of notes so far displayed
114 foreach ($result as $iter) {
116 if ($notes_count >= $N) {
117 //we have more active notes to print, but we've reached our display maximum
119 echo " <td colspan='3' align='center'>\n";
121 if (!$GLOBALS['concurrent_layout']) echo "target='Main' ";
122 echo "href='pnotes_full.php?active=1&docid=" .
123 htmlspecialchars( $docid, ENT_QUOTES
) .
124 "' class='alert' onclick='top.restoreSession()'>";
125 echo htmlspecialchars( xl('Some notes were not displayed.','','',' '), ENT_NOQUOTES
) .
126 htmlspecialchars( xl('Click here to view all.'), ENT_NOQUOTES
) . "</a>\n";
132 $body = $iter['body'];
133 if (preg_match('/^\d\d\d\d-\d\d-\d\d \d\d\:\d\d /', $body)) {
134 $body = nl2br(htmlspecialchars( $body, ENT_NOQUOTES
));
136 $body = htmlspecialchars( date('Y-m-d H:i', strtotime($iter['date'])), ENT_NOQUOTES
) .
137 ' (' . htmlspecialchars( $iter['user'], ENT_NOQUOTES
) . ') ' . nl2br(htmlspecialchars( $body, ENT_NOQUOTES
));
140 echo " <tr class='text noterow' id='".htmlspecialchars( $iter['id'], ENT_QUOTES
)."'>\n";
142 // Modified 6/2009 by BM to incorporate the patient notes into the list_options listings
143 echo " <td valign='top' class='bold'>";
144 echo generate_display_field(array('data_type'=>'1','list_id'=>'note_type'), $iter['title']);
147 echo " <td valign='top'>$body</td>\n";
157 </div
> <!-- end pnotes
-->
161 <script language
="javascript">
162 // jQuery stuff to make the page a little easier to use
164 $
(document
).ready(function(){
165 $
(".noterow").mouseover(function() { $
(this
).toggleClass("highlight"); });
166 $
(".noterow").mouseout(function() { $
(this
).toggleClass("highlight"); });
167 $
(".noterow").click(function() { EditNote(this
); });
170 var EditNote
= function(note
) {
171 <?php
if ( acl_check('patients', 'notes','',array('write','addonly') )): ?
>
172 top
.restoreSession();
173 <?php
if (!$GLOBALS['concurrent_layout']): ?
>
174 top
.Main
.location
.href
= "pnotes_full.php?docid=<?php echo $docid; ?>¬eid=" + note
.id +
"&active=1";
176 location
.href
= "pnotes_full.php?docid=<?php echo $docid; ?>¬eid=" + note
.id +
"&active=1";
180 alert("<?php echo htmlspecialchars( xl('You do not have access to view/edit this note'), ENT_QUOTES); ?>");