'' AND last_name <> '' GROUP BY YEAR(date_created), WEEK(date_created) ORDER BY YEAR(date_created) DESC, WEEK(date_created) DESC;";
$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);
$query_Recordset2 = "SELECT COUNT(contact_id) total_users FROM contacts WHERE first_name <> '' AND last_name <> '' GROUP BY contact_id * 0;";
$Recordset2 = mysql_query($query_Recordset2, $YBDB) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2); //Wait to fetch until do loop
$total_users = $row_Recordset2['total_users'];
$query_Recordset3 = "SELECT year(date), week(date),
COUNT(shop_visit_id) AS total_visitors,
ROUND(SUM(HOUR(TIMEDIFF( time_out, time_in)) + MINUTE(TIMEDIFF( time_out, time_in))/60)) AS total_hours
FROM shops LEFT JOIN shop_hours ON shops.shop_id = shop_hours.shop_id
GROUP BY year(date), week(date)
ORDER BY year(date) DESC, week(date) DESC";
$Recordset3 = mysql_query($query_Recordset3, $YBDB) or die(mysql_error());
//$row_Recordset3 = mysql_fetch_assoc($Recordset3); //Wait to fetch until do loop
$totalRows_Recordset3 = mysql_num_rows($Recordset3);
$query_Recordset4 = "SELECT year(date), week(date),
COUNT(shop_visit_id) AS volunteer_visitors,
ROUND(SUM(HOUR(TIMEDIFF( time_out, time_in)) + MINUTE(TIMEDIFF( time_out, time_in))/60)) AS volunteer_hours
FROM shops
LEFT JOIN shop_hours ON shops.shop_id = shop_hours.shop_id
LEFT JOIN shop_user_roles ON shop_hours.shop_user_role = shop_user_roles.shop_user_role_id
WHERE volunteer = 1
GROUP BY year(date), week(date)
ORDER BY year(date) DESC, week(date) DESC;";
$Recordset4 = mysql_query($query_Recordset4, $YBDB) or die(mysql_error());
//$row_Recordset4 = mysql_fetch_assoc($Recordset4); //Wait to fetch until do loop
$totalRows_Recordset4 = mysql_num_rows($Recordset4);
?>
New and Total Users by Week |
Date |
User Hours for Week |
Number of Visitors for Week |
Users to Date |
Year |
Month |
Week# |
Total |
Volunteer |
Total |
Volunteer |
First Time |
Total |
|
|
|
|
|
|
|
|
|
|