Allow family members to shop for other family members
This commit is contained in:
parent
b5716bb14c
commit
eeae574cb2
1 changed files with 9 additions and 7 deletions
16
src/shop.php
16
src/shop.php
|
@ -142,13 +142,15 @@ if (!empty($_GET["action"])) {
|
|||
}
|
||||
}
|
||||
|
||||
$stmt = $smarty->dbh()->prepare("SELECT * FROM {$opt["table_prefix"]}shoppers WHERE shopper = ? AND mayshopfor = ? AND pending = 0");
|
||||
$stmt->bindParam(1, $userid, PDO::PARAM_INT);
|
||||
$stmt->bindParam(2, $shopfor, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
if (!($stmt->fetch())) {
|
||||
echo "Nice try! (You can't shop for someone who hasn't approved it.)";
|
||||
exit;
|
||||
if (!$opt["auto_connect_family_members"]) {
|
||||
$stmt = $smarty->dbh()->prepare("SELECT * FROM {$opt["table_prefix"]}shoppers WHERE shopper = ? AND mayshopfor = ? AND pending = 0");
|
||||
$stmt->bindParam(1, $userid, PDO::PARAM_INT);
|
||||
$stmt->bindParam(2, $shopfor, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
if (!($stmt->fetch())) {
|
||||
echo "Nice try! (You can't shop for someone who hasn't approved it.)";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_GET["sortdir"])) {
|
||||
|
|
Loading…
Add table
Reference in a new issue