Code Plateforme de Logement

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Code plateforme logement

Pour formulaire inscription etudiant

<!DOCTYPE html>

<html>

<head>

<title>Inscription étudiant</title>

</head>

<body>

<h1>Inscription étudiant</h1>

<form action="inscription.php" method="POST">

<label for="nom">Nom :</label>

<input type="text" id="nom" name="nom"><br>

<label for="email">Email :</label>

<input type="email" id="email" name="email"><br>

<label for="ville_etudes">Ville d'études :</label>

<input type="text" id="ville_etudes" name="ville_etudes"><br>

<label for="budget_location">Budget de location :</label>

<input type="number" id="budget_location" name="budget_location"><br>

<input type="submit" value="Inscription">

</form>

</body>

</html>

1. La création d'une base de données pour stocker les informations des utilisateurs, des
logements et des propriétaires :

CREATE TABLE users (

id INT AUTO_INCREMENT PRIMARY KEY,


name VARCHAR(255) NOT NULL,

email VARCHAR(255) NOT NULL,

password VARCHAR(255) NOT NULL,

city VARCHAR(255) NOT NULL,

budget INT

);

CREATE TABLE properties (

id INT AUTO_INCREMENT PRIMARY KEY,

owner_id INT NOT NULL,

title VARCHAR(255) NOT NULL,

description TEXT,

address VARCHAR(255) NOT NULL,

city VARCHAR(255) NOT NULL,

price INT NOT NULL,

size INT NOT NULL,

image_url VARCHAR(255),

created_at DATETIME DEFAULT CURRENT_TIMESTAMP,

updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

);

CREATE TABLE bookings (

id INT AUTO_INCREMENT PRIMARY KEY,

property_id INT NOT NULL,

user_id INT NOT NULL,

check_in_date DATE NOT NULL,

check_out_date DATE NOT NULL,

total_price INT NOT NULL,

created_at DATETIME DEFAULT CURRENT_TIMESTAMP,

updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

);
2. La création d'une interface utilisateur pour l'inscription et la connexion des utilisateurs
:
3. <!-- Inscription -->
4. <form action="/register" method="POST">
5. <label for="name">Nom :</label>
6. <input type="text" id="name" name="name" required>
7. <br>
8. <label for="email">E-mail :</label>
9. <input type="email" id="email" name="email" required>
10. <br>
11. <label for="password">Mot de passe :</label>
12. <input type="password" id="password" name="password" required>
13. <br>
14. <label for="city">Ville d'études :</label>
15. <input type="text" id="city" name="city" required>
16. <br>
17. <label for="budget">Budget de location :</label>
18. <input type="number" id="budget" name="budget" required>
19. <br>
20. <button type="submit">S'inscrire</button>
21. </form>
22.
23. <!-- Connexion -->
24. <form action="/login" method="POST">
25. <label for="email">E-mail :</label>
26. <input type="email" id="email" name="email" required>
27. <br>
28. <label for="password">Mot de passe :</label>
29. <input type="password" id="password" name="password" required>
30. <br>
31. <button type="submit">Se connecter</button>
32. </form>

33. La création d'une page de recherche de logements pour les utilisateurs connectés :
34. <form action="/search" method="GET">
35. <label for="city">Ville :</label>
36. <input type="text" id="city" name="city">
37. <br>
38. <label for="price">Prix maximum :</label>
39. <input type="number" id="price" name="price">
40. <br>
41. <label for="size">Taille minimum :</label>
42. <input type="number" id="size" name="size">
43. <br>
44. <label for="distance">Distance de l'université maximum :</label>
45. <input type="number" id="distance" name="distance">
46. <br>
47. <button type="submit">Rechercher

You might also like