school_bell_delete.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /*
  3. FusionPBX
  4. Version: MPL 1.1
  5. The contents of this file are subject to the Mozilla Public License Version
  6. 1.1 (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.mozilla.org/MPL/
  9. Software distributed under the License is distributed on an "AS IS" basis,
  10. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. for the specific language governing rights and limitations under the
  12. License.
  13. The Original Code is FusionPBX
  14. The Initial Developer of the Original Code is
  15. Mark J Crane <[email protected]>
  16. Portions created by the Initial Developer are Copyright (C) 2008-2025
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Mark J Crane <[email protected]>
  20. */
  21. //includes files
  22. require_once dirname(__DIR__, 2) . "/resources/require.php";
  23. require_once "resources/pdo.php";
  24. require_once "resources/check_auth.php";
  25. //check permissions
  26. if (permission_exists('school_bell_delete')) {
  27. //access granted
  28. }
  29. else {
  30. echo "access denied";
  31. exit;
  32. }
  33. //add multi-lingual support
  34. $language = new text;
  35. $text = $language->get();
  36. //delete the message
  37. message::add($text['message-delete']);
  38. //delete the data
  39. if (isset($_GET["id"]) && is_uuid($_GET["id"])) {
  40. //get the id
  41. $id = check_str($_GET["id"]);
  42. //delete bridge
  43. $sql = "delete from v_school_bells ";
  44. $sql .= "where school_bell_uuid = '$id' ";
  45. $prep_statement = $db->prepare(check_sql($sql));
  46. $prep_statement->execute();
  47. unset($sql);
  48. //redirect the user
  49. header('Location: school_bells.php');
  50. }
  51. ?>