2 include_once("../../globals.php");
3 include_once("$srcdir/pnotes.inc");
4 include_once("$srcdir/acl.inc");
9 <link rel
=stylesheet href
="<?echo $css_header;?>" type
="text/css">
12 <body
<?
echo $bottom_bg_line;?
> topmargin
='0' rightmargin
='0' leftmargin
='2'
13 bottommargin
='0' marginwidth
='2' marginheight
='0'>
16 $thisauth = acl_check('patients', 'notes');
18 $tmp = getPatientData($pid, "squad");
19 if ($tmp['squad'] && ! acl_check('squads', $tmp['squad']))
23 echo "<p>(Notes not authorized)</p>\n";
24 echo "</body>\n</html>\n";
29 <table border
='0' cellspacing
='0' cellpadding
='0' height
='100%'>
34 <?
if ($thisauth == 'write' ||
$thisauth == 'addonly') { ?
>
36 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
37 <a href
="pnotes_full.php">
39 <a href
="pnotes_full.php" target
="Main">
42 <font
class="title"><?php
xl('Notes','e'); ?
></font
><font
class=more
><?
echo $tmore;?
></font
>
51 //display all of the notes for the day, as well as others that are active from previous dates, up to a certain number, $N
54 $conn = $GLOBALS['adodb']['db'];
56 // Get the billing note if there is one.
60 $sql = "select genericname2, genericval2 " .
61 "from patient_data where pid = '$pid' limit 1";
62 $resnote = $conn->Execute($sql);
63 if($resnote && !$resnote->EOF
&& $resnote->fields
['genericname2'] == 'Billing') {
64 $billing_note = $resnote->fields
['genericval2'];
65 $colorbeg = "<font color='red'>";
69 //Display what the patient owes
70 require_once($GLOBALS['fileroot'] ."/library/classes/WSWrapper.class.php");
71 $customer_info['id'] = 0;
72 $sql = "SELECT foreign_id from integration_mapping as im LEFT JOIN patient_data as pd on im.local_id=pd.id where pd.pid = '" . $pid . "' and im.local_table='patient_data' and im.foreign_table='customer'";
73 $result = $conn->Execute($sql);
74 if($result && !$result->EOF
)
76 $customer_info['id'] = $result->fields
['foreign_id'];
79 $function['ezybiz.customer_balance'] = array(new xmlrpcval($customer_info,"struct"));
80 $ws = new WSWrapper($function);
81 if(is_numeric($ws->value
)) {
82 $formatted = sprintf('$%01.2f', $ws->value
);
84 echo " <td>$colorbeg" . "Balance Due$colorend</td><td>$colorbeg$formatted$colorend</td>\n";
90 echo " <td>$colorbeg" . "Billing Note$colorend</td><td>$colorbeg$billing_note$colorend</td>\n";
94 //retrieve all active notes
95 if ($result = getPnotesByDate("", 1, "id,date,body,user,title,assigned_to",
98 $notes_count = 0;//number of notes so far displayed
99 foreach ($result as $iter) {
101 if ($notes_count >= $N) {
102 //we have more active notes to print, but we've reached our display maximum
104 echo " <td colspan='3' align='center'>\n";
106 if (!$GLOBALS['concurrent_layout']) echo "target='Main' ";
107 echo "href='pnotes_full.php?active=1' class='alert'>";
108 echo "Some notes were not displayed. Click here to view all.</a>\n";
114 $body = $iter['body'];
115 if (preg_match('/^\d\d\d\d-\d\d-\d\d \d\d\:\d\d /', $body)) {
116 $body = nl2br($body);
118 $body = date('Y-m-d H:i', strtotime($iter['date'])) .
119 ' (' . $iter['user'] . ') ' . nl2br($body);
123 echo " <td valign='top'>\n";
124 echo " <a href='pnotes_full.php?noteid=" . $iter['id'] . "&active=1'";
125 if (!$GLOBALS['concurrent_layout']) echo " target='Main'";
126 echo " class='bold'>" . $iter['title'] . "</a>\n";
128 echo " <td valign='top'>\n";
129 echo " <font class='text'>$body</font>\n";