-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstory.php
68 lines (54 loc) · 2.4 KB
/
story.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
<?php
session_start();
if(!isset($_SESSION['loggedin']) && $_SESSION['loggedin']!=true){
header("location: ./index.php");
}
require './partials/_end.php';
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="./images/VITFAM.png" type="image/x-icon">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Cinzel+Decorative&display=swap" rel="stylesheet">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous">
<link rel="stylesheet" href="./style/style.css">
<title>VITFAM | Story</title>
</head>
<body>
<div id="loader">
<div class="clock-loader"></div>
</div>
<?php
require './partials/_header.php';
include './partials/_dbconnect.php';
$id = $_SESSION['user_id'];
$sql = "SELECT * FROM story S, users U WHERE U.story_id = S.story_id AND U.user_id = '$id'";
$result = mysqli_query($conn, $sql);
$num = mysqli_num_rows($result);
if ($num) {
while($row = mysqli_fetch_assoc($result)){
$_SESSION['story_id'] = $row['story_id'];
$_SESSION['clue_id'] = 1;
echo '
<div class="container story-box my-5" style="width:80%;">
<h1 class="text-center my-4" style="font-family: \'Cinzel Decorative\', cursive;">' . $row['story_title'] . '</h1>
<p style="line-height:30px;">' . $row['story_content'] . '</p>
<form action="./clues.php" method="POST" class="d-flex justify-content-lg-end my-5">
<input class="btn btn-warning" type="submit" name="stage1" value="Proceed to Clues">
</form>
</div>
';
}
}
require './partials/_footer.php';
?>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-U1DAWAznBHeqEIlVSCgzq+c9gqGAJn5c/t99JyeKa9xxaYpSvHU5awsuZVVFIhvj" crossorigin="anonymous"></script>
<script src="./js/main.js"></script>
</body>
</html>