Hi there. I need someone to make me a quick script (just code) for a Core PHP project.
I created a Time Slot based feature where Customers can choose an Order Date and Order Time, but the Owner/Store can limit how many orders can be reserved at every 15 minute interval. So, this script you make will help me manage the timeslots faster.
The big functionality here is "bulk insert" and "bulk update" with PHP + Jquery or Javascript or Ajax or some combination. My timeslots table looks like this (and I'll give you the .sql file).
1, Mon, 2022-01-10, 4:00 PM, 3, Downtown
2, Mon, 2022-01-10, 4:15 PM, 5, Downtown
3, Mon, 2022-01-10, 4:30 PM, 10, Downtown
4, Mon, 2022-01-10, 4:45 PM, 5, Downtown
STEP #1 - BULK INSERT: CREATE THE AVAILABLE DATES (NO MORE THAN 31 DATES FROM TODAY)
NOTE: So the Store Owner can basically "schedule" anywhere from 1 day to 31 days ahead.
1. User can choose a start date, like Today or 02/01/2022 (a specific date).
Note: I use [login to view URL] for a lot, so please use that.
2. User can choose/input a number of dates, which creates a vertical list of input text boxes (4 input boxes per date, ie. per row).
Note: I think I have a feature that uses javascript to create text boxes instantly now, which I love, so maybe you can use javascript.
7 dates would create 7 input text box rows and allow them to take orders for the next 7-day week or 30 would create 30 new input box rows, which would allow them to take orders for the next month.
Inputs: Date | Start Time | End Time | Location (ie. 2022-01-10 | 1:00 PM | 3:45 PM | Downtown)
- this example row would create 12 new time slots when submitted (1:00 PM, 1:15 PM, 1:30 PM, etc), but if there are more dates, then obviously there will be more timeslots inserted.
This example basically means the Owners is accepting Order Reservations from 1pm to 3:45pm at their Downtown location on January 10th, 2022. In Phase #2 below, we'll add "availability" to limit how many reservations can be made in between those times.
3. The input boxes created above would automatically have each date in each input. Then the Admin would be able to manually input/enter the Start Time, End Time and Location for each Date/row.
Note: So, if the User chooses today, then the Date inputs would be 01/10/22, 01/11/22, 01/12/22, etc. and if the User chooses 02/01/2022, then the Date inputs would be 02/01/22, 02/02/22, 02/03/22, etc.
4. Also put a plus "+" button at the bottom of the input boxes to add 1 more Date row (on the fly), ie. 3 input boxes on the row.
5. On "submit" or "save" we insert the input box values into a table, which I'll give you. It's pretty simple.
NOTE: THIS BASICALLY CREATES TONS OF *** TIMESLOTS/ROWS *** IN A TABLE BASED ON THE START AND END TIME THE ADMIN CHOSE.
Table Cols: id, day, date, time, available, location (it would be awesome if you could enter the day when you insert the date also, like Mon): 1, Mon, 2022-01-10, 4:00 PM, 0, Downtown
**** I think it's important to save the dates (ie. and timeslots) first, before the Admin/Store-Owners adds their Availability otherwise they might lose all their info as they are inputting it. ****
STEP #2 - BULK UPDATE: INPUT THE AVAILABLE TIME SLOTS
So, this would display a lot of input boxes that represent all the new Timeslot rows, which allows the Admin to input all the different availabilities for each Time Slot (ie. 3, 5, 10, 5 per the example below). We also need a delete row checkbox for each row.
So, the Timeslot rows might look like this:
1, Mon, 2022-01-10, 4:00 PM, 3, Downtown
2, Mon, 2022-01-10, 4:15 PM, 5, Downtown
3, Mon, 2022-01-10, 4:30 PM, 10, Downtown
4, Mon, 2022-01-10, 4:45 PM, 5, Downtown
STEP #3 - BULK DELETE AND BULK UPDATE: CREATE A NEW ARCHIVE FEATURE
Then I would love an archive feature/function that I can stick in a CRON job, which removes older dates from the main timeslots table and inserts them into an identical archives table.