mroe changes - halfway through...
This commit is contained in:
parent
ac531f3de1
commit
0084a916b8
@ -1,14 +1,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- no footer for now...
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<p class="text-muted"><?php echo lang('SERVER_TIME') . ": " . $timenow . " - - - " . lang('SOFTWARE_VERSION') . ": " . $yaptc_version; ?></p>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="<?php echo $yaptc_libweb; ?>ie10-viewport-bug-workaround.js"></script>
|
||||
<script>window.jQuery || document.write('<script src="<?php echo $yaptc_libweb; ?>jquery.min.js"><\/script>')</script>
|
||||
<script src="<?php echo $yaptc_libweb; ?>bootstrap.min.js"></script>
|
||||
-->
|
||||
|
||||
<script src="js/ie10-viewport-bug-workaround.js"></script>
|
||||
<script>window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')</script>
|
||||
<script src="js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -39,6 +39,7 @@ function lang($phrase){
|
||||
'CREATED' => 'Created',
|
||||
'MIN_PASSWORD_LENGTH' => 'Minimum password length is ',
|
||||
'USERTYPE' => 'User Type',
|
||||
'EDIT_PROFILE' => 'Edit Profile',
|
||||
'ILLEGAL_CHARACTERS' => 'Username contains illegal characters',
|
||||
'PASSWORD_NOTMATCH' => 'Passwords do not match',
|
||||
'EMAIL_NOTVALID' => 'Email address not valid',
|
||||
|
@ -6,14 +6,14 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
|
||||
<link rel="stylesheet" href="css/bootstrap.min.css"/>
|
||||
<link rel="stylesheet" href="css/font-awesome.min.css"/>
|
||||
<link rel="stylesheet" href="css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="css/animate.min.css"/>
|
||||
<link rel="stylesheet" href="css/styles.css"/>
|
||||
<link rel="stylesheet" href="css/ie10-viewport-bug-workaround.css">
|
||||
<link rel="stylesheet" href="css/sticky-footer-navbar.css">
|
||||
<!-- [if lt IE 9]>
|
||||
<script src="/js/html5shiv.js" type="text/javascript"></script>
|
||||
<script src="/js/respond.min.js" type="text/javascript"></script>
|
||||
<script src="js/html5shiv.js" type="text/javascript"></script>
|
||||
<script src="js/respond.min.js" type="text/javascript"></script>
|
||||
<![endif] -->
|
||||
<meta name="description" content="<?php echo lang('META_DESC'); ?>" />
|
||||
<title><?php echo $yaptc_company . " > " . $yaptc_appname . " > " . $yaptc_pagename; ?></title>
|
||||
|
90
index.php
90
index.php
@ -16,20 +16,6 @@ else: ?>
|
||||
<!-- ********** BEGIN CONTENT ********** -->
|
||||
|
||||
|
||||
|
||||
<!-- Begin page content -->
|
||||
<div class="container">
|
||||
<div class="page-header">
|
||||
<h2><?php echo $yaptc_pageicon; echo $yaptc_pagename; ?></h2>
|
||||
</div>
|
||||
<p class="lead"><?php if (isset($_SESSION['user_id'])): echo lang('USER') . ": " . $session_user["0"]["firstname"] . ' ' . $session_user["0"]["lastname"]; else: echo lang('PLEASE_LOG_IN'); endif; ?></p>
|
||||
<p>Back to <a href="../sticky-footer">the default sticky footer</a> minus the navbar.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
// Get punch status for buttons and times
|
||||
$session_punch = listPunches($yaptc_db, $session_user["0"]["userid"], 1);
|
||||
@ -53,8 +39,8 @@ endif;
|
||||
// Process posted data from quickpunch section
|
||||
if (isset($_POST['quickpunch'])):
|
||||
if (!empty($_POST['notes'])): $notes = $_POST['notes']; else: $notes = NULL; endif;
|
||||
if ($session_status == lang('IN')): punchOut($yaptc_db, $punchid, $notes, $timenow, NULL);
|
||||
elseif ($session_status == lang('OUT')): punchIn($yaptc_db, $_SESSION['user_id'], $notes, $timenow, NULL);
|
||||
if ($session_status == lang('IN')): punchOut($yaptc_db, $punchid, $notes, $timenow, NULL); $session_status = lang('OUT'); $session_message = lang('PUNCH_STATUS') . ": " . $session_status . " " . lang('SINCE') . " " . date('g:i a \o\n M jS, Y', strtotime($statustime)); $notes = NULL;
|
||||
elseif ($session_status == lang('OUT')): punchIn($yaptc_db, $_SESSION['user_id'], $notes, $timenow, NULL); $session_status = lang('IN'); $session_message = lang('PUNCH_STATUS') . ": " . $session_status . " " . lang('SINCE') . " " . date('g:i a \o\n M jS, Y', strtotime($statustime));
|
||||
endif;
|
||||
header('Location: ' . $_SERVER['PHP_SELF']);
|
||||
endif;
|
||||
@ -63,37 +49,75 @@ if (isset($_POST['quickpunch'])):
|
||||
if (isset($_POST['advancedpunch'])):
|
||||
if (!empty($_POST['notes'])): $notes = $_POST['notes']; else: $notes = NULL; endif;
|
||||
if (!empty($_POST['punchtime'])): $punchtime = $_POST['punchtime']; else: $punchtime = $timenow; endif;
|
||||
if ($session_status == lang('IN')): punchOut($yaptc_db, $punchid, $notes, $timenow, NULL);
|
||||
elseif ($session_status == lang('OUT')): punchIn($yaptc_db, $_SESSION['user_id'], $notes, $punchtime, NULL);
|
||||
if ($session_status == lang('IN')): punchOut($yaptc_db, $punchid, $notes, $timenow, NULL); $session_status = lang('OUT'); $session_message = lang('PUNCH_STATUS') . ": " . $session_status . " " . lang('SINCE') . " " . date('g:i a \o\n M jS, Y', strtotime($statustime)); $notes = NULL;
|
||||
elseif ($session_status == lang('OUT')): punchIn($yaptc_db, $_SESSION['user_id'], $notes, $punchtime, NULL); $session_status = lang('IN'); $session_message = lang('PUNCH_STATUS') . ": " . $session_status . " " . lang('SINCE') . " " . date('g:i a \o\n M jS, Y', strtotime($statustime));
|
||||
endif;
|
||||
header('Location: ' . $_SERVER['PHP_SELF']);
|
||||
endif;
|
||||
?>
|
||||
|
||||
// HTML
|
||||
<!-- Begin page content -->
|
||||
<div class="container">
|
||||
<div class="page-header">
|
||||
<h2><?php echo $yaptc_pageicon; echo $yaptc_pagename; ?></h2>
|
||||
</div>
|
||||
<p class="lead"><?php if (isset($_SESSION['user_id'])): echo lang('USER') . ": " . $session_user["0"]["firstname"] . ' ' . $session_user["0"]["lastname"]; else: echo lang('PLEASE_LOG_IN'); endif; ?></p>
|
||||
<p class="lead"><?php echo $session_message; ?></p>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
// HTML section for quick punch only
|
||||
if ($yaptc_allowuseradvancedpunch == "no"): ?>
|
||||
<h2 class="content-subhead"><?php echo lang('QUICK_PUNCH'); ?></h2>
|
||||
<p><?php echo $session_message; ?></p>
|
||||
<p><?php echo lang('QUICK_PUNCH_PARAGRAPH'); ?></p>
|
||||
<form class="pure-form" action="index.php" method="post">
|
||||
<fieldset>
|
||||
<input type="text" name="notes" placeholder="<?php echo lang('NOTES_PLACEHOLDER'); ?>" maxlength="255" value="<?php if (isset($notes)): echo $notes; endif; ?>" />
|
||||
<button type="submit" class="pure-button <?php if ($session_status == lang('IN')): echo "button-error"; elseif ($session_status == lang('OUT')): echo "button-success"; endif;?>" name="quickpunch"><?php if ($session_status == lang('IN')): echo '<i class="fa fa-stop-circle"></i>'; elseif ($session_status == lang('OUT')): echo '<i class="fa fa-play-circle"></i>'; endif;?></button>
|
||||
<!-- Begin page content -->
|
||||
<div class="container">
|
||||
<div class="page-header">
|
||||
<h2><i class="glyphicon glyphicon-time"></i> <?php echo lang('QUICK_PUNCH'); ?></h2>
|
||||
</div>
|
||||
<p class="lead"><?php echo lang('QUICK_PUNCH_PARAGRAPH'); ?></p>
|
||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
|
||||
<fieldset id="quickpunch">
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="notes" placeholder="<?php echo lang('NOTES_PLACEHOLDER'); ?>" maxlength="255" value="<?php if (isset($notes)): echo $notes; endif; ?>" />
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<button type="submit" class="form-control btn btn-block <?php if ($session_status == lang('IN')): echo "btn-danger"; elseif ($session_status == lang('OUT')): echo "btn-success"; endif;?>" name="quickpunch"><?php if ($session_status == lang('IN')): echo '<i class="glyphicon glyphicon-stop"></i> ' . lang('PUNCH') . ' ' . lang('OUT'); elseif ($session_status == lang('OUT')): echo '<i class="glyphicon glyphicon-play"></i> ' . lang('PUNCH') . ' ' . lang('IN'); endif;?></button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
// HTML section for advanced punch only
|
||||
elseif ($yaptc_allowuseradvancedpunch == "yes"): ?>
|
||||
<h2 class="content-subhead"><?php echo lang('ADVANCED_PUNCH'); ?></h2>
|
||||
<p><?php echo $session_message; ?></p>
|
||||
<p><?php echo lang('ADVANCED_PUNCH_PARAGRAPH'); ?></p>
|
||||
<form class="pure-form" action="index.php" method="post">
|
||||
<fieldset>
|
||||
<input type="text" name="punchtime" placeholder="<?php echo $timenow; ?>" />
|
||||
<input type="text" name="notes" placeholder="<?php echo lang('NOTES_PLACEHOLDER'); ?>" maxlength="255" value="<?php if (isset($notes)): echo $notes; endif; ?>" />
|
||||
<button type="submit" class="pure-button <?php if ($session_status == lang('IN')): echo "button-error"; elseif ($session_status == lang('OUT')): echo "button-success"; endif;?>" name="advancedpunch"><?php if ($session_status == lang('IN')): echo '<i class="fa fa-stop-circle"></i>'; elseif ($session_status == lang('OUT')): echo '<i class="fa fa-play-circle"></i>'; endif;?></button>
|
||||
<!-- Begin page content -->
|
||||
<div class="container">
|
||||
<div class="page-header">
|
||||
<h2><i class="glyphicon glyphicon-time"></i> <?php echo lang('ADVANCED_PUNCH'); ?></h2>
|
||||
</div>
|
||||
<p class="lead"><?php echo lang('ADVANCED_PUNCH_PARAGRAPH'); ?></p>
|
||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
|
||||
<fieldset id="advancedpunch">
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-3">
|
||||
<input class="form-control" type="text" name="punchtime" placeholder="<?php echo $timenow; ?>" />
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" type="text" name="notes" placeholder="<?php echo lang('NOTES_PLACEHOLDER'); ?>" maxlength="255" value="<?php if (isset($notes)): echo $notes; endif; ?>" />
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<button type="submit" class="form-control btn btn-block <?php if ($session_status == lang('IN')): echo "btn-danger"; elseif ($session_status == lang('OUT')): echo "btn-success"; endif;?>" name="advancedpunch"><?php if ($session_status == lang('IN')): echo '<i class="glyphicon glyphicon-stop"></i> ' . lang('PUNCH') . ' ' . lang('OUT'); elseif ($session_status == lang('OUT')): echo '<i class="glyphicon glyphicon-play"></i> ' . lang('PUNCH') . ' ' . lang('IN'); endif;?></button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
<!-- ********** END CONTENT ********** -->
|
||||
|
69
profile.php
69
profile.php
@ -44,45 +44,53 @@ $page_count = 0;
|
||||
if (0 === $row_count): else: $page_count = (int)ceil($row_count / $yaptc_rowsperpage); if($page_num > $page_count): $page_num = 1; endif; endif;
|
||||
?>
|
||||
|
||||
<h2 class="content-subhead"><?php echo lang('ACCOUNT_INFO_HEADER'); ?></h2>
|
||||
<p><?php echo lang('ACCOUNT_INFO_DESC') . $yaptc_min_password; ?></p>
|
||||
<form class="pure-form pure-form-stacked" action="profile.php" method="post">
|
||||
|
||||
<!-- Begin page content -->
|
||||
<div class="container">
|
||||
<div class="page-header">
|
||||
<h2><i class="glyphicon glyphicon-edit"></i> <?php echo lang('EDIT_PROFILE'); ?></h2>
|
||||
</div>
|
||||
<p class="lead"><?php echo lang('ACCOUNT_INFO_DESC') . $yaptc_min_password; ?></p>
|
||||
|
||||
|
||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
|
||||
<fieldset>
|
||||
<div class="pure-g">
|
||||
<div class="pure-u-1 pure-u-md-1-3">
|
||||
<label for="username"><?php echo lang('USERNAME'); ?></label>
|
||||
<input type="text" name="username" id="username" maxlength="50" value="<?php echo $session_user["0"]["username"]; ?>" readonly />
|
||||
<label for="created"><?php echo lang('CREATED'); ?></label>
|
||||
<input type="text" name="created" id="created" value="<?php echo $session_user["0"]["created"]; ?>" readonly />
|
||||
<label for="usertype"><?php echo lang('USERTYPE'); ?></label>
|
||||
<input type="text" name="usertype" id="usertype" maxlength="50" value="<?php echo $session_user["0"]["usertype"]; ?>" readonly />
|
||||
<div class="form-group row">
|
||||
<label for="username" class="col-sm-2 col-form-label"><?php echo lang('USERNAME'); ?></label>
|
||||
<div class="col-sm-2"><input class="form-control" type="text" name="username" id="username" maxlength="50" value="<?php echo $session_user["0"]["username"]; ?>" readonly /></div>
|
||||
<label for="created" class="col-sm-2 col-form-label"><?php echo lang('CREATED'); ?></label>
|
||||
<div class="col-sm-2"><input class="form-control" type="text" name="created" id="created" value="<?php echo $session_user["0"]["created"]; ?>" readonly /></div>
|
||||
<label for="usertype" class="col-sm-2 col-form-label"><?php echo lang('USERTYPE'); ?></label>
|
||||
<div class="col-sm-2"><input class="form-control" type="text" name="usertype" id="usertype" maxlength="50" value="<?php echo $session_user["0"]["usertype"]; ?>" readonly /></div>
|
||||
</div>
|
||||
<div class="pure-u-1 pure-u-md-1-3">
|
||||
<label for="firstname"><?php echo lang('FIRSTNAME'); ?></label>
|
||||
<input type="text" name="firstname" id="firstname" maxlength="50" value="<?php echo $session_user["0"]["firstname"]; ?>" />
|
||||
<label for="lastname"><?php echo lang('LASTNAME'); ?></label>
|
||||
<input type="text" name="lastname" id="lastname" maxlength="50" value="<?php echo $session_user["0"]["lastname"]; ?>" />
|
||||
<label for="email"><?php echo lang('EMAIL'); ?></label>
|
||||
<input type="text" name="email" id="email" maxlength="100" value="<?php echo $session_user["0"]["email"]; ?>" />
|
||||
<div class="form-group row">
|
||||
<label for="firstname" class="col-sm-2 col-form-label"><?php echo lang('FIRSTNAME'); ?></label>
|
||||
<div class="col-sm-2"><input class="form-control" type="text" name="firstname" id="firstname" maxlength="50" value="<?php echo $session_user["0"]["firstname"]; ?>" /></div>
|
||||
<label for="lastname" class="col-sm-2 col-form-label"><?php echo lang('LASTNAME'); ?></label>
|
||||
<div class="col-sm-2"><input class="form-control" type="text" name="lastname" id="lastname" maxlength="50" value="<?php echo $session_user["0"]["lastname"]; ?>" /></div>
|
||||
<label for="email" class="col-sm-2 col-form-label"><?php echo lang('EMAIL'); ?></label>
|
||||
<div class="col-sm-2"><input class="form-control" type="text" name="email" id="email" maxlength="100" value="<?php echo $session_user["0"]["email"]; ?>" /></div>
|
||||
</div>
|
||||
<div class="pure-u-1 pure-u-md-1-3">
|
||||
<label for="password"><?php echo lang('NEW') . " " . lang('PASSWORD'); ?></label>
|
||||
<input type="password" name="password" id="password" />
|
||||
<label for="newpassword2"><?php echo lang('CONFIRM') . " " . lang('NEW') . " " . lang('PASSWORD'); ?></label>
|
||||
<input type="password" name="newpassword2" id="newpassword2" />
|
||||
<div class="form-group row">
|
||||
<label for="password" class="col-sm-2 col-form-label"><?php echo lang('NEW') . " " . lang('PASSWORD'); ?></label>
|
||||
<div class="col-sm-2"><input class="form-control" type="password" name="password" id="password" /></div>
|
||||
<label for="newpassword2" class="col-sm-2 col-form-label"><?php echo lang('CONFIRM') . " " . lang('NEW') . " " . lang('PASSWORD'); ?></label>
|
||||
<div class="col-sm-2"><input class="form-control" type="password" name="newpassword2" id="newpassword2" /></div>
|
||||
<div class="col-sm-4"><button type="submit" name="saveprofile" id="saveprofile" class="form-control btn btn-block btn-primary"><?php echo lang('SAVE'); ?></button></div>
|
||||
</div>
|
||||
<div class="pure-controls pure-u-1">
|
||||
<button type="submit" name="saveprofile" id="saveprofile" class="pure-input-1 pure-button button-success "><?php echo lang('SAVE'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
<h2 class="content-subhead"><?php echo lang('PUNCH_HISTORY_HEADER'); ?></h2>
|
||||
<p><?php echo lang('PUNCH_HISTORY_DESC'); ?></p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div class="page-header">
|
||||
<h2><i class="glyphicon glyphicon-folder-open"></i> <?php echo lang('PUNCH_HISTORY_HEADER'); ?></h2>
|
||||
</div>
|
||||
<p class="lead"><?php echo lang('PUNCH_HISTORY_DESC'); ?></p>
|
||||
|
||||
<table class="pure-table pure-table-striped">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr><th colspan="4"><?php echo lang('PAGE') . ": "; for ($i = 1; $i <= $page_count; $i++): if ($i === $page_num): echo $i . ' '; else: echo '<a href="' . $_SERVER['PHP_SELF'] . '?pnum=' . $i . '">' . $i . '</a> '; endif; endfor; ?></th></tr>
|
||||
<tr><th><?php echo lang('IN') . " / " . lang('OUT'); ?></th><th><?php echo lang('HOURS'); ?></th><th><?php echo lang('FLAG'); ?></th><th><?php echo lang('NOTES'); ?></th></tr>
|
||||
@ -96,5 +104,6 @@ if (0 === $row_count): else: $page_count = (int)ceil($row_count / $yaptc_rowsper
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<!-- ********** END CONTENT ********** -->
|
||||
<?php endif; require_once($yaptc_inc . "footer.inc.php"); ?>
|
||||
|
@ -127,7 +127,7 @@ if (!empty($_POST['newuser']) && empty($errors)):
|
||||
<?php echo isset($errors['usertype']) ? $errors['usertype'] : ''; ?>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<button type="submit" class="form-control" value="Submit" name="newuser"><i class="fa fa-user-plus"></i> <?php echo lang('ADD_USER'); ?></button>
|
||||
<button type="submit" class="form-control btn btn-block btn-primary" value="Submit" name="newuser"><i class="fa fa-user-plus"></i> <?php echo lang('ADD_USER'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user