-
Notifications
You must be signed in to change notification settings - Fork 0
/
book1.php
126 lines (109 loc) · 3.31 KB
/
book1.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
<!DOCTYPE html>
<html>
<head>
<title>
Package info
</title>
<link rel="stylesheet" href="stylepkg.css">
</head>
<body>
<div class="card">
<div class="top-section">
<?php
session_start();
$host = "localhost";
$dbusername = "root";
$dbpassword = "";
$dbname = "Travel_Agency";
$conn = new mysqli($host, $dbusername, $dbpassword, $dbname);
$paID = $_GET["name"];
$P_start;
$P_Destination;
$P_Price_Adult;
$P_Price_Child;
$Tr_Type;
$img1;
$img2;
$img3;
$r;
$rr;
$coname;
$rrcheck;
$sql2;
$sql3;
$Com_ID;
$sql = "select Pa_Start, Pa_Destination, Co_ID, Pa_Price_Adult, Pa_Price_Child,T_Type
from package p, transport t
where Pa_ID = $paID and p.T_ID = t.T_ID;";
$result = mysqli_query($conn, $sql);
$resultcheck = mysqli_num_rows($result);
if ($resultcheck > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$P_start = $row['Pa_Start'];
$P_Destination = $row['Pa_Destination'];
$P_Price_Adult = $row['Pa_Price_Adult'];
$P_Price_Child = $row['Pa_Price_Child'];
$Tr_Type = $row['T_Type'];
$Com_ID = $row['Co_ID'];
}
}
if ($conn->query($sql)) {
} else {
echo "Error" . $sql . "<br />" . $conn->error;
}
$sql2 = "select Pa_ID,Pa_img1, Pa_img2, Pa_img3
from pa_image where Pa_ID = $paID;";
$r = mysqli_query($conn, $sql2);
$rcheck = mysqli_num_rows($r);
if ($rcheck > 0) {
while ($row2 = mysqli_fetch_assoc($r)) {
$img1 = $row2['Pa_img1'];
$img2 = $row2['Pa_img2'];
$img3 = $row2['Pa_img3'];
}
}
$sql3 = "select Co_Name from company where Co_ID = $Com_ID;";
$rr = mysqli_query($conn, $sql3);
$rrcheck = mysqli_num_rows($rr);
if ($rcheck > 0) {
while ($row3 = mysqli_fetch_assoc($rr)) {
$coname = $row3['Co_Name'];
}
}
$conn->close();
?>
<img id="image-container" src="<?php echo $img1; ?>" alt="">
<div class="nav">
<img onclick="change_img(this)" src="<?php echo $img1; ?>">
<img onclick="change_img(this)" src="<?php echo $img2; ?>">
<img onclick="change_img(this)" src="<?php echo $img3; ?>">
</div>
</div>
<div class="product-info">
<div class="name"><?php echo $P_Destination; ?></div>
<div class="dis">
The starting location is <b><?php echo $P_start; ?></b>.<br>
The Destination location is <b><?php echo $P_Destination; ?></b>.<br>
Price per adult is <b><?php echo $P_Price_Adult; ?></b> taka.<br>
Price per child is <b><?php echo $P_Price_Child; ?></b> taka.<br>
The transport of choice is <b><?php echo $Tr_Type; ?></b>.<br>
The Company is <b><?php echo $coname; ?></b>.<br>
</div>
<?php
if (isset($_SESSION['userID'])) {
?>
<a class="btn" href="reservation1.php?name=<?= $paID; ?>">Book This Package</a>
<?php
} else {
echo '<a class="btn" href="signin1.php">Sign in to Book!</a>';
}
?>
</div>
<script type="text/javascript">
var container = document.getElementById("image-container");
function change_img(image) {
container.src = image.src;
}
</script>
</body>
</html>