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.
 
 
 
 

49 lines
1.6 KiB

<?php
require_once('../ajax_asm.php');
$UID = intval( $CUser->Data['id'] );
$ACCESS = intval( $CUser->Data['access'] );
$Data = array();
if( $UID > 1 ){
if( isset( $_POST['MID'] ) ){
$MID = intval($_POST['MID']);
$QS = "SELECT * FROM `location_maps` WHERE `id`={$MID}";
$DDD = $DATABASE->Query( $QS );
if( count( $DDD ) ){
$Data = $DDD[0];
} else {
// Default Map - OpenStreetMap
$Data['id']=0;
$Data['type']=1;
$Data['name']='__DEFAULT__';
$Data['layer_url']='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
$Data['attribution']='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors';
$Data['maxNativeZoom']=18;
$Data['maxZoom']=24;
};
} else {
$QS = "SELECT `map_id`, `local_binding` FROM `system_props` LIMIT 1";
$DDD = $DATABASE->Query( $QS );
$Data['selected_map'] = intval( $DDD[0]['map_id'] );
$Data['local_binding'] = ( intval( $DDD[0]['local_binding'] ) > 0 );
$QS = "SELECT * FROM `location_maps` WHERE `id`={$Data['selected_map']}";
//$Data['maps'] = array();
$R = $DATABASE->Query( $QS );
if( count( $R ) ){
$Data['maps']=$R[0];
} else {
// Default Map - OpenStreetMap
$MD['id']=0;
$MD['type']=1;
$MD['name']='OpenStreetMap';
$MD['layer_url']='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
$MD['attribution']='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors';
$MD['maxNativeZoom']=18;
$MD['maxZoom']=24;
$Data['maps'] = $MD;
};
};
} else {
};
echo json_encode( $Data );
?>