Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

87 lines (72 sloc) 2.432 kB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Attendance History</title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.0r4/build/reset-fonts-grids/reset-fonts-grids.css" />
<link rel="stylesheet" type="text/css" href="index.css" >
</head>
<body id="history">
<?php
include('AttendanceSheet.class.php');
//print_r($_POST);
$date = @$_POST['date'];
$ampm = @$_POST['ampm'];
$driver = @$_POST['driver'];
$riders = @$_POST['rider'] ? $_POST['rider'] : array();
$timestamp = time();
if ($driver) {
// disabled checkboxes are often not posted
if (is_array($riders)) {
$riders[] = $driver;
}
else {
$riders = array($riders, $driver);
}
// in case the disabled checkbox was posted
$riders = array_unique($riders);
$riders = implode(',', $riders);
$record = array($date, $ampm, $timestamp, $driver, $riders);
// print_r($record);
}
$sheet = new AttendanceSheet('./attendance.csv');
if ($driver) $sheet->prependRow($record);
$count = @$_GET['count'] ? $_GET['count'] : 20;
$records = $sheet->fileToMatrix($count);
?>
<div id="hd">
<ul>
<li class="back"><a href="./index.php">Go Back</a></li>
<li class="all"><a href="./history.php?count=9999">See All</a></li>
</ul>
</div>
<div id="bd">
<table>
<thead>
<tr>
<th>Date</th>
<th>Day</th>
<th>AM/PM</th>
<th>Timestamp</th>
<th class="drivers">Driver</th>
<th class="drivers">Riders</th>
<th>Count</th>
</tr>
</thead>
<tbody>
<?php foreach ($records as $record): ?>
<tr>
<td><?php echo $record[0] ?></td>
<td><?php echo date('D', strtotime($record[0])); ?></td>
<td><?php echo $record[1] ?></td>
<td><?php echo $record[2] ?></td>
<td class="drivers"><?php echo $record[3] ?></td>
<td class="drivers"><?php echo $record[4] ?></td>
<td><?php $participants = explode(',', $record[4]); echo count($participants); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.