2015-02-12 15:23:08 -05:00
|
|
|
<?php
|
|
|
|
session_start();
|
|
|
|
require_once("config.inc.php");
|
2017-05-12 11:12:29 -04:00
|
|
|
require_once($yaptc_lang);
|
|
|
|
|
2015-02-20 05:16:28 -05:00
|
|
|
require_once($yaptc_inc . "functions.inc.php");
|
2015-02-12 15:23:08 -05:00
|
|
|
$yaptc_pagename = "Reports";
|
2016-02-04 14:18:34 -05:00
|
|
|
$yaptc_pageicon = '<i class="fa fa-newspaper-o"></i> ';
|
2015-02-12 15:23:08 -05:00
|
|
|
require_once($yaptc_inc . "header.inc.php");
|
2015-02-20 01:57:34 -05:00
|
|
|
if (getSessionStatus() == false):
|
2015-02-19 11:02:13 -05:00
|
|
|
killSession();
|
2015-02-20 05:16:28 -05:00
|
|
|
else: ?>
|
|
|
|
<!-- ********** BEGIN CONTENT ********** -->
|
2015-02-20 01:57:34 -05:00
|
|
|
|
2015-02-24 10:37:52 -05:00
|
|
|
<?php if ($session_user["0"]["usertype"] == "Administrator"): ?>
|
2017-05-12 00:38:26 -04:00
|
|
|
|
|
|
|
<div class="container">
|
|
|
|
<div class="page-header">
|
|
|
|
<h2><i class="glyphicon glyphicon-calendar"></i> <?php echo lang('REPORTS'); ?></h2>
|
|
|
|
</div>
|
|
|
|
<p class="lead"><?php echo lang('REPORTS_DESC'); ?></p>
|
|
|
|
|
|
|
|
<form action="reports.php" method="post">
|
2015-02-20 01:57:34 -05:00
|
|
|
<fieldset>
|
2017-05-12 00:38:26 -04:00
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-sm-6">
|
|
|
|
<select name="reporttype" class="form-control">
|
2015-02-20 01:57:34 -05:00
|
|
|
<?php if (isset($_POST['reporttype'])): ?>
|
2016-02-04 14:18:34 -05:00
|
|
|
<option value="<?php echo $_POST['reporttype']; ?>" placeholder="Report Type"><?php echo $_POST['reporttype']; ?></option>
|
2015-02-20 01:57:34 -05:00
|
|
|
<option>----------</option>
|
|
|
|
<?php else: ?>
|
|
|
|
<option></option>
|
|
|
|
<?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>
|
2015-02-24 10:37:52 -05:00
|
|
|
<option value="All Punches">All Punches</option>
|
2015-02-20 01:57:34 -05:00
|
|
|
</select>
|
|
|
|
</div>
|
2017-05-12 00:38:26 -04:00
|
|
|
<div class="col-sm-6">
|
|
|
|
<button type="submit" class="form-control btn btn-block btn-primary"><i class="glyphicon glyphicon-play"></i> Run Report</button>
|
2016-02-04 14:18:34 -05:00
|
|
|
</div>
|
2015-02-20 01:57:34 -05:00
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
</form>
|
|
|
|
|
2015-02-24 10:37:52 -05:00
|
|
|
|
2015-02-20 01:57:34 -05:00
|
|
|
<?php if (isset($_POST['reporttype'])): ?>
|
2017-05-12 00:38:26 -04:00
|
|
|
<?php if ($_POST['reporttype'] == "Hours per week per user"): ?><table class="table table-striped">
|
2015-02-24 10:37:52 -05:00
|
|
|
<thead><tr><th>Year</th><th>Week#</th><th>Name</th><th>Hours</th></tr></thead>
|
2015-02-20 01:57:34 -05:00
|
|
|
<tbody><?php foreach (reportWeeklyByUser($yaptc_db) as $row): ?>
|
2015-02-24 10:37:52 -05:00
|
|
|
<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; ?>
|
2015-02-20 01:57:34 -05:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<?php endif; ?>
|
2017-05-12 00:38:26 -04:00
|
|
|
<?php if ($_POST['reporttype'] == "Hours per month per user"): ?><table class="table table-striped">
|
2015-02-24 10:37:52 -05:00
|
|
|
<thead><tr><th>Year</th><th>Month</th><th>Name</th><th>Hours</th></tr></thead>
|
2015-02-20 01:57:34 -05:00
|
|
|
<tbody><?php foreach (reportMonthlyByUser($yaptc_db) as $row): ?>
|
2015-02-24 10:37:52 -05:00
|
|
|
<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; ?>
|
2017-05-12 00:38:26 -04:00
|
|
|
<?php if ($_POST['reporttype'] == "All Punches"): ?><table class="table table-striped">
|
2015-02-24 10:37:52 -05:00
|
|
|
<thead><tr><th>In</th><th>Out</th><th>Name</th><th>Hours</th><th>Flagged</th><th>Notes</th></tr></thead>
|
2017-05-11 13:22:44 -04:00
|
|
|
<tbody><?php foreach (listPunches($yaptc_db, "%") as $row): ?>
|
2015-02-24 10:37:52 -05:00
|
|
|
<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; ?>
|
2015-02-20 01:57:34 -05:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php else: ?>
|
|
|
|
<p>No query to display. Please select from the dropdown above...</p>
|
|
|
|
<?php endif; ?>
|
2017-05-12 00:38:26 -04:00
|
|
|
</div>
|
2015-02-23 03:09:15 -05:00
|
|
|
<?php else: ?>
|
|
|
|
<h2 class="content-subhead">NOT AUTHORIZED!</h2>
|
|
|
|
<?php endif; ?>
|
2015-02-20 01:57:34 -05:00
|
|
|
|
2015-02-20 05:16:28 -05:00
|
|
|
<!-- ********** END CONTENT ********** -->
|
|
|
|
<?php endif; require_once($yaptc_inc . "footer.inc.php"); ?>
|