I need some advice. I have been given this assignment at my internship. The task is to create a booking calendar. I managed to create it but currently I have a problem with the backend specifically with sending data from the form to the database using php.
In school we have only recently started discussing php so that’s why I’m here to see if anyone could give me some advice. Another thing I don’t know how to deal with are multiple databases. So far I have always worked with just one and in this assignment there are many more.
Attached is the form code in HTML and the specification of how the database should look like to create the correct php code solution.
I will be glad for any advice or pointing to some source of information in which I could learn more and solve my problem.
Thanks!
<form id='form' action='module/form.php' method="post">
<p class="form-upper-text">Vyberte datum a čas podle obsazenosti dle kalendáře nahoře</p>
<p class="form-upper-down-text">(všechna pole formuláře <span style='font-weight: bold;'>musí</span> být vyplněna)</p>
<label for='facility'>Zařízení:</label>
<select id='facility' name='facility' required>
<option value='hriste'>Venkovní hřiště</option>
<option value='sokolovna'>Sokolovna</option>
</select>
<label for='start'>Začátek:</label>
<input type='datetime-local' id='start' name='start'/>
<label for='end'>Konec:</label>
<input type='datetime-local' id='end' name='end' />
<label for='purpose'>Účel rezervace:</label>
<input type='text' id='purpose' name='purpose' placeholder="Vyplňte účel rezervace" />
<label for='email'>Email:</label>
<input type='email' id='email' name='email' placeholder="Zadejte platný email" />
<label for='persons'>Počet osob:</label>
<input type='number' id='persons' name='persons' min="1" placeholder="Vyplňte počet osob pro Vaší rezervaci" />
<label class="consent-text">
<input type='checkbox' id='consent' name='consent' />
SOUHLASÍM se zpracováním osobních údajů pro účely provedení rezervace v souladu s Obecným nařízením na ochranu osobních údajů (GDPR)
</label>
<div id='captcha'>
<!-- CAPTCHA implementace -->
</div>
<button type='submit'>Rezervovat</button>
</form>
Database scheme
I tried copying different solutions and nothing worked. I also tried to create the code myself but nothing worked either.
I think the main problem will be the date I send from the form.
Nowak is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.