added switch to disable user manual punch

This commit is contained in:
Josh North 2015-02-23 10:49:32 -05:00
parent 6541972a3c
commit 7c85d55315
2 changed files with 5 additions and 3 deletions

View File

@ -7,7 +7,7 @@ $yaptc_appname = 'Timecard System'; // Program name to display in
$yaptc_company = 'Widgets, Inc.'; // Your company name
$yaptc_db = new PDO('mysql:host=localhost;dbname=YOUR_DATABASE;charset=utf8', 'YOUR_USER', 'YOUR_PASSWORD'); // Database connection string
$yaptc_adminmsg = ''; // Message will display on all pages!
$yaptc_allowadvancedpunch = 'yes'; // Should we allow users to make manual punch entries? set to yes or no

View File

@ -19,7 +19,9 @@ $result = $yaptc_db->prepare("SELECT punches.id as punchid, users.id as user, pu
$result->execute();
$last = $result->fetchObject();
// Let's build the page - this is the header with current status
// Let's build the page - this is the header with current status IF allowed
if ($yaptc_allowadvancedpunch == 'yes'):
echo "<h2 class=\"content-subhead\">Advanced Punch</h2>";
if(!isset($last->user)) {
echo "<p>You do not appear to have any punches on record.</p>";
@ -92,7 +94,7 @@ header('Location: '.$_SERVER['PHP_SELF']);
// Close out the form...
echo "</fieldset>";
echo "</form>";
endif;
echo "<h2 class=\"content-subhead\">Punch History</h2>";
echo "<p>Below is your full punch history, sorted newest to oldest.</p>";