2 [-*****************************************************************************-]
3 [-* Copyright (C)
2005-
2006 Rod Roark
<rod@sunsetsystems.com
> and others *-]
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"-]
23 font-family: Arial, Helvetica, sans-serif;
25 div.tiny { width:
1px; height:
1px; font-size:
1px; }
27 border:
2px solid blue;
34 width:
20%; /* can't make this
25% for some reason */
36 padding:
0px
5px
0px
5px;
37 margin-right:
5%; /* added because of the width issue above */
49 font-family: Arial, Helvetica, sans-serif;
63 background-color: lightblue;
66 font-family: Arial, Helvetica, sans-serif;
73 font-family: Arial, Helvetica, sans-serif;
79 background-color: lightblue;
83 border-collapse: collapse;
86 page-break-after: always;
89 /* these are for the small datepicker DIV */
91 border-collapse: collapse;
92 border:
3px solid lightblue;
94 #datePicker .tdDOW-small {
95 font-family: Arial, Helvetica, sans-serif;
98 background-color: lightblue;
101 padding:
2px
3px
2px
3px;
103 #datePicker .tdDatePicker {
107 #datePicker .tdWeekend-small {
108 font-family: Arial, Helvetica, sans-serif;
112 padding:
2px
3px
2px
3px;
113 background-color: #dddddd;
117 #datePicker .tdOtherMonthDay-small {
118 font-family: Arial, Helvetica, sans-serif;
122 padding:
2px
3px
2px
3px;
123 background-color: #ffffff;
127 #datePicker .tdMonthName-small {
129 font-family: Arial, Helvetica, sans-serif;
134 #datePicker .tdMonthDay-small {
135 font-family: Arial, Helvetica, sans-serif;
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;
153 /* the DIV of times */
155 border-right:
1px solid black;
158 border-collapse: collapse;
165 border-top:
1px solid black;
171 height: [-php-]echo $timeslotHeightVal.$timeslotHeightUnit;[-/php-];
176 background-color: pink;
180 border:
1px solid #
999999;
182 /* types of events */
184 background-color: white;
189 background-color: pink;
194 background-color: white;
199 border-bottom:
1px solid blue;
203 background-color: pink;
208 border-bottom:
1px solid blue;
211 background-color: pink;
219 <script type=
"text/javascript" src=
"../../../library/js/jquery-1.2.2.min.js"></script>
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();
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"-]
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));
268 $providerid = $provider['id'];
270 echo
"<table border='0' cellpadding='1' cellspacing='0' width='100%'>\n";
272 echo
" <td colspan='7' style='text-align: center; background-color:#ddd;'>";
273 echo $provider['fname'].
" ".$provider['lname'];
277 // output date headers
279 $defaultDate =
""; // used when creating link for a 'new' event
280 $in_cat_id =
0; // used when creating link for a 'new' event
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));
287 if ($dowCount++ ==
6) { break; }
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,
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
" "; }
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";
334 $evtClass =
"event_in";
336 case
3: // OUT of office
337 $evtClass =
"event_out";
342 $evtClass =
"event_reserved";
344 default: // some appointment
345 $evtClass =
"event_appointment";
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));
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";
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>";
405 if (date(
"w", strtotime($date)) ==
6) { echo
"</tr>"; }
413 // [-include
file=
"$TPL_NAME/views/global/footer.html"-]
414 // [-include
file=
"$TPL_NAME/views/footer.html"-]
420 <script language='JavaScript'
>
421 $(document
).ready(function(){
422 var win
= top
.printLogPrint
? top
: opener
.top
;
423 win
.printLogPrint(window
);