added switch to disable user manual punch
This commit is contained in:
parent
6541972a3c
commit
7c85d55315
@ -7,7 +7,7 @@ $yaptc_appname = 'Timecard System'; // Program name to display in
|
|||||||
$yaptc_company = 'Widgets, Inc.'; // Your company name
|
$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_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_adminmsg = ''; // Message will display on all pages!
|
||||||
|
$yaptc_allowadvancedpunch = 'yes'; // Should we allow users to make manual punch entries? set to yes or no
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,7 +19,9 @@ $result = $yaptc_db->prepare("SELECT punches.id as punchid, users.id as user, pu
|
|||||||
$result->execute();
|
$result->execute();
|
||||||
$last = $result->fetchObject();
|
$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>";
|
echo "<h2 class=\"content-subhead\">Advanced Punch</h2>";
|
||||||
if(!isset($last->user)) {
|
if(!isset($last->user)) {
|
||||||
echo "<p>You do not appear to have any punches on record.</p>";
|
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...
|
// Close out the form...
|
||||||
echo "</fieldset>";
|
echo "</fieldset>";
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
|
endif;
|
||||||
|
|
||||||
echo "<h2 class=\"content-subhead\">Punch History</h2>";
|
echo "<h2 class=\"content-subhead\">Punch History</h2>";
|
||||||
echo "<p>Below is your full punch history, sorted newest to oldest.</p>";
|
echo "<p>Below is your full punch history, sorted newest to oldest.</p>";
|
||||||
|
Loading…
Reference in New Issue
Block a user