string 내의 $ 호출들 일괄 변환.

This commit is contained in:
2018-01-16 03:56:50 +09:00
parent c73a3bcf95
commit 28eaf7b0d7
119 changed files with 6485 additions and 6479 deletions
+25 -25
View File
@@ -10,21 +10,21 @@ $query = "select turnterm from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,gold,rice,special,userlevel from general where user_id='$_SESSION[p_id]'";
$query = "select no,name,gold,rice,special,userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select no from auction where no1='$me[no]'";
$query = "select no from auction where no1='$me['no']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$tradeCount = MYDB_num_rows($result);
$query = "select no from auction where no2='$me[no]'";
$query = "select no from auction where no2='$me['no']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$bidCount = MYDB_num_rows($result);
$btCount = $tradeCount + $bidCount;
switch($admin[turnterm]) {
switch($admin['turnterm']) {
case 0: $unit = 7200; break;
case 1: $unit = 3600; break;
case 2: $unit = 1800; break;
@@ -42,7 +42,7 @@ $value = round($value / 10) * 10;
if($term > 24) $term = 24;
$valid = 1;
if($me[userlevel] >= 5 || ($me[special] != 30 && $btCount < 1) || ($me[special] == 30 && $btCount < 3)) {
if($me['userlevel'] >= 5 || ($me['special'] != 30 && $btCount < 1) || ($me['special'] == 30 && $btCount < 3)) {
} else {
$msg = "ㆍ<O>더이상 등록할 수 없습니다.</>";
$msg2 = "ㆍ<O>더이상 등록할 수 없습니다.</>";
@@ -75,14 +75,14 @@ if($btn == "판매") {
$msg = "ㆍ<O>즉시판매가는 시작판매가의 110% 이상이어야 합니다.</>";
$valid = 0;
}
if($amount > $me[rice] - 1000) {
if($amount > $me['rice'] - 1000) {
$msg = "ㆍ<O>기본 군량 1000은 거래할 수 없습니다.</>";
$valid = 0;
}
if($valid == 1) {
$msg = "ㆍ<O>등록 성공.</>";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (0, '$me[no]', '$me[name]', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')";
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (0, '$me['no']', '$me['name']', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif($btn == "구매시도") {
@@ -90,7 +90,7 @@ if($btn == "판매") {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$auction = MYDB_fetch_array($result);
if($value == $auction[topv]) {
if($value == $auction['topv']) {
$valid = 2;
}
if(!$auction) {
@@ -103,32 +103,32 @@ if($btn == "판매") {
$valid = 0;
}
*/
if($auction[no2] > 0 && $value <= $auction[value]) {
if($auction[no2] > 0 && $value <= $auction['value']) {
$msg = "ㆍ<O>현재판매가보다 높게 입찰해야 합니다.</>";
$valid = 0;
}
if($value < $auction[value]) {
if($value < $auction['value']) {
$msg = "ㆍ<O>현재판매가보다 높게 입찰해야 합니다.</>";
$valid = 0;
}
if($value > $auction[topv]) {
if($value > $auction['topv']) {
$msg = "ㆍ<O>즉시판매가보다 높을 수 없습니다.</>";
$valid = 0;
}
if($value > $me[gold] - 1000) {
if($value > $me['gold'] - 1000) {
$msg = "ㆍ<O>기본 자금 1000은 거래할 수 없습니다.</>";
$valid = 0;
}
if($valid == 1) {
$msg = "ㆍ<O>입찰 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
if($auction[expire] > $date) $date = $auction[expire];
$query = "update auction set value='$value',no2='$me[no]',name2='$me[name]',expire='$date' where no='$sel'";
if($auction['expire'] > $date) $date = $auction['expire'];
$query = "update auction set value='$value',no2='$me['no']',name2='$me['name']',expire='$date' where no='$sel'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($valid == 2) {
$msg = "ㆍ<O>즉시판매 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
$query = "update auction set value='$value',no2='$me[no]',name2='$me[name]',expire='$date' where no='$sel'";
$query = "update auction set value='$value',no2='$me['no']',name2='$me['name']',expire='$date' where no='$sel'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif($btn == "구매") {
@@ -156,14 +156,14 @@ if($btn == "판매") {
$msg2 = "ㆍ<O>즉시구매가는 시작구매가의 90% 이하이어야 합니다.</>";
$valid = 0;
}
if($cost > $me[gold] - 1000) {
if($cost > $me['gold'] - 1000) {
$msg2 = "ㆍ<O>기본 자금 1000은 거래할 수 없습니다.</>";
$valid = 0;
}
if($valid == 1) {
$msg2 = "ㆍ<O>등록 성공.</>";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (1, '$me[no]', '$me[name]', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')";
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (1, '$me['no']', '$me['name']', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif($btn == "판매시도") {
@@ -171,7 +171,7 @@ if($btn == "판매") {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$auction = MYDB_fetch_array($result);
if($value == $auction[topv]) {
if($value == $auction['topv']) {
$valid = 2;
}
if(!$auction) {
@@ -182,32 +182,32 @@ if($btn == "판매") {
$msg2 = "ㆍ<O>현재 쌀만 거래 가능합니다.</>";
$valid = 0;
}
if($auction[no2] > 0 && $value >= $auction[value]) {
if($auction[no2] > 0 && $value >= $auction['value']) {
$msg2 = "ㆍ<O>현재구매가보다 낮게 입찰해야 합니다.</>";
$valid = 0;
}
if($value > $auction[value]) {
if($value > $auction['value']) {
$msg2 = "ㆍ<O>현재구매가보다 낮게 입찰해야 합니다.</>";
$valid = 0;
}
if($value < $auction[topv]) {
if($value < $auction['topv']) {
$msg2 = "ㆍ<O>즉시구매가보다 낮을 수 없습니다.</>";
$valid = 0;
}
if($value > $me[rice] - 1000) {
if($value > $me['rice'] - 1000) {
$msg2 = "ㆍ<O>기본 군량 1000은 거래할 수 없습니다.</>";
$valid = 0;
}
if($valid == 1) {
$msg2 = "ㆍ<O>입찰 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
if($auction[expire] > $date) $date = $auction[expire];
$query = "update auction set value='$value',no2='$me[no]',name2='$me[name]',expire='$date' where no='$sel'";
if($auction['expire'] > $date) $date = $auction['expire'];
$query = "update auction set value='$value',no2='$me['no']',name2='$me['name']',expire='$date' where no='$sel'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($valid == 2) {
$msg2 = "ㆍ<O>즉시구매 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
$query = "update auction set value='$value',no2='$me[no]',name2='$me[name]',expire='$date' where no='$sel'";
$query = "update auction set value='$value',no2='$me['no']',name2='$me['name']',expire='$date' where no='$sel'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}