diff --git a/reports.php b/reports.php index cb3a299..f259303 100755 --- a/reports.php +++ b/reports.php @@ -35,7 +35,7 @@ if ($_POST['reporttype'] == "Hours per week per user") { $query = "SELECT YEAR(punches.intime) AS g_year, WEEK(punches.intime) AS g_week, -SUM(TIME_TO_SEC(TIMEDIFF(punches.outtime, punches.intime))/3600) AS punchhours, +ROUND(SUM(TIME_TO_SEC(TIMEDIFF(punches.outtime, punches.intime))/3600),2) AS punchhours, punches.id as punchid, users.id as user, users.username as username, @@ -79,8 +79,8 @@ echo ''; elseif ($_POST['reporttype'] == "Hours per month per user") { $query = "SELECT YEAR(punches.intime) AS g_year, -MONTH(punches.intime) AS g_month, -SUM(TIME_TO_SEC(TIMEDIFF(punches.outtime, punches.intime))/3600) AS punchhours, +MONTHNAME(punches.intime) AS g_month, +ROUND(SUM(TIME_TO_SEC(TIMEDIFF(punches.outtime, punches.intime))/3600),2) AS punchhours, punches.id as punchid, users.id as user, users.username as username, diff --git a/users.php b/users.php index 3f7e7a1..47b7f8b 100755 --- a/users.php +++ b/users.php @@ -13,7 +13,7 @@ echo "
Use the following form to add users to the system. Passwords must be 8+ characters. Email must be filled out, and username must be unique.
"; require_once($yaptc_lib . "phpass-0.3/PasswordHash.php"); -if (!empty($_POST)) +if (!empty($_POST['newuser'])) { if (empty($_POST['username'])) { @@ -97,7 +97,7 @@ if (!empty($_POST)) * If the form has been submitted and no errors were detected, we can proceed * to account creation. */ -if (!empty($_POST) && empty($errors)) +if (!empty($_POST['newuser']) && empty($errors)) { /** * Hash password before storing in database @@ -177,17 +177,34 @@ if (!empty($_POST) && empty($errors)) - + -