diff --git a/hwe/_119_b.php b/hwe/_119_b.php index 84495ea7..e6dfe110 100644 --- a/hwe/_119_b.php +++ b/hwe/_119_b.php @@ -7,8 +7,8 @@ include "func.php"; $session = Session::requireGameLogin()->setReadOnly(); if($session->userGrade < 5){ - //echo ""; - echo '_119.php';//TODO:debug all and replace + header('location:_119.php'); + die(); } $v = new Validator($_POST); @@ -68,6 +68,4 @@ case "락풀기": break; } -//echo ""; -//echo '_119.php';//TODO:debug all and replace header('Location:_119.php'); \ No newline at end of file diff --git a/hwe/_admin1_submit.php b/hwe/_admin1_submit.php index 2ae49504..6d09c214 100644 --- a/hwe/_admin1_submit.php +++ b/hwe/_admin1_submit.php @@ -7,8 +7,8 @@ include "func.php"; $session = Session::requireGameLogin()->setReadOnly(); if ($session->userGrade < 5) { - //echo ""; - echo '_admin1.php';//TODO:debug all and replace + header('location:_admin1.php'); + die(); } $v = new Validator($_POST); diff --git a/hwe/_admin2_submit.php b/hwe/_admin2_submit.php index 45947fdc..e9ad6652 100644 --- a/hwe/_admin2_submit.php +++ b/hwe/_admin2_submit.php @@ -8,7 +8,7 @@ include "func.php"; $weap = Util::getReq('weap', 'int'); //로그인 검사 -$session = Session::requireLogin()->loginGame(); +$session = Session::requireLogin()->loginGame()->setReadOnly(); if($session->userGrade < 5) { header('location:_admin2.php'); @@ -303,6 +303,4 @@ switch($btn) { break; } -//echo ""; -echo '_admin2.php';//TODO:debug all and replace - +header('location:_admin2.php'); \ No newline at end of file diff --git a/hwe/_admin4_submit.php b/hwe/_admin4_submit.php index 09ea4402..c663b50a 100644 --- a/hwe/_admin4_submit.php +++ b/hwe/_admin4_submit.php @@ -7,8 +7,8 @@ include "func.php"; $session = Session::requireGameLogin()->setReadOnly(); if($session->userGrade < 5) { - //echo ""; - echo '_admin4.php';//TODO:debug all and replace + header('location:_admin4.php'); + die(); } $db = DB::db(); @@ -57,6 +57,5 @@ switch($btn) { break; } -//echo ""; -echo '_admin4.php'; //TODO:debug all and replace +header('location:_admin4.php'); diff --git a/hwe/_admin5_submit.php b/hwe/_admin5_submit.php index fdd9ca2d..0520e0cd 100644 --- a/hwe/_admin5_submit.php +++ b/hwe/_admin5_submit.php @@ -11,8 +11,8 @@ $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); if($session->userGrade < 5) { - //echo ""; - echo '_admin5.php';//TODO:debug all and replace + header('location:_admin5.php'); + die(); } $db = DB::db(); @@ -34,7 +34,6 @@ switch($btn) { break; } -//echo ""; -echo '_admin5.php';//TODO:debug all and replace +header('location:_admin5.php'); diff --git a/hwe/b_myPage.php b/hwe/b_myPage.php index 85d6774a..32bf8e55 100644 --- a/hwe/b_myPage.php +++ b/hwe/b_myPage.php @@ -52,8 +52,7 @@ $me = MYDB_fetch_array($result); diff --git a/hwe/b_tournament.php b/hwe/b_tournament.php index 77df1b18..743514e9 100644 --- a/hwe/b_tournament.php +++ b/hwe/b_tournament.php @@ -377,10 +377,11 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), " $betting = MYDB_fetch_array($result); $bet = []; for ($i=0; $i < 16; $i++) { - $bet[$i] = @round($betting['bet'] / $betting["bet{$i}"], 2); - if ($bet[$i] == 0) { - $bet[$i] = "∞"; + if($betting['bet'] == 0){ + $bet[$i] = '∞'; + continue; } + $bet[$i] = round($betting['bet'] / $betting["bet{$i}"], 2); } echo " diff --git a/hwe/c_chiefboard.php b/hwe/c_chiefboard.php index f62968fb..b830d829 100644 --- a/hwe/c_chiefboard.php +++ b/hwe/c_chiefboard.php @@ -52,10 +52,4 @@ if(getBlockLevel() != 1 && getBlockLevel() != 3) { } } -//echo ""; -echo 'b_chiefboard.php';//TODO:debug all and replace -?> - - - - +header('location:b_chiefboard.php'); \ No newline at end of file diff --git a/hwe/c_dipcenter.php b/hwe/c_dipcenter.php index 948706f3..770d7d3d 100644 --- a/hwe/c_dipcenter.php +++ b/hwe/c_dipcenter.php @@ -27,8 +27,7 @@ $btn = $_POST['btn']; //내가 수뇌부이어야함 if($me['level'] < 5) { - //echo ""; - echo 'b_myBossInfo.php';//TODO:debug all and replace + header('location:b_myBossInfo.php'); exit(); } @@ -69,7 +68,5 @@ if($btn == "국가방침") { MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); } -//echo ""; -echo 'b_dipcenter.php';//TODO:debug all and replace - +header('location:b_dipcenter.php'); diff --git a/hwe/c_double.php b/hwe/c_double.php index 73f0e2ee..138d1ce1 100644 --- a/hwe/c_double.php +++ b/hwe/c_double.php @@ -61,9 +61,13 @@ if($command == 46) { $query['turn'.$turnIdx] = $comStr; } $db->update('general', $query, 'owner=%i', $userID); - header('Location:index.php'); + header('Location:./'); + die(); + +} + //통합제의 -} elseif($command == 53) { +if($command == 53) { $query = "select nation,level from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $me = MYDB_fetch_array($result); @@ -87,10 +91,12 @@ if($command == 46) { $query = "update nation set {$str} where nation='{$me['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); } - //echo ""; - echo 'b_chiefcenter.php';//TODO:debug all and replace + header('location:b_chiefcenter.php'); + die(); +} + //불가침 -} elseif($command == 61) { +if($command == 61) { $query = "select nation,level from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $me = MYDB_fetch_array($result); @@ -113,13 +119,16 @@ if($command == 46) { $query = "update nation set {$str} where nation='{$me['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); } - //echo ""; - echo 'b_chiefcenter.php';//TODO:debug all and replace + + header('location:b_chiefcenter.php'); + die(); +} + //포상, 몰수, 발령, 항복권고, 원조 //선전포고, 종전, 파기, 초토화, 천도, 증축, 감축 //백성동원, 수몰, 허보, 피장파장, 의병모집, 이호경식, 급습 //국기변경 -} elseif($command == 23 || $command == 24 || $command == 27 || $command == 51 || $command == 52 || $command > 60) { +if($command == 23 || $command == 24 || $command == 27 || $command == 51 || $command == 52 || $command > 60) { $query = "select no,nation,level from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $me = MYDB_fetch_array($result); @@ -136,13 +145,14 @@ if($command == 46) { MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); } header('location:b_chiefcenter.php'); -} else { - $query = []; - foreach($turn as $turnIdx){ - $query['turn'.$turnIdx] = $comStr; - } - $db->update('general', $query, 'owner=%i', $userID); - header('Location:index.php'); + die(); } +//일반 턴 +$query = []; +foreach($turn as $turnIdx){ + $query['turn'.$turnIdx] = $comStr; +} +$db->update('general', $query, 'owner=%i', $userID); +header('Location:./'); diff --git a/hwe/c_myBossInfo.php b/hwe/c_myBossInfo.php index bcfb1bbd..fa210030 100644 --- a/hwe/c_myBossInfo.php +++ b/hwe/c_myBossInfo.php @@ -33,7 +33,7 @@ $ruler = MYDB_fetch_array($result); //수뇌가 아니면 아무것도 할 수 없음 if($meLevel < 5){ - echo 'b_myBossInfo.php';//TODO:debug all and replace + header('location:b_myBossInfo.php'); exit(); } @@ -45,8 +45,8 @@ if($btn == "임명") { //임명할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함 if($general['level'] == 12 || $meLevel < 5 || ($general['nation'] != $me['nation'] && $genlist != 0)) { - //echo ""; - echo 'b_myBossInfo.php';//TODO:debug all and replace + + header('location:b_myBossInfo.php'); exit(); } } elseif($btn == "추방") { @@ -56,15 +56,14 @@ if($btn == "임명") { //추방할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함 if($general['level'] == 12 || $meLevel < 5 || ($general['nation'] != $me['nation'] && $outlist != 0)) { - //echo ""; - echo 'b_myBossInfo.php';//TODO:debug all and replace + header('location:b_myBossInfo.php'); exit(); } } //나와 대상 장수는 국가가 같아야 함 if($me['nation'] != $general['nation']){ - echo 'b_myBossInfo.php';//TODO:debug all and replace + header('location:b_myBossInfo.php'); exit(); } @@ -188,7 +187,11 @@ if($btn == "추방") { pushGenLog($general, $log); pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); } -} elseif($btn == "임명" && $level >= 5 && $level <= 11) { + header('location:b_myBossInfo.php'); + die(); +} + +if($btn == "임명" && $level >= 5 && $level <= 11) { $query = "select l{$level}set,level,chemi from nation where nation='{$me['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); @@ -235,7 +238,12 @@ if($btn == "추방") { } } } -} elseif($btn == "임명" && $level >= 2 && $level <= 4 && $citylist > 0) { + header('location:b_myBossInfo.php'); + die(); +} + + +if($btn == "임명" && $level >= 2 && $level <= 4 && $citylist > 0) { switch($level) { case 4: $lv = 1; break; case 3: $lv = 2; break; @@ -246,8 +254,7 @@ if($btn == "추방") { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $city = MYDB_fetch_array($result); if(!$city){ - //echo ""; - echo 'b_myBossInfo.php';//TODO:debug all and replace + header('location:b_myBossInfo.php'); die(); } $oldlist = $city["gen{$lv}"]; @@ -283,9 +290,11 @@ if($btn == "추방") { MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); } } + header('location:b_myBossInfo.php'); + die(); } -//echo ""; -echo 'b_myBossInfo.php';//TODO:debug all and replace + +header('location:b_myBossInfo.php'); diff --git a/hwe/c_nationboard.php b/hwe/c_nationboard.php index 2d269803..b76f046d 100644 --- a/hwe/c_nationboard.php +++ b/hwe/c_nationboard.php @@ -50,11 +50,4 @@ if(getBlockLevel() != 1 && getBlockLevel() != 3) { } } -//echo ""; -echo 'b_nationboard.php';//TODO:debug all and replace - -?> - - - - +header('location:b_nationboard.php'); diff --git a/hwe/c_nationrule.php b/hwe/c_nationrule.php index 89366ac7..4b5d718c 100644 --- a/hwe/c_nationrule.php +++ b/hwe/c_nationrule.php @@ -21,6 +21,4 @@ $msg = addslashes(SQ2DQ($msg)); $query = "update nation set rule='$msg' where nation='{$me['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); -//echo ""; -echo 'b_nationrule.php';//TODO:debug all and replace - +header('location:b_nationrule.php'); \ No newline at end of file diff --git a/hwe/c_tournament.php b/hwe/c_tournament.php index 5c6d72a7..7a7b7d47 100644 --- a/hwe/c_tournament.php +++ b/hwe/c_tournament.php @@ -33,7 +33,10 @@ case 2: $tp = "power"; $tp2 = "일기토"; $tp3 = "power"; break; case 3: $tp = "intel"; $tp2 = "설전"; $tp3 = "intel"; break; } -if($me['tournament'] == 1 && $session->userGrade < 5) { echo ""; exit(); } +if($me['tournament'] == 1 && $session->userGrade < 5) { + header('locatoin:b_tournament.php'); + exit(); +} if($btn == "자동개최설정" && $session->userGrade >= 5) { $db->update('game', ['tnmt_trig'=>$trig], true); @@ -101,7 +104,10 @@ if($btn == "자동개최설정" && $session->userGrade >= 5) { $general = MYDB_fetch_array($result); //{$admin['develcost']}원 참가비 - if($general['gold'] < $admin['develcost']) { echo ""; exit(1); } + if($general['gold'] < $admin['develcost']) { + header('location:b_tournament.php'); + exit(1); + } $general['gold'] -= $admin['develcost']; } @@ -216,7 +222,5 @@ if($btn == "자동개최설정" && $session->userGrade >= 5) { $query = "update game set tnmt_msg='$msg'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); } -?> - -b_tournament.php +header('location:b_tournament.php'); \ No newline at end of file diff --git a/hwe/c_vacation.php b/hwe/c_vacation.php index eda7ba4b..e694007c 100644 --- a/hwe/c_vacation.php +++ b/hwe/c_vacation.php @@ -19,6 +19,6 @@ $admin['killturn'] *= 3; $query = "update general set killturn='{$admin['killturn']}' where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); -//echo ""; -echo 'b_myPage.php'; //TODO:debug all and replace + +header('location:b_myPage.php'); diff --git a/hwe/c_vote.php b/hwe/c_vote.php index 96ece6e3..ca6385b0 100644 --- a/hwe/c_vote.php +++ b/hwe/c_vote.php @@ -56,8 +56,7 @@ else if($btn == "댓글" && $comment != "") { } if($session->userGrade < 5){ - echo " - echo 'a_vote.php '; + header('location:a_vote.php'); die(); } @@ -96,7 +95,5 @@ if($btn == "수정") { $query = "update game set voteopen=2"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); } -?> - -a_vote.php \ No newline at end of file +header('location:a_vote.php'); \ No newline at end of file diff --git a/hwe/d_ally.php b/hwe/d_ally.php index dcb2e17b..a5187102 100644 --- a/hwe/d_ally.php +++ b/hwe/d_ally.php @@ -128,5 +128,5 @@ pushGenLog($you, $youlog); //pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); //pushWorldHistory($history, $admin['year'], $admin['month']); -echo ""; +header('location:msglist.php'); diff --git a/hwe/d_cancel.php b/hwe/d_cancel.php index 16e039eb..252a1548 100644 --- a/hwe/d_cancel.php +++ b/hwe/d_cancel.php @@ -109,5 +109,4 @@ pushGenLog($you, $youlog); pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); pushWorldHistory($history, $admin['year'], $admin['month']); -echo ""; - +header('location:msglist.php'); diff --git a/hwe/d_cease.php b/hwe/d_cease.php index 94f70ab9..bce92012 100644 --- a/hwe/d_cease.php +++ b/hwe/d_cease.php @@ -114,5 +114,4 @@ pushGenLog($you, $youlog); pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); pushWorldHistory($history, $admin['year'], $admin['month']); -echo ""; - +header('location:msglist.php'); diff --git a/hwe/d_merge.php b/hwe/d_merge.php index 9a822cf0..ece9105b 100644 --- a/hwe/d_merge.php +++ b/hwe/d_merge.php @@ -148,5 +148,5 @@ pushGenLog($you, $youlog); pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); pushWorldHistory($history, $admin['year'], $admin['month']); -echo ""; +header('location:msglist.php'); diff --git a/hwe/d_scout.php b/hwe/d_scout.php index 9f0ecfc7..9ffc35b7 100644 --- a/hwe/d_scout.php +++ b/hwe/d_scout.php @@ -174,5 +174,4 @@ pushGenLog($you, $youlog); pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); //pushWorldHistory($history, $admin['year'], $admin['month']); -echo ""; - +header('location:msglist.php'); \ No newline at end of file diff --git a/hwe/d_surrender.php b/hwe/d_surrender.php index f565b191..4af69215 100644 --- a/hwe/d_surrender.php +++ b/hwe/d_surrender.php @@ -137,5 +137,4 @@ pushGenLog($you, $youlog); pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); pushWorldHistory($history, $admin['year'], $admin['month']); -echo ""; - +header('location:msglist.php'); \ No newline at end of file diff --git a/hwe/func_command.php b/hwe/func_command.php index 12f90604..90cb98ce 100644 --- a/hwe/func_command.php +++ b/hwe/func_command.php @@ -718,8 +718,7 @@ function command_Chief($turn, $command) { $query = "update nation set {$str} where nation='{$me['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); } - //echo ""; - echo 'b_chiefcenter.php';//TODO:debug all and replace + header('location:b_chiefcenter.php'); } function command_Other($turn, $commandtype) { diff --git a/hwe/func_legacy.php b/hwe/func_legacy.php index b4aeceb5..41ce5a86 100644 --- a/hwe/func_legacy.php +++ b/hwe/func_legacy.php @@ -71,7 +71,7 @@ function GetNationColors() { function backButton() { return " -
+
"; } diff --git a/hwe/func_message.php b/hwe/func_message.php index 35bbdbe7..ef7eaffd 100644 --- a/hwe/func_message.php +++ b/hwe/func_message.php @@ -276,7 +276,7 @@ function DecodeMsg($msg, $type, $who, $date, $bg, $num=0) { switch($bg) { case 2: - case 4: $bgcolor = "CC6600"; break; + case 4: $bgcolor = "#CC6600"; break; } if($category == 6) { diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index 6bbf3fff..97606655 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -673,7 +673,7 @@ function process_47(&$general) { //분쟁기록 모두 지움 DeleteConflict($general['nation']); // 국명, 색깔 바꿈 국가 레벨 0, 성향리셋, 기술0 - $query = "update nation set name='{$general['name']}',color='330000',level='0',type='0',tech='0',totaltech='0',capital='0' where nation='{$general['nation']}'"; + $query = "update nation set name='{$general['name']}',color='#330000',level='0',type='0',tech='0',totaltech='0',capital='0' where nation='{$general['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); // 본인 빼고 건국/임관제한 $query = "update general set makelimit='12' where no!='{$general['no']}' and nation='{$general['nation']}'"; diff --git a/hwe/join_post.php b/hwe/join_post.php index 492750df..a757c5b0 100644 --- a/hwe/join_post.php +++ b/hwe/join_post.php @@ -276,6 +276,6 @@ $rootDB->insert('member_log', [ - + diff --git a/hwe/preprocessing.php b/hwe/preprocessing.php index f714f5c8..2d50b058 100644 --- a/hwe/preprocessing.php +++ b/hwe/preprocessing.php @@ -17,7 +17,7 @@ $commandtype = Util::getReq('commandtype', 'int'); increaseRefresh("턴입력", 1); if(!$turn || $commandtype === null){ - header('location:index.php'); + header('location:./'); die(); } @@ -31,8 +31,7 @@ $me = MYDB_fetch_array($result); $con = checkLimit($me['con'], $admin['conlimit']); if($con >= 2) { - //echo ""; - echo 'index.php';//TODO:debug all and replace + header('location:./'); exit(); } diff --git a/hwe/processing.php b/hwe/processing.php index 3afa91d6..06379028 100644 --- a/hwe/processing.php +++ b/hwe/processing.php @@ -191,8 +191,8 @@ function command_99($turn) { MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); } } - //echo ""; - echo 'b_chiefcenter.php';//TODO:debug all and replace + + header('location:b_chiefcenter.php'); } function command_11($turn, $command) { diff --git a/hwe/templates/error.php b/hwe/templates/error.php index 7718226e..74a76ed1 100644 --- a/hwe/templates/error.php +++ b/hwe/templates/error.php @@ -19,7 +19,7 @@    운영자가 처리할 때까지 기다려주세요
- +
message?> diff --git a/hwe/turn.php b/hwe/turn.php index 41534ddd..d5ff9cc1 100644 --- a/hwe/turn.php +++ b/hwe/turn.php @@ -25,8 +25,7 @@ $conLimit = $db->queryFirstField('SELECT conlimit FROM game LIMIT 1'); $con = checkLimit($myActionCnt, $conLimit); if($con >= 2) { - echo ""; - //echo 'index.php';//TODO:debug all and replace + header('location:commandlist.php'); exit(); } diff --git a/hwe/turn_pop_core.php b/hwe/turn_pop_core.php index 06f3614c..5148f3ec 100644 --- a/hwe/turn_pop_core.php +++ b/hwe/turn_pop_core.php @@ -16,5 +16,4 @@ $me = MYDB_fetch_array($result); updateCommand($me['no'], 2); -//echo ""; -echo 'b_chiefcenter.php';//TODO:debug all and replace +header('location:b_chiefcenter.php'); diff --git a/hwe/turn_push_core.php b/hwe/turn_push_core.php index 1d5cb31d..d3b8f088 100644 --- a/hwe/turn_push_core.php +++ b/hwe/turn_push_core.php @@ -16,6 +16,4 @@ $me = MYDB_fetch_array($result); backupdateCommand($me['no'], 2); -//echo ""; -echo 'b_chiefcenter.php';//TODO:debug all and replace - +header('location:b_chiefcenter.php'); diff --git a/js/func.js b/js/func.js index e3e7c597..e69de29b 100644 --- a/js/func.js +++ b/js/func.js @@ -1,234 +0,0 @@ -function ClearContent(sel) { - $(sel).html(""); -} - -function Open(url) { - window.open(url); -} - -function Replace(url) { - //location.replace(url); - console.log('this',url); -} - -function ReplaceFrame(url) { - console.log('top',url); - window.top.location.replace(url); - -} - -function ImportStyle(href) { - var CSS = document.createElement('link'); - CSS.rel = 'stylesheet'; - CSS.type = 'text/css'; - CSS.media = 'screen'; - CSS.href = href; - document.getElementsByTagName('head')[0].appendChild(CSS); -} - -function ImportView(sel, url) { - var html = $.ajax({ - url: url, - async: false - }); - $(sel).append(html.responseText); -} - -function ImportAction(sel, url) { - var tag = ""; - $(sel).append(tag); -} - -function ImportAction(url) { -// 비동기라서 동기화된 함수로 변경 -// 추후 cache: true, 로 변경 -// $.getScript(url, function() { eval(initFunc); }); - $.ajax({ - type: 'GET', - url: url, - cache: true, - async: false, - dataType: 'script' - }); -} - -function GetJSON(url, data, callback) { - $.ajax({ - type: 'GET', - url: url, - cache: true, - async: true, - data: data, - success: callback, - dataType: 'json', - error: Error - }); -} - -function GetJSONSync(url, data, callback) { - $.ajax({ - type: 'GET', - url: url, - cache: true, - async: false, - data: data, - success: callback, - dataType: 'json', - error: Error - }); -} - -function PostJSON(url, data, callback) { - $.ajax({ - type: 'POST', - url: url, - cache: true, - async: true, - data: data, - success: callback, - dataType: 'json', - error: Error - }); -} - -function PostJSONSync(url, data, callback) { - $.ajax({ - type: 'POST', - url: url, - cache: true, - async: false, - data: data, - success: callback, - dataType: 'json', - error: Error - }); -} - -function Error(xhr, textStatus, errorThrown) { -// alert(xhr.status); - alert(xhr.responseText); -// alert(textStatus); -// alert(errorThrown); -/* - if(xhr.status == 404) { - alert("처리 프로그램이 없습니다!"); - alert(xhr.responseText); - } else if(xhr.status == 500) { - alert("처리 프로그램이 오류입니다!"); - alert(xhr.responseText); - } -*/ -} - -function IsNumber(input) { - var check = /(^\d+$)/; - return check.test(input); -} - -function Second(time, amount) { - var h = parseInt(time.substr(0, 2), 10); - var m = parseInt(time.substr(3, 2), 10); - var s = parseInt(time.substr(6, 2), 10); - s += amount; - - if(amount > 0) { - if(s > 60) { m += Math.floor(s/60); s = s%60; } - if(m > 60) { h += Math.floor(m/60); m = m%60; } - if(h > 24) { h = h%24; } - } else { - if(s < 0) { m += Math.floor(s/60); s = 60+s%60; } - if(m < 0) { h += Math.floor(m/60); m = 60+m%60; } - if(h < 0) { h = 24+h%24; } - } - - if(h < 10) h = "0"+h; - if(m < 10) m = "0"+m; - if(s < 10) s = "0"+s; - - var newTime = h+":"+m+":"+s; - return newTime; -} - -function ExitButton(obj) { - $(obj).each(function() { - $(this).css("background", "transparent url(../e_image/button/exit0x26x25.png) no-repeat"); - $(this).mouseover(function () { $(this).css("background", "transparent url(../e_image/button/exit1x26x25.png) no-repeat" ); }); - $(this).mouseout(function () { $(this).css("background", "transparent url(../e_image/button/exit0x26x25.png) no-repeat"); }); - $(this).mousedown(function () { $(this).css("background", "transparent url(../e_image/button/exit2x26x25.png) no-repeat"); }); - $(this).mouseup(function () { $(this).css("background", "transparent url(../e_image/button/exit1x26x25.png) no-repeat"); }); - }); -} - -function Button(obj, w) { - $(obj).each(function() { - $(this).css("background", "transparent url(../e_image/button/button0x"+w+"x20.png) no-repeat"); - $(this).mouseover(function () { $(this).css("background", "transparent url(../e_image/button/button1x"+w+"x20.png) no-repeat" ); }); - $(this).mouseout(function () { $(this).css("background", "transparent url(../e_image/button/button0x"+w+"x20.png) no-repeat"); }); - $(this).mousedown(function () { $(this).css("background", "transparent url(../e_image/button/button2x"+w+"x20.png) no-repeat"); }); - $(this).mouseup(function () { $(this).css("background", "transparent url(../e_image/button/button1x"+w+"x20.png) no-repeat"); }); - }); -} - -function Disable(obj, w) { - $(obj).each(function() { - $(this).css("background", "transparent url(../e_image/button/button3x"+w+"x20.png) no-repeat"); - $(this).css("color", "#CCCCCC"); - $(this).css("font-style", "italic"); - $(this).css("cursor", "default"); - $(this).attr("disabled", "true"); - }); -} - -function Enable(obj, w) { - $(obj).each(function() { - $(this).css("background", "transparent url(../e_image/button/button0x"+w+"x20.png) no-repeat"); - $(this).css("color", "#FFFFFF"); - $(this).css("font-style", "normal"); - $(this).css("cursor", "pointer"); - $(this).attr("disabled", ""); - }); -} - -function Drag(obj) { - var _ox = $(obj).offset().left; - var _oy = $(obj).offset().top; - - $(obj).attr("_x", 0); - $(obj).attr("_y", 0); - $(obj).attr("_ox", _ox); - $(obj).attr("_oy", _oy); - - $(obj).bind("dragstart", function(event) { - $(this).attr("_x", $(this).scrollLeft()); - $(this).attr("_y", $(this).scrollTop()); - }); - - $(obj).bind("dragend", function(event) { - $(this).attr("_x", $(this).scrollLeft()); - $(this).attr("_y", $(this).scrollTop()); - }); - - $(obj).bind("drag", function(event) { - var _x = parseInt($(this).attr("_x")); - var _y = parseInt($(this).attr("_y")); - var _ox = parseInt($(this).attr("_ox")); - var _oy = parseInt($(this).attr("_oy")); - - $(this).scrollLeft(_x + _ox - event.offsetX); - $(this).scrollTop(_y + _oy - event.offsetY); - }); -} - -function ScrollTo(obj, x, y) { - var w = $(obj).width(); - var h = $(obj).height(); - - $(obj).scrollLeft(x - w/2); - $(obj).scrollTop(y - h/2); -} - -function CheckIE6PNG() { - if($.browser.msie == true && $.browser.version == "6.0") { - DD_belatedPNG.fix(".png"); - } -}