-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroomtemplate.php
172 lines (158 loc) · 5.56 KB
/
roomtemplate.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
<?php
session_start();
// Determine which room we're in based on URL parameter
$current_room = isset($_GET['room']) ? $_GET['room'] : '';
// Mark the room as visited in the session
switch($current_room) {
case 'living_room':
$_SESSION['living_room_visited'] = true;
$room_details = [
'title' => 'Living Room',
'description' => 'As you enter the living room, an eerie silence greets you. The space looks like it has been the scene of a violent encounter.',
'clues' => [
[
'title' => 'Broken Vase',
'description' => 'An elegant vase lies shattered on the floor. Closer inspection reveals potential fingerprints on the ceramic fragments.'
],
[
'title' => 'Whiskey Glass',
'description' => 'A half-empty whiskey glass sits on the side table. Lipstick marks rim the edge, suggesting recent use.'
]
]
];
break;
case 'kitchen':
$_SESSION['kitchen_visited'] = true;
$room_details = [
'title' => 'Kitchen',
'description' => 'The kitchen appears slightly disheveled. A knife is out of place, and there are signs of a hasty departure.',
'clues' => [
[
'title' => 'Dropped Knife',
'description' => 'A kitchen knife lies on the floor, with what appears to be a trace of blood.'
],
[
'title' => 'Half-Eaten Meal',
'description' => 'A plate with half-eaten food suggests someone was interrupted mid-meal.'
]
]
];
break;
case 'bedroom':
$_SESSION['bedroom_visited'] = true;
$room_details = [
'title' => 'Bedroom',
'description' => 'The bedroom is in complete disarray. Drawers are pulled out, and personal items are scattered across the floor.',
'clues' => [
[
'title' => 'Open Diary',
'description' => 'A diary lies open, with a recent entry partially visible.'
],
[
'title' => 'Hidden Letter',
'description' => 'A crumpled letter is found tucked behind the nightstand.'
]
]
];
break;
default:
// Redirect back to house if no room is specified
header('Location: index.php');
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo $room_details['title']; ?> - Murder Mystery</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #2c3e50;
color: #ecf0f1;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.room-container {
background-color: rgba(44, 62, 80, 0.9);
border-radius: 10px;
padding: 30px;
max-width: 800px;
width: 90%;
box-shadow: 0 0 20px rgba(0,0,0,0.3);
}
.room-title {
text-align: center;
color: #8e44ad;
border-bottom: 2px solid #8e44ad;
padding-bottom: 15px;
}
.room-description {
margin: 20px 0;
line-height: 1.6;
}
.clues {
background-color: rgba(39, 174, 96, 0.1);
border-radius: 8px;
padding: 20px;
}
.clue {
margin-bottom: 15px;
padding: 10px;
background-color: rgba(52, 73, 94, 0.5);
border-left: 4px solid #8e44ad;
}
.navigation {
display: flex;
justify-content: space-between;
margin-top: 20px;
}
.btn {
display: inline-block;
padding: 10px 20px;
background-color: #8e44ad;
color: white;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s ease;
}
.btn:hover {
background-color: #9b59b6;
}
</style>
</head>
<body>
<div class="room-container">
<h1 class="room-title"><?php echo $room_details['title']; ?></h1>
<div class="room-description">
<p><?php echo $room_details['description']; ?></p>
</div>
<div class="clues">
<h2>Discovered Clues</h2>
<?php foreach($room_details['clues'] as $clue): ?>
<div class="clue">
<h3><?php echo htmlspecialchars($clue['title']); ?></h3>
<p><?php echo htmlspecialchars($clue['description']); ?></p>
</div>
<?php endforeach; ?>
</div>
<div class="navigation">
<a href="index.php" class="btn">Back to House</a>
<?php
// Check if all rooms have been visited
$all_rooms_visited = isset($_SESSION['living_room_visited']) &&
isset($_SESSION['kitchen_visited']) &&
isset($_SESSION['bedroom_visited']);
if($all_rooms_visited): ?>
<a href="solution.php" class="btn">Submit Solution</a>
<?php endif; ?>
</div>
</div>
</body>
</html>