diff --git a/app/includes/app_functions.php b/app/includes/app_functions.php index 4011194..6d7bf28 100644 --- a/app/includes/app_functions.php +++ b/app/includes/app_functions.php @@ -1,4 +1,17 @@ prepare($stmt); + $sql->execute(); + $sql->setFetchMode(PDO::FETCH_ASSOC); + $result = $sql->fetchAll(); + } catch (PDOException $e) { + echo("Error: " . $e->getMessage()); + } + return $result; + } + function get_user_name($db, $user_uuid) { try { $stmt = "SELECT given_name, family_name FROM users WHERE uuid=:uuid"; diff --git a/app/public/actions/addsub.php b/app/public/actions/addsub.php new file mode 100644 index 0000000..6a18db0 --- /dev/null +++ b/app/public/actions/addsub.php @@ -0,0 +1,30 @@ +prepare($stmt); + $sql->bindParam(':tktuuid', $request['uuid']); + $sql->bindParam(':usruuid', $POST['addSubSelector']); + $sql->execute(); + } catch (PDOException $e) { + $alert = array("danger", "Failed to add subscriber: " . $e->getMessage()); + } + } + $newURL = "/managesub?rid=" . $request['uuid']; + echo(""); + } else { + $alert = array("danger", "You are not authorised to manage subscribers on this request."); + $newURL = "/managesub?rid=" . $request['uuid']; + echo(""); + } + +?> diff --git a/app/public/actions/delsub.php b/app/public/actions/delsub.php new file mode 100644 index 0000000..f4ed389 --- /dev/null +++ b/app/public/actions/delsub.php @@ -0,0 +1,30 @@ +prepare($stmt); + $sql->bindParam(':tktuuid', $request['uuid']); + $sql->bindParam(':usruuid', $POST['addSubSelector']); + $sql->execute(); + } catch (PDOException $e) { + $alert = array("danger", "Failed to remove subscriber(s): " . $e->getMessage()); + } + } + $newURL = "/managesub?rid=" . $request['uuid']; + echo(""); + } else { + $alert = array("danger", "You are not authorised to manage subscribers on this request."); + $newURL = "/managesub?rid=" . $request['uuid']; + echo(""); + } + +?> diff --git a/app/public/managesub.php b/app/public/managesub.php index 238e5f3..e403603 100644 --- a/app/public/managesub.php +++ b/app/public/managesub.php @@ -1,11 +1,12 @@ @@ -38,7 +39,9 @@
-
Information
+
+ Information +
  • @@ -90,66 +93,57 @@
    -
    Updates
    +
    + Manage Subscribers +
      - No updates"); - } else { - foreach($updates as $update) { - ?> -
    • -
      -
      - -
      -
      - -
      +
    • +
      +
      +
      +
      + + + +
      + +
      -
    • - +
    +
  • +
  • +
    +
    +
    +
    + + + +
    + +
    +
    +
    +
-
-
-
-
-
- Request Subscribers -
- -
-
- - -