Support for optional logging of print actions.
[openemr.git] / interface / main / calendar / modules / PostCalendar / pntemplates / default / views / month_print / ajax_template.html
blobcf6edbbca040199d0b7dfe52229d3ac1df88d07d
1 [-*Smarty*-]
2 [-*****************************************************************************-]
3 [-* Copyright (C) 2005-2006 Rod Roark <rod@sunsetsystems.com> and others *-]
4 [-* *-]
5 [-* 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 [-*****************************************************************************-]
10 [-config_load file="default.conf"-]
11 [-*Load the Language Definitions*-]
12 [-config_load file="lang.$USER_LANG"-]
13 [-include file="$TPL_NAME/views/header.html"-]
14 [-* we want to include out stylesheet for this view*-]
15 [-fetch file="$TPL_STYLE_PATH/day.css" assign="css"-]
16 [-eval var=$css-]
18 <style>
19 a {
20 text-decoration:none;
22 td {
23 font-family: Arial, Helvetica, sans-serif;
25 div.tiny { width:1px; height:1px; font-size:1px; }
26 #monthview {
27 border: 2px solid blue;
29 #dayview, #weekview {
30 cursor: pointer;
31 cursor: hand;
33 #functions {
34 width: 20%; /* can't make this 25% for some reason */
35 float: left;
36 padding: 0px 5px 0px 5px;
37 margin-right: 5%; /* added because of the width issue above */
39 #topToolbarRight {
40 float: right;
41 width: 70%;
43 #dateNAV {
44 float: left;
46 #dateDisplay {
47 float: left;
48 padding-left: 10px;
49 font-family: Arial, Helvetica, sans-serif;
51 #viewPicker {
52 float: right;
54 #datePicker {
55 width: 25%;
56 float: left;
57 position: absolute;
58 display: inline;
59 top: 50px;
60 left: 0px;
61 padding: 5px;
62 text-align: center;
63 background-color: lightblue;
65 #datePicker td {
66 font-family: Arial, Helvetica, sans-serif;
67 font-size: 0.7em;
68 /* font-size: 9pt; */
70 #bigCalHeader {
71 width: 100%;
72 text-align:center;
73 font-family: Arial, Helvetica, sans-serif;
74 font-size: 14pt;
76 #bigCal {
77 width: 100%;
78 overflow: auto;
79 background-color: lightblue;
80 position: relative;
82 #bigCal table {
83 border-collapse: collapse;
85 .pagebreak {
86 page-break-after: always;
89 /* these are for the small datepicker DIV */
90 #datePicker table {
91 border-collapse: collapse;
92 border: 3px solid lightblue;
94 #datePicker .tdDOW-small {
95 font-family: Arial, Helvetica, sans-serif;
96 font-size: 10px;
97 vertical-align: top;
98 background-color: lightblue;
99 text-align: center;
100 border: none;
101 padding: 2px 3px 2px 3px;
103 #datePicker .tdDatePicker {
104 cursor: pointer;
105 cursor: hand;
107 #datePicker .tdWeekend-small {
108 font-family: Arial, Helvetica, sans-serif;
109 font-size: 10px;
110 vertical-align: top;
111 border: none;
112 padding: 2px 3px 2px 3px;
113 background-color: #dddddd;
114 color: #999999;
117 #datePicker .tdOtherMonthDay-small {
118 font-family: Arial, Helvetica, sans-serif;
119 font-size: 10px;
120 vertical-align: top;
121 border: none;
122 padding: 2px 3px 2px 3px;
123 background-color: #ffffff;
124 color: #999999;
127 #datePicker .tdMonthName-small {
128 text-align: center;
129 font-family: Arial, Helvetica, sans-serif;
130 font-size: 12px;
131 font-style: normal
134 #datePicker .tdMonthDay-small {
135 font-family: Arial, Helvetica, sans-serif;
136 font-size: 10px;
137 vertical-align: top;
138 border: none;
139 padding: 2px 3px 2px 3px;
140 background-color: #ffffff;
142 #datePicker .currentWeek {
143 border-top: 1px solid blue;
144 border-bottom: 1px solid blue;
145 background-color: lightblue;
147 #datePicker .currentDate {
148 border: 1px solid blue;
149 background-color: blue;
150 color: lightblue;
153 /* the DIV of times */
154 #times {
155 border-right: 1px solid black;
157 #times table {
158 border-collapse: collapse;
159 width: 100%;
160 margin: 0px;
161 padding: 0px;
163 #times table td {
164 border: 0px;
165 border-top: 1px solid black;
166 margin: 0px;
167 padding: 0px;
168 font-size: 10pt;
170 .timeslot {
171 height: [-php-]echo $timeslotHeightVal.$timeslotHeightUnit;[-/php-];
172 margin: 0px;
173 padding: 0px;
175 .schedule {
176 background-color: pink;
177 vertical-align: top;
178 padding: 0px;
179 margin: 0px;
180 border: 1px solid #999999;
182 /* types of events */
183 .event_in {
184 background-color: white;
185 width: 100%;
186 z-index:1;
188 .event_out {
189 background-color: pink;
190 width: 100%;
191 z-index:1;
193 .event_appointment {
194 background-color: white;
195 z-index:2;
196 overflow: hidden;
197 width: 100%;
198 font-size: 0.8em;
199 border-bottom: 1px solid blue;
200 height: 1.4em;
202 .event_noshow {
203 background-color: pink;
204 z-index:2;
205 overflow: hidden;
206 width: 100%;
207 font-size: 0.8em;
208 border-bottom: 1px solid blue;
210 .event_reserved {
211 background-color: pink;
212 z-index:2;
213 overflow: hidden;
214 width: 100%;
215 font-size: 0.8em;
217 </style>
219 <script type="text/javascript" src="../../../library/js/jquery-1.2.2.min.js"></script>
221 [-php-]
223 // this is my proposed setting in the globals config file so we don't
224 // need to mess with altering the pn database AND the config file
225 //pnModSetVar(__POSTCALENDAR__, 'pcFirstDayOfWeek', $GLOBALS['schedule_dow_start']);
227 $A_CATEGORY =& $this->_tpl_vars['A_CATEGORY'];
228 $A_EVENTS =& $this->_tpl_vars['A_EVENTS'];
229 $providers =& $this->_tpl_vars['providers'];
230 $times =& $this->_tpl_vars['times'];
231 $interval = $this->_tpl_vars['interval'];
232 $viewtype = $this->_tpl_vars['VIEW_TYPE'];
233 $PREV_WEEK_URL = $this->_tpl_vars['PREV_WEEK_URL'];
234 $NEXT_WEEK_URL = $this->_tpl_vars['NEXT_WEEK_URL'];
235 $PREV_DAY_URL = $this->_tpl_vars['PREV_DAY_URL'];
236 $NEXT_DAY_URL = $this->_tpl_vars['NEXT_DAY_URL'];
238 $Date = postcalendar_getDate();
239 if (!isset($y)) $y = substr($Date, 0, 4);
240 if (!isset($m)) $m = substr($Date, 4, 2);
241 if (!isset($d)) $d = substr($Date, 6, 2);
243 $provinfo = getProviderInfo();
244 [-/php-]
246 [-assign var="dayname" value=$DATE|date_format:"%w"-]
247 [-assign var="day" value=$DATE|date_format:"%d"|string_format:"%1d"-]
248 [-assign var="month" value=$DATE|date_format:"%m"|string_format:"%1d"-]
249 [-assign var="year" value=$DATE|date_format:"%Y"|string_format:"%4d"-]
251 [-php-]
253 // start out without adding a pagebreak
254 $addPagebreak = false;
256 // This loops once for each provider to be displayed.
258 foreach ($providers as $provider) {
259 // output a pagebreak, if needed
260 if ($addPagebreak) { echo "<div class='pagebreak'></div>"; }
261 $addPagebreak = true;
263 echo "<div id='bigCal'>";
264 echo "<div id='bigCalHeader'>";
265 echo date('F', strtotime($Date));
266 echo "</div>";
268 $providerid = $provider['id'];
270 echo "<table border='0' cellpadding='1' cellspacing='0' width='100%'>\n";
271 echo " <tr>\n";
272 echo " <td colspan='7' style='text-align: center; background-color:#ddd;'>";
273 echo $provider['fname']." ".$provider['lname'];
274 echo "</td>\n";
275 echo " </tr>\n";
277 // output date headers
278 echo " <tr>\n";
279 $defaultDate = ""; // used when creating link for a 'new' event
280 $in_cat_id = 0; // used when creating link for a 'new' event
281 $dowCount = 0;
282 foreach ($A_EVENTS as $date => $events) {
283 if ($defaultDate == "") $defaultDate = date("Ymd", strtotime($date));
284 echo "<td align='center' style='font-size: 0.7em; width:13%'>";
285 echo date("D", strtotime($date));
286 echo "</td>";
287 if ($dowCount++ == 6) { break; }
289 echo " </tr>\n";
291 // For each day...
292 // output a TD with an inner containing DIV positioned 'relative'
293 // within that DIV we place our event DIVs using 'absolute' positioning
294 foreach ($A_EVENTS as $date => $events) {
295 $eventdate = substr($date, 0, 4) . substr($date, 5, 2) . substr($date, 8, 2);
297 $gotoURL = pnModURL(__POSTCALENDAR__,'user','view',
298 array('tplview'=>$template_view,
299 'viewtype'=>'day',
300 'Date'=> date("Ymd", strtotime($date)),
301 'pc_username'=>$pc_username,
302 'pc_category'=>$category,
303 'pc_topic'=>$topic));
305 if (date("w", strtotime($date)) == 0) { echo "<tr>"; }
306 echo "<td class='schedule'>";
307 echo "<div style='position: relative; height: 100%; width: 100%;'>\n";
308 echo "<div style='width:100%; font-size: 0.8em; text-align:right; background-color:lightgrey; padding:1px 2px 1px 2px;'>";
309 echo date("d", strtotime($date))."</div>";
311 if (count($events) == 0) { echo "&nbsp;"; }
313 foreach ($events as $event) {
314 // skip events for other providers
315 // yeah, we've got that sort of overhead here... it ain't perfect
316 if ($providerid != $event['aid']) { continue; }
318 // Omit IN and OUT events to reduce clutter in this month view
319 if (($event['catid'] == 2) || ($event['catid'] == 3)) { continue; }
321 // figure the start time and minutes (from midnight)
322 $starth = substr($event['startTime'], 0, 2);
323 $startm = substr($event['startTime'], 3, 2);
324 $eStartMin = $starth * 60 + $startm;
325 $startDateTime = strtotime($date." ".$event['startTime']);
327 // determine the class for the event DIV based on the event category
328 $evtClass = "event_appointment";
329 switch ($event['catid']) {
330 case 1: // NO-SHOW appt
331 $evtClass = "event_noshow";
332 break;
333 case 2: // IN office
334 $evtClass = "event_in";
335 break;
336 case 3: // OUT of office
337 $evtClass = "event_out";
338 break;
339 case 4: // VACATION
340 case 8: // LUNCH
341 case 11: // RESERVED
342 $evtClass = "event_reserved";
343 break;
344 default: // some appointment
345 $evtClass = "event_appointment";
346 break;
349 // now, output the event DIV
351 echo "<div class='".$evtClass."' style='background-color:".$event['catcolor'].";'>";
353 $eventid = $event['eid'];
354 $patientid = $event['pid'];
355 $commapos = strpos($event['patient_name'], ",");
356 $lname = substr($event['patient_name'], 0, $commapos);
357 $fname = substr($event['patient_name'], $commapos + 2);
358 $patient_dob = $event['patient_dob'];
359 $patient_age = $event['patient_age'];
360 $catid = $event['catid'];
361 $comment = addslashes($event['hometext']);
362 $catname = $event['catname'];
363 $title = "Age $patient_age ($patient_dob)";
365 // format the time specially
366 $displayTime = date("g", $startDateTime);
367 if (date("i", $startDateTime) == "00") {
368 $displayTime .= (date("a", $startDateTime));
370 else {
371 $displayTime .= (date(":ia", $startDateTime));
374 if ($comment && $GLOBALS['calendar_appt_style'] < 4) $title .= " " . $comment;
376 if ($catid == 4 || $catid == 8 || $catid == 11) {
377 if ($catid == 4) $catname = "VACATION";
378 else if ($catid == 8) $catname = "LUNCH";
379 else if ($catid == 11) $catname = "RESERVED";
381 $content = "<a href='javascript:oldEvt($eventdate,$eventid)'>";
382 $content .= $displayTime." ";
383 $content .= $catname;
384 if ($comment) $content .= " - $comment";
385 $content .= "</a>";
387 else {
388 // some sort of patient appointment
390 $content = "<a href='javascript:oldEvt($eventdate,$eventid)' title='$catname'>";
391 $content .= $displayTime . htmlspecialchars($event['apptstatus']) . "</a>";
392 $content .= "<a href='javascript:goPid($patientid)' title='$title'>";
393 if ($catid == 1) $content .= "<strike>";
394 $content .= htmlspecialchars($lname);
395 if ($catid == 1) $content .= "</strike>";
396 $content .= "</a>";
399 echo $content;
400 echo "</div>\n";
401 } // end EVENT loop
403 echo "</div>";
404 echo "</td>";
405 if (date("w", strtotime($date)) == 6) { echo "</tr>"; }
406 } // end date
408 echo "</table>\n";
409 echo "</div>";
410 } // end provider
412 // [-*footer*-]
413 // [-include file="$TPL_NAME/views/global/footer.html"-]
414 // [-include file="$TPL_NAME/views/footer.html"-]
416 [-/php-]
418 </body>
420 <script language='JavaScript'>
421 $(document).ready(function(){
422 var win = top.printLogPrint ? top : opener.top;
423 win.printLogPrint(window);
424 window.close();
426 </script>
429 </html>