forked from jasonhillinger/Mini-Stackoverflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
114 lines (101 loc) · 4.38 KB
/
index.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
<?php
include_once 'server.php';
session_start(); //start a new session if not already started
include_once 'posts.php';
include 'fetchProfile.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Tech Hut</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<script> src=".js/index.js" </script>
<link href=".css/index.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="header">
<img src="tech2.jpg" alt="logo" class="src">
<h1><b>Welcome to Tech Hut</b></h1>
</div>
<div class="navbar">
<a href="index.php">Home</a>
<?php
if (isset($_SESSION["userID"])){
echo("<a href=\"logout.php\" class=\"right\">Logout</a>");
echo("<a href=\"profile.php?userID=". $_SESSION["userID"] ."\" class=\"right\">". $_SESSION["username"] ."</a>");
}
else{
echo("<a href=\"registration.php\" class=\"right\" >Register</a>");
echo("<a href=\"login.php\" class=\"right\">Login</a>");
}?>
</div>
<div class="container">
<h2><b> A fast and efficient website to ask your Tech questions </b></h2>
<img src="" />
</div>
<div class="container text-center">
<div class="row">
<div class="col-sm-12">
<div class="row">
<div class="col-sm-2">
</div>
<div class="col-sm-6">
<div class="panel panel-default text-left">
<form id="form" method="post">
<div class="panel-body">
<label>Have a Question?</label>
<br>
<input type="hidden" name="submitQuestion" value="1" />
<textarea class="form-control" id="title" name="title" rows=1 cols="30" required placeholder="Question Title"></textarea>
<textarea class="form-control" id="userQuestion" name="userQuestion" rows=4 cols="50" required placeholder="Describe your question here"></textarea>
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-default" value="Submit Question">
</div>
</form>
</div>
</div>
<div class="col-sm-1">
</div>
<?php
if (isset($_SESSION["userID"])){
echo("
<div class=\"col-sm-3 well\">
<div class=\"well\">
<p><a href=\"profile.php?userID=". $_SESSION["userID"] ."\">". $_SESSION["username"] ."</a></p>
<a href=\"profile.php?userID=". $_SESSION["userID"] ."\"><img class=\"img-circle\" src=\"data:image/jpeg;base64, " . fetchProfilePic($_SESSION["username"]) . "\" alt=\"Profile Picture\" height=\"65\" width=\"65\"></a>
</div>
<div class=\"well\">
<p><a href=\"#\">Tags</a></p>
<p>
<span class=\"label label-default\">News Technology</span>
<span class=\"label label-primary\">IT questions</span>
<span class=\"label label-success\">HELP</span>
<span class=\"label label-info\">Q&A</span>
</p>
</div>
</div>");
}
else{
}
?>
</div>
</div>
<div class="col-sm-9">
<?php include 'fetchQA.php'; ?>
</div>
</div>
</div>
</div>
<footer class="footer">
<h5></h5>
</footer>
<footer class="footer">
<p>Project by Team 01 for SOEN 341 <a>https://github.com/jasonhillinger/soen341project</a></p>
</footer>
</body>
</html>