@ -10,6 +10,7 @@
include_once(ROOT_PATH.'/include/config.inc.php');
include_once(ROOT_PATH.'/include/config.inc.php');
include_once(ROOT_PATH.'/include/char.inc.php');
include_once(ROOT_PATH.'/include/char.inc.php');
include_once (ROOT_PATH . '/include/parse.inc.php');
include_once (ROOT_PATH . '/include/parse.inc.php');
include_once (ROOT_PATH . '/include/sqlwrapper.inc.php');
// GET-Section
// GET-Section
// Kritisch (SQL-Injections)
// Kritisch (SQL-Injections)
$char_id = validateUnsignedInteger($_GET['char_id'], null);
$char_id = validateUnsignedInteger($_GET['char_id'], null);
@ -18,13 +19,13 @@ $c_ware = validateUnsignedInteger($_GET['c_ware'], null);
//Unkritisch
//Unkritisch
$charm = $_GET['charm'];
$charm = $_GET['charm'];
if(!$char_id) {
if($charm == 1) {
include(ROOT_PATH.'/char_index.php');
$chars = getCharsOfUser($user_ida['id']);
exit;
}
if($charm) {
foreach($chars as $char) {
mysql_query("UPDATE chars SET clan_train='$c_ware' WHERE id='$char_id' AND besitzer='$user_ida[id]' LIMIT 1");
$c_ware = validateUnsignedInteger($_GET['c_ware_'.$char['id']], null);
db_query('UPDATE chars SET clan_train='.$c_ware.' WHERE id='.$char['id'].' AND besitzer='.$user_ida[id]);
}
}
}
$char = getChar($char_id, false);
$char = getChar($char_id, false);
@ -43,7 +44,6 @@ if(!isUserOwnerOf($user_ida['id'], $char_id)){
< form action = "index.php" method = "GET" >
< form action = "index.php" method = "GET" >
< input type = "hidden" name = "as" value = "clan/c_ware" / >
< input type = "hidden" name = "as" value = "clan/c_ware" / >
< input type = "hidden" name = "charm" value = "1" / >
< input type = "hidden" name = "charm" value = "1" / >
< input type = "hidden" name = "char_id" value = " <?php echo $char_id ; ?> " />
< table cellpadding = "0" cellspacing = "0" width = "100%" height = "127" >
< table cellpadding = "0" cellspacing = "0" width = "100%" height = "127" >
<!-- MSTableType="layout" -->
<!-- MSTableType="layout" -->
@ -51,25 +51,36 @@ if(!isUserOwnerOf($user_ida['id'], $char_id)){
< td valign = "top" height = "31" colspan = "2" >
< td valign = "top" height = "31" colspan = "2" >
< p align = "center" > < b > Clan Items< / b > < / td >
< p align = "center" > < b > Clan Items< / b > < / td >
< / tr >
< / tr >
<?php
$chars = getCharsOfUser($user_ida['id'], false);
foreach($chars as $char) {
$clan_items = mysql_query("SELECT ci.name, ci.type, cw.id, 1/(1+exp(3-$char[level]/12)) * nutzung as nutzkosten FROM clan_ware cw LEFT JOIN clan_item ci ON(cw.item_id=ci.id) WHERE cw.clan='$user_ida[clan]'");
?>
< tr >
< tr >
< td height = "25" width = "260" valign = "middle" align = "center" >
< td height = "25" width = "260" valign = "middle" align = "center" >
Raum fü r <?php echo $char [ name ] ; ?> </ td >
Raum fü r <?php echo $char [ name ] ; ?>
< / td >
< td height = "25" width = "273" valign = "middle" >
< td height = "25" width = "273" valign = "middle" >
< select id = "input" name = "c_ware" >
< select id = "input" name = "c_ware _<?php echo $char_id ; ?> " >
< option value = "0" > Wä hle Kampf Raum
< option value = "0" > Wä hle Kampf Raum< / option >
<?php
<?php
while($row = mysql_Fetch_array($clan_items)) {
while($row = mysql_Fetch_array($clan_items)) {
$save="";
$save="";
if($row['id'] == $char['clan_train']) { $save = "Selected"; }
if($row['id'] == $char['clan_train']) {
if($row['type'] == "Raum") {
$save = 'Selected';
}
if($row['type'] == 'Raum') {
echo "< option value = '$row[id]' $ save > $row[name] (".displayMoney($row['nutzkosten']).") < / option > ";
echo "< option value = '$row[id]' $ save > $row[name] (".displayMoney($row['nutzkosten']).") < / option > ";
}
}
}
}
?>
?>
< / select >
< / select >
< / td >
< / td >
< / tr >
< / tr >
<?php
}
?>
< tr >
< tr >
< td height = "19" width = "260" valign = "top" > < / td >
< td height = "19" width = "260" valign = "top" > < / td >
< td height = "19" width = "273" > < input id = "input" type = submit value = "Speichern" > < / form > < / td >
< td height = "19" width = "273" > < input id = "input" type = submit value = "Speichern" > < / form > < / td >