-
Notifications
You must be signed in to change notification settings - Fork 1
/
viewSched.php
81 lines (75 loc) · 2.58 KB
/
viewSched.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php require_once('common.php');
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// $Id: viewSched.php,v 1.7 2005/10/30 22:37:19 atrommer Exp $
checkUser($_SESSION['USERTYPE'], 2);
if (empty($_REQUEST['user'])){ // keep people from navigating here directly
accessDenied("Please choose a user first.");
}
$oEmp = getUserVals($_REQUEST['user']);
if (empty($oEmp)){ // this would happen if they arbitrarily typed in a num in the url
accessDenied("You selected an invalid user!");
}
if (!$_REQUEST['doPop']){
doHeader("Viewing $oEmp->user_first $oEmp->user_last's schedule");
} else {
?>
<html>
<head>
<title>Viewing <?=$oEmp->user_first .' '. $oEmp->user_last ?>'s schedule</title>
<link href="global.css" rel="stylesheet" type="text/css">
</head>
<body>
<?
}
?>
Displaying availibility for <? print $oEmp->user_first . " " . $oEmp->user_last; ?>:<br>
<?
// draw day grid
print "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=center><tr>";
for ($iDay=0; $iDay<7; $iDay++){
print "<tr><td class=contactInfoName align=center>" . $gaDOW[$iDay] . "</td></tr>";
$oEmpAvail = getAvail($_REQUEST['user'], $iDay);
if (count($oEmpAvail)){
foreach ($oEmpAvail as $Block){
print "<tr><td>" . date("g:ia", strtotime($Block->avail_start)) . " - ";
print date("g:ia", strtotime($Block->avail_end)) . "</td></tr>";
}
} else { print "<tr><td><i>Not Available</i></td></tr>"; }
next($gaDOW);
}
print "</tr></table>";
?>
<hr>
Days requested off:
<br>
<?
$oDaysOff = getDayOff($_REQUEST['user']);
if (!count($oDaysOff)){
print "<br><i>No days requested off</i><br>";
}
foreach ($oDaysOff as $Day){ ?>
<table width="100%" border="0" cellpadding="2" class="contactInfo">
<tr>
<td class="contactInfoName"><? print(date("D, n/d/y", strtotime($Day->day_start))) ?>
thru <? print(date("D, n/d/y", strtotime($Day->day_end))) ?></td>
</tr>
<tr><td><?=$Day->day_desc ?></td></tr>
</table>
<hr>
<? } ?>
<?doFooter();
?>