This repository has been archived by the owner on May 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaddans.php
executable file
·146 lines (144 loc) · 4.2 KB
/
addans.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
<?php session_start(); ?>
<?php
if(!isset($_SESSION['loggedin'])){
header('location:login.php');}
?>
<?php
include("header.php");
include("essentials/database.php");
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="description" content="GNDEC GATE FORUM">
<meta name="keywords" content="gate,priyanshumay,gne,gndec,">
<meta name="author" content="PriyanshuMay,priyanshumay">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Add answer</title>
<link href="forum.css" rel="stylesheet" type="text/css">
<style type="text/css">
body{
padding-top: 100px;
overflow-x: hidden;
padding-left: 130px;
}
.question_display {
position: relative;
border: none;
width: 90%;
padding: 20px;
}
#answerbox{
position: relative;
padding-left: 130px;
width: 80%;
}
#submitans {
background-color:#833AB4;
color: white;
padding: 11px;
font-size: 11px;
border: none;
cursor: pointer;
font-weight: bold;
font-family: courier;
border-radius: 5%;
}
#submitans:hover, #submitans:focus {
background-color: #DB4437;
}
#title{
line-height: 1.5;
letter-spacing: -1px;
color: #333;
tab-size: 4;
word-break: break-word;
text-align: left;
direction: ltr;
user-select: text;
font-size: 25px;
font-family: Courier new ;
}
.select {
position: relative;
letter-spacing: 0px;
font-family: courier;
color: red;
}
.select option{
font-family: courier;
color: white;
font-weight: bold;
}
.option{
font-family: courier;
color: white;
font-weight: bold;
background-color:#833AB4;
padding: 5px;
}
#specs{
font-size:12px;
font-family: courier new ;
font-weight: bold;
color: #833AB4;
}
#details{
font-weight: bold;
color: red;
font-size:12px;
}
#line{
border: 2px solid red;
border-radius: 5px;
}
</style>
</head>
<body>
<?php
$ID = $_POST['id'];
$sql = "SELECT id,content,level,tym,branch,username,datetym FROM questions WHERE id = '$ID'";
$result = $con->query($sql);
if ($result->num_rows > 0)
while($row = $result->fetch_assoc()) :?>
<div class="question_display" style="left: 30px;">
<span id="title"><?php echo $row["content"]; ?></span><br><hr id="line"><br>
<span id="specs">Asked by </span> <span id="details"><?php echo $row["username"]; ?></span>  
<span id="specs">time alloted is</span> <span id="details"><?php echo $row["tym"]; ?></span>  
<span id="specs">difficulty level estimated is</span> <span id="details"><?php echo $row["level"]; ?></span>  
<span id="specs">question comes under</span> <span id="details"><?php echo $row["branch"]; ?></span><span id="specs"> branch</span> 
<span id="specs">posted on</span> <span id="details"><?php echo $row["datetym"]; ?></span><br>
</div><br><br>
<?php
endwhile;
?>
<div id="answerbox" >
<form name="addform" action="postans.php" method="POST">
<input type="hidden" name="qid" value="<?php echo $ID;?>">
<textarea name="content" class="input_text" id="content" placeholder="Enter the solution" cols="100" rows="10" required></textarea>
<div class="select">
<br>
<label>Difficulty level</label>
<select name="level" class="option">
<option value="Low">Low</option>
<option value="Medium">Medium</option>
<option value="High">High</option>
</select>  
<label>Time Required</label>
<select name="tym" class="option">
<option value="0-2 min">0-2 Min</option>
<option value="2-5 Min">2-5 Min</option>
<option value="5-10 Min">5-10 Min</option>
</select>
    <button type="submit" name="submit" class="submit" id="submitans" >Post Your Answer</button>
</div>
<script src="essentials/ckeditor/ckeditor.js" ></script>
<script type="text/javascript">
CKEDITOR.replace('content');
</script>
</form>
</div>
</div>
</div>
</body>