diff --git a/include_header_stats.html b/include_header_stats.html new file mode 100644 index 0000000..a4cc175 --- /dev/null +++ b/include_header_stats.html @@ -0,0 +1,39 @@ + + + + + + + +YBDB + + + + + + + + + + + + + + + +
Current Shop | All Shops | Add/Edit Contact | Statistics | Transaction Log | PS Home
diff --git a/stats/stats_MechanicOperationMetrics_byMonth.php b/stats/stats_MechanicOperationMetrics_byMonth.php index 7f61696..d3eb0e6 100644 --- a/stats/stats_MechanicOperationMetrics_byMonth.php +++ b/stats/stats_MechanicOperationMetrics_byMonth.php @@ -23,7 +23,7 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> - + diff --git a/stats/stats_MechanicOperationMetrics_byWeek.php b/stats/stats_MechanicOperationMetrics_byWeek.php index b5b4f2a..54ebdc2 100644 --- a/stats/stats_MechanicOperationMetrics_byWeek.php +++ b/stats/stats_MechanicOperationMetrics_byWeek.php @@ -23,7 +23,7 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> - +
diff --git a/stats/stats_VolVsMechMetrics_byMonth.php b/stats/stats_VolVsMechMetrics_byMonth.php index 1f41860..12c3ba6 100644 --- a/stats/stats_VolVsMechMetrics_byMonth.php +++ b/stats/stats_VolVsMechMetrics_byMonth.php @@ -34,7 +34,7 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> - +
diff --git a/stats/stats_VolVsMechMetrics_byWeek.php b/stats/stats_VolVsMechMetrics_byWeek.php index 61cc55e..bffbd07 100644 --- a/stats/stats_VolVsMechMetrics_byWeek.php +++ b/stats/stats_VolVsMechMetrics_byWeek.php @@ -34,7 +34,7 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> - +
diff --git a/stats/stats_employeemetrics.php b/stats/stats_employeemetrics.php index 0d63234..277d1ac 100644 --- a/stats/stats_employeemetrics.php +++ b/stats/stats_employeemetrics.php @@ -65,7 +65,7 @@ $row_Recordset1 = mysql_fetch_assoc($Recordset1); ?> - +
- + diff --git a/stats/stats_monthlytransactiontotals.php b/stats/stats_monthlytransactiontotals.php index 419c150..2673617 100644 --- a/stats/stats_monthlytransactiontotals.php +++ b/stats/stats_monthlytransactiontotals.php @@ -29,7 +29,7 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> - +
diff --git a/stats/stats_monthlytransactiontotals_paid.php b/stats/stats_monthlytransactiontotals_paid.php index dd0f352..1dbd81c 100644 --- a/stats/stats_monthlytransactiontotals_paid.php +++ b/stats/stats_monthlytransactiontotals_paid.php @@ -23,7 +23,7 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> - +
diff --git a/stats/stats_paidstaffhours.php b/stats/stats_paidstaffhours.php index 16d0eef..a206a2e 100644 --- a/stats/stats_paidstaffhours.php +++ b/stats/stats_paidstaffhours.php @@ -33,7 +33,7 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> - +
diff --git a/stats/stats_paidstaffhours_byMonth.php b/stats/stats_paidstaffhours_byMonth.php index 582ce4a..a84fc57 100644 --- a/stats/stats_paidstaffhours_byMonth.php +++ b/stats/stats_paidstaffhours_byMonth.php @@ -23,7 +23,7 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> - +
diff --git a/stats/stats_paidstaffhours_byPayPeriod.php b/stats/stats_paidstaffhours_byPayPeriod.php index 1ed0013..378e187 100644 --- a/stats/stats_paidstaffhours_byPayPeriod.php +++ b/stats/stats_paidstaffhours_byPayPeriod.php @@ -40,7 +40,7 @@ $totalRows_Recordset2 = mysql_num_rows($Recordset2); ?> - +
Staff Hours by Month
diff --git a/stats/stats_paidstaffhours_byWeek.php b/stats/stats_paidstaffhours_byWeek.php index 25e5524..b41c31f 100644 --- a/stats/stats_paidstaffhours_byWeek.php +++ b/stats/stats_paidstaffhours_byWeek.php @@ -23,7 +23,7 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> - +
Staff Hours by Pay Period
diff --git a/stats/stats_shoptransactiontotals.php b/stats/stats_shoptransactiontotals.php index 533c8b6..ccc9c77 100644 --- a/stats/stats_shoptransactiontotals.php +++ b/stats/stats_shoptransactiontotals.php @@ -30,7 +30,7 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> - +
Staff Hours by Week
diff --git a/stats/stats_shoptransactiontotals_byshop.php b/stats/stats_shoptransactiontotals_byshop.php index b5f4ca5..3c36a13 100644 --- a/stats/stats_shoptransactiontotals_byshop.php +++ b/stats/stats_shoptransactiontotals_byshop.php @@ -26,7 +26,7 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> - +
diff --git a/stats/stats_userhours.php b/stats/stats_userhours.php index 413db32..dd0ca6d 100644 --- a/stats/stats_userhours.php +++ b/stats/stats_userhours.php @@ -57,7 +57,7 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> - +
diff --git a/stats/stats_userhours_season.php b/stats/stats_userhours_season.php index 6348460..bbdc26b 100644 --- a/stats/stats_userhours_season.php +++ b/stats/stats_userhours_season.php @@ -66,7 +66,7 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> - +
diff --git a/stats/stats_userhours_year.php b/stats/stats_userhours_year.php index 5214361..9d988a1 100644 --- a/stats/stats_userhours_year.php +++ b/stats/stats_userhours_year.php @@ -16,7 +16,9 @@ default: } mysql_select_db($database_YBDB, $YBDB); -$query_Recordset1 = "SELECT * FROM (SELECT contacts.contact_id, CONCAT(last_name, ', ', first_name, ' ',middle_initial) AS full_name, +$query_Recordset1 = "SELECT * FROM + +(SELECT contacts.contact_id, CONCAT(last_name, ', ', first_name, ' ',middle_initial) AS full_name, COUNT(shop_hours.contact_id) as sort_visits, ROUND(SUM(HOUR(SUBTIME( TIME(time_out), TIME(time_in))) + MINUTE(SUBTIME( TIME(time_out), TIME(time_in)))/60)) AS sort_hours FROM shop_hours @@ -25,6 +27,7 @@ LEFT JOIN shop_user_roles ON shop_hours.shop_user_role = shop_user_roles.shop_us WHERE shop_user_roles.volunteer = 1 AND time_in > DATE_SUB(CURDATE(),INTERVAL 12 MONTH) GROUP BY contact_id ORDER BY sort_hours DESC) AS sort_hours + LEFT JOIN (SELECT contacts.contact_id AS vh_contact_id, COUNT(shop_hours.contact_id) as th_visits, ROUND(SUM(HOUR(SUBTIME( TIME(time_out), TIME(time_in))) + MINUTE(SUBTIME( TIME(time_out), TIME(time_in)))/60)) AS th_hours @@ -33,6 +36,7 @@ LEFT JOIN contacts ON shop_hours.contact_id = contacts.contact_id LEFT JOIN shop_user_roles ON shop_hours.shop_user_role = shop_user_roles.shop_user_role_id GROUP BY contacts.contact_id ORDER BY last_name, first_name) AS total_hours ON sort_hours.contact_id = total_hours.vh_contact_id + LEFT JOIN (SELECT contacts.contact_id AS vh_contact_id, COUNT(shop_hours.contact_id) as vh_visits, ROUND(SUM(HOUR(SUBTIME( TIME(time_out), TIME(time_in))) + MINUTE(SUBTIME( TIME(time_out), TIME(time_in)))/60)) AS vh_hours @@ -42,6 +46,7 @@ LEFT JOIN shop_user_roles ON shop_hours.shop_user_role = shop_user_roles.shop_us WHERE shop_user_roles.volunteer = 1 GROUP BY contacts.contact_id ORDER BY last_name, first_name) AS volunteer_hours ON sort_hours.contact_id = volunteer_hours.vh_contact_id + LEFT JOIN (SELECT contacts.contact_id AS th3_contact_id, COUNT(shop_hours.contact_id) as th3_visits, ROUND(SUM(HOUR(SUBTIME( TIME(time_out), TIME(time_in))) + MINUTE(SUBTIME( TIME(time_out), TIME(time_in)))/60)) AS th3_hours @@ -51,6 +56,7 @@ LEFT JOIN shop_user_roles ON shop_hours.shop_user_role = shop_user_roles.shop_us WHERE time_in > DATE_SUB(CURDATE(),INTERVAL 12 MONTH) GROUP BY contacts.contact_id ORDER BY last_name, first_name) AS total_hours3 ON sort_hours.contact_id = total_hours3.th3_contact_id + LEFT JOIN (SELECT contacts.contact_id AS vh3_contact_id, COUNT(shop_hours.contact_id) as vh3_visits, ROUND(SUM(HOUR(SUBTIME( TIME(time_out), TIME(time_in))) + MINUTE(SUBTIME( TIME(time_out), TIME(time_in)))/60)) AS vh3_hours @@ -60,13 +66,14 @@ LEFT JOIN shop_user_roles ON shop_hours.shop_user_role = shop_user_roles.shop_us WHERE shop_user_roles.volunteer = 1 AND time_in > DATE_SUB(CURDATE(),INTERVAL 12 MONTH) GROUP BY contacts.contact_id ORDER BY first_name) AS volunteer_hours3 ON sort_hours.contact_id = volunteer_hours3.vh3_contact_id"; + $Recordset1 = mysql_query($query_Recordset1, $YBDB) or die(mysql_error()); //$row_Recordset1 = mysql_fetch_assoc($Recordset1); //Wait to fetch until do loop $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> - +
diff --git a/stats/stats_usersbydayweek.php b/stats/stats_usersbydayweek.php index 6c9e8de..236d424 100644 --- a/stats/stats_usersbydayweek.php +++ b/stats/stats_usersbydayweek.php @@ -36,7 +36,7 @@ function print_table_daysofweek($year, $week, $total_visits, $new_visits){ ?> - +
diff --git a/stats/stats_usersbyweek.php b/stats/stats_usersbyweek.php index cd011fb..9b59c67 100644 --- a/stats/stats_usersbyweek.php +++ b/stats/stats_usersbyweek.php @@ -52,7 +52,7 @@ $totalRows_Recordset4 = mysql_num_rows($Recordset4); ?> - +
New and Total Users by Day/Week
diff --git a/stats/status_totals.php b/stats/status_totals.php new file mode 100644 index 0000000..9ef25b6 --- /dev/null +++ b/stats/status_totals.php @@ -0,0 +1,144 @@ + DATE_SUB(CURDATE(),INTERVAL 12 MONTH) GROUP BY shop_user_role +ORDER BY volunteer_hours DESC; + ++----------------+-----------------+--------+-------+ +| shop_user_role | unique_visitors | visits | hours | ++----------------+-----------------+--------+-------+ +| Personal | 141 | 303 | 679 | +| Shopping | 61 | 66 | 48 | ++----------------+-----------------+--------+-------+ + +SELECT shop_user_role, COUNT(DISTINCT shop_hours.contact_id) as unique_visitors, +COUNT(shop_hours.contact_id) as visits, +ROUND(SUM(HOUR(SUBTIME( TIME(time_out), TIME(time_in))) + MINUTE(SUBTIME( TIME(time_out), +TIME(time_in)))/60)) AS hours +FROM shop_hours +LEFT JOIN contacts ON shop_hours.contact_id = contacts.contact_id +LEFT JOIN shop_user_roles ON shop_hours.shop_user_role = shop_user_roles.shop_user_role_id +WHERE shop_user_roles.volunteer = 0 +AND shop_user_roles.other_volunteer = 0 +AND time_in > DATE_SUB(CURDATE(),INTERVAL 12 MONTH) GROUP BY shop_user_role +ORDER BY hours DESC; + + ++-------------------+------------------+-----------------+ +| unique_volunteers | volunteer_visits | volunteer_hours | ++-------------------+------------------+-----------------+ +| 114 | 778 | 2676 | ++-------------------+------------------+-----------------+ + +SELECT COUNT(DISTINCT shop_hours.contact_id) as unique_volunteers, +COUNT(shop_hours.contact_id) as volunteer_visits, +ROUND(SUM(HOUR(SUBTIME( TIME(time_out), TIME(time_in))) + MINUTE(SUBTIME( TIME(time_out), TIME(time_in)))/60)) AS volunteer_hours +FROM shop_hours +LEFT JOIN contacts ON shop_hours.contact_id = contacts.contact_id +LEFT JOIN shop_user_roles ON shop_hours.shop_user_role = shop_user_roles.shop_user_role_id +WHERE shop_user_roles.volunteer = 1 +OR shop_user_roles.other_volunteer = 1 +AND time_in > DATE_SUB(CURDATE(),INTERVAL 12 MONTH); + ++-----------------+--------+-------+ +| unique_visitors | visits | hours | ++-----------------+--------+-------+ +| 188 | 369 | 727 | ++-----------------+--------+-------+ + +SELECT COUNT(DISTINCT shop_hours.contact_id) as unique_visitors, +COUNT(shop_hours.contact_id) as visits, +ROUND(SUM(HOUR(SUBTIME( TIME(time_out), TIME(time_in))) + MINUTE(SUBTIME( TIME(time_out), TIME(time_in)))/60)) AS hours +FROM shop_hours +LEFT JOIN contacts ON shop_hours.contact_id = contacts.contact_id +LEFT JOIN shop_user_roles ON shop_hours.shop_user_role = shop_user_roles.shop_user_role_id +WHERE shop_user_roles.volunteer = 0 +AND shop_user_roles.other_volunteer = 0 +AND time_in > DATE_SUB(CURDATE(),INTERVAL 12 MONTH); + + +*/ + +?> + + + + + +
New and Total Users by Week
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Volunteers
Shop Roles
Unique Volunteers
Volunteer Visits
Volunteer Hours
       
    
+ + +