/
admin_updateMarks.php
60 lines (48 loc) · 1.33 KB
/
admin_updateMarks.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
<?php
/*
Version: 2.0.2
http:// .com
*/
require_once("models/config.php");
if (!securePage($_SERVER['PHP_SELF'])){die();}
require_once("models/header.php");
if ($loggedInUser->checkPermission(array(2))){
if (isset($_POST['userId'])&&isset($_POST['marks'])) {
$userId = $_POST['userId'];
$questionId = $_POST['question_id'];
$marksAwarded = $_POST['marks'];
$marksAwardedBy = $_POST['whoAdded'];
updateUserMarks($userId, $questionId,$marksAwarded,$marksAwardedBy);
$totalMarksOfUser = fetchTotalMarks($userId);
updateUserProfileMarks($totalMarksOfUser, $userId );
echo "Marks updated Successfully..";
# code...
}
echo "
<body>
<div id='wrapper'>
<div id='content'>
<h1>ACM EVENT</h1>
<h2>Account</h2>
<div id='left-nav'>";
include("left-nav.php");
echo "
</div>
<div id='bottom'></div>
</div>
</body>
</html>";
?>
<form method = "POST" action = "admin_updateMarks.php" name= "updateMarks">
<h3>Update Marks</h3>
<p>User ID : <input type = "text" name = "userId"> </p>
<p>Question ID : <input type= "text" name = "question_id" ></p>
<p>Marks Awarded : <input type = "text" name = "marks"> </p>
<input type = "hidden" name = "whoAdded" value = " <?php echo $loggedInUser->user_id; ?> ">
<p><input type = "submit" value = "Update Marks">
</p>
</form>
<?php
}
else echo 'Sorry . You are not the administrator of the site.. Your IP is traced.';
?>