2 // Copyright (C) 2011 Cassian LUP <cassi.lup@gmail.com>
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, " .
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";
24 $res = sqlStatement($query, array($pid) );
27 if(sqlNumRows($res)>0)
31 while($row = sqlFetchArray($res)) {
33 $dayname = xl(date("l", strtotime($row['pc_eventDate'])));
35 $disphour = substr($row['pc_startTime'], 0, 2) +
0;
36 $dispmin = substr($row['pc_startTime'], 3, 2);
37 if ($disphour >= 12) {
39 if ($disphour > 12) $disphour -= 12;
41 if ($row['pc_hometext'] != "") {
42 $etitle = 'Comments'.": ".$row['pc_hometext']."\r\n";
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']) {
60 if (isset($res) && $res != null) {
61 if ( $count < 1 ) { echo " " . htmlspecialchars('None',ENT_NOQUOTES
); }
63 } else { // if no appts
64 echo htmlspecialchars( xl('No Appointments'),ENT_NOQUOTES
);