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.
 
 
 
 

47 lines
1.2 KiB

<?php
require_once('../ajax_asm.php');
/*
$CREATE_SENTENCE = <<<_DATA_BOUNDARY
CREATE TABLE "location_maps" (
"id" INTEGER NOT NULL UNIQUE,
"type" INTEGER NOT NULL DEFAULT 1,
"name" TEXT NOT NULL,
"desc" TEXT,
"layer_url" TEXT,
"maxNativeZoom" INTEGER,
"maxZoom" INTEGER,
"attribution" TEXT,
"bounds_lx" REAL,
"bounds_ly" REAL,
"bounds_rx" REAL,
"bounds_ry" REAL,
PRIMARY KEY("id" AUTOINCREMENT)
)
_DATA_BOUNDARY;
*/
if( $CUser->Data['id'] > 1 ){
$Data = array();
$Data['success'] = false;
//$DATABASE->Query( $CREATE_SENTENCE );
$QS = "SELECT * FROM `location_maps`";
$Result = $DATABASE->Query($QS,false);
if( count( $Result ) ){
$Data['maps'] = array();
foreach( $Result as $CD ){
$cnode['map_id'] = intval($CD['id']);
$cnode['map_type'] = intval($CD['type']);
$cnode['map_name'] = $CD['name'];
$cnode['map_url'] = $CD['layer_url'];
$cnode['map_attr'] = $CD['attribution'];
$cnode['map_zoom'] = intval($CD['maxZoom']);
$cnode['map_native_zoom'] = intval($CD['maxNativeZoom']);
$Data['maps'][] = $cnode;
};
$Data['success'] = true;
};
echo json_encode( $Data );
} else {
header('location: /');
};
?>