Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.2 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. /*
  4. $CREATE_SENTENCE = <<<_DATA_BOUNDARY
  5. CREATE TABLE "location_maps" (
  6. "id" INTEGER NOT NULL UNIQUE,
  7. "type" INTEGER NOT NULL DEFAULT 1,
  8. "name" TEXT NOT NULL,
  9. "desc" TEXT,
  10. "layer_url" TEXT,
  11. "maxNativeZoom" INTEGER,
  12. "maxZoom" INTEGER,
  13. "attribution" TEXT,
  14. "bounds_lx" REAL,
  15. "bounds_ly" REAL,
  16. "bounds_rx" REAL,
  17. "bounds_ry" REAL,
  18. PRIMARY KEY("id" AUTOINCREMENT)
  19. )
  20. _DATA_BOUNDARY;
  21. */
  22. if( $CUser->Data['id'] > 1 ){
  23. $Data = array();
  24. $Data['success'] = false;
  25. //$DATABASE->Query( $CREATE_SENTENCE );
  26. $QS = "SELECT * FROM `location_maps`";
  27. $Result = $DATABASE->Query($QS,false);
  28. if( count( $Result ) ){
  29. $Data['maps'] = array();
  30. foreach( $Result as $CD ){
  31. $cnode['map_id'] = intval($CD['id']);
  32. $cnode['map_type'] = intval($CD['type']);
  33. $cnode['map_name'] = $CD['name'];
  34. $cnode['map_url'] = $CD['layer_url'];
  35. $cnode['map_attr'] = $CD['attribution'];
  36. $cnode['map_zoom'] = intval($CD['maxZoom']);
  37. $cnode['map_native_zoom'] = intval($CD['maxNativeZoom']);
  38. $Data['maps'][] = $cnode;
  39. };
  40. $Data['success'] = true;
  41. };
  42. echo json_encode( $Data );
  43. } else {
  44. header('location: /');
  45. };
  46. ?>