@ -9,8 +9,11 @@
include_once ($_SERVER['DOCUMENT_ROOT'] . 'ag/include/designfunctions.inc.php');
include_once ($_SERVER['DOCUMENT_ROOT'] . 'ag/include/designfunctions.inc.php');
include_once ($_SERVER['DOCUMENT_ROOT'] . 'ag/include/fehlerausgabe.inc.php');
include_once ($_SERVER['DOCUMENT_ROOT'] . 'ag/include/fehlerausgabe.inc.php');
include_once ($_SERVER['DOCUMENT_ROOT'] . 'ag/include/parse.inc.php');
include_once ($_SERVER['DOCUMENT_ROOT'] . 'ag/include/parse.inc.php');
include_once ($_SERVER['DOCUMENT_ROOT'] . 'ag/include/char.inc.php');
$char_id = validateUnsignedInteger($_GET['char_id'], null);
$char_id = validateUnsignedInteger($_GET['char_id'], null);
$attack_id = validateUnsignedInteger($_REQUEST['attack_id'], null);
if ($char_id == null) {
if ($char_id == null) {
include ($_SERVER['DOCUMENT_ROOT'] . 'ag/char_index.php');
include ($_SERVER['DOCUMENT_ROOT'] . 'ag/char_index.php');
exit;
exit;
@ -19,27 +22,103 @@ if ($char_id == null) {
displayErrorMessage(NULL, 'Dieser Charakter gehö rt nicht dir.', displayHistoryBackLink());
displayErrorMessage(NULL, 'Dieser Charakter gehö rt nicht dir.', displayHistoryBackLink());
exit;
exit;
}
}
$use = mysql_query('SELECT a.name, l.benutzt FROM lernen l LEFT JOIN attacken a ON(a.id=l.at_id) WHERE l.besitzer='.$char_id.' ORDER BY l.id');
if ($attack_id != null) {
$test = 'INSERT INTO lernen(name, at_id,besitzer,aktiv) VALUES'.
'((SELECT name FROM attacken WHERE id ='.$attack_id.'), '.$attack_id.', '.$char_id.', 1);';
$qry = mysql_query($test);
}
$attacks_learned = getAttacksforChar($char_id, 0);
$attacks_unlearned = getAttacksforChar($char_id, 1);
$testuser = isUserInGroup($usergroups, tester);
?>
?>
< table border = "0" width = "480" height = "83" >
< form
action=<?php echo $_SERVER [ 'PHP_SELF' ] . '?as=info/lern&char_id=' . $char_id ; ?>
method="POST">
< table border = "0" width = "500" height = "83" >
< tr >
< tr >
< td height = "50" width = "480" colspan = "2" >
< td height = "50" width = "480" colspan = "2" >
< p align = "center" > < b > Technik System< / b > < / td >
< p align = "center" >
< b > Technik System< / b >
< / td >
< / tr >
< tr >
< td width = "100%" >
< table border = "0" width = "100%" >
< tr >
< th width = "30%" > Attacke< / th >
< th width = "10%" > Level< / th >
< th width = "10%" > eingesetzt< / th >
< th width = "10%" > Anzahl< / th >
< th width = "40%" > benötigte Attacken< / th >
<?php if ( $testuser ) {
echo '< th widht = "5%" > lernen?< / th > ';
}
?>
< / tr >
< / tr >
<?php
<?php
foreach ($attacks_learned as $item) {
while ($row = mysql_fetch_array($use)) {
?>
?>
< tr >
< tr >
< td height = "25" width = "152" >< b > <?php echo $row [ name ]; ?> </ b ></ td >
< td >< b > <?php echo $item [ 'name' ]; ?> </ b >
< td height = "25" width = "312" > < b >< font color = #0000ff > <?php echo $row [ benutzt ]; ?> </ font ></ b > mal im Kampf
< / td >
eingesetzt.< / td >
< td align = "center" > -< / td >
< td align = "center" > <?php echo $item [ 'benutzt' ] . 'x' ; ?>
< / td >
< td align = "center" > -< / td >
< td > gelernt!< / td >
< / tr >
< / tr >
<?php
<?php
}
}
foreach ($attacks_unlearned as $item) {
?>
?>
< tr >
< td >< b > <?php echo $item [ 'name' ]; ?> </ b ></ td >
< td align = "center" > <?php if ( $item [ 'levelups' ]) {
echo $item['levelups'];
} else
echo '-';
?>
< / td >
< td align = "center" > 0x< / td >
< td align = "center" > <?php if ( isset ( $item [ 'req' ])) {
foreach($item['req'] as $requirenment) {
echo $requirenment['reggs'].'x< br > ';
}
} else
echo '-';
?>
< / td >
< td > <?php if ( isset ( $item [ 'req' ])) {
foreach($item['req'] as $requirenment) {
echo $requirenment['name'].'< br > ';
}
} else
echo ' ';
if($testuser) {
echo '< td align = "center" > ';
echo '< input type = "radio" value = "'.$item['id'].'" name = "attack_id" > ';
echo '< / td > ';
}
?>
< / td >
< / tr >
<?php }; ?>
< / table >
< / table >
< / td >
< / tr >
<?php
<?php
if($testuser) {
echo '< tr > ';
echo '< td > < hr id = "hrc" > < / td > ';
echo '< / tr > ';
echo '< tr > ';
echo '< td align = "center" > < input id = "input" size = "15" type = "submit" value = "lernen" > < / td > ';
echo '< / tr > ';
}
}
?>
?>
< / table >
< / form >
<?php } ?>