school_bell_delete.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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-2023
  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/check_auth.php";
  24. //check permissions
  25. if (permission_exists('school_bell_delete')) {
  26. //access granted
  27. }
  28. else {
  29. echo "access denied";
  30. exit;
  31. }
  32. //add multi-lingual support
  33. $language = new text;
  34. $text = $language->get();
  35. //delete the message
  36. message::add($text['message-delete']);
  37. //delete the data
  38. if (isset($_GET["id"]) && is_uuid($_GET["id"])) {
  39. //get the id
  40. $id = check_str($_GET["id"]);
  41. //delete bridge
  42. $sql = "delete from v_school_bells ";
  43. $sql .= "where school_bell_uuid = '$id' ";
  44. $prep_statement = $db->prepare(check_sql($sql));
  45. $prep_statement->execute();
  46. unset($sql);
  47. //redirect the user
  48. header('Location: school_bells.php');
  49. }
  50. ?>