command_Single 동작 변경
This commit is contained in:
@@ -681,19 +681,21 @@ where nation='{$general['nation']}'
|
|||||||
|
|
||||||
|
|
||||||
function command_Single($turn, $command) {
|
function command_Single($turn, $command) {
|
||||||
|
if(!$turn){
|
||||||
|
header('location:commandlist.php');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
|
||||||
$userID = Session::getUserID();
|
$userID = Session::getUserID();
|
||||||
|
|
||||||
$command = EncodeCommand(0, 0, 0, $command);
|
$command = EncodeCommand(0, 0, 0, $command);
|
||||||
|
|
||||||
$count = count($turn);
|
$setValues = [];
|
||||||
$str = "con=con";
|
foreach($turn as $turnIdx){
|
||||||
for($i=0; $i < $count; $i++) {
|
$setValues["turn{$turnIdx}"] = $command;
|
||||||
$str .= ",turn{$turn[$i]}='{$command}'";
|
|
||||||
}
|
}
|
||||||
$query = "update general set {$str} where owner='{$userID}'";
|
$db->update('general', $setValues, 'owner=%i',$userID);
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
header('location:commandlist.php');
|
header('location:commandlist.php');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user