-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeneralNotificationFuncs.php
40 lines (36 loc) · 1.26 KB
/
generalNotificationFuncs.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
<?php
function getGroupOwner($db, $gid) {
$stmt = $db->prepare("SELECT userID FROM groupUserRel
WHERE groupID = :gid AND owner = 1");
$stmt->bindValue(":gid", $gid, SQLITE3_INTEGER);
$result = $stmt->execute();
$temp = $result->fetchArray();
return $temp[0];
}
function getBillOwner($db, $bid) {
$stmt = $db->prepare("SELECT userID FROM billContributors
WHERE billID = :bid AND owner = 1");
$stmt->bindValue(":bid", $bid, SQLITE3_INTEGER);
$result = $stmt->execute();
$temp = $result->fetchArray();
return $temp[0];
}
function notiLumpBill($db, $liid, $bid) {
$stmt = $db->prepare("INSERT INTO notiBill(notiID, billID) VALUES(:liid, :bid)");
$stmt->bindValue(":liid", $liid, SQLITE3_INTEGER);
$stmt->bindValue(":bid", $bid, SQLITE3_INTEGER);
$stmt->execute();
}
function notiLumpUser($db, $liid, $uid) {
$stmt = $db->prepare("INSERT INTO notiUser(notiID, secondUserID) VALUES(:liid, :uid)");
$stmt->bindValue(":liid", $liid, SQLITE3_INTEGER);
$stmt->bindValue(":uid", $uid, SQLITE3_INTEGER);
$stmt->execute();
}
function notiLumpGroup($db, $liid, $gid) {
$stmt = $db->prepare("INSERT INTO notiGroup(notiID, groupID) VALUES(:liid, :gid)");
$stmt->bindValue(":liid", $liid, SQLITE3_INTEGER);
$stmt->bindValue(":gid", $gid, SQLITE3_INTEGER);
$stmt->execute();
}
?>