-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisitor_menu_science.php
More file actions
141 lines (130 loc) · 3.9 KB
/
visitor_menu_science.php
File metadata and controls
141 lines (130 loc) · 3.9 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
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
<?php
$conn = new mysqli("localhost", "root", "", "museumsys");
//connection created
if($conn->connect_error){
die("Connection failed:".$conn->connect_error);
}
else{
$SELECT_DID = "CALL selectDepartment(3)";
//executing query
$result = $conn->query($SELECT_DID);
if($result->num_rows == 1){
$row = $result->fetch_assoc();
$Did = $row['Did'];
$Dname = $row['Dname'];
$floor = $row['Floor'];
//now we got all details of history department
}
else{
echo "<script>window.alert('Department does not exist')</script>";
exit();
}
$result->close();
}
$conn->close();
//getting all model, statues, and painting details from the department
?>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="css/visitor_menu_science.css" />
<link rel="stylesheet" href="E:/xampp/htdocs/Museum/fonts/fontawesome-free-5.10.2-web/css/all.min.css">
<title>Science and Space Page</title>
</head>
<body>
<center>
<h2 align="center"><?php echo $Dname; ?></h2>
<div class="welcome_block">
<img src="images/ken.jpg" alt="">
<div class="general_desc" align="center">
<p>The Science and Space Department.</p>
</div>
</div>
<p>We have varieties of items in the museum related to <?php echo $Dname; ?>.<br/>
The Science and Space Department is located on <?php echo $floor; ?> floor.</p>
<h3 align="center">MODELS</h3>
<div class="show_items">
<?php
$conn = new mysqli("localhost", "root", "", "museumsys");
//connection created
if($conn->connect_error){
die("Connection failed:".$conn->connect_error);
}
$SELECT = "CALL selectModel($Did)";
$result = $conn->query($SELECT);
if($result->num_rows > 0){
while($row = $result->fetch_assoc()){
echo "<hr></hr>";
echo "<div class='item_block'>";
echo " Title : ".$row['title']."<br />";
echo " Artist Name : ".$row['artist_name']."<br />";
echo " Size : ".$row['size']."<br />";
echo " Year : ".$row['year']."<br />";
echo "</div>";
echo "<hr></hr>";
}
}
$result->close();
$conn->close();
?>
</div>
<h3 align="center">STATUES</h3>
<div class="show_items">
<?php
$conn = new mysqli("localhost", "root", "", "museumsys");
//connection created
if($conn->connect_error){
die("Connection failed:".$conn->connect_error);
}
$SELECT = "CALL selectStatue($Did)";
$result = $conn->query($SELECT);
if($result->num_rows > 0){
while($row = $result->fetch_assoc()){
echo "<hr></hr>";
echo "<div class='item_block'>";
echo " Title : ".$row['title']."<br />";
echo " Artist Name : ".$row['artist_name']."<br />";
echo " Material : ".$row['material']."<br />";
echo " Style : ".$row['style']."<br />";
echo " Height : ".$row['height_in_m']." m <br />";
echo " Weight : ".$row['weight_in_kg']." kg <br />";
echo " Year : ".$row['year']."<br />";
echo "</div>";
echo "<hr></hr>";
}
}
$result->close();
$conn->close();
?>
</div>
<h3 align="center">PAINTINGS</h3>
<div class="show_items">
<?php
$conn = new mysqli("localhost", "root", "", "museumsys");
//connection created
if($conn->connect_error){
die("Connection failed:".$conn->connect_error);
}
$SELECT = "CALL selectPainting($Did)";
$result = $conn->query($SELECT);
if($result->num_rows > 0){
while($row = $result->fetch_assoc()){
echo "<hr></hr>";
echo "<div class='item_block'>";
echo " Title : ".$row['title']."<br />";
echo " Artist Name : ".$row['artist_name']."<br />";
echo " Style : ".$row['style']."<br />";
echo " Material Type : ".$row['material_type']."<br />";
echo " Year : ".$row['year']."<br />";
echo "</div>";
echo "<hr></hr>";
}
}
$result->close();
?>
</div>
</body>
</html>
<?php
$conn->close();
?>