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) {
49 if ($row ['pc_hometext'] != "") {
50 $etitle = 'Comments' . ": " . $row ['pc_hometext'] . "\r\n";
55 echo "<a href='#' onclick='editAppointment(0," . htmlspecialchars ( $row ['pc_eid'], ENT_QUOTES
) . ')' . "' title='" . htmlspecialchars ( $etitle, ENT_QUOTES
) . "'>";
56 echo "<b>" . htmlspecialchars ( $dayname . ", " . $row ['pc_eventDate'], ENT_NOQUOTES
) . "</b><br>";
57 echo htmlspecialchars ( "$disphour:$dispmin " . $dispampm . " " . $row ['pc_catname'], ENT_NOQUOTES
) . "<br>";
58 echo htmlspecialchars ( $row ['fname'] . " " . $row ['lname'], ENT_NOQUOTES
) . "<br>";
59 echo htmlspecialchars ( "Status: " . $row ['pc_apptstatus'] , ENT_NOQUOTES
);
60 echo "</a></p></td></tr>";
63 if (isset ( $res ) && $res != null) {
65 echo " " . xlt('None');
68 } else { // if no appts
69 echo xlt('No Appointments');
71 echo '</tbody></table>';
73 <div style
='margin: 5px 0 5px'>
74 <a href
='#' onclick
="editAppointment('add',<?php echo attr($pid); ?>)"><button
75 class='btn btn-primary pull-right'><?php
echo xlt('Schedule New Appointment'); ?
></button
></a
>
78 function editAppointment(mode
,deid
){
80 var title
= '<?php echo xla('Request
New Appointment
'); ?>';
81 var mdata
= {pid
:deid
};
84 var title
= '<?php echo xla('Edit Appointment
'); ?>';
85 var mdata
= {eid
:deid
};
89 { text
: '<?php echo xla('Cancel
'); ?>', close
: true, style
: 'default' },
90 //{ text: 'Print', close: false, style: 'success', click: showCustom }
93 url
: './add_edit_event_user.php',
98 .then(function () { });