Problem management fix for Fee Sheet Justify Search and syntax error fix in code_set_...
[openemr.git] / patients / get_appointments.php
blob9b1c3b3560becce969753c41bb582a6cce8f52b2
1 <?php
2 // Copyright (C) 2011 Cassian LUP <cassi.lup@gmail.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
10 require_once("verify_session.php");
13 $query = "SELECT e.pc_eid, e.pc_aid, e.pc_title, e.pc_eventDate, " .
14 "e.pc_startTime, e.pc_hometext, u.fname, u.lname, u.mname, " .
15 "c.pc_catname " .
16 "FROM openemr_postcalendar_events AS e, users AS u, " .
17 "openemr_postcalendar_categories AS c WHERE " .
18 "e.pc_pid = ? AND e.pc_eventDate >= CURRENT_DATE AND " .
19 "u.id = e.pc_aid AND e.pc_catid = c.pc_catid " .
20 "ORDER BY e.pc_eventDate, e.pc_startTime";
22 //echo $query;
24 $res = sqlStatement($query, array($pid) );
26 //echo "test";
27 if(sqlNumRows($res)>0)
29 $count = 0;
31 while($row = sqlFetchArray($res)) {
32 $count++;
33 $dayname = xl(date("l", strtotime($row['pc_eventDate'])));
34 $dispampm = "am";
35 $disphour = substr($row['pc_startTime'], 0, 2) + 0;
36 $dispmin = substr($row['pc_startTime'], 3, 2);
37 if ($disphour >= 12) {
38 $dispampm = "pm";
39 if ($disphour > 12) $disphour -= 12;
41 if ($row['pc_hometext'] != "") {
42 $etitle = 'Comments'.": ".$row['pc_hometext']."\r\n";
43 } else {
44 $etitle = "";
46 if ($GLOBALS['portal_onsite_appt_modify']) {
47 echo "<a href='add_edit_event_user.php?eid=" . htmlspecialchars($row['pc_eid'],ENT_QUOTES) .
48 "' class='edit_event iframe' title='" . htmlspecialchars($etitle,ENT_QUOTES) . "'>";
50 echo "<b>" . htmlspecialchars($dayname . ", " . $row['pc_eventDate'],ENT_NOQUOTES) . "</b><br>";
51 echo htmlspecialchars("$disphour:$dispmin " . $dispampm . " " . $row['pc_catname'],ENT_NOQUOTES) . "<br>\n";
52 echo htmlspecialchars($row['fname'] . " " . $row['lname'],ENT_NOQUOTES);
53 if ($GLOBALS['portal_onsite_appt_modify']) {
54 echo "</a><br>\n";
56 else {
57 echo "<br>\n";
60 if (isset($res) && $res != null) {
61 if ( $count < 1 ) { echo "&nbsp;&nbsp;" . htmlspecialchars('None',ENT_NOQUOTES); }
63 } else { // if no appts
64 echo htmlspecialchars( xl('No Appointments'),ENT_NOQUOTES);