This is a site that can show a leaderboard for hustle times for dominos drivers. It retrieves the leaderboard from a SQL-database You can upload new times on the generate.php page.
I started a few test to automate the generation of the leaderboard using selenium: jump to automation
You should create a file called 'database.php' to add the database login variables ($servername, $username, $password, $dbname).
The database consists of one table called 'drivers' and a table per week called 'week_<wwyy>'
id: 4-digit code used by PULSE to identify driver, must correspond to the system.
name: name of the driver. Can be anything (/has no dependencies anywhere)
points: total points scored so far by the driver.
id: entry identifier. Not used.
name: driver ID, 4-digit code used by PULSE to identify driver.
time: avg hustle time this week.
percentage: avg percentage of app usage this week.
points_this_week: points aquired this week. Calculated during the upload (see Generate page).
total_points: the total points this driver had during this week.
- Open 'rapporten' on chrome. Navigate to 'Store Reporting' and then 'Daily Store Report'.
- Copy (select from bottom-right to top left entry, ctrl+c)
- Paste the two tables next to each other in a new Excel sheet. Ensure that the columns are aligned properly.
-
Your table should look something like this:
Store ID | Driver ID | Monday | ... | Sunday | Week Avg | Store ID | Driver ID | Monday | ... | Sunday | Week Avg
- After ensuring that the data is structured correctly, save the Excel file.
-
Convert the Excel file to a CSV file:
- In Excel, go to File > Save As.
- Choose the location where you want to save the file.
- In the Save as type dropdown, select CSV (Comma delimited) (*.csv).
- Click Save.
- If prompted about features not compatible with CSV format, click Yes.
- Enter the week number and year below.
- Select the CSV file you just created by clicking browse below.
- Hit upload, points are calculated automatically.
Ensure that all performance metrics are in numeric format. Entries with percentages below the threshold will not receive any points, so make sure to review the data accordingly.
Make sure all drivers that may show up in the reports are added to this list. You can do so with the form under Add Driver. If you make a mistake you can remove it again.
This button resets all points in the drivers table.
UNFINISHED The goal of this pythonscript is to retrieve the daily store report from the powerBI database, and extract the relevant hustle times and percentages to generate the leaderboard automatically.
You could set up a server that runs this script every week (e.g. as a cron job), so the leaderboard stays up to date.
Save the login-details for the PowerBI reports site in the "PowerBIPassword.py" file.