$_POST, $_GET 남은 부분 제거. 연감 지도 받아오는 부분 재 작성
This commit is contained in:
+3
-1
@@ -4,7 +4,8 @@ namespace sammo;
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
$btn = Util::getReq('btn');
|
||||
$yearmonth = $_POST['yearmonth'];
|
||||
$yearmonth = Util::getReq('yearmonth');
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
@@ -38,6 +39,7 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "
|
||||
$history = MYDB_fetch_array($result);
|
||||
$e = ($history['year']*12) + $history['month'];
|
||||
|
||||
//FIXME: $yearmonth가 올바르지 않을 경우에 처리가 필요.
|
||||
if (!$yearmonth) {
|
||||
$year = $admin['year'];
|
||||
$month = $admin['month'] - 1;
|
||||
|
||||
@@ -12,7 +12,7 @@ if($session->userGrade < 5){
|
||||
}
|
||||
|
||||
|
||||
$scenarioIdx = Util::toInt(Util::array_get($_GET['scenarioIdx']));
|
||||
$scenarioIdx = Util::getReq('scenarioIdx', 'int');
|
||||
|
||||
if ($scenarioIdx !== null) {
|
||||
//TODO: preview 지도 출력
|
||||
|
||||
+21
-16
@@ -1,37 +1,42 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
$year = $_GET['year'];
|
||||
$month = $_GET['month'];
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$year = Util::getReq('year', 'int');
|
||||
$month = Util::getReq('month', 'int');
|
||||
|
||||
$url = '/a_history.php';
|
||||
|
||||
if(!strpos($_SERVER['HTTP_REFERER'], $url)) {
|
||||
exit(1);
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'Invalid Referer'
|
||||
]);
|
||||
}
|
||||
|
||||
if(!$year || !$month) {
|
||||
exit(1);
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'year, month가 지정되지 않았습니다'
|
||||
]);
|
||||
}
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select map from history where year='$year' and month='$month'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$history = MYDB_fetch_array($result);
|
||||
$map = $db->queryFirstField('SELECT map FROM history WHERE year=%i AND month=%i', $year, $month);
|
||||
|
||||
if(!$history['map']) {
|
||||
exit(1);
|
||||
if(!$map){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'해당하는 연월의 지도가 없습니다'
|
||||
]);
|
||||
}
|
||||
|
||||
$map = $history['map'];
|
||||
$map = str_replace('<_quot_>', "'", $map);
|
||||
$map = str_replace('<_dquot_>', '"', $map);
|
||||
|
||||
echo $map;
|
||||
Json::die(Json::decode($map));
|
||||
Reference in New Issue
Block a user