-
Notifications
You must be signed in to change notification settings - Fork 0
/
acc.php
38 lines (33 loc) · 1.15 KB
/
acc.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
<?php
error_reporting(E_ALL ^ E_NOTICE);
require_once("models/config.php");
if (!securePage($_SERVER['PHP_SELF'])){die();}
if(!isUserLoggedIn){ header("Location: login.php"); die();}
$from = $_SESSION["from"];
$prid = $_SESSION["prid"];
$sql = "UPDATE send_request
SET accepted='1' WHERE from_user='$from'";
if ($mysqli->query($sql) === TRUE) {
echo "";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$sql1 = "INSERT INTO team_mem (proj_id, mem1, mem2, mem3, mem4, mem5)
VALUES('$prid', NULL , NULL, NULL, NULL, NULL)";
if ($mysqli->query($sql1) === TRUE) {
echo "";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$counter = 1;
$mem = "mem".$counter;
$sql2 = "UPDATE team_mem
SET $mem='$from' WHERE proj_id='$prid' AND mem1='NULL'";
if ($mysqli->query($sql2) === TRUE) {
echo "Added to group.";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$counter++;
header("Location: account.php");
?>