-
Notifications
You must be signed in to change notification settings - Fork 0
/
contactUs.php
173 lines (112 loc) · 4.73 KB
/
contactUs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php
require_once "../hotel/db/db.php";
$formPopup = "false";
//sending mail though php on localserver
//edo confirmed it will work to send a contact me
if (isset($_POST['email'])) {
$to = "damosisamuel@gmail.com"; // this is your Email address
$from = $_POST['email']; // this is the sender's Email address
$name = $_POST['name'];
$surname = $_POST['surname'];
$email = $_POST['email'];
$description = $_POST['description'];
$phone = $_POST["phone"];
$subject = "form da hotel Bezos";
$message = $name . " - " . $surname. " ". $description . " " . $from . " " . $phone . " " . $email ;
//headers
$headers = "From:hotelBezos.it";
mail($to, $subject, $message, $headers);
$formPopup = "true";
}
//$conn = new mysqli($servername, $username, $password, $dbname);
$hotelRooms = getRooms();
$mainHotel = getHotel();
$customers = getUser();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- bootstrap link -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<!-- bootstrap link -->
<link rel="stylesheet" href="./css/styles.css">
<link rel="icon" href="./images/company.jpg" />
<!-- //cdn fontawesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta2/css/all.min.css" integrity="sha512-YWzhKL2whUzgiheMoBFwW8CKV4qpHQAEuvilg9FAn5VJUDwKZZxkJNuGM4XkWuk94WCrrwslk8yWNGmY1EduTA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<title>Room Booking</title>
</head>
<body>
<!-- header include from footer folder-->
<header>
<?php
include('./header/header.php');
?>
</header>
<!-- header include from footer folder-->
<!-- main -->
<main>
<div class="container">
<h1 class="text-center text-bg-light ">Contact us </h1>
<div class="headerrip">
<?php
if ($mainHotel->num_rows > 0) {
// output data of each row
while ($row = $mainHotel->fetch_assoc()) {
?>
<div class="words">
<h2><?= $row["hotel_name"] ?></h2>
</div>
<?php
}
} else {
echo "0 results";
}
?>
</div>
<div class="container">
<div class="col-md-12 text-center text-primary mt-3">
<h3>Contact Us</h3>
</div>
<!-- section form -->
<form method="post" action="" id="contactform">
<div class="col-md-4" >
<label for="" class="form-label">Name</label>
<input type="text" class="form-control" id="name" name="name">
</div>
<div class="col-md-4" >
<label for="" class="form-label">Surname</label>
<input type="text" class="form-control" id="surname" name="surname">
</div>
<div class="col-md-4" >
<label for="" class="form-label">Email</label>
<input type="text" class="form-control" id="email" name="email">
</div>
<div class="col-md-4">
<label for="" class="form-label">Description</label>
<!-- instead of using this input we can use text area -->
<!-- <input type="text" class="form-control" id="description" name="description"> -->
<textarea class="form-control" name="description" id="description" cols="30" rows="10"></textarea>
<!-- <textarea name="description" id="description" id="" cols="30" rows="10"></textarea> -->
</div>
<div class="col-md-4">
<label for="" class="form-label">Phone Number</label>
<input type="text" class="form-control" id="phone" name="phone">
</div>
<button type="submit" class="btn btn-primary mt-2">Submit</button>
</form>
</div>
</div>
</div>
</main>
<!-- main -->
<footer>
<?php
include('./footer/footer.php')
?>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
</body>
</html>