applied required changes for tournament and hall of fame. Also display of generic attacks has changed.

main
hecht 7 years ago
parent a83a7ac85b
commit 2c5f3f8e8e

@ -122,6 +122,24 @@ foreach ($types as $type) {
</select>
</td>
</tr>
<tr>
<td>Turniergewinner ausschliessen?</td>
<td style="text-align: center"><select id="input" name="exclude_winners">
<option value="1">ja</option>
<option value="0">nein</option>
</select>
</td>
</tr>
<tr>
<td>Anzahl Teilnahmen nach der Fusionen ausgeschlossen werden?</td>
<td style="text-align: center"><select id="input" name="exclude_fusi_count">
<option value="0">deaktiviert</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</td>
</tr>
<!-- <tr>
<td>Gruppenphase?</td>
<td style="text-align: center"><select id="input" name="gruppenphase">
@ -169,6 +187,8 @@ function displayCheckTournament($request) {
$itemless = $request['itemless'];
$fruit_chance = $request['fruit'];
$fruit_type = $request['fruit_type'];
$exclude_winners = $request['exclude_winners'];
$exclude_fusi_count = $request['exclude_fusi_count'];
if(is_numeric($minlvl) && is_numeric($maxlvl)) {?>
<table width="80%">
@ -180,7 +200,8 @@ function displayCheckTournament($request) {
href="<?php echo $GLOBALS['URL_TO_TURNIER'].'?fusion='.$fusion.'&special='.
$special.'&minlevel='.$minlvl.'&maxlevel='.$maxlvl.'&gain='.$gain.'&randomize='.
$random.'&name='.$name.'&anzahl='.$anzahl.'&itemless='.$itemless.'&fruit='.
$fruit_chance.'&fruit_type='.$fruit_type;?>"
$fruit_chance.'&fruit_type='.$fruit_type.'&exclude_winners='.$exclude_winners.
'&exclude_fusi_count='.$exclude_fusi_count;?>"
target="_blank">Turnier starten!</a>
</td>
<td style="text-align: center"><a

@ -23,57 +23,79 @@ if(!is_numeric($page) || $page < 1){
$page = $maxpages;
}
?>
// Determine the importance of the Highscores (the less occurece, the more important)
$qry = db_query('Select count(*) as anzahl, art from highscore where runde = '.($maxpages-$page).' group by art order by anzahl,art asc');
while($row = mysqli_fetch_assoc($qry)){
$events[] = $row;
}
<script>
function kampf(id) {
window.open("./turnier2.php?charm=1&id="+id,"","status=no,hotkeys=no,height=600,width=929,scrollbar=yes");
}
</script>
$qry = db_query('Select * from highscore where runde = '.($maxpages-$page).' order by art, datum');
<?php
$qry = db_query('Select * from highscore where runde = '.($maxpages-$page).' order by datum');
echo '<table cellpadding="0" cellspacing="0" width="100%" height="69">'."\n";
echo '<table border="0" cellpadding="0" cellspacing="0" width="100%" height="69">'."\n";
echo '<tr>'."\n";
echo ' <th class="content" colspan="3">Halle der Helden aus Runde '.($maxpages - $page).'</th>'."\n";
echo ' <th class="content" colspan="4">Halle der Helden aus Runde '.($maxpages - $page).'</th>'."\n";
echo '</tr>'."\n";
$name_translation = array(
'klein' => 'Anf&auml;ngerturnier',
'gross' => 'Weltturnier',
'grossst' => 'Weltturnier Non-Fusion',
'wochen' => 'Wochenturnier',
'wochenst' => 'Wochenturnier Non-Fusion'
);
$eventhighscore = array();
$events = array();
// Now generate the strings
while($row = mysqli_fetch_assoc($qry)){
if($old != $row['art']){
$eventhighscore[$row['art']] .= '<tr>'."\n";
$eventhighscore[$row['art']] .= ' <th class="content" height="39" colspan="3">'.$row['art'].'</th>'."\n";
$eventhighscore[$row['art']] .= '</tr>'."\n";
$eventhighscore[$row['art']] .= '<tr>'."\n";
$eventhighscore[$row['art']] .= ' <th class="content" height="22" width="100" align="center">Datum</th>'."\n";
$eventhighscore[$row['art']] .= ' <th class="content" height="22" width="100" align="center">Sieger</th>'."\n";
$eventhighscore[$row['art']] .= ' <th class="content" height="22" width="100" align="center">Trainer</th>'."\n";
$eventhighscore[$row['art']] .= '</tr>'."\n";
$old = $row['art'];
$art = $row['art'];
if ($name_translation[$art] !== NULL) {
$art = $name_translation[$art];
}
$eventhighscore[$row['art']] .= '<tr>'."\n";
$eventhighscore[$row['art']] .= ' <td class="content" height="25" width="100" align="center">'.$row['datum'].'</td>'."\n";
$events[$art] += 1;
$eventhighscore[$art] .= '<tr>'."\n";
$eventhighscore[$art] .= ' <td class="content" height="25" width="100" align="center">'.$row['datum'].'</td>'."\n";
if(!is_null($row['charid'])){
$eventhighscore[$row['art']] .= ' <td class="content" height="25" width="100" align="center">'.displayCharLink($row['charid'], $row['charname']).'</td>'."\n";
$eventhighscore[$art] .= ' <td class="content" height="25" width="100" align="center">'.displayCharLink($row['charid'], $row['charname']).'</td>'."\n";
} else {
$eventhighscore[$row['art']] .= ' <td class="content" height="25" width="100" align="center">'.$row['charname'].'</td>'."\n";
$eventhighscore[$art] .= ' <td class="content" height="25" width="100" align="center">'.$row['charname'].'</td>'."\n";
}
if(!is_null($row['userid'])){
$eventhighscore[$row['art']] .= ' <td class="content" height="25" width="100" align="center">'.displayUserLink($row['userid'], $row['username']).'</td>'."\n";
$eventhighscore[$art] .= ' <td class="content" height="25" width="100" align="center">'.displayUserLink($row['userid'], $row['username']).'</td>'."\n";
} else{
$eventhighscore[$row['art']] .= ' <td class="content" height="25" width="100" align="center">'.$row['username'].'</td>'."\n";
$eventhighscore[$art] .= ' <td class="content" height="25" width="100" align="center">'.$row['username'].'</td>'."\n";
}
$eventhighscore[$row['art']] .= '</tr>'."\n";
if(!is_null($row['tournament_id'])) {
$eventhighscore[$art] .= ' <td class="content" height="25" width="100" align="center"><a href="javascript:kampf('.$row['tournament_id'].');">Turnier anzeigen</a></td>'."\n";
}
$eventhighscore[$art] .= '</tr>'."\n";
}
// Now echo the stuff!!
for($i=0;$i<count($events);$i++){
echo $eventhighscore[$events[$i]['art']];
asort($events);
foreach ($events as $key => $value) {
echo '<tr>'."\n";
echo ' <th class="content" height="39" colspan="4">'.$key.'</th>'."\n";
echo '</tr>'."\n";
echo '<tr>'."\n";
echo ' <th class="content" height="22" width="100" align="center">Datum</th>'."\n";
echo ' <th class="content" height="22" width="100" align="center">Sieger</th>'."\n";
echo ' <th class="content" height="22" width="100" align="center">Trainer</th>'."\n";
echo '</tr>'."\n";
echo $eventhighscore[$key];
}
echo '<tr>'."\n";
echo ' <td align="center" valign="bottom" height="22" width="100%" colspan="3">'."\n";
echo ' <td align="center" valign="bottom" height="22" width="100%" colspan="4">'."\n";
echo ' <table width="100%">'."\n";
echo displayPagelinks($page, $maxpages, $url);
echo ' </table>'."\n";

@ -101,8 +101,16 @@ function generateAttackNameByID($attackid, $withColor = TRUE) {
$qry = db_query($sql);
$row = mysqli_fetch_assoc($qry);
$type = $row['type'];
if ( $row['options'] !== NULL ) {
$array = json_decode($row['options'], true);
if ( $array !== NULL && isset($array['type'])) {
$type = $array['type'];
}
}
$qry = db_query('SELECT farbe FROM `attackentyp` where name = \'' . $row['type'].'\'');
$qry = db_query('SELECT farbe FROM `attackentyp` where name = \''.$type.'\'');
$row_color = mysqli_fetch_row($qry);
$color = 'style="color:'.$row_color[0].'"';

@ -20,6 +20,16 @@ function showAttDetails($at_id) {
$req_lvl = explode(",", $at_info['req_lvl']);
$req_attack = mysqli_fetch_array(db_query("SELECT f.name AS f_name, b.name AS b_name, c.name AS c_name, d.name AS d_name, e.name AS e_name FROM attacken a LEFT JOIN attacken b ON(b.id='".$req_atk[0]."') LEFT JOIN attacken c ON(c.id='".$req_atk[1]."') LEFT JOIN attacken d ON(d.id='".$req_atk[2]."') LEFT JOIN attacken e ON(e.id='".$req_atk[3]."') LEFT JOIN attacken f ON(f.id='".$req_atk[4]."') WHERE a.id='".$at_id."'"));
$attacken_type = $at_info['type'];
if ( $at_info['options'] !== NULL ) {
$array = json_decode($at_info['options'], true);
if ( $array !== NULL && isset($array['type'])) {
$attacken_type= $array['type'].' ('.$at_info['type'].')';
}
}
?>
<div align="center">
<input type="button" value="Zur&uuml;ck" onClick="history.back()">
@ -67,7 +77,7 @@ function showAttDetails($at_id) {
<tr>
<td width="158" height="25">
<p align="center"><b>Type</b></td>
<td width="340" height="25">&nbsp;<?php echo $at_info['type']; ?></td>
<td width="340" height="25">&nbsp;<?php echo $attacken_type; ?></td>
</tr>
<tr>
<td width="158" height="25">

@ -5,6 +5,7 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include_once('path.inc.php'); // get the path ;)
include_once(ROOT_PATH.'/include/config.inc.php');
include_once(ROOT_PATH.'/include/fehlerausgabe.inc.php');
@ -13,6 +14,7 @@ include_once(ROOT_PATH.'/include/parse.inc.php');
include_once(ROOT_PATH.'/include/erstellfunctions.inc.php');
include_once(ROOT_PATH.'/include/semaphore.inc.php');
include_once(ROOT_PATH.'/include/random.inc.php');
include_once(ROOT_PATH.'/include/items.inc.php');
$charm = $_GET['charm'];
$set = $_GET['set'];
@ -32,59 +34,6 @@ function create_set(id, name){
</SCRIPT>
<?php
function get_set_definitions() {
$items_map = array();
$topics_map = array();
$qry = db_query('SELECT * from sp_item');
while( $row = mysqli_fetch_assoc($qry) ) {
$row['table_name'] = 'sp_item';
$items_map['sp_item'][$row['id']] = $row;
}
$qry = db_query('SELECT * from item');
while( $row = mysqli_fetch_assoc($qry)) {
$row['table_name'] = 'item';
$items_map['item'][$row['id']] = $row;
}
$qry = db_query('SELECT * from wochen_markt');
while( $row = mysqli_fetch_assoc($qry) ) {
$row['name'] = $row['item'];
$row['table_name'] = 'wochen_markt';
$items_map['wochen_markt'][$row['id']] = $row;
}
$qry = db_query('SELECT * from sp_set_topics ORDER BY id');
while( $row = mysqli_fetch_assoc($qry) ) {
$topics_map[$row['id']] = $row;
}
$qry = db_query('SELECT * from sp_sets ORDER BY set_topic_id');
$sets = array();
while( $row = mysqli_fetch_assoc($qry) ) {
$set = array();
$set['item'] = $items_map[$row['table_name']][$row['item_id']];
$dep_items = array();
$qry2 = db_query('SELECT * from sp_set_ingredient WHERE set_id = '.$row['set_id']);
while( $row2 = mysqli_fetch_assoc($qry2) ) {
$dep_items[] = $items_map[$row2['table_name']][$row2['item_id']];
}
$set['deps'] = $dep_items;
$set['id'] = $row['set_id'];
$set['topic_id'] = $row['set_topic_id'];
if ( $set['topic_id'] !== NULL ) {
$set['topic'] = $topics_map[$set['topic_id']]['name'];
}
$sets[] = $set;
}
return $sets;
}
function get_user_items($user_ida) {
$items_map = array();
$qry = db_query('SELECT * from sp_ware where user = '.$user_ida['id']);

@ -31,12 +31,19 @@ function displaySomething($event_id, $id, $new_max_turnier, $char_nic1, $char_ni
// GET-Section
// Kritisch (SQL-Injections)
$art = validateString($_GET['art']);
$art = validateStringCritical($_GET['art']);
$id = validateUnsignedInteger($_GET['id']);
// Unkritisch
$charm = $_GET['charm'];
$turnier_daten = mysqli_fetch_assoc(db_query('SELECT * from turniere WHERE art = "'.$art.'" ORDER BY datum DESC LIMIT 1'));
$turnier_daten = NULL;
if (is_numeric($id)) {
$turnier_daten = mysqli_fetch_assoc(db_query('SELECT * from turniere WHERE id = "'.$id.'"'));
} else {
$turnier_daten = mysqli_fetch_assoc(db_query('SELECT * from turniere WHERE art = "'.$art.'" ORDER BY datum DESC LIMIT 1'));
}
if(!$turnier_daten) {
displayErrorMessage(NULL,'Turnier fand noch nicht statt!',$back);

Loading…
Cancel
Save