Discuss how to prepare and show a jobs planner

I have a mysql table called jobs
jobs.fields are jobs.id, jobs.name, jobs.startdate and jobs.enddate.

I need to select all jobs that are between startdate and enddate - defined by two parameters.
From the returned records I want to plot each job in a grid - like a spreadsheet where row is jobs.id and jobs.name and columns represent all dates for all the jobs in the recordset.
I suspect each row in array could be built with -1 for each column(i.e. date) that a job exists for, else 0.

For presentation, I propose to load the records into a grid with jobs.id and jobs,name and a colour where date columns are -1
The grid will obviously be dynamically set by the maximum number of columns, probably more than 30 and less than 365 days - so user will have to scroll horizontally.

Thoughts and comments please.

I would think a control app with start/end date. Put results in a global and redirect to the grid which has sql as “select blahblahblah from jobs where startdate >=[startdate] and enddate <=enddate” Order by whatever…

That puts them all in the grid. If you want details you can have a link from each job id that opens up another grid with detail info. Or have your detail info in details for each record. Am not seeing why would you need a job exists or not. If it is in the date criteria it exists, no?

The select will only find jobs within the date span criteria and a control app could do that and put the results in global. Good idea.
What I want the user to see is a grid with a visual length in days for each selected job over a large time span. Time span needs to be in days, from the earliest job start date and until the greatest job finish date.
For example, two jobs might be found with the first job of 10 days long from the middle of April and the second job of 6 days long starting at the beginning of May.
So the grid would need two rows, one with a block of 10 days ‘wide’ and the next with a block of 6 days ‘wide’.
Ideally the grid would allow the user to click on a grid row to open a detailed form view of the subject job (by passing a global variable from the grid).

I would use a calendar to show the jobs planner, instead of a grid…

1 Like

A Calendar might work, although if many jobs span a particular day, that date in the calendar might be beyond the ability of Scriptcase to hold all the jobs!

I wonder now if a Chart is an alternative approach - with horizontal bars, one for each jobid.
The data would be rows of jobid with #days a job starts after or on today and #job elapse days.
First job has several gaps (days before job start) and then a bar of 10 (days) length.
Second job has even more gaps (days before job start) and then a bar of 6 (days) length.
Chart width needs to be dynamic in days (always start with today) finishes at n days (using today through to the latest job finish date).
Could that be an option and would there be issues using Scriptcase Charts?

There is an example calendar at scriptcase.net/samples/php-calendars/calendar-google-integration/
It looks ideal, but how much data is being exposed to Google?