-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbonusfile.php
More file actions
51 lines (40 loc) · 1.06 KB
/
bonusfile.php
File metadata and controls
51 lines (40 loc) · 1.06 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
<?php
session_start();
$act = $_GET['action'];
if(!isset($_SESSION['id'])){
if (($act != "check") && ($act != "register") && ($act != "reset"))
{
header("location:login.html");
exit();
}
}
include 'db.php';
include 'util.php';
include 'projnum.php';
if ($groupnum == -1)
{
header("location:index.html");
exit();
}
$id = $_SESSION['id'];
$sql = "SELECT * FROM bonus where groupnum=$groupnum order by entry";
$rs = mysqli_query($cid, $sql);
$counter = 0;
while ($assignment = mysqli_fetch_array($rs, MYSQLI_ASSOC))
{
# echo "<br>Review for " . $assignment["entry"] . " is " . $_POST[$counter] . "<br>\n";
$value = $_POST[$counter];
if (strlen($value) < 1)
$value = 0;
$entry = $assignment["entry"];
$id = $_SESSION['id'];
$sql = "delete from bonuspoints where reviewid=$id and entry=$entry";
mysqli_query($cid, $sql);
$sql = "insert into bonuspoints(reviewid, entry, score) values($id, $entry, $value)";
# echo $sql . "<br><br>";
$rs2 = mysqli_query($cid, $sql);
$counter = $counter + 1;
}
header("location:bonus.php");
exit();
?>