Location: PHPKode > projects > ConPortal > conportal/show_perm.php
<?php
/*
 *  ConPortal - Pomona College ITS scheduling appplication
 *  Copyright (C) 2005-2006  Pomona College
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of version 2 of the GNU General Public License
 *  as published by the Free Software Foundation.
 *
 *  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
 */
require_once('standard.php');

xhtml_header_privileged('Permanent Shifts', 'manage_shifts');

$data = getAllShiftDetails();
$i = 0;

?>
<table id='usersTable'>
    <tr>
        <th>PID</th><th>Shift Group</th><th style='width:6em'>Start Date</th>
        <th style='width:6em'>End Date</th><th>Start Time</th><th>End Time</th>
        <th>DoW</th><th>Position</th><th>Owner</th><th>Time Taken</th>
        <th>Dropped by</th><th>Time Dropped</th>
    </tr>
<?
foreach ($data as $row) {
    $shiftgroup = getShiftgroupDetails($row['shift_group']);
    $position = getPositionDetails($row['position']);
    if ($row['owner']) {
        $user = getUserDetails($row['owner']);
        $owner = $user['name'];
    } else
        $owner = '';

    if ($row['dropper']) {
        $user = getUserDetails($row['dropper']);
        $dropper = $user['name'];
    } else
        $dropper = '';

?>
    <tr class='d<?= $i++ % 2 ?>' onmouseover='javascript:highlight(this)'
        onmouseout='javascript:unhighlight(this)'>
        <td><?= $row['pid'] ?></td><td><?= $shiftgroup['name'] ?></td>
        <td><?= date('M d Y', $row['start_date']) ?></td><td><?= date('M d Y', $row['end_date']) ?></td>
        <td><?= date('g:ia', $row['start_time']) ?></td><td><?= date('g:ia', $row['end_time']) ?></td>
        <td><?= $row['day_of_week'] ?></td><td><?= $position['name'] ?></td>
        <td><?= $owner ?>&nbsp;</td><td><?= date('M d Y g:ia', $row['time_taken']) ?>&nbsp;</td>
        <td><?= $dropper ?>&nbsp;</td><td><?= $row['time_dropped'] ?>&nbsp;</td>
    </tr>
<?
}
?>
</table>
<?
xhtml_footer();
?>
Return current item: ConPortal