4 * Copyright (C) 2016-2017 Jerry Padgett <sjpadgett@gmail.com>
5 * Copyright (C) 2011 Cassian LUP <cassi.lup@gmail.com>
7 * LICENSE: This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
19 * @author Cassian LUP <cassi.lup@gmail.com>
20 * @author Jerry Padgett <sjpadgett@gmail.com>
21 * @link http://www.open-emr.org
24 require_once("verify_session.php");
26 $query = "SELECT e.pc_eid, e.pc_aid, e.pc_title, e.pc_eventDate, " . "e.pc_startTime, e.pc_hometext, e.pc_apptstatus, u.fname, u.lname, u.mname, " .
27 "c.pc_catname " . "FROM openemr_postcalendar_events AS e, users AS u, " .
28 "openemr_postcalendar_categories AS c WHERE " . "e.pc_pid = ? AND e.pc_eventDate >= CURRENT_DATE AND " . "u.id = e.pc_aid AND e.pc_catid = c.pc_catid " . "ORDER BY e.pc_eventDate, e.pc_startTime";
30 $res = sqlStatement($query, array (
34 if (sqlNumRows($res) > 0) {
36 echo '<table id="appttable" style="width:100%;background:#eee;" class="table table-striped fixedtable"><thead>
38 while ($row = sqlFetchArray($res)) {
40 $dayname = xl(date("l", strtotime($row ['pc_eventDate'])));
42 $disphour = substr($row ['pc_startTime'], 0, 2) +
0;
43 $dispmin = substr($row ['pc_startTime'], 3, 2);
44 if ($disphour >= 12) {
51 if ($row ['pc_hometext'] != "") {
52 $etitle = 'Comments' . ": " . $row ['pc_hometext'] . "\r\n";
58 echo "<a href='#' onclick='editAppointment(0," . htmlspecialchars($row ['pc_eid'], ENT_QUOTES
) . ')' . "' title='" . htmlspecialchars($etitle, ENT_QUOTES
) . "'>";
59 echo "<b>" . htmlspecialchars($dayname . ", " . $row ['pc_eventDate'], ENT_NOQUOTES
) . "</b><br>";
60 echo htmlspecialchars("$disphour:$dispmin " . $dispampm . " " . $row ['pc_catname'], ENT_NOQUOTES
) . "<br>";
61 echo htmlspecialchars($row ['fname'] . " " . $row ['lname'], ENT_NOQUOTES
) . "<br>";
62 echo htmlspecialchars("Status: " . $row ['pc_apptstatus'], ENT_NOQUOTES
);
63 echo "</a></p></td></tr>";
66 if (isset($res) && $res != null) {
68 echo " " . xlt('None');
71 } else { // if no appts
72 echo xlt('No Appointments');
75 echo '</tbody></table>';
77 <div style
='margin: 5px 0 5px'>
78 <a href
='#' onclick
="editAppointment('add',<?php echo attr($pid); ?>)"><button
79 class='btn btn-primary pull-right'><?php
echo xlt('Schedule New Appointment'); ?
></button
></a
>
82 function editAppointment(mode
,deid
){
84 var title
= '<?php echo xla('Request
New Appointment
'); ?>';
85 var mdata
= {pid
:deid
};
88 var title
= '<?php echo xla('Edit Appointment
'); ?>';
89 var mdata
= {eid
:deid
};
93 { text
: '<?php echo xla('Cancel
'); ?>', close
: true, style
: 'default' },
94 //{ text: 'Print', close: false, style: 'success', click: showCustom }
97 url
: './add_edit_event_user.php',
102 .then(function () { });