Files
core/twe/j_map.php
T
Hide_D 0841950366 func_map.php를 통해 현재 지도 값을 받아오는 코드 추가
j_map.php를 통해 지도를 json 형태로 열람하는 코드 추가

연감의 저장코드를 http를 통해 지도를 받아오는 방식에서 func_map.php를 이용하는 방식으로 변경

map.js에서 반환값이 올바른지 확인하는 코드 추가
2018-02-02 00:30:04 +09:00

44 lines
973 B
PHP

<?php
include 'lib.php';
include 'func.php';
use utilphp\util as util;
//읽기 전용이다. 빠르게 세션 끝내자
session_write_close();
$defaultPost = [
'year' => null,
'month' => null,
'aux' => null,
'neutralView' => false,
'showMe' => true
];
$post = array_merge($defaultPost, parseJsonPost());
if($post['year']){
if($post['month'] < 1 || $post['month'] > 12){
returnJson([
'result'=>false,
'reason'=>'잘못된 개월 값'
]);
}
$post['year'] = intval($post['year']);
$post['month'] = intval($post['month']);
}
else{
$post['year'] = null;
$post['month'] = null;
}
//TODO: DB를 받아오는 함수를 부른다. 부르는 함수는 func.php 쪽에 있는 것이 좋을 듯. 받아오는 방식은 map.php 참고.
//TODO: 결과값을 반환한다. 반환하는 양식은 tmp_map/result.json 참고
$request = new MapRequest($post);
returnJson(getWorldMap($request));