58 lines
1.1 KiB
PHP
58 lines
1.1 KiB
PHP
<?php
|
|
session_start();
|
|
if( !defined('IN') ) die('bad request!');
|
|
include_once( AROOT . 'controller' . DS . 'app.class.php');
|
|
header("Content-Type: text/html; charset=utf-8");
|
|
|
|
class dashboardController extends appController
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
// 发送错误结果集
|
|
public function send_error($number,$msg)
|
|
{
|
|
$obj = array();
|
|
$obj['code'] = intval($number);
|
|
$obj['result'] = $msg;
|
|
|
|
if( g('API_EMBED_MODE') == 1 ){
|
|
return json_encode($obj);
|
|
}else{
|
|
header("Content-Type: application/json");
|
|
die(json_encode($obj));
|
|
}
|
|
}
|
|
|
|
// 发送结果集
|
|
public function send_result($data)
|
|
{
|
|
$obj = array();
|
|
$obj['code'] = 0;
|
|
$obj['result'] = 'success';
|
|
$obj['data'] = $data;
|
|
|
|
if( g('API_EMBED_MODE') == 1 ){
|
|
return json_encode($obj);
|
|
}else{
|
|
header("Content-Type: application/json");
|
|
die(json_encode($obj));
|
|
}
|
|
}
|
|
|
|
//设备的经度纬度
|
|
public function getAreaAllDeviceMapInfo(){
|
|
$role_id = $this -> TokenRole();
|
|
$role_id=2;
|
|
if($role_id == 1){
|
|
|
|
}else{
|
|
$sql = "select longitude,latitude from terminal";
|
|
}
|
|
|
|
$data = get_data($sql);
|
|
return self::send_result($resu);
|
|
}
|
|
} |