-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreviewfile.php
More file actions
42 lines (34 loc) · 902 Bytes
/
reviewfile.php
File metadata and controls
42 lines (34 loc) · 902 Bytes
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
<?php
# header("location:login.html");
# exit();
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';
$id = $_SESSION['id'];
$sql = "SELECT * FROM review where reviewid = '$id' and project=$projnum";
$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;
$rid = $assignment["rid"];
$sql = "update review set score=$value where rid=$rid";
# echo $sql . "<br><br>";
$rs2 = mysqli_query($cid, $sql);
$counter = $counter + 1;
}
header("location:index.php");
exit();
?>