diff --git a/stats/community_service_hours.php b/stats/community_service_hours.php index b6c59bc..e07cfef 100644 --- a/stats/community_service_hours.php +++ b/stats/community_service_hours.php @@ -41,30 +41,16 @@ if (isset($_POST['range1'])) { $today = $range2; } -/* - -SELECT contacts.contact_id, CONCAT(last_name, ', ', first_name, ' ',middle_initial) AS full_name, -COUNT(shop_hours.contact_id) as cs_volunteer_visits, -ROUND(SUM(HOUR(SUBTIME( TIME(time_out), TIME(time_in))) + MINUTE(SUBTIME( TIME(time_out), TIME(time_in)))/60)) AS cs_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 (time_in > DATE_SUB(CURDATE(),INTERVAL $days_range1 DAY) AND time_in <= DATE_SUB(CURDATE(), INTERVAL $days_range2 DAY)) -AND shop_user_roles.other_volunteer = 1 -GROUP BY contact_id -ORDER BY sort_hours DESC; - -*/ - $query = "SELECT contacts.contact_id, CONCAT(last_name, ', ', first_name, ' ',middle_initial) AS full_name, COUNT(shop_hours.contact_id) as cs_volunteer_visits, - ROUND(SUM(HOUR(SUBTIME( TIME(time_out), TIME(time_in))) + MINUTE(SUBTIME( TIME(time_out), TIME(time_in)))/60)) AS cs_volunteer_hours + ROUND(SUM(HOUR(TIMEDIFF( time_out, time_in)) + MINUTE(TIMEDIFF( time_out, time_in))/60)) AS cs_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 (SUBSTRING_INDEX(time_in, ' ', 1) >= DATE_SUB(CURDATE(),INTERVAL $days_range1 DAY) AND SUBSTRING_INDEX(time_in, ' ', 1) <= DATE_SUB(CURDATE(), INTERVAL $days_range2 DAY)) AND shop_user_roles.other_volunteer = 1 + AND shop_hours.shop_user_role = 'Student Volunteer/Community Service Hours' GROUP BY contact_id ORDER BY cs_volunteer_hours DESC;"; $cs_volunteers_sql = mysql_query($query, $YBDB) or die(mysql_error()); diff --git a/stats/paid_members.php b/stats/paid_members.php index f0bd28a..1c9c0da 100644 --- a/stats/paid_members.php +++ b/stats/paid_members.php @@ -41,7 +41,7 @@ $query = "SELECT contact_id, full_name, normal_full_name, email, phone, sort_vis CONCAT(first_name, ' ', last_name) AS normal_full_name, contacts.email AS email, contacts.phone AS phone, 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 +ROUND(SUM(HOUR(TIMEDIFF( time_out, time_in)) + MINUTE(TIMEDIFF( time_out, time_in))/60)) AS sort_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 diff --git a/stats/shops.php b/stats/shops.php index 7130847..935c408 100644 --- a/stats/shops.php +++ b/stats/shops.php @@ -33,7 +33,6 @@ if (isset($_POST['range1'])) { $today = $range2; } - $query = "SELECT COUNT(shop_id) as total_shops from shops WHERE (date >= DATE_SUB(CURDATE(),INTERVAL $days_range1 DAY) AND date <= DATE_SUB(CURDATE(), INTERVAL $days_range2 DAY));"; $shop_totals_sql = mysql_query($query, $YBDB) or die(mysql_error()); diff --git a/stats/stats_monthlysalestax.php b/stats/stats_monthlysalestax.php index 6ab4291..89db5b6 100644 --- a/stats/stats_monthlysalestax.php +++ b/stats/stats_monthlysalestax.php @@ -37,13 +37,13 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1);
Year | -Month | -Total Sales | -Accounting Group | +Year | +Month | +Total Sales | +Accounting Group |
---|