diff --git a/Python/client.py b/Python/client.py new file mode 100644 index 0000000..12ee50f --- /dev/null +++ b/Python/client.py @@ -0,0 +1,8 @@ +import socket + +if __name__ == '__main__': + clientSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM); + data = "Hello Server!"; + clientSocket.sendto(data.encode(),("172.26.145.62",9090)); + dataFromServer,sourceAddress = clientSocket.recvfrom(1024); + print(dataFromServer.decode()); diff --git a/Python/serveur.py b/Python/serveur.py new file mode 100644 index 0000000..ec866f8 --- /dev/null +++ b/Python/serveur.py @@ -0,0 +1,9 @@ +import socket + +if __name__=='__main__': + server.Socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM); + serverSocket.bind(("172.26.145.62",9090)); # Adresse du serveur à modifer selon l'IP de la RASPBERRY (TODO : prendre un argument qui sera donné par le serveur Web) + while(True): + dataFromClient, sourceAddress = serverSocket.recvfrom(1024); + print("Data from %s is %s"%(sourceAddress,dataFromClient.decode())); + serverSocket.sendto("Hello Client!".encode(),sourceAddress); diff --git a/html/Python/client.py b/html/Python/client.py new file mode 100644 index 0000000..12ee50f --- /dev/null +++ b/html/Python/client.py @@ -0,0 +1,8 @@ +import socket + +if __name__ == '__main__': + clientSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM); + data = "Hello Server!"; + clientSocket.sendto(data.encode(),("172.26.145.62",9090)); + dataFromServer,sourceAddress = clientSocket.recvfrom(1024); + print(dataFromServer.decode()); diff --git a/html/gestionReservation.php b/html/gestionReservation.php index ae3aff1..157befb 100644 --- a/html/gestionReservation.php +++ b/html/gestionReservation.php @@ -36,13 +36,18 @@ /* Verification de la syntaxe de la date */ $explosion_date = explode("-",$txtDate); $jour = $explosion_date[2]; + $mois = $explosion_date[1]; + $annee = $explosion_date[0]; if($jour<10){ - $jour = "0$jour"; - $mois = $explosion_date[1]; - $annee = $explosion_date[0]; + $jour = "0$jour"; + $txtDate = "$annee-$mois-$jour"; + } + if($mois<10){ + $mois = "0$mois"; $txtDate = "$annee-$mois-$jour"; } } + echo $txtDate; ?>
diff --git a/html/index.html b/html/index.html index 0549450..b6344f1 100644 --- a/html/index.html +++ b/html/index.html @@ -18,7 +18,7 @@
-