Centralized formatting.inc.php include
[openemr.git] / interface / main / onotes / office_comments.php
blob79d4f4ec164ff781dca5d2c792c9f15dc1cc1d6b
1 <?php
2 /**
3 * Viewing of office notes.
5 * LICENSE: This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
16 * @package OpenEMR
17 * @author Brady Miller <brady@sparmy.com>
18 * @link http://www.open-emr.org
21 include_once("../../globals.php");
23 //display all of the notes for the day, as well as others that are active from previous dates, up to a certain number, $N
24 $N = 10;
26 $oNoteService = new \services\ONoteService();
29 <html>
30 <head>
32 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
33 <link rel="stylesheet" href="<?php echo $GLOBALS['assets_static_relative'] ?>/bootstrap-3-3-4/dist/css/bootstrap.min.css">
34 <?php if ($_SESSION['language_direction'] == 'rtl') { ?>
35 <link rel="stylesheet" href="<?php echo $GLOBALS['assets_static_relative'] ?>/bootstrap-rtl-3-3-4/dist/css/bootstrap-rtl.min.css">
36 <?php } ?>
38 <script src="<?php echo $GLOBALS['assets_static_relative'] ?>/jquery-min-1-11-1/index.js"></script>
39 <script src="<?php echo $GLOBALS['assets_static_relative'] ?>/bootstrap-3-3-4/dist/js/bootstrap.min.js"></script>
40 </head>
41 <body class="body_top">
43 <div id="officenotes_list">
44 <a href="office_comments_full.php" onclick='top.restoreSession()'>
45 <font class="title"><?php echo xlt('Office Notes'); ?></font>
46 <font class="more"><?php echo text($tmore);?></font></a>
48 <br>
50 <table border=0 width=100%>
52 <?php
54 $notes = $oNoteService->getNotes(1, 0, ($N + 1));
56 //retrieve all active notes
57 if($notes) {
59 $notes_count = 0;//number of notes so far displayed
60 foreach ($notes as $note) {
61 if ($notes_count >= $N) {
62 //we have more active notes to print, but we've reached our display maximum (defined at top of this file)
63 $notice = '';
64 $notice .= '<div class="alert alert-info">';
65 $notice .= ' <a href=\'office_comments_full.php?active=-1\' onclick=\'top.restoreSession()\'>'.xlt("Some office notes were not displayed. Click here to view all.").'</a>';
66 $notice .= '</div>';
67 print $notice;
68 break;
71 $date = $note->getDate()->format('Y-m-d');
72 $date = oeFormatShortDate($date);
74 $todaysDate = new DateTime();
75 if ($todaysDate->format('Y-m-d') == $date) {
76 $date_string = xl("Today") . ", " . $date;
77 } else {
78 $date_string = $date;
81 $card = '';
82 $card .= '<div class="panel panel-default">';
83 $card .= ' <div class="panel-heading">';
84 $card .= ' <h3 class="panel-title">'.text($date_string).' <strong>('.text($note->getUser()->getUsername()).')</strong></h3>';
85 $card .= ' </div>';
86 $card .= ' <div class="panel-body">';
87 $card .= text($note->getBody());
88 $card .= ' </div>';
89 $card .= '</div>';
91 print $card;
93 $notes_count++;
99 </table>
100 </div>
102 </body>
103 </html>