Major overhauls, added admin punch as well

This commit is contained in:
2015-02-24 10:37:52 -05:00
parent 7c85d55315
commit 65204a6c59
12 changed files with 356 additions and 764 deletions

View File

@@ -10,9 +10,9 @@ killSession();
else: ?>
<!-- ********** BEGIN CONTENT ********** -->
<?php if ($userLogged == true && $userAccess == "Administrator"): ?>
<h2 class="content-subhead">Punch History</h2>
<p>Below is your company punch history. The below drop-down can be used to select pre-configured reports. Other reports are currently being written.</p>
<?php if ($session_user["0"]["usertype"] == "Administrator"): ?>
<h2 class="content-subhead">History Reports</h2>
<p>The drop-down below can be used to select pre-configured reports. Other reports are currently being written.</p>
<form class="pure-form pure-form-stacked" action="reports.php" method="post">
<fieldset>
<div class="pure-g">
@@ -27,6 +27,7 @@ else: ?>
<?php endif; ?>
<option value="Hours per week per user">Hours per week per user</option>
<option value="Hours per month per user">Hours per month per user</option>
<option value="All Punches">All Punches</option>
</select>
</div>
</div>
@@ -34,18 +35,26 @@ else: ?>
</fieldset>
</form>
<?php if (isset($_POST['reporttype'])): ?>
<?php if ($_POST['reporttype'] == "Hours per week per user"): ?><table class="pure-table">
<thead><tr><th>Year</th><th>Week#</th><th>Username</th><th>Hours</th></tr></thead>
<thead><tr><th>Year</th><th>Week#</th><th>Name</th><th>Hours</th></tr></thead>
<tbody><?php foreach (reportWeeklyByUser($yaptc_db) as $row): ?>
<tr><td><?php echo $row['g_year']; ?></td><td><?php echo $row['g_week']; ?></td><td><?php echo $row['username']; ?></td><td><?php echo $row['punchhours']; ?></td></tr><?php endforeach; ?>
<tr><td><?php echo $row['g_year']; ?></td><td><?php echo $row['g_week']; ?></td><td><?php echo $row['lastname'] . ", " . $row['firstname']; ?></td><td><?php echo $row['punchhours']; ?></td></tr><?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php if ($_POST['reporttype'] == "Hours per month per user"): ?><table class="pure-table">
<thead><tr><th>Year</th><th>Month</th><th>Username</th><th>Hours</th></tr></thead>
<thead><tr><th>Year</th><th>Month</th><th>Name</th><th>Hours</th></tr></thead>
<tbody><?php foreach (reportMonthlyByUser($yaptc_db) as $row): ?>
<tr><td><?php echo $row['g_year']; ?></td><td><?php echo $row['g_month']; ?></td><td><?php echo $row['username']; ?></td><td><?php echo $row['punchhours']; ?></td></tr><?php endforeach; ?>
<tr><td><?php echo $row['g_year']; ?></td><td><?php echo $row['g_month']; ?></td><td><?php echo $row['lastname'] . ", " . $row['firstname']; ?></td><td><?php echo $row['punchhours']; ?></td></tr><?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php if ($_POST['reporttype'] == "All Punches"): ?><table class="pure-table">
<thead><tr><th>In</th><th>Out</th><th>Name</th><th>Hours</th><th>Flagged</th><th>Notes</th></tr></thead>
<tbody><?php foreach (listPunches($db, "%") as $row): ?>
<tr><td><?php echo $row['intime']; ?></td><td><?php echo $row['outtime']; ?></td><td><?php echo $row['lastname'] . ", " . $row['firstname']; ?></td><td><?php echo $row['punchhours']; ?></td><td><?php echo $row['modified']; ?></td><td><?php echo $row['notes']; ?></td></tr><?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>