루트DB를 관리하는 방식을 통째로 변경
- DB 불러오는 방식을 기존의 set.php에서 conf.php의 getRootDB()를 이용하도록 변경 - ADODB 에 기반한 _DB 클래스 폐기 - DBS.php 폐기 - _Setting 클래스 용도 변경 - 서버 목록 정의 방식을 하나로 모음 - 로그인시 세션에 사용자 등급을 추가 - "참여"(donation) 관련 코드 전면 제거 - 서버 리셋시 부운영자 비밀번호 문제 수정 - 서버 오픈,닫힘 여부를 새 서버 목록 정의 방식에 따르도록 수정 - DBS.php가 폐기 되었으므로 서버 오픈시 기본 정보를 json으로 받아오도록 하기 위하여 기본 준비 - 기존에 남아있던 세부 서버 로그인 처리 파일을 제거(enterPost.php) - DBS.php 삭제로 전콘 변경시에도 각 서버로 json 호출을 하도록 하는 방식으로 준비 - 전콘을 수동으로 서버에 올린뒤 처리할 수 있도록 하던 legacy 코드 제거 - general 테이블에서 userlevel 컬럼을 삭제하고, 세션에 기록된 userGrade를 이용하도록 변경 - 벌점 제한을 모든 유저 공통으로 하도록 수정 - 세부 서버 리셋을 json ajax로 처리하도록 준비
This commit is contained in:
@@ -78,33 +78,3 @@ function Entrance_Logout() {
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
//TODO: 재설계
|
||||
function Entrance_Enter(serverDir) {
|
||||
Popup_Wait(function() {
|
||||
PostJSON(
|
||||
HOME+I+ENTRANCE+W+"enterPost", {
|
||||
},
|
||||
function(response, textStatus) {
|
||||
if(response.result == "SUCCESS") {
|
||||
var form = $("<form></form>");
|
||||
$(form).attr("action", HOME+serverDir);
|
||||
$(form).attr("method", "post");
|
||||
|
||||
var id = $("<input type='hidden' name='id'>");
|
||||
$(id).attr("value", response.id);
|
||||
var pw = $("<input type='hidden' name='pw'>");
|
||||
$(pw).attr("value", response.pw);
|
||||
var conmsg = $("<input type='hidden' name='conmsg'>");
|
||||
$(conmsg).attr("value", response.conmsg);
|
||||
|
||||
$(form).append(id).append(pw).append(conmsg);
|
||||
$("body").append(form);
|
||||
$(form).submit();
|
||||
} else {
|
||||
Popup_WaitShow("입장 실패!");
|
||||
}
|
||||
}
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,18 +3,16 @@ require_once('_common.php');
|
||||
require_once(ROOT.W.F_CONFIG.W.DB.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.SESSION.PHP);
|
||||
|
||||
$rs = $DB->Select('NOTICE', 'SYSTEM', "NO='1'");
|
||||
$system = $DB->Get($rs);
|
||||
$db = getRootDB();
|
||||
$system = $db->queryFirstRow('SELECT `NOTICE` FROM `SYSTEM` WHERE `NO`=1');
|
||||
|
||||
$rs = $DB->Select('ID, GRADE', 'MEMBER', "NO='{$SESSION->NoMember()}'");
|
||||
$member = $DB->Get($rs);
|
||||
$member = $db->queryFirstRow('SELECT ID, GRADE FROM `MEMBER` WHERE `NO` = %i', $SESSION->NoMember());
|
||||
|
||||
?>
|
||||
|
||||
<?php include(MANAGE.W.FRAME); ?>
|
||||
<?php
|
||||
if($member['GRADE'] >= 6) {
|
||||
include(DONATION.W.FRAME);
|
||||
include(MEMBER.W.FRAME);
|
||||
}
|
||||
?>
|
||||
|
||||
+10
-13
@@ -15,7 +15,6 @@ Entrance_AdminUpdate();
|
||||
|
||||
<div id="Entrance_0002" class="bg0">
|
||||
<div id="Entrance_000200" class="bg2">회 원 관 리</div>
|
||||
<input id="Entrance_000201" type="button" value="참 여 기 록">
|
||||
<input id="Entrance_000202" type="button" value="회 원 관 리">
|
||||
<input id="Entrance_000203" type="text" value="<?=$system['NOTICE'];?>">
|
||||
<input id="Entrance_000204" type="button" value="공 지 변 경">
|
||||
@@ -30,19 +29,22 @@ Entrance_AdminUpdate();
|
||||
<div id="Entrance_000302">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach($_serverDirs as $serverDir) {
|
||||
$serverPath = ROOT.W.$serverDir;
|
||||
$realServerPath = realpath(dirname(__FILE__)).W.$serverPath;
|
||||
foreach($severList as $server) {
|
||||
|
||||
$settingObj = $server[2];
|
||||
|
||||
$serverPath = $settingObj->getBasePath();
|
||||
$serverDir = $settingObj->getShortName();
|
||||
//TODO: .htaccess가 서버 오픈에도 사용될 수 있으니 별도의 방법이 필요함
|
||||
if(!is_dir($serverPath)){
|
||||
$state = '상태이상, 01';
|
||||
}
|
||||
else if(!file_exists($realServerPath.'/index.php')){
|
||||
else if(!file_exists($serverPath.'/index.php')){
|
||||
$state = '상태이상, 02';
|
||||
}
|
||||
else if(file_exists($realServerPath.'/.htaccess')) {
|
||||
else if(file_exists($serverPath.'/.htaccess')) {
|
||||
// 폐쇄중
|
||||
if(file_exists($realServerPath.W.D_SETTING.W.SET.PHP)) {
|
||||
if($settingObj->isExist()) {
|
||||
// 폐쇄중, 설정있음
|
||||
$state = '폐쇄중, 설정있음';
|
||||
} else {
|
||||
@@ -51,7 +53,7 @@ foreach($_serverDirs as $serverDir) {
|
||||
}
|
||||
} else{
|
||||
// 오픈중
|
||||
if(file_exists($realServerPath.W.D_SETTING.W.SET.PHP)) {
|
||||
if($settingObj->isExist()) {
|
||||
// 서비스중
|
||||
$state = '서비스중';
|
||||
} else {
|
||||
@@ -60,10 +62,6 @@ foreach($_serverDirs as $serverDir) {
|
||||
}
|
||||
}
|
||||
|
||||
/*else {
|
||||
// 이상함
|
||||
$state = '상태이상, 03';
|
||||
}*/
|
||||
?>
|
||||
<div class="Entrance_ServerAdminList">
|
||||
<div class="Entrance_ServerAdminListServer"><?=$serverDir;?></div>
|
||||
@@ -79,7 +77,6 @@ foreach($_serverDirs as $serverDir) {
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
+14
-14
@@ -21,19 +21,20 @@ $notice = util::array_get($_POST['notice'], '');
|
||||
$server = util::array_get($_POST['server'], '');
|
||||
$select = util::array_get($_POST['select'], '');
|
||||
|
||||
$db = getRootDB();
|
||||
|
||||
$rs = $DB->Select('GRADE', 'MEMBER', "NO='{$SESSION->NoMember()}'");
|
||||
$member = $DB->Get($rs);
|
||||
$member = $db->queryFirstRow('SELECT `GRADE` FROM `MEMBER` WHERE `NO` = %i', $SESSION->NoMember());
|
||||
|
||||
function doServerModeSet($server, $select, &$response){
|
||||
global $_serverDirs;
|
||||
$serverDir = $_serverDirs[$server];
|
||||
$serverPath = ROOT.W.$serverDir;
|
||||
global $serverList;
|
||||
$settingObj = $serverList[$server][2];
|
||||
|
||||
$serverDir = $settingObj->getShortName();
|
||||
$serverPath = $settingObj->getBasePath();
|
||||
$realServerPath = realpath(dirname(__FILE__)).W.$serverPath;
|
||||
|
||||
if($select == 0) { //폐쇄
|
||||
$templates = new League\Plates\Engine('templates');
|
||||
|
||||
|
||||
//TODO: .htaccess가 서버 오픈에도 사용될 수 있으니 별도의 방법이 필요함
|
||||
$allow_ip = util::get_client_ip(false);
|
||||
@@ -48,16 +49,16 @@ function doServerModeSet($server, $select, &$response){
|
||||
|
||||
$htaccess = $templates->render('block_htaccess',
|
||||
['allow_ip' => $allow_ip, 'xforward_allow_ip' => $xforward_allow_ip]);
|
||||
file_put_contents($realServerPath.'/.htaccess', $htaccess);
|
||||
file_put_contents($serverPath.'/.htaccess', $htaccess);
|
||||
} elseif($select == 1) {//리셋
|
||||
if(file_exists($realServerPath.W.D_SETTING.W.SET.PHP)){
|
||||
@unlink($realServerPath.W.D_SETTING.W.SET.PHP);
|
||||
if(file_exists($serverPath.W.D_SETTING.W.'conf.php')){
|
||||
@unlink($serverPath.W.D_SETTING.W.'conf.php');
|
||||
}
|
||||
|
||||
$response['installURL'] = $serverPath.W."install.php";
|
||||
$response['installURL'] = $serverDir.W."install.php";
|
||||
} elseif($select == 2) {//오픈
|
||||
if(file_exists($realServerPath.'.htaccess')){
|
||||
@unlink($realServerPath.'.htaccess');
|
||||
if(file_exists($serverPath.'.htaccess')){
|
||||
@unlink($serverPath.'.htaccess');
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -72,7 +73,7 @@ function doAdminPost($member, $action, $notice, $server, $select){
|
||||
}
|
||||
|
||||
if($action == 0) {
|
||||
$DB->Update('SYSTEM', "NOTICE='{$notice}'", 'NO=1');
|
||||
$db->update('SYSTEM', ['NOTICE'=>$notice], 'NO=1');
|
||||
$response['result'] = 'SUCCESS';
|
||||
return $response;
|
||||
}
|
||||
@@ -93,5 +94,4 @@ function doAdminPost($member, $action, $notice, $server, $select){
|
||||
|
||||
$response = doAdminPost($member, $action, $notice, $server, $select);
|
||||
|
||||
sleep(1);
|
||||
echo json_encode($response);
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
function EntranceDonation_Import() {
|
||||
}
|
||||
|
||||
function EntranceDonation_Init() {
|
||||
$("#EntranceDonation_0001").click(EntranceDonation_Back);
|
||||
$("#EntranceDonation_000200").click(function() { EntranceDonation_Calculate(); });
|
||||
$("#EntranceDonation_000308").click(function() { EntranceDonation_Donate(); });
|
||||
}
|
||||
|
||||
function EntranceDonation_Update() {
|
||||
EntranceDonation_UpdateDonation();
|
||||
}
|
||||
|
||||
function EntranceDonation_Back() {
|
||||
$("#EntranceDonation_00").hide();
|
||||
|
||||
$("#Entrance_00").show();
|
||||
Entrance_Update();
|
||||
}
|
||||
|
||||
function EntranceDonation_UpdateDonation() {
|
||||
Popup_Wait(function() {
|
||||
GetJSON(
|
||||
HOME+I+ENTRANCE+W+DONATION+W+GET, {
|
||||
},
|
||||
function(response, textStatus) {
|
||||
if(response.result == "SUCCESS") {
|
||||
$("#EntranceDonation_0005").html(response.donations);
|
||||
$("#EntranceDonation_000301").val(response.date);
|
||||
Popup_WaitHide();
|
||||
} else {
|
||||
Popup_WaitShow("처리 실패!");
|
||||
}
|
||||
}
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
function EntranceDonation_Calculate() {
|
||||
Popup_Wait(function() {
|
||||
PostJSON(
|
||||
HOME+I+ENTRANCE+W+DONATION+W+"calculate"+POST, {
|
||||
},
|
||||
function(response, textStatus) {
|
||||
if(response.result == "SUCCESS") {
|
||||
$("#EntranceDonation_000301").val("");
|
||||
$("#EntranceDonation_000302").val("");
|
||||
$("#EntranceDonation_000303").val("");
|
||||
$("#EntranceDonation_000304").val("");
|
||||
$("#EntranceDonation_000305").val("");
|
||||
$("#EntranceDonation_000306").val("");
|
||||
Popup_WaitHide();
|
||||
EntranceDonation_UpdateDonation();
|
||||
} else {
|
||||
Popup_WaitShow("처리 실패!");
|
||||
}
|
||||
}
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
function EntranceDonation_Donate() {
|
||||
var date = $("#EntranceDonation_000301").val();
|
||||
var id = $("#EntranceDonation_000302").val();
|
||||
var name = $("#EntranceDonation_000303").val();
|
||||
var rname = $("#EntranceDonation_000304").val();
|
||||
var subname = $("#EntranceDonation_000305").val();
|
||||
var amount = $("#EntranceDonation_000306").val();
|
||||
|
||||
Popup_Wait(function() {
|
||||
PostJSON(
|
||||
HOME+I+ENTRANCE+W+DONATION+W+POST, {
|
||||
date: date,
|
||||
id: id,
|
||||
name: name,
|
||||
rname: rname,
|
||||
subname: subname,
|
||||
amount: amount
|
||||
},
|
||||
function(response, textStatus) {
|
||||
if(response.result == "SUCCESS") {
|
||||
$("#EntranceDonation_000301").val("");
|
||||
$("#EntranceDonation_000302").val("");
|
||||
$("#EntranceDonation_000303").val("");
|
||||
$("#EntranceDonation_000304").val("");
|
||||
$("#EntranceDonation_000305").val("");
|
||||
$("#EntranceDonation_000306").val("");
|
||||
Popup_WaitHide();
|
||||
EntranceDonation_UpdateDonation();
|
||||
} else {
|
||||
Popup_WaitShow("처리 실패!");
|
||||
}
|
||||
}
|
||||
)
|
||||
});
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
require_once('_common.php');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
ImportStyle("<?=ROOT;?>"+W+I+ENTRANCE+W+DONATION+W+STYLE);
|
||||
ImportAction("<?=ROOT;?>"+W+I+ENTRANCE+W+DONATION+W+ACTION);
|
||||
EntranceDonation_Import();
|
||||
EntranceDonation_Init();
|
||||
</script>
|
||||
|
||||
<div id="EntranceDonation_00">
|
||||
<div id="EntranceDonation_0000" class="bg2 font4">
|
||||
참 여 기 록
|
||||
</div>
|
||||
<input id="EntranceDonation_0001" type="button" value="돌아가기">
|
||||
<div id="EntranceDonation_0002" class="bg0">
|
||||
<input id="EntranceDonation_000200" type="button" value="통계계산">
|
||||
</div>
|
||||
<div id="EntranceDonation_0003" class="bg0">
|
||||
<div id="EntranceDonation_000300">-</div>
|
||||
<input id="EntranceDonation_000301" type="text">
|
||||
<input id="EntranceDonation_000302" type="text">
|
||||
<input id="EntranceDonation_000303" type="text">
|
||||
<input id="EntranceDonation_000304" type="text">
|
||||
<input id="EntranceDonation_000305" type="text">
|
||||
<input id="EntranceDonation_000306" type="text">
|
||||
<div id="EntranceDonation_000307">-</div>
|
||||
<input id="EntranceDonation_000308" type="button" value="기록">
|
||||
</div>
|
||||
<div id="EntranceDonation_0004" class="bg1">
|
||||
<div id="EntranceDonation_000400">순번</div>
|
||||
<div id="EntranceDonation_000401">일자</div>
|
||||
<div id="EntranceDonation_000402">ID</div>
|
||||
<div id="EntranceDonation_000403">이름</div>
|
||||
<div id="EntranceDonation_000404">입금자</div>
|
||||
<div id="EntranceDonation_000405">닉네임</div>
|
||||
<div id="EntranceDonation_000406">금액</div>
|
||||
<div id="EntranceDonation_000407">개인누적</div>
|
||||
<div id="EntranceDonation_000408">총누적</div>
|
||||
</div>
|
||||
<div id="EntranceDonation_0005">
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
require_once('_common.php');
|
||||
|
||||
require_once(ROOT.W.F_FUNC.W.'class._JSON.php');
|
||||
require_once(ROOT.W.F_FUNC.W.'class._Time.php');
|
||||
require_once(ROOT.W.F_CONFIG.W.DB.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.SESSION.PHP);
|
||||
|
||||
// 외부 파라미터
|
||||
|
||||
$rs = $DB->Select('GRADE', 'MEMBER', "NO='{$SESSION->NoMember()}'");
|
||||
$member = $DB->Get($rs);
|
||||
|
||||
if($member['GRADE'] < 6) {
|
||||
$response['result'] = 'FAIL';
|
||||
$response['msg'] = '운영자 권한이 없습니다.';
|
||||
} else {
|
||||
$response['donations'] = '<table id="EntranceDonation_000500" class="bg0">';
|
||||
|
||||
$rs = $DB->Select('NO, ID, NAME, RNAME, SUBNAME, DATE, AMOUNT, CUMUL, TOTAL', 'DONATION', '1 ORDER BY DATE DESC, NO DESC');
|
||||
while($DB->HasNext($rs)) {
|
||||
$donation = $DB->Next($rs);
|
||||
|
||||
$response['donations'] .= "
|
||||
<tr>
|
||||
<td class='EntranceDonation_00050000'>{$donation['NO']}</td>
|
||||
<td class='EntranceDonation_00050001'>{$donation['DATE']}</td>
|
||||
<td class='EntranceDonation_00050002'>{$donation['ID']}</td>
|
||||
<td class='EntranceDonation_00050003'>{$donation['NAME']}</td>
|
||||
<td class='EntranceDonation_00050004'>{$donation['RNAME']}</td>
|
||||
<td class='EntranceDonation_00050005'>{$donation['SUBNAME']}</td>
|
||||
<td class='EntranceDonation_00050006'>{$donation['AMOUNT']}</td>
|
||||
<td class='EntranceDonation_00050007'>{$donation['CUMUL']}</td>
|
||||
<td class='EntranceDonation_00050008'>{$donation['TOTAL']}</td>
|
||||
</tr>";
|
||||
}
|
||||
$response['donations'] .= '</table>';
|
||||
$response['date'] = _Time::DateToday();
|
||||
|
||||
$response['result'] = 'SUCCESS';
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
echo json_encode($response);
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
require_once('_common.php');
|
||||
require_once(ROOT.W.F_FUNC.W.'class._JSON.php');
|
||||
require_once(ROOT.W.F_CONFIG.W.DB.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.SESSION.PHP);
|
||||
|
||||
// 외부 파라미터
|
||||
// $_POST['date'] : 일자
|
||||
// $_POST['id'] : ID
|
||||
// $_POST['name'] : 이름
|
||||
// $_POST['rname'] : 입금자
|
||||
// $_POST['subname'] : 닉네임
|
||||
// $_POST['amount'] : 금액
|
||||
$date = $_POST['date'];
|
||||
$id = $_POST['id'];
|
||||
$name = $_POST['name'];
|
||||
$rname = $_POST['rname'];
|
||||
$subname = $_POST['subname'];
|
||||
$amount = $_POST['amount'];
|
||||
|
||||
$rs = $DB->Select('GRADE', 'MEMBER', "NO='{$SESSION->NoMember()}'");
|
||||
$member = $DB->Get($rs);
|
||||
|
||||
if($member['GRADE'] < 6) {
|
||||
$response['result'] = 'FAIL';
|
||||
$response['msg'] = '운영자 권한이 없습니다.';
|
||||
} else {
|
||||
if($subname == "") {
|
||||
$rs = $DB->Select('NAME', 'MEMBER', "ID='{$id}'");
|
||||
$donator = $DB->Get($rs);
|
||||
$subname = $donator['NAME'];
|
||||
}
|
||||
|
||||
$rs = $DB->Select('SUM(AMOUNT) AS CUM', 'DONATION', "ID='{$id}'");
|
||||
$donator = $DB->Get($rs);
|
||||
$cumul = $donator['CUM'] + $amount;
|
||||
|
||||
$rs = $DB->Select('SUM(AMOUNT) AS TOT', 'DONATION');
|
||||
$donator = $DB->Get($rs);
|
||||
$total = $donator['TOT'] + $amount;
|
||||
|
||||
$DB->InsertArray('DONATION', array(
|
||||
'ID' => $id,
|
||||
'NAME' => $name,
|
||||
'RNAME' => $rname,
|
||||
'SUBNAME' => $subname,
|
||||
'DATE' => $date,
|
||||
'AMOUNT' => $amount,
|
||||
'CUMUL' => $cumul,
|
||||
'TOTAL' => $total
|
||||
));
|
||||
|
||||
$response['result'] = 'SUCCESS';
|
||||
}
|
||||
|
||||
echo json_encode($response);
|
||||
|
||||
|
||||
@@ -1,178 +0,0 @@
|
||||
@charset "utf-8";
|
||||
|
||||
#EntranceDonation_00 {
|
||||
width: 800px; height: 20px;
|
||||
border: none;
|
||||
position: absolute;
|
||||
top: 20px; left: 50%;
|
||||
margin-left: -400px; /* DIV박스 크기의 1/2로 마진을 잡아줍니다. */
|
||||
display: none;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
#EntranceDonation_0000 {
|
||||
width: 800px; height: 50px;
|
||||
position: absolute; top: 0px; left: 0px;
|
||||
}
|
||||
|
||||
#EntranceDonation_0001 {
|
||||
width: 100px; height: 30px;
|
||||
position: absolute; top: 10px; left: 650px;
|
||||
}
|
||||
|
||||
#EntranceDonation_0002 {
|
||||
width: 800px; height: 20px;
|
||||
position: absolute; top: 52px; left: 0px;
|
||||
}
|
||||
|
||||
#EntranceDonation_000200 {
|
||||
width: 100px; height: 20px;
|
||||
}
|
||||
|
||||
#EntranceDonation_0003 {
|
||||
width: 800px; height: 20px;
|
||||
position: absolute; top: 74px; left: 0px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#EntranceDonation_000300 {
|
||||
width: 48px; height: 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000301 {
|
||||
width: 96px; height: 16px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000302 {
|
||||
width: 96px; height: 16px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000303 {
|
||||
width: 96px; height: 16px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000304 {
|
||||
width: 96px; height: 16px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000305 {
|
||||
width: 96px; height: 16px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000306 {
|
||||
width: 66px; height: 16px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000307 {
|
||||
width: 78px; height: 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000308 {
|
||||
width: 100px; height: 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_0004 {
|
||||
width: 800px; height: 20px;
|
||||
position: absolute; top: 96px; left: 0px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#EntranceDonation_000400 {
|
||||
width: 48px; height: 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000401 {
|
||||
width: 98px; height: 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000402 {
|
||||
width: 98px; height: 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000403 {
|
||||
width: 98px; height: 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000404 {
|
||||
width: 98px; height: 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000405 {
|
||||
width: 98px; height: 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000406 {
|
||||
width: 68px; height: 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000407 {
|
||||
width: 78px; height: 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_000408 {
|
||||
width: 98px; height: 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#EntranceDonation_0005 {
|
||||
width: 800px; height: 20px;
|
||||
position: absolute; top: 118px; left: 0px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#EntranceDonation_000500 {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.EntranceDonation_00050000 {
|
||||
width: 48px;
|
||||
}
|
||||
|
||||
.EntranceDonation_00050001 {
|
||||
width: 98px;
|
||||
}
|
||||
|
||||
.EntranceDonation_00050002 {
|
||||
width: 98px;
|
||||
}
|
||||
|
||||
.EntranceDonation_00050003 {
|
||||
width: 98px;
|
||||
}
|
||||
|
||||
.EntranceDonation_00050004 {
|
||||
width: 98px;
|
||||
}
|
||||
|
||||
.EntranceDonation_00050005 {
|
||||
width: 98px;
|
||||
}
|
||||
|
||||
.EntranceDonation_00050006 {
|
||||
width: 68px;
|
||||
}
|
||||
|
||||
.EntranceDonation_00050007 {
|
||||
width: 78px;
|
||||
}
|
||||
|
||||
.EntranceDonation_00050008 {
|
||||
width: 98px;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
if(!defined('ROOT')){
|
||||
define('ROOT', '../..');
|
||||
}
|
||||
require_once(ROOT.'/f_config/config.php');
|
||||
require_once(ROOT.W.F_CONFIG.W.APP.PHP);
|
||||
require_once(ROOT.W.F_FUNC.W.FUNC.PHP);
|
||||
|
||||
CustomHeader();
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
<?php
|
||||
require_once('_common.php');
|
||||
require_once(ROOT.W.F_FUNC.W.'class._JSON.php');
|
||||
require_once(ROOT.W.F_CONFIG.W.DB.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.SESSION.PHP);
|
||||
|
||||
// 외부 파라미터
|
||||
$rs = $DB->Select('GRADE', 'MEMBER', "NO='{$SESSION->NoMember()}'");
|
||||
$member = $DB->Get($rs);
|
||||
|
||||
if($member['GRADE'] < 6) {
|
||||
$response['result'] = 'FAIL';
|
||||
$response['msg'] = '운영자 권한이 없습니다.';
|
||||
} else {
|
||||
//개인누적계산
|
||||
$rs = $DB->Select('ID', 'DONATION', '1', 'ID');
|
||||
while($DB->HasNext($rs)) {
|
||||
$donator = $DB->Next($rs);
|
||||
$cumul = 0;
|
||||
|
||||
$rs2 = $DB->Select('NO, AMOUNT', 'DONATION', "ID='{$donator['ID']}' ORDER BY DATE, NO");
|
||||
while($DB->HasNext($rs2)) {
|
||||
$donation = $DB->Next($rs2);
|
||||
$cumul += $donation['AMOUNT'];
|
||||
|
||||
$DB->Update('DONATION', "CUMUL='{$cumul}'", "NO='{$donation['NO']}'");
|
||||
}
|
||||
}
|
||||
|
||||
$total = 0;
|
||||
//총누적계산
|
||||
$rs = $DB->Select('NO, AMOUNT', 'DONATION', '1 ORDER BY DATE, NO');
|
||||
while($DB->HasNext($rs)) {
|
||||
$donation = $DB->Next($rs);
|
||||
$total += $donation['AMOUNT'];
|
||||
|
||||
$DB->Update('DONATION', "TOTAL='{$total}'", "NO='{$donation['NO']}'");
|
||||
}
|
||||
|
||||
$response['result'] = 'SUCCESS';
|
||||
}
|
||||
|
||||
echo json_encode($response);
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
require_once('_common.php');
|
||||
require_once(ROOT.W.F_FUNC.W.'class._JSON.php');
|
||||
require_once(ROOT.W.F_CONFIG.W.DB.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.SESSION.PHP);
|
||||
|
||||
// 외부 파라미터
|
||||
// $_POST['serverDir'] : 로그인할 서버 디렉토리
|
||||
//$serverDir = $_POST['serverDir']; //TODO:쓸모 없어보이는데?
|
||||
|
||||
|
||||
$rs = $DB->Select('ID, PW, CONMSG', 'MEMBER', "NO='{$SESSION->NoMember()}'");
|
||||
$member = $DB->Get($rs);
|
||||
|
||||
$response['id'] = $member['ID'];
|
||||
$response['pw'] = $member['PW'].md5(rand()%100000000);;
|
||||
$response['conmsg'] = $member['CONMSG'];
|
||||
|
||||
$response['result'] = 'SUCCESS';
|
||||
|
||||
sleep(1);
|
||||
echo json_encode($response);
|
||||
@@ -20,7 +20,7 @@ function EntranceManage_Init() {
|
||||
function EntranceManage_Update() {
|
||||
Popup_Wait(function() {
|
||||
PostJSON(
|
||||
HOME+I+ENTRANCE+W+MANAGE+W+GET, {
|
||||
HOME+I+ENTRANCE+W+MANAGE+W+'Get.php', {
|
||||
},
|
||||
function(response, textStatus) {
|
||||
if(response.result == "SUCCESS") {
|
||||
@@ -50,7 +50,6 @@ function EntranceManage_UpdateInfo(member) {
|
||||
$("#EntranceManage_0010").text(member.grade);
|
||||
$("#EntranceManage_001500").attr("src", member.picture0);
|
||||
$("#EntranceManage_001501").attr("src", member.picture1);
|
||||
$("#EntranceManage_0020").html(member.donation);
|
||||
}
|
||||
|
||||
function EntranceManage_ChangePw() {
|
||||
|
||||
@@ -51,6 +51,4 @@ require_once('_common.php');
|
||||
<font color=magenta>탈퇴신청시 1개월간 정보가 보존되며,
|
||||
1개월간 재가입이 불가능합니다.</font></pre>
|
||||
</div>
|
||||
<div id="EntranceManage_0020">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,9 +6,8 @@ require_once(ROOT.W.F_CONFIG.W.SESSION.PHP);
|
||||
|
||||
// 외부 파라미터
|
||||
|
||||
|
||||
$rs = $DB->Select('ID, NAME, GRADE, PICTURE', 'MEMBER', "NO='{$SESSION->NoMember()}'");
|
||||
$member = $DB->Get($rs);
|
||||
$db = getRootDB();
|
||||
$member = $db->queryFirstRow('SELECT `ID`, `NAME`, `GRADE`, `PICTURE` FROM `MEMBER` WHERE `NO` = %i', $SESSION->NoMember());
|
||||
|
||||
$response['id'] = $member['ID'];
|
||||
$response['name'] = $member['NAME'];
|
||||
@@ -31,42 +30,6 @@ if($member['PICTURE'] == '') {
|
||||
$response['picture1'] = '../d_pic/'.$member['PICTURE'];
|
||||
}
|
||||
|
||||
$response['donation'] = '';
|
||||
|
||||
$rs = $DB->Select('DATE, AMOUNT, CUMUL', 'DONATION', "ID='{$member['ID']}'");
|
||||
$count = $DB->Count($rs);
|
||||
if($count > 0) {
|
||||
$response['donation'] = '
|
||||
<table id="EntranceManage_002000" class="bg0">
|
||||
<th id="EntranceManage_00200000" class="bg2" colspan="4">참 여 기 록</th>
|
||||
<tr>
|
||||
<td class="EntranceManage_Sequence bg1">순번</td>
|
||||
<td class="EntranceManage_Date bg1">일자</td>
|
||||
<td class="EntranceManage_Amount bg1">금액</td>
|
||||
<td class="EntranceManage_Cumul bg1">누적</td>
|
||||
</tr>
|
||||
';
|
||||
|
||||
$i = 1;
|
||||
while($DB->HasNext($rs)) {
|
||||
$donation = $DB->Next($rs);
|
||||
|
||||
$response['donation'] .= "
|
||||
<tr>
|
||||
<td class='EntranceManage_Sequence'>{$i}</td>
|
||||
<td class='EntranceManage_Date'>{$donation['DATE']}</td>
|
||||
<td class='EntranceManage_Amount'>{$donation['AMOUNT']}</td>
|
||||
<td class='EntranceManage_Cumul'>{$donation['CUMUL']}</td>
|
||||
</tr>
|
||||
";
|
||||
$i++;
|
||||
}
|
||||
|
||||
$response['donation'] .= '
|
||||
</table>
|
||||
';
|
||||
}
|
||||
|
||||
$response['result'] = 'SUCCESS';
|
||||
|
||||
sleep(1);
|
||||
|
||||
@@ -2,17 +2,13 @@
|
||||
require_once('_common.php');
|
||||
require_once(ROOT.W.F_FUNC.W.'class._JSON.php');
|
||||
require_once(ROOT.W.F_CONFIG.W.DB.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.'DBS'.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.SETTINGS.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.SESSION.PHP);
|
||||
|
||||
// 외부 파라미터
|
||||
|
||||
$respone = [];
|
||||
|
||||
$rs = $DB->Select('ID, PICTURE', 'MEMBER', "NO='{$SESSION->NoMember()}'");
|
||||
|
||||
$member = $DB->Get($rs);
|
||||
$db = getRootDB();
|
||||
$member = $db->queryFirstRow('SELECT ID, PICTURE FROM `MEMBER` WHERE `NO` = %i', $SESSION->NoMember());
|
||||
|
||||
|
||||
|
||||
@@ -38,21 +34,18 @@ if($dt == $rf) {
|
||||
$response['msg'] = '1일 1회 변경 가능합니다!';
|
||||
$response['result'] = 'FAIL';
|
||||
} else {
|
||||
$DB->Update('MEMBER', "PICTURE='', IMGSVR=0", "NO='{$SESSION->NoMember()}'");
|
||||
if(file_exists($dest)){
|
||||
@unlink($dest);
|
||||
}
|
||||
|
||||
for($i=0; $i < $_serverCount; $i++) {
|
||||
if($SETTINGS[$i]->IsExist()) {
|
||||
$rs = $DBS[$i]->Select('IMG', 'game', "NO='1'");
|
||||
$game = $DBS[$i]->Get($rs);
|
||||
if($game['IMG'] > 0) {
|
||||
// 엔장선택 제외하고 업데이트
|
||||
$DBS[$i]->Update('general', "PICTURE='default.jpg', IMGSVR=0", "NPC=0 AND USER_ID='{$member['ID']}'");
|
||||
}
|
||||
}
|
||||
$db->update('MEMBER', [
|
||||
'PICTURE'=>'',
|
||||
'IMGSVR'=>0,
|
||||
], 'NO=%i', $SESSION->NoMember());
|
||||
|
||||
//TODO: 각 세부 서버가 '열린 경우' 이미지를 갱신하도록 처리
|
||||
//Token을 받아 처리하는 형식이면 가능할듯.
|
||||
/*
|
||||
for($i=0; $i < ; $i++) {
|
||||
Update('general', "PICTURE='default.jpg', IMGSVR=0", "NPC=0 AND USER_ID='{$member['ID']}'");
|
||||
}
|
||||
*/
|
||||
|
||||
$response['msg'] = '제거에 성공했습니다!';
|
||||
$response['result'] = 'SUCCESS';
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<?php
|
||||
require_once('_common.php');
|
||||
require_once(ROOT.W.F_CONFIG.W.DB.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.'DBS'.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.SETTINGS.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.SESSION.PHP);
|
||||
|
||||
// 외부 파라미터
|
||||
@@ -20,8 +18,8 @@ $imageType = $size[2];
|
||||
|
||||
$availableImageType = array('.jpg'=>IMAGETYPE_JPEG, '.png'=>IMAGETYPE_PNG, '.gif'=>IMAGETYPE_GIF);
|
||||
|
||||
$rs = $DB->Select('ID, PICTURE', 'MEMBER', "NO='{$SESSION->NoMember()}'");
|
||||
$member = $DB->Get($rs);
|
||||
$db = getRootDB();
|
||||
$member = $db->queryFirstRow('SELECT `ID`, `PICTURE` FROM `MEMBER` WHERE `NO` = %i', $SESSION->NoMember());
|
||||
|
||||
|
||||
$picName = $member['PICTURE'];
|
||||
@@ -78,22 +76,14 @@ if(!is_uploaded_file($image['tmp_name'])) {
|
||||
$response['msg'] = '업로드에 실패했습니다!';
|
||||
$response['result'] = 'FAIL';
|
||||
} else {
|
||||
if(file_exists($old_path)){
|
||||
@unlink($old_path);
|
||||
}
|
||||
$pic = "{$newPicName}?={$rf}";
|
||||
$DB->Update('MEMBER', "PICTURE='{$pic}', IMGSVR=1", "NO='{$SESSION->NoMember()}'");
|
||||
getRootDB()->update('MEMBER',[
|
||||
'PICTURE' => $pic,
|
||||
'IMGSVR' => 1
|
||||
], 'NO=%i', $SESSION->NoMember());
|
||||
|
||||
for($i=0; $i < $_serverCount; $i++) {
|
||||
if($SETTINGS[$i]->IsExist()) {
|
||||
$rs = $DBS[$i]->Select('IMG', 'game', "NO='1'");
|
||||
$game = $DBS[$i]->Get($rs);
|
||||
if($game['IMG'] > 0) {
|
||||
// 엔장선택 제외하고 업데이트
|
||||
$DBS[$i]->Update('general', "PICTURE='{$pic}', IMGSVR=1", "NPC=0 AND USER_ID='{$member['ID']}'");
|
||||
}
|
||||
}
|
||||
}
|
||||
//TODO: 각 서버에도 전파
|
||||
//Update('general', "PICTURE='{$pic}', IMGSVR=1", "NPC=0 AND USER_ID='{$member['ID']}'");
|
||||
|
||||
$response['msg'] = '업로드에 성공했습니다!';
|
||||
$response['result'] = 'SUCCESS';
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
require_once('_common.php');
|
||||
require_once(ROOT.W.F_FUNC.W.'class._JSON.php');
|
||||
require_once(ROOT.W.F_CONFIG.W.DB.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.'DBS'.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.SETTINGS.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.SESSION.PHP);
|
||||
|
||||
// 외부 파라미터
|
||||
@@ -14,20 +12,14 @@ $newPw = $_POST['newPw'];
|
||||
|
||||
$response['result'] = 'FAIL';
|
||||
|
||||
$rs = $DB->Select('ID, PW', 'MEMBER', "NO='{$SESSION->NoMember()}'");
|
||||
$member = $DB->Get($rs);
|
||||
$db = getRootDB();
|
||||
$member = $db->queryFirstRow('SELECT `ID`, `PW` FROM `MEMBER` WHERE `NO` = %i', $SESSION->NoMember());
|
||||
|
||||
if($member['PW'] != $pw) {
|
||||
$response['result'] = 'FAIL';
|
||||
$response['msg'] = '실패: 현재 비밀번호가 일치하지 않습니다.';
|
||||
} else {
|
||||
$DB->Update('MEMBER', "PW='{$newPw}'", "NO='{$SESSION->NoMember()}'");
|
||||
|
||||
for($i=0; $i < $_serverCount; $i++) {
|
||||
if($SETTINGS[$i]->IsExist()) {
|
||||
$DBS[$i]->Update('general', "PASSWORD='{$newPw}'", "USER_ID='{$member['ID']}'");
|
||||
}
|
||||
}
|
||||
$db->update('MEMBER', ['PW'=>$newPw], 'NO=%i', $SESSION->NoMember());
|
||||
|
||||
$response['result'] = 'SUCCESS';
|
||||
$response['msg'] = "정상적으로 비밀번호가 수정되었습니다.";
|
||||
|
||||
@@ -11,17 +11,17 @@ $pw = $_POST['pw'];
|
||||
|
||||
$response['result'] = 'FAIL';
|
||||
|
||||
$rs = $DB->Select('PW', 'MEMBER', "NO='{$SESSION->NoMember()}'");
|
||||
$member = $DB->Get($rs);
|
||||
$db = getRootDB();
|
||||
$member = $db->queryFirstRow('SELECT `PW` FROM `MEMBER` WHERE `NO` = %i', $SESSION->NoMember());
|
||||
|
||||
if($member['PW'] != $pw) {
|
||||
$response['result'] = 'FAIL';
|
||||
$response['msg'] = '실패: 현재 비밀번호가 일치하지 않습니다.';
|
||||
} else {
|
||||
$DB->UpdateArray('MEMBER', array(
|
||||
$db->update('MEMBER', array(
|
||||
'QUIT' => 'Y',
|
||||
'REG_DATE'=> _Time::DatetimeNow()
|
||||
), "NO='{$SESSION->NoMember()}'");
|
||||
), 'NO=%i', $SESSION->NoMember());
|
||||
|
||||
|
||||
$SESSION->Logout();
|
||||
|
||||
@@ -23,7 +23,6 @@ EntranceMember_Init();
|
||||
<input id="EntranceMember_000604" type="button" value="로그인금지">
|
||||
<input id="EntranceMember_000605" type="button" value="탈퇴처리(1개월)">
|
||||
<input id="EntranceMember_000606" type="button" value="오래된계정(6개월)">
|
||||
<input id="EntranceMember_000607" type="button" value="이미지업로드">
|
||||
</div>
|
||||
<div id="EntranceMember_0002" class="bg2 font2">
|
||||
선택:
|
||||
@@ -63,8 +62,6 @@ EntranceMember_Init();
|
||||
<div id="EntranceMember_000407">등록</div>
|
||||
<div id="EntranceMember_000408">최근등록일</div>
|
||||
<div id="EntranceMember_000409">등급</div>
|
||||
<div id="EntranceMember_000410">총참여</div>
|
||||
<div id="EntranceMember_000411">최근참여일</div>
|
||||
<div id="EntranceMember_000412">사진</div>
|
||||
<div id="EntranceMember_000413">SVR</div>
|
||||
<div id="EntranceMember_000414">탈퇴</div>
|
||||
|
||||
+15
-28
@@ -10,41 +10,31 @@ use utilphp\util as util;
|
||||
// $_GET['select'] : 정렬선택
|
||||
$select = $_GET['select'];
|
||||
|
||||
$rs = $DB->Select('GRADE', 'MEMBER', "NO='{$SESSION->NoMember()}'");
|
||||
$member = $DB->Get($rs);
|
||||
$donCumul = [];
|
||||
$donDate = [];
|
||||
$db = getRootDB();
|
||||
$member = $db->queryFirstRow('SELECT `GRADE` FROM `MEMBER` WHERE `no` = %i', $SESSION->NoMember());
|
||||
if($member['GRADE'] < 6) {
|
||||
$response['result'] = 'FAIL';
|
||||
$response['msg'] = '운영자 권한이 없습니다.';
|
||||
} else {
|
||||
$rs = $DB->Select('ID, CUMUL, DATE', 'DONATION', '1 ORDER BY NO');
|
||||
while($DB->HasNext($rs)) {
|
||||
$donation = $DB->Next($rs);
|
||||
|
||||
$donCumul[$donation['ID']] = $donation['CUMUL'];
|
||||
$donDate[$donation['ID']] = $donation['DATE'];
|
||||
}
|
||||
|
||||
$whereStr = '';
|
||||
$orderByStr = '';
|
||||
switch($select) {
|
||||
case 0: $whereStr = '1 ORDER BY NO'; break;
|
||||
case 1: $whereStr = '1 ORDER BY ID'; break;
|
||||
case 2: $whereStr = '1 ORDER BY NAME'; break;
|
||||
case 3: $whereStr = '1 ORDER BY PID'; break;
|
||||
case 4: $whereStr = '1 ORDER BY IP'; break;
|
||||
case 5: $whereStr = '1 ORDER BY GRADE DESC'; break;
|
||||
case 6: $whereStr = '1 ORDER BY REG_NUM DESC'; break;
|
||||
case 7: $whereStr = '1 ORDER BY REG_DATE DESC'; break;
|
||||
case 0: $orderByStr = 'ORDER BY NO'; break;
|
||||
case 1: $orderByStr = 'ORDER BY ID'; break;
|
||||
case 2: $orderByStr = 'ORDER BY NAME'; break;
|
||||
case 3: $orderByStr = 'ORDER BY PID'; break;
|
||||
case 4: $orderByStr = 'ORDER BY IP'; break;
|
||||
case 5: $orderByStr = 'ORDER BY GRADE DESC'; break;
|
||||
case 6: $orderByStr = 'ORDER BY REG_NUM DESC'; break;
|
||||
case 7: $orderByStr = 'ORDER BY REG_DATE DESC'; break;
|
||||
}
|
||||
|
||||
$response['lists'] = '';
|
||||
$response['members'] = '<table id="EntranceMember_000500" class="bg0">';
|
||||
|
||||
$rs = $DB->Select('NO, ID, PID, NAME, IP, PICTURE, IMGSVR, GRADE, REG_NUM, REG_DATE, BLOCK_NUM, BLOCK_DATE, QUIT', 'MEMBER', $whereStr);
|
||||
$count = $DB->Count($rs);
|
||||
while($DB->HasNext($rs)) {
|
||||
$member = $DB->Next($rs);
|
||||
$members = $db->queryFirstRow('SELECT NO, ID, PID, NAME, IP, PICTURE, IMGSVR, GRADE, REG_NUM, REG_DATE, BLOCK_NUM, BLOCK_DATE, QUIT FROM MEMBER %l', $orderByStr);
|
||||
$count = count($members);
|
||||
foreach($members as $member){
|
||||
$member['PID'] = substr($member['PID'], 0, 8);
|
||||
$member['PICTURE'] = substr($member['PICTURE'], -8);
|
||||
|
||||
@@ -68,8 +58,6 @@ if($member['GRADE'] < 6) {
|
||||
<td class='EntranceMember_00050007'>{$member['REG_NUM']}</td>
|
||||
<td class='EntranceMember_00050008'>{$member['REG_DATE']}</td>
|
||||
<td class='EntranceMember_00050009'>{$member['GRADE']}</td>
|
||||
<td class='EntranceMember_00050010'>".util::array_get($donCumul[$member['ID']],'0')."</td>
|
||||
<td class='EntranceMember_00050011'>".util::array_get($donDate[$member['ID']],'')."</td>
|
||||
<td class='EntranceMember_00050012'>{$member['PICTURE']}</td>
|
||||
<td class='EntranceMember_00050013'>{$member['IMGSVR']}</td>
|
||||
<td class='EntranceMember_00050014'>{$member['QUIT']}</td>
|
||||
@@ -79,8 +67,7 @@ if($member['GRADE'] < 6) {
|
||||
|
||||
$response['count'] = "(0000/{$count})";
|
||||
|
||||
$rs = $DB->Select('REG, LOGIN', 'SYSTEM', "NO='1'");
|
||||
$system = $DB->Get($rs);
|
||||
$system = getRootDB()->queryFirstRow('SELECT `REG`, `LOGIN` FROM `SYSTEM` WHERE `NO`=1');
|
||||
|
||||
$response['state'] = "가입: {$system['REG']}, 로그인: {$system['LOGIN']}";
|
||||
|
||||
|
||||
+24
-75
@@ -2,8 +2,6 @@
|
||||
require_once('_common.php');
|
||||
require_once(ROOT.W.F_FUNC.W.'class._JSON.php');
|
||||
require_once(ROOT.W.F_CONFIG.W.DB.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.'DBS'.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.SETTINGS.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.SESSION.PHP);
|
||||
|
||||
// 외부 파라미터
|
||||
@@ -12,104 +10,55 @@ require_once(ROOT.W.F_CONFIG.W.SESSION.PHP);
|
||||
$select = $_POST['select'];
|
||||
$no = $_POST['no'];
|
||||
|
||||
$rs = $DB->Select('GRADE', 'MEMBER', "NO='{$SESSION->NoMember()}'");
|
||||
$member = $DB->Get($rs);
|
||||
$db = getRootDB();
|
||||
$member = $db->queryFirstRow('SELECT `GRADE` FROM `MEMBER` WHERE `NO` = %i', $SESSION->NoMember());
|
||||
|
||||
if($member['GRADE'] < 6) {
|
||||
$response['result'] = 'FAIL';
|
||||
$response['msg'] = '운영자 권한이 없습니다.';
|
||||
} else {
|
||||
$rs = $DB->Select('ID', 'MEMBER', "NO='{$no}'");
|
||||
$member = $DB->Get($rs);
|
||||
|
||||
if($select == 0) {
|
||||
// 블럭회원
|
||||
$DB->Update('MEMBER', 'GRADE=0', "NO='{$no}'");
|
||||
|
||||
for($i=0; $i < $_serverCount; $i++) {
|
||||
if($SETTINGS[$i]->IsExist()) {
|
||||
$DBS[$i]->Update('general', 'USERLEVEL=0', "USER_ID='{$member['ID']}'");
|
||||
}
|
||||
}
|
||||
} elseif($select == 1) {
|
||||
// 일반회원
|
||||
$DB->Update('MEMBER', 'GRADE=1', "NO='{$no}'");
|
||||
|
||||
for($i=0; $i < $_serverCount; $i++) {
|
||||
if($SETTINGS[$i]->IsExist()) {
|
||||
$DBS[$i]->Update('general', 'USERLEVEL=1', "USER_ID='{$member['ID']}'");
|
||||
}
|
||||
}
|
||||
} elseif($select == 2) {
|
||||
// 참여회원
|
||||
$DB->Update('MEMBER', 'GRADE=2', "NO='{$no}'");
|
||||
|
||||
for($i=0; $i < $_serverCount; $i++) {
|
||||
if($SETTINGS[$i]->IsExist()) {
|
||||
$DBS[$i]->Update('general', 'USERLEVEL=2', "USER_ID='{$member['ID']}'");
|
||||
}
|
||||
}
|
||||
} elseif($select == 3) {
|
||||
// 유효회원
|
||||
$DB->Update('MEMBER', 'GRADE=3', "NO='{$no}'");
|
||||
|
||||
for($i=0; $i < $_serverCount; $i++) {
|
||||
if($SETTINGS[$i]->IsExist()) {
|
||||
$DBS[$i]->Update('general', 'USERLEVEL=3', "USER_ID='{$member['ID']}'");
|
||||
}
|
||||
}
|
||||
} elseif($select == 4) {
|
||||
// 특별회원
|
||||
$DB->Update('MEMBER', 'GRADE=4', "NO='{$no}'");
|
||||
|
||||
for($i=0; $i < $_serverCount; $i++) {
|
||||
if($SETTINGS[$i]->IsExist()) {
|
||||
$DBS[$i]->Update('general', 'USERLEVEL=4', "USER_ID='{$member['ID']}'");
|
||||
}
|
||||
}
|
||||
|
||||
if($select >= 0 && $select <= 4) {
|
||||
/*
|
||||
0: 블럭회원
|
||||
1: 일반회원
|
||||
2: 참여회원?
|
||||
3: 유효회원?
|
||||
4: 특별회원?
|
||||
*/
|
||||
$db->update('MEMBER', ['GRADE'=>$select], 'NO=%i', $no);
|
||||
} elseif($select == 5) {
|
||||
// 전콘제거
|
||||
$DB->Update('MEMBER', "PICTURE='', IMGSVR=0", "NO='{$no}'");
|
||||
$db->update('MEMBER', [
|
||||
'PICTURE'=>'',
|
||||
'IMGSVR'=>0
|
||||
], 'NO=%i', $no);
|
||||
|
||||
for($i=0; $i < $_serverCount; $i++) {
|
||||
if($SETTINGS[$i]->IsExist()) {
|
||||
$DBS[$i]->Update('general', "PICTURE='default.jpg', IMGSVR=0", "NPC=0 AND USER_ID='{$member['ID']}'");
|
||||
}
|
||||
}
|
||||
} elseif($select == 6) {
|
||||
// 비번초기화
|
||||
$pw = md5('11111111');
|
||||
$DB->Update('MEMBER', "PW='{$pw}'", "NO='{$no}'");
|
||||
$db->update('MEMBER', ['PW'=>$pw], 'NO=%i',$no);
|
||||
} elseif($select == 7) {
|
||||
// 회원삭제
|
||||
$DB->Delete('MEMBER', "NO='{$no}'");
|
||||
$db->delete('MEMBER', 'NO=%i', $no);
|
||||
} elseif($select == 8) {
|
||||
// 가입허용
|
||||
$DB->Update('SYSTEM', "REG='Y'", "NO='1'");
|
||||
$db->update('SYSTEM', ['REG'=>'Y'], 'NO=1');
|
||||
} elseif($select == 9) {
|
||||
// 가입금지
|
||||
$DB->Update('SYSTEM', "REG='N'", "NO='1'");
|
||||
$db->update('SYSTEM', ['REG'=>'N'], 'NO=1');
|
||||
} elseif($select == 10) {
|
||||
// 로그인허용
|
||||
$DB->Update('SYSTEM', "LOGIN='Y'", "NO='1'");
|
||||
$db->update('SYSTEM', ['LOGIN'=>'Y'], 'NO=1');
|
||||
} elseif($select == 11) {
|
||||
// 로그인금지
|
||||
$DB->Update('SYSTEM', "LOGIN='N'", "NO='1'");
|
||||
$db->update('SYSTEM', ['LOGIN'=>'N'], 'NO=1');
|
||||
} elseif($select == 12) {
|
||||
// 탈퇴처리(1개월)
|
||||
$DB->Delete('MEMBER', "QUIT='Y' AND GRADE<'5' AND REG_DATE<DATE_SUB(NOW(), INTERVAL 1 MONTH)");
|
||||
$db->delete('MEMBER', "QUIT='Y' AND GRADE<'5' AND REG_DATE<DATE_SUB(NOW(), INTERVAL 1 MONTH)");
|
||||
} elseif($select == 13) {
|
||||
// 오래된계정(6개월)
|
||||
$DB->Delete('MEMBER', "GRADE<'5' AND REG_DATE<DATE_SUB(NOW(), INTERVAL 6 MONTH)");
|
||||
} elseif($select == 14) {
|
||||
// 이미지업로드
|
||||
$DB->Update('MEMBER', 'IMGSVR=0');
|
||||
|
||||
for($i=0; $i < $_serverCount; $i++) {
|
||||
if($SETTINGS[$i]->IsExist()) {
|
||||
$DBS[$i]->Update('general', 'IMGSVR=0');
|
||||
}
|
||||
}
|
||||
$db->delete('MEMBER', "GRADE<'5' AND REG_DATE<DATE_SUB(NOW(), INTERVAL 6 MONTH)");
|
||||
}
|
||||
|
||||
$response['result'] = 'SUCCESS';
|
||||
|
||||
+12
-132
@@ -2,153 +2,33 @@
|
||||
require_once('_common.php');
|
||||
require_once(ROOT.W.F_FUNC.W.'class._JSON.php');
|
||||
require_once(ROOT.W.F_CONFIG.W.DB.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.DBS.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.SETTINGS.PHP);
|
||||
require_once(ROOT.W.F_CONFIG.W.SESSION.PHP);
|
||||
|
||||
// 외부 파라미터
|
||||
|
||||
|
||||
$rs = $DB->Select('ID, GRADE', 'MEMBER', "NO='{$SESSION->NoMember()}'");
|
||||
$member = $DB->Get($rs);
|
||||
|
||||
$response['serverCount'] = $_serverCount;
|
||||
$response['serverCount'] = count($serverList);
|
||||
$response['servers'] = '';
|
||||
for($i=0; $i < $_serverCount; $i++) {
|
||||
if(!$SETTINGS[$i]->IsExist()) {
|
||||
|
||||
foreach($serverList as $serverInfo){
|
||||
list($serverKorName, $serverColor, $setting) = $serverInfo;
|
||||
|
||||
$serverText = "<span style='font-weight:bold;font-size:1.4em;color:{$serverColor}'>{$serverKorName}</span>";
|
||||
if(!$serverInfo->isExist()) {
|
||||
$response['servers'] .= "
|
||||
<div class='Entrance_ServerList'>
|
||||
<div class='Entrance_ServerListServer'><br>{$_serverNames[$i]}</div>
|
||||
<div class='Entrance_ServerListServer'><br>{$serverText}</div>
|
||||
<div class='Entrance_ServerListDown'><br>- 폐 쇄 중 -</div>
|
||||
</div>
|
||||
";
|
||||
} else {
|
||||
$rs = $DBS[$i]->Select('ISUNITED, NPCMODE, YEAR, MONTH, SCENARIO, MAXGENERAL, TURNTERM', 'game', "NO='1'");
|
||||
$game = $DBS[$i]->Get($rs);
|
||||
|
||||
$rs = $DBS[$i]->Select('COUNT(*) AS CNT', 'nation', "LEVEL>'0'");
|
||||
$nation = $DBS[$i]->Get($rs);
|
||||
|
||||
$rs = $DBS[$i]->Select('COUNT(*) AS CNT', 'general', "NPC<'2'");
|
||||
$gen = $DBS[$i]->Get($rs);
|
||||
|
||||
$rs = $DBS[$i]->Select('COUNT(*) AS CNT', 'general', "NPC>='2'");
|
||||
$npc = $DBS[$i]->Get($rs);
|
||||
|
||||
unset($me);
|
||||
$rs = $DBS[$i]->Select('NAME, PICTURE, IMGSVR', 'general', "USER_ID='{$member['ID']}'");
|
||||
$me = $DBS[$i]->Get($rs);
|
||||
|
||||
if($game['ISUNITED'] == 2) { $state = "§천하통일§"; }
|
||||
else { $state = "<{$nation['CNT']}국 경쟁중>"; }
|
||||
$state = "<font size=2>{$state}</font>";
|
||||
|
||||
if($me) { $site = "index.php"; }
|
||||
elseif($game['NPCMODE'] == 1) { $site = "selection.php"; }
|
||||
else { $site = "join.php"; }
|
||||
|
||||
$info = "서기 {$game['YEAR']}년 {$game['MONTH']}월 (<font color=orange>".getScenario($game['SCENARIO'])."</font>)<br>
|
||||
유저 : {$gen['CNT']} / {$game['MAXGENERAL']}명 <font color=cyan>NPC : {$npc['CNT']}명</font> (<font color=limegreen>".getTurnTerm($game['TURNTERM'])."</font>)";
|
||||
|
||||
if($member['GRADE'] == 0) {
|
||||
$character = "<div class='Entrance_ServerListBlock'>- 계정 블럭 -</div>";
|
||||
} elseif($_serverLevels[$i] == 2 && $member['GRADE'] < 2) {
|
||||
$character = "<div class='Entrance_ServerListBlock'>- 클로즈 테스트중 -</div>";
|
||||
} elseif($_serverLevels[$i] == 3 && $member['GRADE'] < 3) {
|
||||
$character = "<div class='Entrance_ServerListBlock'>- 클로즈 테스트중 -</div>";
|
||||
} elseif($_serverLevels[$i] == 4 && $member['GRADE'] < 4) {
|
||||
$character = "<div class='Entrance_ServerListBlock'>- 클로즈 테스트중 -</div>";
|
||||
} elseif($_serverLevels[$i] == 5 && $member['GRADE'] < 5) {
|
||||
$character = "<div class='Entrance_ServerListBlock'>- 부운영자 테스트중 -</div>";
|
||||
} elseif($_serverLevels[$i] >= 6 && $member['GRADE'] < 6) {
|
||||
$character = "<div class='Entrance_ServerListBlock'>- 운영자 테스트중 -</div>";
|
||||
} elseif($me) {
|
||||
if($me['PICTURE'] == '') {
|
||||
$picture = '<img src="'.IMAGE.W.'default.jpg">';
|
||||
} else {
|
||||
if($me['IMGSVR'] == 0) {
|
||||
$picture = '<img src="'.IMAGE.W."{$me['PICTURE']}\">";
|
||||
} else {
|
||||
$picture = '<img src="../d_pic/'.W."{$me['PICTURE']}\">";
|
||||
}
|
||||
}
|
||||
|
||||
$character = "
|
||||
<div class='Entrance_ServerListCharacter'>{$picture}</div>
|
||||
<div class='Entrance_ServerListName'>{$me['NAME']}</div>
|
||||
<input class='Entrance_ServerListLogin' type='button' value='입장' onclick=\"location.href='{$_serverDirs[$i]}')\">
|
||||
";
|
||||
} elseif($gen['CNT'] >= $game['MAXGENERAL']) {
|
||||
$character = "<div class='Entrance_ServerListBlock'>- 장수 등록 마감 -</div>";
|
||||
} else {
|
||||
$character = "<div class='Entrance_ServerListNoRegister'>- 미 등 록 -</div>";
|
||||
if($game['NPCMODE'] == 1) {
|
||||
$character .= "<input class='Entrance_ServerListSelect' type='button' value='장수선택' onclick=\"location.href='{$_serverDirs[$i]}/select_npc.php';\">";
|
||||
$character .= "<input class='Entrance_ServerListSelect' type='button' value='장수생성' onclick=\"location.href='{$_serverDirs[$i]}/join.php';\">";
|
||||
} else {
|
||||
$character .= "<input class='Entrance_ServerListLogin' type='button' value='장수생성' onclick=\"location.href='{$_serverDirs[$i]}/join.php';\">";
|
||||
}
|
||||
}
|
||||
|
||||
$response['servers'] .= "
|
||||
<div class='Entrance_ServerList'>
|
||||
<div class='Entrance_ServerListServer'><br>{$_serverNames[$i]}<br>{$state}</div>
|
||||
<div class='Entrance_ServerListInfo'><br>{$info}</div>
|
||||
{$character}
|
||||
</div>
|
||||
";
|
||||
<div class='Entrance_ServerList ServerActive' data-server='{$serverInfo->getServerName()}>
|
||||
<div class='Entrance_ServerListServer'><br>{$serverText}</div>
|
||||
</div>";
|
||||
//TODO: 이에 대해 동적으로 j_server_basic_info.php 를 불러서 기록해야함.
|
||||
}
|
||||
}
|
||||
|
||||
$response['result'] = 'SUCCESS';
|
||||
|
||||
sleep(1);
|
||||
echo json_encode($response);
|
||||
|
||||
function getScenario($scenario) {
|
||||
switch($scenario) {
|
||||
case 0: $str = "공백지모드"; break;
|
||||
case 1: $str = "역사모드1 : 184년 황건적의 난"; break;
|
||||
case 2: $str = "역사모드2 : 190년 반동탁연합"; break;
|
||||
case 3: $str = "역사모드3 : 194년 군웅할거"; break;
|
||||
case 4: $str = "역사모드4 : 196년 황제는 허도로"; break;
|
||||
case 5: $str = "역사모드5 : 200년 관도대전"; break;
|
||||
case 6: $str = "역사모드6 : 202년 원가의 분열"; break;
|
||||
case 7: $str = "역사모드7 : 207년 적벽대전"; break;
|
||||
case 8: $str = "역사모드8 : 213년 익주 공방전"; break;
|
||||
case 9: $str = "역사모드9 : 219년 삼국정립"; break;
|
||||
case 10: $str = "역사모드10 : 225년 칠종칠금"; break;
|
||||
case 11: $str = "역사모드11 : 228년 출사표"; break;
|
||||
|
||||
case 12: $str = "IF모드1 : 191년 백마장군의 위세"; break;
|
||||
|
||||
case 20: $str = "가상모드1 : 180년 영웅 난무"; break;
|
||||
case 21: $str = "가상모드1 : 180년 영웅 집결"; break;
|
||||
case 22: $str = "가상모드2 : 179년 훼신 집결"; break;
|
||||
case 23: $str = "가상모드3 : 180년 영웅 시대"; break;
|
||||
case 24: $str = "가상모드4 : 180년 결사항전"; break;
|
||||
case 25: $str = "가상모드5 : 180년 영웅독존"; break;
|
||||
case 26: $str = "가상모드6 : 180년 무풍지대"; break;
|
||||
case 27: $str = "가상모드7 : 180년 가요대잔치"; break;
|
||||
case 28: $str = "가상모드8 : 180년 확산성 밀리언 아서"; break;
|
||||
default: $str = "시나리오?"; break;
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
function getTurnTerm($term) {
|
||||
switch($term) {
|
||||
case 0: $str = "120분 턴 서버"; break;
|
||||
case 1: $str = "60분 턴 서버"; break;
|
||||
case 2: $str = "30분 턴 서버"; break;
|
||||
case 3: $str = "20분 턴 서버"; break;
|
||||
case 4: $str = "10분 턴 서버"; break;
|
||||
case 5: $str = "5분 턴 서버"; break;
|
||||
case 6: $str = "2분 턴 서버"; break;
|
||||
case 7: $str = "1분 턴 서버"; break;
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user