schema_name_value_delete.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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-2012
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Mark J Crane <[email protected]>
  20. */
  21. require_once "root.php";
  22. require_once "resources/require.php";
  23. require_once "resources/check_auth.php";
  24. if (permission_exists('schema_delete')) {
  25. //access granted
  26. }
  27. else {
  28. echo "access denied";
  29. exit;
  30. }
  31. //add multi-lingual support
  32. $language = new text;
  33. $text = $language->get();
  34. //get the http values
  35. if (count($_GET) > 0) {
  36. $id = check_str($_GET["id"]);
  37. $schema_uuid = check_str($_GET["schema_uuid"]);
  38. $schema_field_uuid = check_str($_GET["schema_field_uuid"]);
  39. }
  40. //delete the data
  41. if (strlen($id) > 0) {
  42. $sql .= "delete from v_schema_name_values ";
  43. $sql .= "where domain_uuid = '$domain_uuid' ";
  44. $sql .= "and schema_name_value_uuid = '$id' ";
  45. $prep_statement = $db->prepare(check_sql($sql));
  46. $prep_statement->execute();
  47. unset($sql);
  48. }
  49. //redirect the user
  50. $_SESSION["message"] = $text['message-delete'];
  51. header("Location: schema_field_edit.php?schema_uuid=".$schema_uuid."&id=".$schema_field_uuid);
  52. return;
  53. ?>