MAJOR updatesgit add --all

This commit is contained in:
2015-02-25 16:01:50 -05:00
parent e54b722bf5
commit 73c7c17219
12 changed files with 285 additions and 429 deletions

View File

@@ -1,8 +1,9 @@
</div>
<div class="header">
<h2><?php echo lang('SERVER_TIME') . ": " . $timenow; ?></h2>
</div>
</div>
<script src="<?php echo $yaptc_libweb; ?>ui.js"></script>
</body>
</div>
<div class="header">
<h2><?php echo lang('SERVER_TIME') . ": " . $timenow . " - - - " . lang('SOFTWARE_VERSION') . ": " . $yaptc_version; ?></h2>
</div>
</div>
</div>
<script src="<?php echo $yaptc_libweb; ?>ui.js"></script>
</body>
</html>

View File

@@ -3,15 +3,65 @@
// Languages
function lang($phrase){
static $lang = array(
'ACCOUNT_INFO_HEADER' => 'Account Information',
'ACCOUNT_INFO_DESC' => 'You may make changes to your user profile below. To change your password, enter a new password twice below and press save. Minimum password length is ',
'USER_LIST_HEADER' => 'User List',
'USER_LIST_DESC' => 'Delete or Punch users from the actions column. Eventually, password resets will also be enabled.',
'PUNCH_HISTORY_HEADER' => 'Punch History',
'PUNCH_HISTORY_DESC' => 'The following is your entire punch history, most recent first.',
'NO_PUNCHES' => 'You have no recorded punches',
'NOT_AUTHORIZED' => 'Not Authorized!',
'OUT' => 'Out',
'IN' => 'In',
'ADD_USER' => 'Add User',
'ADD_USER_DESC' => 'All fields are required! Username and email must be unique. Minimum password length is ',
'HOURS' => 'Hours',
'FLAG' => 'Flag',
'NOTES' => 'Notes',
'HOME' => 'Home',
'LOGIN' => 'Login',
'LOGOUT' => 'Logout',
'ACCOUNT' => 'Account',
'META_DESC' => 'YAPTC Timecard system is a time recording application for small businesses.',
'USERS' => 'Manage Users',
'SAVE' => 'Save',
'NEW' => 'New',
'NAME' => 'Name',
'CONFIRM' => 'Confirm',
'PUNCH' => 'Punch',
'NOTES_PLACEHOLDER' => 'Enter notes if needed',
'USERNAME' => 'Username',
'DELETE_WARNING' => '********* WARNING! ********** Are you SURE you want to DELETE this user AND ALL ASSOCIATED PUNCHES!?!? There is NO UNDO!',
'ACTIONS' => 'Actions',
'CREATED' => 'Created',
'MIN_PASSWORD_LENGTH' => 'Minimum password length is ',
'USERTYPE' => 'User Type',
'ILLEGAL_CHARACTERS' => 'Username contains illegal characters',
'PASSWORD_NOTMATCH' => 'Passwords do not match',
'EMAIL_NOTVALID' => 'Email address not valid',
'USERNAME_NOTEMPTY' => 'Username cannot be empty',
'PASSWORD_NOTEMPTY' => 'Password cannot be empty',
'USERNAME_USED' => 'Username already in use',
'EMAIL_USED' => 'Email already in use',
'PASSWORD_NOTCONFIRMED' => 'Password must be confirmed',
'PASSWORD' => 'Password',
'USER' => 'User',
'FIRSTNAME' => 'First Name',
'LASTNAME' => 'Last Name',
'EMAIL' => 'E-Mail',
'USER_INFORMATION' => 'User Information',
'PUNCH_EDITOR' => 'Punch Edit',
'PLEASE_LOG_IN' => 'Please log in to use the timecard system',
'REPORTS' => 'Reports',
'SINCE' => 'since',
'PUNCH_STATUS' => 'Punch Status',
'SERVER_TIME' => 'Server Time',
'QUICK_PUNCH_PARAGRAPH' => 'Click below to immediately punch your time. You may enter notes for your administrator to review.',
'ADVANCED_PUNCH_PARAGRAPH' => 'Click the punch button to immediately punch your time. You may also make changes to the defaults. Note that changing the punch time will result in a flag on the punch for your administrator to review.',
'YOU_HAVE_BEEN_PUNCHED' => 'You have been punched',
'QUICK_PUNCH' => 'Quick Punch'
'QUICK_PUNCH' => 'Quick Punch',
'SOFTWARE_VERSION' => 'Software Version',
'ADVANCED_PUNCH' => 'Advanced Punch'
);
return $lang[$phrase];
}
@@ -20,6 +70,9 @@ function lang($phrase){
// Current Time
$timenow = date('Y-m-d H:i:s');
// This Version
$yaptc_version = 'yaptc 0.8-beta';
// Get user list for users management page
function listUsers($yaptc_db) {
$stmt = $yaptc_db->query("SELECT users.id as userid, users.username as username, users.email as email, users.created as created, users.firstname as firstname, users.lastname as lastname, users.usertype as usertypeid, usertypes.typename as usertype

View File

@@ -1,28 +1,27 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="YAPTC Timecard system is a time recording application for small businesses.">
<title><?php echo $yaptc_company . ">" . $yaptc_appname . ">" . $yaptc_pagename; ?></title>
<link rel="stylesheet" href="<?php echo $yaptc_libweb; ?>pure/pure.css">
<!--[if lte IE 8]>
<link rel="stylesheet" href="<?php echo $yaptc_incweb; ?>side-menu-old-ie.css">
<![endif]-->
<!--[if gt IE 8]><!-->
<link rel="stylesheet" href="<?php echo $yaptc_incweb; ?>side-menu.css">
<!--<![endif]-->
<!--[if lte IE 8]>
<link rel="stylesheet" href="<?php echo $yaptc_libweb; ?>pure/grids-responsive-old-ie-min.css">
<![endif]-->
<!--[if gt IE 8]><!-->
<link rel="stylesheet" href="<?php echo $yaptc_libweb; ?>pure/grids-responsive-min.css">
<!--<![endif]-->
</head>
<body>
<html lang="<?php echo $yaptc_language; ?>">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="<?php echo lang('META_DESC'); ?>" />
<title><?php echo $yaptc_company . " > " . $yaptc_appname . " > " . $yaptc_pagename; ?></title>
<link rel="stylesheet" href="<?php echo $yaptc_libweb; ?>pure/pure.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="<?php echo $yaptc_incweb; ?>side-menu-old-ie.css" />
<![endif]-->
<!--[if gt IE 8]>
<!-->
<link rel="stylesheet" href="<?php echo $yaptc_incweb; ?>side-menu.css" />
<!--
<![endif]-->
<!--[if lte IE 8]>
<link rel="stylesheet" href="<?php echo $yaptc_libweb; ?>pure/grids-responsive-old-ie-min.css" />
<![endif]-->
<!--[if gt IE 8]>
<!-->
<link rel="stylesheet" href="<?php echo $yaptc_libweb; ?>pure/grids-responsive-min.css" />
<!--
<![endif]-->
</head>
<body>
<div id="layout">

View File

@@ -1,62 +1,35 @@
<div id="layout">
<!-- Menu toggle -->
<a href="#menu" id="menuLink" class="menu-link">
<!-- Hamburger icon -->
<span></span>
</a>
<div id="menu">
<div class="pure-menu pure-menu-open">
<a class="pure-menu-heading" href="index.php"><?php echo $yaptc_company; ?></a>
<ul>
<?php
// Get logged-in user's profile information
$session_user = getUserInfo($db, $_SESSION['user_id']);
<?php
if (isset($_SESSION['user_id'])): $session_user = getUserInfo($db, $_SESSION['user_id']); endif;
$session_status = getSessionStatus();
// Menu Setup
// For logged-out users
if ($session_status == false):
echo '<li'; if ($yaptc_pagename=='Login') {echo ' class="pure-menu-selected">';} else {echo '>';} echo '<a href="login.php">Login</a></li>';
// For logged-in users, depending on access
elseif ($session_status == true):
// Home
echo '<li'; if ($yaptc_pagename=='Home'): echo ' class="pure-menu-selected">'; else: echo '>'; endif; echo '<a href="index.php">Home</a></li>';
// Profile Menu
echo '<li'; if ($yaptc_pagename=='Profile'): echo ' class="pure-menu-selected">'; else: echo '>'; endif; echo '<a href="profile.php">Profile</a></li>';
// Punch Log Menu
echo '<li'; if ($yaptc_pagename=='Punch Log'): echo ' class="pure-menu-selected">'; else: echo '>'; endif; echo '<a href="punchlog.php">Punch Log</a></li>';
// Users Menu
if ($session_user["0"]["usertype"] == "Administrator"):
echo '<li'; if ($yaptc_pagename=='Users'): echo ' class="pure-menu-selected">'; else: echo '>'; endif; echo '<a href="users.php">Users</a></li>';
endif;
// Manual Punch
if ($session_user["0"]["usertype"] == "Administrator"):
echo '<li'; if ($yaptc_pagename=='Manual Punch'): echo ' class="pure-menu-selected">'; else: echo '>'; endif; echo '<a href="manualpunch.php">Manual Punch</a></li>';
endif;
// Reports Menu
if ($session_user["0"]["usertype"] == "Administrator"):
echo '<li'; if ($yaptc_pagename=='Reports'): echo ' class="pure-menu-selected">'; else: echo '>'; endif; echo '<a href="reports.php">Reports</a></li>';
endif;
// Logout Menu
echo '<li'; if ($yaptc_pagename=='Logout'): echo ' class="pure-menu-selected">'; else: echo '>'; endif; echo '<a href="logout.php">Logout</a></li>';
endif;
?>
</ul>
</div>
</div>
<div id="main">
<div class="header">
<h1><?php echo $yaptc_pagename; ?></h1>
<h2><?php if (isset($_SESSION['user_id'])): echo "User: " . $session_user["0"]["firstname"] . ' ' . $session_user["0"]["lastname"]; else: echo "Please log in to use the timecard system"; endif; ?></h2>
<h4><?php if (!empty($adminmessage)): echo "<div class=\"adminmessage\">" . $adminmessage . "</div>"; endif; ?></h4>
</div>
<div class="content">
<!-- SIDE MENU -->
<a href="#menu" id="menuLink" class="menu-link"><span></span></a>
<div id="menu">
<div class="pure-menu pure-menu-open">
<a class="pure-menu-heading" href="index.php"><?php echo $yaptc_company; ?></a>
<ul>
<?php if ($session_status == false): ?>
<!-- MENU FOR ALL LOGGED OUT -->
<li class="<?php if ($yaptc_pagename==lang('LOGIN')): echo "pure-menu-selected"; endif; ?>"><a href="login.php"><?php echo lang('LOGIN'); ?></a></li>
<?php elseif ($session_status == true): ?>
<!-- MENU FOR ALL LOGGED IN -->
<li class="<?php if ($yaptc_pagename==lang('HOME')): echo "pure-menu-selected"; endif; ?>"><a href="index.php"><?php echo lang('HOME'); ?></a></li>
<li class="<?php if ($yaptc_pagename==lang('ACCOUNT')): echo "pure-menu-selected"; endif; ?>"><a href="profile.php"><?php echo lang('ACCOUNT'); ?></a></li>
<?php if ($session_user["0"]["usertype"] == "Administrator"): ?>
<!-- ADDITIONAL MENU IF LOGGED IN AS ADMIN -->
<li class="<?php if ($yaptc_pagename==lang('USERS')): echo "pure-menu-selected"; endif; ?>"><a href="users.php"><?php echo lang('USERS'); ?></a></li>
<li class="<?php if ($yaptc_pagename==lang('PUNCH_EDITOR')): echo "pure-menu-selected"; endif; ?>"><a href="manualpunch.php"><?php echo lang('PUNCH_EDITOR'); ?></a></li>
<li class="<?php if ($yaptc_pagename==lang('REPORTS')): echo "pure-menu-selected"; endif; ?>"><a href="reports.php"><?php echo lang('REPORTS'); ?></a></li>
<?php endif; ?>
<!-- MENU FOR ALL LOGGED IN - BOTTOM END -->
<li class="<?php if ($yaptc_pagename==lang('LOGOUT')): echo "pure-menu-selected"; endif; ?>"><a href="logout.php"><?php echo lang('LOGOUT'); ?></a></li>
<?php endif; ?>
</ul>
</div>
</div>
<div id="main">
<div class="header">
<h1><?php echo $yaptc_pagename; ?></h1>
<h2><?php if (isset($_SESSION['user_id'])): echo lang('USER') . ": " . $session_user["0"]["firstname"] . ' ' . $session_user["0"]["lastname"]; else: echo lang('PLEASE_LOG_IN'); endif; ?></h2>
</div>
<div class="content">

View File

@@ -38,19 +38,19 @@ body {
line-height:1em;
}
.header {
margin:.25em 0 0 0;
margin:.25em 0 1em 0;
color:#333;
padding:.0;
padding:0;
border-bottom:2px solid #eee;
}
.header h1 {
margin:0;
margin:.25em 0 0 0;
font-size:2em;
font-weight:300;
padding:0;
}
.header h2 {
margin:0;
margin:.25em 0 0 0;
font-size:1em;
font-weight:300;
padding:0;
@@ -63,7 +63,7 @@ body {
font-size:1.5em;
}
.content p {
margin:.25em 0 1em 0;
margin:.25em 0 0 0;
font-weight:300;
color: #888;
font-size:1em;