-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconect.php
More file actions
53 lines (45 loc) · 1.57 KB
/
Copy pathconect.php
File metadata and controls
53 lines (45 loc) · 1.57 KB
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
<!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">
<title>Rezervare</title>
</head>
<body>
<?php
$checkIn = $_POST['checkIn'];
$checkOut = $_POST['checkOut'];
$adults = $_POST['adults'];
$kids = $_POST['kids'];
//Conectare baza de date
$conn = new mysqli('localhost','root','','apartHotel');
if($conn->connect_error){
die('Conectare esuata : '.$conn->connect_error);
}else{
$stmt = $conn->prepare("insert into deluxeApartment(checkIn, checkOut, adults, kids)values(?, ?, ?, ?)");
$stmt->bind_param("ssii", $checkIn, $checkOut, $adults, $kids);
$stmt->execute();
echo "Your stay is reserved <br>";
echo "You have a reservation for: " .$adults. " adults";
echo " and " .$kids. " kids";
echo " between " .$checkIn. " - ";
echo "".$checkOut."";
$stmt->close();
$conn->close();
}
?>
<button><a href ='apartment1.html' style="text-decoration:none" >OK</button>
<a href='apartment1.html' button onclick="cancelreservation('Your reservation it will be canceled')"style="margin-top:1%;margin-bottom:1%;margin-left:2%;
text-decoration:none;color:black;border-style:solid">Cancel reservation</button>
<script>
function cancelreservation(){
var result=confirm('Are you sure?');
if (result==false){
event.preventDefault();
}
alert(msg)
}
</script>
</body>
</html>