Sedang Disiapkan

PHP dynamic time appointment form

I have an appointment form that dynamically generates possible appointments days. (today plus 7 days ahead) I need to make the time slots available, change if "Saturday" is selected, but because the days of the week are dynamic and include the date, I'm not sure how to do this on my own.

Here is the portion of the php code that I need worked on:

=====================================

<select name="a_date" id="a_date">

<?php

$m = date("m");

$d = date("j");

$y = date("Y");

$twodays = mktime(0,0,0,$m,$d,$y);

$j = 0;

for($i = 0; $i < 7; $i++){

$day_unix = $twodays + (86400 * $j);

if(date("w",$day_unix) == 0){

$j += 1;

$day_unix = $twodays + (86400 * $j);

}

$day_text = date("D M j, Y", $day_unix);

?>

<option value="<?=$day_text?>"><?=$day_text?></option>

<?php $j++; } ?>

</select>

</td>

</tr>

<tr>

<td><span class="red-text">*</span>Time:</td>

<td align="right"><select name="a_time" id="a_time">

<option selected>Choose One ...</option>

<option>8:00 AM</option>

<option>8:30 AM</option>

<option>9:00 AM</option>

<option>9:30 AM</option>

<option>10:00 AM</option>

<option>10:30 AM</option>

<option>11:00 AM</option>

<option>11:30 AM</option>

<option>12:00 PM</option>

<option>12:30 PM</option>

<option>1:00 PM</option>

<option>1:30 PM</option>

<option>2:00 PM</option>

<option>2:30 PM</option>

<option>3:00 PM</option>

<option>3:30 PM</option>

<option>4:00 PM</option>

<option>4:30 PM</option>

<option>5:00 PM</option>

<option>5:30 PM</option>

<option>6:00 PM</option>

<option>6:30 PM</option>

</select></td>

</tr>

<tr align="right">

<td colspan="2">Monday thru Friday from 8:00a.m -7:00p.m.<br>

Saturday from 8:00a.m -1:00p.m.</td>

</tr>

===============================

The time portion needs to stay 8am to 6:30pm for all days except if they choose a Saturday appointment. If Saturday it needs to be 8am to 12:30 pm.

I don't care if it is written in Php or Javascript.

Thanks for your consideration.

Kemahiran: Javascript, PHP

Lihat lebih lanjut: php appointment form, dynamic time php javascript, php dynamic time, dynamic time php, javascript appointment time, dynamic time javascript, appointment code php, javascript dynamic time, care here, appointments plus, php appointment time, change dynamic time php javascript, php appointment class, javascript appointment, appointment form php, appointment form javascript, change time form php, apointment form creater, appointment form free, code dynamic time, schedule appt php form, form time php, time appoint php, free appointment time forms, form appointment php

Tentang Majikan:
( 1 ulasan ) Pearland, United States

ID Projek: #374356

Dianugerahkan kepada:

ichurakov

Hello. Ready to start. Thnx.

$30 USD dalam 0 hari
(234 Ulasan)
6.3

4 pekerja bebas membida secara purata $69 untuk pekerjaan ini

TechVillage

let's start

$50 USD dalam sehari
(86 Ulasan)
6.6
fastphp

I will complete as per.

$100 USD dalam sehari
(28 Ulasan)
5.6
joblesspoet

I can manage it easily

$95 USD dalam sehari
(18 Ulasan)
5.6