Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating Scheduler App - process and concept questions
    text
    copied!<p><em>If there are other times this has been asked or answered, I apologize - I think my searches keep getting lost in people who are trying to schedule PHP tasks on a server so I'm not finding what I am looking for.</em></p> <p>So as my first self-built app (not a guided or instructed one) I am trying to build a camp scheduling program. I have things already built to login, add cabins/groups or remove them, add activities/groups or remove them, and to generate a date range, and from that data, to select which of those things you want to schedule for and then send it to a scheduler which then creates a new MySQL table and...</p> <p>This is where I keep stopping and wondering If I'm thinking about this correctly. </p> <ul> <li>Should each new run of a schedule create a new table - is this scalable (it doesn't matter for me if its scalable for this, but it does matter for other projects, obviously)?</li> <li>Should I do sorting with arrays before I ever enter data into the MySQL table, or can I enter consecutively and then enter the next item as its being sorted?</li> </ul> <p>Ultimately, I cannot do only a round-robin, because I need to add other factors like: </p> <ul> <li>Has this group done this activity in the last X number of scheduled periods? If so, choose another one.</li> <li>Do not always start from the top of the activities list, otherwise some activities will always be schedule and some will always be the first to be left empty - maybe even be able to prioritize the importance given some factors.</li> <li>Initially I just want to schedule the activities for the dates with the groups, but I'd also like to add a feature to be able to factor in another schedule (canoe trips that cabins take) to exclude them from the scheduled list for the days they will be gone.</li> </ul> <p>Any help I can get with the sorting logic is appreciated. Thanks.</p> <p><strong>Edit:</strong> So based on your suggestion, I am thinking that I have the following tables with only two columns for ID and name (can be updated/edited by the user at any time):</p> <pre><code>cabins activities </code></pre> <p>I then add another table which has up to, say, 56 columns for date entries (8 weeks) + a name and user column called:</p> <pre><code>dates </code></pre> <p>Then I have another table called:</p> <pre><code>schedule </code></pre> <p>which has columns like this:</p> <pre><code>ID (primary Key) User (logged in user that created this) schedule_name (user defined name of schedule) cabin (foreign key of a cabin) period_001 (foreign key of first date in corresponding 'dates' table) activity_001 (foreign key of an available activity which has been chosen to go here) period_002 (...) activity_003 (...) etc... </code></pre> <p>Then the PHP logic will ask for rows grouped by name and user, so that for each schedule name for a given user, there would be one row for every selected cabin in camp (ex. 25 rows for 25 cabins). And each row in the 'dates' table contains the entire date range for a given schedule.</p> <p>Is this what you had in mind?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload