forked from if-itb/IF3110-2015-T1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
question.php
133 lines (119 loc) · 3.65 KB
/
question.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
<?php
include ("functions.php");
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>StackExchange</title>
<link href='https://fonts.googleapis.com/css?family=Titillium+Web|Source+Sans+Pro|Droid+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="css/styles.css">
<script type="text/javascript" src="js/validation.js"></script>
</head>
<body>
<div class="container">
<div class="header">
<h1>
<a href="index.php">Simple StackExchange</a>
</h1>
</div>
<div class="wrapper">
<div class="title">
<h2>
<?php
getQuestionByParam("topic");
?>
</h2>
</div>
<?php
$voteUpURL = "vote.php?id=".$_GET['id']."&act=up";
$voteDownURL = "vote.php?id=".$_GET['id']."&act=down";
?>
<div class="question-container">
<div class="vote-place">
<img src="images/up-arrow.png" onclick='vote(<?php echo $_GET['id'] ?>, "question", "up")' class="arrow-images">
<h1>
<?php
$idQuestion = "question-".$_GET['id'];
?>
<span id=<?php echo $idQuestion; ?> >
<?php
getQuestionByParam("votes");
?>
</span>
</h1>
<img src="images/down-arrow.png" onclick='vote(<?php echo $_GET['id'] ?>, "question", "down")' class="arrow-images">
</div>
<div class="full-question">
<p>
<?php
getQuestionByParam("content");
?>
</p>
</div>
<div class="asked-by">
<p>asked by
<span class="name">
<?php
getQuestionByParam("email");
?>
</span>
at
<span class="date">
<?php
getQuestionByParam("date");
?>
</span>
<?php
$editURL = "form-edit.php?id=".$_GET['id'];
$deleteURL = "delete-question.php?id=".$_GET['id'];
?>
| <a href=<?php echo $editURL ?> class="edit"> edit </a>
| <a href=<?php echo $deleteURL ?> onclick="return validateDelete()" class="delete"> delete </a>
</p>
</div>
</div>
<?php
getCountAnswers();
?>
<?php
getAnswers();
?>
<!--
<div class="answer-container">
<div class="vote-place">
<img src="images/up-arrow.png" class="arrow-images">
<h1>6</h1>
<img src="images/down-arrow.png" class="arrow-images">
</div>
<div class="full-question">
<p>The answer content goes here Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="asked-by">
<p>answered by username at datetimes</p>
</div>
</div>
-->
<?php
$actionURL = "add-answer.php?id=".$_GET['id'];
?>
<form role="form" method="post" action=<?php echo $actionURL ?> onsubmit="return validateForms()" class="question-form">
<div class="title">
<h1>Your Answer</h1>
</div>
<input name="name" type="text" placeholder="Name" class="content-question-form">
<input name="email" type="text" placeholder="Email" class="content-question-form">
<textarea name="content" rows="10" cols="106" placeholder="Content" class="textarea-question-form"></textarea>
<input name="post-answer" type="submit" value="Post" class="post-button">
</form>
</div>
</div>
</body>
</html>