-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremoveUserFromGroup.php
More file actions
31 lines (28 loc) · 921 Bytes
/
removeUserFromGroup.php
File metadata and controls
31 lines (28 loc) · 921 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
<?php
require 'database.php';
require 'generalNotificationFuncs.php';
$gid = $_POST["gid"];
$uid = $_POST["uid"];
if (!empty($gid)) {
$db = new Database();
$stmt = $db->prepare("SELECT name FROM groups WHERE groupID = :gid");
$stmt->bindValue(":gid", $gid, SQLITE3_INTEGER);
$result = $stmt->execute();
$temp = $result->fetchArray();
$name = $temp[0];
$stmt = $db->prepare("INSERT INTO notifications(userID, typeID, custmsg) VALUES(:uid, 5, :name)");
$stmt->bindValue(":uid", $uid, SQLITE3_INTEGER);
$stmt->bindValue(":name", $name, SQLITE3_TEXT);
$stmt->execute();
$liid = $db->lastInsertRowID();
notiLumpGroup($db, $liid, $gid);
$stmt = $db->prepare("DELETE FROM groupUserRel
WHERE userID = :uid AND groupID = :gid");
$stmt->bindValue(":gid", $gid, SQLITE3_INTEGER);
$stmt->bindValue(":uid", $uid, SQLITE3_INTEGER);
$stmt->execute();
echo 'Good';
exit();
}
?>
<?php include "wrongTurn.php";?>