<?php
/*
* ConPortal - Pomona College ITS & Bucknell University ISR scheduling appplication
* Copyright (C) 2005-2007 Pomona College, Bucknell University
*
* 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('View Report of Unusual Logouts', 'punch_tracking');
echo "<h1 class='center'>Unusual Logout History</h1>\n";
$time = strtotime("-2 weeks");
$start_month = isset($_POST['start_month']) ? $_POST['start_month'] : date('n', $time);
$start_day = isset($_POST['start_day']) ? $_POST['start_day'] : date('d', $time);
$start_year = isset($_POST['start_year']) ? $_POST['start_year'] : date('Y', $time);
?>
<form method='post' action='logout_report.php'><div>
Starting on <select name='start_month' style='width: 8em'>
<? print_month_options($start_month) ?>
</select>
<select name='start_day' style='width: 3.5em'>
<? print_day_options($start_day) ?>
</select>
<select name='start_year' style='width: 4.6em'>
<? print_year_options($start_year) ?>
</select>
for <select name='length' style='width: 3.5em'>
<?
$sel = isset($_POST['length']) ? $_POST['length'] : 14;
for($i = 1; $i <= 30; ++$i) {
if ($i == $sel)
echo "<option selected='selected'>$i</option>\n";
else
echo "<option>$i</option>\n";
}
?>
</select> days.
<input type='submit' value='
<?php
echo DISPLAY_REPORT_SUBMIT;
?>
' />
</div></form>
<hr style='margin-top: 1em' />
<?
if (isset($_POST['start_year']) and (int)$_POST['start_year'] and
isset($_POST['start_month']) and (int)$_POST['start_month'] and
isset($_POST['start_day']) and (int)$_POST['start_day'] and
isset($_POST['length']) and (int)$_POST['length']) {
$start = mktime(0, 0, 0, (int)$_POST['start_month'],
(int)$_POST['start_day'], (int)$_POST['start_year']);
$end = strtotime("+".((int)$_POST['length'])." days", $start);
print_logout_report($start, $end);
}
xhtml_footer();
?>