Jump to content

JacoSwanepoel

Members
  • Posts

    11
  • Joined

  • Last visited

JacoSwanepoel's Achievements

Member

Member (2/5)

0

Reputation

  1. // SEND EMAIL TO CUSTOMER $to = $CustomerEmail; $subject = 'Subject Here'; $message .= 'Text Here"<br>'; $message .= 'Text Here<br>'; $message .= 'Have a fantastic day.'; $headers = "From: Company Sales Portal <no-reply@yourdomain.com>\r\n"; $headers .= "Reply-To: Company SA Sales Portal Administrator <admin@yourdomain.com>\r\n"; $headers .= "Content-type: text/html\r\n"; mail($to, $subject, $message, $headers); Ive been using this and never gad any problems with outlook or gmail. Maybe itll help
  2. Good Morning Barand I think solution 2 is what i am looking for and will try to implement this as soon as possible Regards Jaco Swanepoel
  3. I get the 1st part, but the second part i am unsure how to do? I have to admit that this does seem more into the direction that i want to go with this, but if all else fails then I still have your 1st option to work from. how do you generate a temporary slot table?
  4. Thank you so much for your valuable time and information, Your input makes 100% sense. I have alot to think about and some changes to make as well. You are an absolute legend.
  5. Ahhh,,, Ok Great. The lightbulb just lit up,,, lol. so when a salon updates their booking time slot duration I will need to run a update on the valid_until column for the specific salon ID with todays date -1 day and post a new "array is it?" to the database table with the updated time slots for that salon?
  6. Will this method require me to add booking slots for each salon added for each day of the month or am I misunderstanding?
  7. Ok,,, Great I ended up with this.... SELECT sb_time_slots.slot_start_time, sb_bookings.booking_date, sb_bookings.start_time FROM sb_time_slots LEFT JOIN sb_bookings ON sb_time_slots.slot_start_time = TIME(start_time) AND DATE(booking_date) = '$SelectedDate' WHERE booking_start IS NULL and ultimately ending up with,,,, <div class="col-lg-3"> <select type="text" class="form-control m-t-5" name="available_time" id="available_time" required=""> <?php $SQL_AvailableTime = mysqli_query($conn, "SELECT sb_time_slots.slot_start_time, sb_bookings.booking_date, sb_bookings.start_time FROM sb_time_slots LEFT JOIN sb_bookings ON sb_time_slots.slot_start_time = TIME(start_time) AND DATE(booking_date) = '$SelectedDate' WHERE booking_start IS NULL"); while ($row = mysqli_fetch_array($SQL_AvailableTime)) { echo("<option value='" . $row['slot_start_time'] . "'>" . $row['slot_start_time'] . "</option>"); } ?> <label for="dropdown">Select</label> </select> </div><!-- col --> and it works great, however i was wondering how can this work between the 2 or more branches when we decide to open another store? Specifically when updating hours of operation and say changing the booking slot duration from 1 hour to 45min for instance. is there an alternate way to do this for when one of our branches decides to change booking slot times. <div class="col-lg-4"> <?php $start = "08:00:00"; $end = "17:00:00"; $tStart = strtotime($start); $tEnd = strtotime($end); $tNow = $tStart; ?> <select class="form-control m-t-5" name="booking_start" required=""> <option value="">Select Time</option> <?php while($tNow <= $tEnd){ ?> <option value="<?php echo date("H:i:s",$tNow); ?>"> <?php echo date("H:i:s",$tNow);?></option> <?php $tNow = strtotime('+60 minutes',$tNow); } ?> </select> </div> is there any way to dynamically update the hours of operation and the time slot duration without the use of a second table while achieving the required results
  8. Great stuff. Thank you for your input so far, I will try my best to figure this out.
  9. Thank you so much. Correct me if I'm wrong. based on the query the structure will look something like 08:00:00 09:00:00 10:00:00 11:00:00 12:00:00 13:00:00 14:00:00 15:00:00 16:00:00 17:00:00 Instead of |id | Slot 1 | Slot 2 | Slot 3 | Slot 4 | Slot 5 | Slot 6 | Slot 7 | Apologies again for this,,, I am very new to all of this
  10. Thank you for your reply Barand. I will add a slot table to my DB. but now my brain is running a mile a minute trying to figure out this query 🤔
  11. Good Afternoon everyone I am really hoping that someone can assist me with a problem that I am facing. I am 53 and trying to learn myself new things and one of them is PHP which is not the easiest thing for me to understand. I am "trying" to build a online salon booking system for my wife and i am having difficulty excluding time slots that is already booked I have a database table called sb_bookings and the structure is as follows (For now at least) | id | booking_date | booking_time | booking_title | booking_start | booking_end | | 1 | 2022-05-15 | 10:00:00 | Customer Name | 2022-05-15 10:00:00 | 2022-05-15 11:00:00 | For the sake of this example let’s say that I only have this 1 booking on 2022-05-15 at 10:00am. If a user selects a date on the datepicker & clicks the “Select Date” button it opens a modal using JS and passes the selected date to the modal. I know the start hours for the day & the end hours and want to display the hours in a dropdown list. This I can accomplish using this little piece of code <div class="col-lg-4"> <?php $start = "08:00:00"; $end = "17:00:00"; $tStart = strtotime($start); $tEnd = strtotime($end); $tNow = $tStart; ?> <select class="form-control m-t-5" name="booking_start" required=""> <option value="">Select Time</option> <?php while($tNow <= $tEnd){ ?> <option value="<?php echo date("H:i:s",$tNow); ?>"> <?php echo date("H:i:s",$tNow);?></option> <?php $tNow = strtotime('+60 minutes',$tNow); } ?> </select> </div> Apologies for the formatting in advance. This gives me the output as follows in the dropdown 08:00:00 09:00:00 10:00:00 <---- Needs to be excluded from the dropdown seeing that the date & time is already in the database 11:00:00 12:00:00 13:00:00 14:00:00 15:00:00 16:00:00 17:00:00 Is there a way that "10:00:00" can be excluded from the dropdown options using php seeing that there is already a DB entry with that date & time. Like I said I am trying to learn something new & challenging and for the most part I am enjoying it, so please be kind. but honestly I am really stumped an how to get this done. any help will greatly be appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.