2021-02-01 22:51:05 +01:00
|
|
|
<!DOCTYPE html>
|
2021-01-30 17:10:07 +01:00
|
|
|
<html>
|
2021-02-01 22:51:05 +01:00
|
|
|
<head>
|
|
|
|
<link rel="stylesheet" href="style.css">
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
2021-02-27 13:20:49 +01:00
|
|
|
<title>rezerwacja</title>
|
2021-02-01 22:51:05 +01:00
|
|
|
</head>
|
2021-01-30 17:10:07 +01:00
|
|
|
<body>
|
2021-02-27 13:20:49 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
function przekierowanie()
|
|
|
|
{
|
|
|
|
window.location.replace("../rejestracja/index.php");
|
|
|
|
}
|
|
|
|
</script>
|
2021-01-30 17:10:07 +01:00
|
|
|
<?php
|
|
|
|
$godzina=$dzien="";
|
|
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST")
|
|
|
|
{
|
|
|
|
if (isset($_POST["godzina"]))
|
|
|
|
{
|
|
|
|
$godzina=$_POST["godzina"].":00:00";
|
|
|
|
}
|
|
|
|
else print "zla godzina";
|
|
|
|
echo "<br>";
|
|
|
|
if (preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/',$_POST["data"]))
|
|
|
|
{
|
|
|
|
$data = explode("-",$_POST["data"]);
|
|
|
|
if (checkdate($data[1],$data[2],$data[0]))
|
|
|
|
{
|
|
|
|
$dzien=$_POST["data"];
|
|
|
|
}}
|
|
|
|
else print "zly dzien";
|
|
|
|
|
|
|
|
if ($dzien!=""&&$godzina!="")
|
|
|
|
{
|
|
|
|
$polaczenie=mysqli_connect('localhost','pacjent','pacjent','rejestracja');
|
|
|
|
$zapytanie="INSERT INTO `wizyty` (`ID_lekarz`,`telefon`,`dzien`,`godzina`,`stan`)VALUES ('1','29736508','$dzien','$godzina','0')";
|
2021-02-08 21:30:39 +01:00
|
|
|
$wynik=mysqli_query($polaczenie,$zapytanie)or die ("błąd podczas zgłaszania wizyty");
|
|
|
|
print("Twoje zgłoszenie zostało poprawnie wysłane");
|
2021-01-30 17:10:07 +01:00
|
|
|
mysqli_close($polaczenie);
|
|
|
|
}}
|
|
|
|
?>
|
|
|
|
<form method="post" name="formularz1" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
|
|
|
|
<label for="godzina">Wybierz godzinę wizyty:</label>
|
|
|
|
<select name="godzina">
|
|
|
|
<option value="10">10</option>
|
|
|
|
<option value="11">11</option>
|
|
|
|
<option value="12">12</option>
|
|
|
|
<option value="13">13</option>
|
|
|
|
<option value="14">14</option>
|
|
|
|
<option value="15">15</option>
|
|
|
|
<option value="16">16</option>
|
|
|
|
<option value="17">17</option>
|
|
|
|
</select>
|
|
|
|
<input type="date" name="data">
|
|
|
|
<input type="submit" value="sprawdź"><br><br>
|
2021-02-27 13:20:49 +01:00
|
|
|
</form>
|
|
|
|
<input type="button" value="home" onClick="przekierowanie()">
|
2021-01-30 17:10:07 +01:00
|
|
|
</form>
|
|
|
|
</body>
|
|
|
|
</html>
|