-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshowcode.php
More file actions
126 lines (101 loc) · 3.84 KB
/
Copy pathshowcode.php
File metadata and controls
126 lines (101 loc) · 3.84 KB
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
<!doctype html>
<html ng-app="CodexApp">
<head>
<title>Editor</title>
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="main.css" />
<link rel="stylesheet" href="css/bootstrap.css" type="text/css" media="all">
<link rel="stylesheet" href="css/style.css" type="text/css" media="all">
<link rel="stylesheet" href="css/font-awesome.min.css" />
<!-- default css files -->
<!--web font-->
<link href="//fonts.googleapis.com/css?family=Noto+Sans:400,400i,700,700i&subset=cyrillic,cyrillic-ext,devanagari,greek,greek-ext,latin-ext,vietnamese" rel="stylesheet">
<link href="//fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese" rel="stylesheet">
<!--//web font-->
<!-- scrolling script -->
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".scroll").click(function(event) {
event.preventDefault();
$('html,body').animate({
scrollTop: $(this.hash).offset().top
}, 1000);
});
});
</script>
<!-- //scrolling script -->
<style>
.coding-pane {
width: 100%;
height: 100%;
padding: 10px;
}
.write-code {
width: 50%;
height: 100%;
font-family: consolas, monospace;
}
input.username{
border: 0px;
background: white;
width: 100px;
}
</style>
</head>
<!-- Body -->
<body>
<!-- banner -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" style="float:right">
<ul class="nav navbar-nav link-effect-4">
<li><a href="/ProjectCodex/Dashboard.php?user=<?php echo $_GET['user'] ?>">Dashboard</a> </li>
<!-- <li><a href="/ProjectCodex/about.html" data-hover="About">About </a> </li> -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" style="color:#428BCA;font-size:15px;">
<?php
if(isset( $_GET['user']))
{$_SESSION['userid'] = $_GET['user'];
echo "<b><input name='userid' class='username' type='text' value = '".$_SESSION['userid']."' disabled='true'/> </b>";
}
?>
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="/ProjectCodex/profile.php"><span class="glyphicon glyphicon-cog"></span>Settings</a></li>
<li><a href="/ProjectCodex/index.html"><span class="glyphicon glyphicon-log-out"></span>Logout</a></li>
</ul>
</li>
<li><a href="notification.php"><span class="glyphicon glyphicon-bell"></span>Notifications</a></li>
</ul>
</div>
<br><br>
<h4 style="background-color: black; padding: 10px; color: #428BCA">
<?php
$answerId = $_GET['AnsId'];
$con = mysqli_connect("localhost", "root", "root123", "Codex");
if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
}
$getQuestionID = "SELECT qid FROM answer WHERE AnsID = ".$answerId." limit 1";
$Qresult = mysqli_query($con, $getQuestionID);
$QNameRow = mysqli_fetch_array($Qresult);
echo 'Q. ';
$questionId = $QNameRow['qid'];
$getQuestion = "SELECT * FROM queavail WHERE QID = ".$QNameRow['qid']." limit 1";
$result_q = mysqli_query($con, $getQuestion);
$row_q = mysqli_fetch_array($result_q);
echo $row_q['Qname'];
?>
</h4>
<?php
session_start();
$code= isset($_GET['cd']) ? $_GET['cd'] : '';
$con=mysqli_connect("localhost","root","root123","Codex");
if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
}
$ans=$_GET['AnsId'];
$res=mysqli_query($con,"select * from answer where AnsID='".$ans."'");
$row=mysqli_fetch_array($res);
echo $row['Solution'];
?>
</body>
</html>