-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdescription.php
executable file
·130 lines (80 loc) · 2.29 KB
/
description.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
<?php
session_start();
$_SESSION['url'] = $_SERVER['REQUEST_URI'];
if (!isset($_SESSION["un"])) {
header("Location:login.php");
}
if (isset($_SESSION['un'])) {
$username = $_SESSION['un'];
}
require_once "config.php";
$mysql = "SELECT status from user WHERE name='$username'";
$snd = mysqli_query($con, $mysql);
$arrow = mysqli_fetch_array($snd);
$st = $arrow['status'];
$access = 0;
if ($st == "Teacher" || $st == "Developer") {
$access = 1;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Description</title>
<?php include 'linkers.php';?>
</head>
<body>
<div class="main">
<?php require 'nav2.php';?>
<?php
if (isset($_GET['id'])) {
$problemid = $_GET['id'];
}
if (isset($_GET['name'])) {
$problem = $_GET['name'];
$sql = "SELECT * FROM archieve WHERE pbname='$problem'";
} else {
$sql = "SELECT * FROM archieve WHERE id='$problemid'";
}
$sq = mysqli_query($con, $sql);
$row = mysqli_fetch_array($sq);
$str = "$row[pbdes]";
$key = "<br>";
echo "
<div class=\"container \">
<div class=\"col-sm-12 upore\">
<div class=\"\"><h3 style=\"text-align:center;\">$row[pbname]</h3></div>";
if ($access == 1) {
echo "<center><a class=\"btn btn-success\" href=\"editarchiveproblem.php?id=$row[id]\">Edit</a></center>";
}
echo "
</div>
</div>
<div class=\"autto container\">
<div class=\"col-sm-12\">
<p>Time Limit: $row[tlimit] Seconds</p><br><br>
<b>Problem Description</b><br><br>";
// if (strpos($str, $key) == true) {
echo "
<div id=\"\" class=\"rb math-tex\"style=\"height: 600px; width: 1100px ;background-color:white !important; overflow: scroll;padding:20px; line-height: 200%;\">
<h6>$str</h6>
</div> ";
// } else {
// echo "
// <textarea class=\"form-control rb\" rows=\"30\" cols=\"100\" readonly>$row[pbdes]</textarea>
// ";
// }
echo "
<br>
<b>Problem Setter : <a class=\"blue\" href=\"profile.php?user=$row[pbauthor]\">$row[pbauthor]</a></b><br><br>";
echo "<a class=\"btn btn-success\" href=\"submit.php?id=$row[id]\">Submit Your Code</a></div>";
?>
</div>
</div>
</div><br><br><br>
<?php require 'footer.php';?>
</body>
</html>
<!-- <textarea class=\"form-control rb\" rows=\"30\" cols=\"100\" readonly>$row[pbdes]</textarea> -->