You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			178 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			PHP
		
	
			
		
		
	
	
			178 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			PHP
		
	
<?php
 | 
						|
/*
 | 
						|
 *
 | 
						|
 * @copyright (c) 2010 animegame.eu
 | 
						|
 * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
 | 
						|
 *
 | 
						|
 */
 | 
						|
 | 
						|
$nodisturb = 'YES';
 | 
						|
 | 
						|
include_once('path.inc.php'); // get the path ;)
 | 
						|
include_once(ROOT_PATH.'/include/config.inc.php');
 | 
						|
include_once(ROOT_PATH.'/include/char.inc.php');
 | 
						|
include_once(ROOT_PATH.'/include/designfunctions.inc.php');
 | 
						|
include_once(ROOT_PATH.'/include/parse.inc.php');
 | 
						|
include_once(ROOT_PATH.'/include/fehlerausgabe.inc.php');
 | 
						|
 | 
						|
 | 
						|
// Um Copy&PasteFehler zu umgehen!
 | 
						|
function displaySomething($id, $new_max_turnier, $art, $char_nic1, $char_nic2, $colspan = 1){
 | 
						|
	?>
 | 
						|
		<td width="430" height="150" valign="middle" align="center" colspan="<?php echo $colspan; ?>">
 | 
						|
			<a href="last_fight2.php?kampf_id=<?php echo $id[$new_max_turnier]; ?>&spleoic=turnier_kampf&art=<?php echo $art; ?>"><?php echo $char_nic1[$new_max_turnier]; ?></a>
 | 
						|
		</td>
 | 
						|
		<td width="430"  valign="middle" align="center"colspan="<?php echo $colspan; ?>">
 | 
						|
			<a href="last_fight2.php?kampf_id=<?php echo $id[$new_max_turnier]; ?>&spleoic=turnier_kampf&art=<?php echo $art; ?>"><?php echo $char_nic2[$new_max_turnier]; ?></a>
 | 
						|
		</td>
 | 
						|
	<?php
 | 
						|
}
 | 
						|
 | 
						|
// GET-Section
 | 
						|
// Kritisch (SQL-Injections)
 | 
						|
$art = validateString($_GET['art']);
 | 
						|
 | 
						|
// Unkritisch
 | 
						|
$charm = $_GET['charm'];
 | 
						|
 | 
						|
if($art == 'woche') { $art = 'wochen'; }
 | 
						|
$turnier = mysql_fetch_array(mysql_query('SELECT hp1, id FROM turnier_kampf WHERE art=\''.$art.'\' LIMIT 1'));
 | 
						|
if(!$turnier[id]) {
 | 
						|
	displayErrorMessage(NULL,'Turnier fand noch nicht statt!',$back);
 | 
						|
}
 | 
						|
else if($charm == 1) {
 | 
						|
$max_turnier = mysql_num_rows(mysql_query('SELECT id FROM turnier_kampf WHERE art=\''.$art.'\''));
 | 
						|
 | 
						|
echo '<link rel="stylesheet" type="text/css" href="design/style3.css">';
 | 
						|
$turnier_date = date('d.m.Y');
 | 
						|
$turnier_info = mysql_query('SELECT win, char1, char2, id, round, dauer FROM turnier_kampf WHERE art=\''.$art.'\' ORDER BY id ASC');
 | 
						|
	$u=0;
 | 
						|
	$pl = 300;
 | 
						|
 | 
						|
	while($row=mysql_Fetch_array($turnier_info)) {
 | 
						|
		$char_info1 = getChar($row['char1']);
 | 
						|
		$char_info2 = getChar($row['char2']);
 | 
						|
 | 
						|
		$dauer[] = $row['dauer'];
 | 
						|
		if(($pl * $u) + $dauer[0] < time()) {
 | 
						|
		$char_nic1[]='<img src="'.$char_info1['bild'].'" width="75" height="75" border="0"><br>'.$char_info1['name'];
 | 
						|
		$char_nic2[]='<img src="'.$char_info2['bild'].'" width="75" height="75" border="0"><br>'.$char_info2['name'];
 | 
						|
		} else {
 | 
						|
		$char_nic1[]='<img src="design/bilder/avatare/Char.gif" width="75" height="75" border="0"><br>???';
 | 
						|
		$char_nic2[]='<img src="design/bilder/avatare/Char.gif" width="75" height="75" border="0"><br>???';
 | 
						|
		}
 | 
						|
		$char_nick1[]=$char_info1['name'];
 | 
						|
		$char_nick2[]=$char_info2['name'];
 | 
						|
		$char1[]=$row['char1'];
 | 
						|
		$char2[]=$row['char2'];
 | 
						|
 | 
						|
 | 
						|
		$win[]=$row['win'];
 | 
						|
		$id[]=$row['id'];
 | 
						|
		$round[]=$row['round'];
 | 
						|
$u++;
 | 
						|
}
 | 
						|
$maxs = $max_turnier-1;
 | 
						|
$win_char = getChar($win[$maxs]);
 | 
						|
 | 
						|
?>
 | 
						|
 | 
						|
<html>
 | 
						|
 | 
						|
<body bgcolor="#008080">
 | 
						|
 | 
						|
<table cellpadding="0" cellspacing="0" width="913" height="0">
 | 
						|
	<!-- MSTableType="layout" -->
 | 
						|
	<tr>
 | 
						|
		<th valign="top" height="32" colspan="8" align="center">Das Turnier am <?php echo $turnier_date; ?></th>
 | 
						|
	</tr>
 | 
						|
 | 
						|
<?php
 | 
						|
 | 
						|
if(($pl * $max_turnier) + $dauer[0] < time()) {
 | 
						|
	?>
 | 
						|
	<tr>
 | 
						|
		<td width="900" height="150" colspan="8" valign="middle" align="center">
 | 
						|
			<img src="<?php echo $win_char['bild']; ?>" width="75" height="75">
 | 
						|
			<br><?php echo $win_char['name']; ?>
 | 
						|
		</td>
 | 
						|
	</tr>
 | 
						|
	<?php
 | 
						|
} else {
 | 
						|
	?>
 | 
						|
	<tr>
 | 
						|
		<td width="900" height="150" colspan="8" valign="middle" align="center">
 | 
						|
			<img src="design/bilder/avatare/Char.gif" width="75" height="75">
 | 
						|
		</td>
 | 
						|
	</tr>
 | 
						|
	<?php
 | 
						|
}
 | 
						|
	// Keine Ahnung was da angezeigt werden soll
 | 
						|
	echo '<tr>';
 | 
						|
	$new_max_turnier = $max_turnier-1;
 | 
						|
	displaySomething($id, $new_max_turnier, $art, $char_nic1, $char_nic2, 4);
 | 
						|
	echo '</tr><tr>';
 | 
						|
	$new_max_turnier = $max_turnier-3;
 | 
						|
	displaySomething($id, $new_max_turnier, $art, $char_nic1, $char_nic2, 2);
 | 
						|
	$new_max_turnier = $max_turnier-2;
 | 
						|
	displaySomething($id, $new_max_turnier, $art, $char_nic1, $char_nic2, 2);
 | 
						|
	echo '</tr><tr>';
 | 
						|
	$new_max_turnier = $max_turnier-7;
 | 
						|
	displaySomething($id, $new_max_turnier, $art, $char_nic1, $char_nic2);
 | 
						|
	$new_max_turnier = $max_turnier-6;
 | 
						|
	displaySomething($id, $new_max_turnier, $art, $char_nic1, $char_nic2);
 | 
						|
	$new_max_turnier = $max_turnier-5;
 | 
						|
	displaySomething($id, $new_max_turnier, $art, $char_nic1, $char_nic2);
 | 
						|
	$new_max_turnier = $max_turnier-4;
 | 
						|
	displaySomething($id, $new_max_turnier, $art, $char_nic1, $char_nic2);
 | 
						|
	echo '</tr>';
 | 
						|
?>
 | 
						|
</table>
 | 
						|
<table cellpadding="0" cellspacing="0" width="913" height="83">
 | 
						|
	<!-- MSTableType="layout" -->
 | 
						|
	<tr>
 | 
						|
		<th valign="middle" height="21" align="center">Vorrunde</th>
 | 
						|
	</tr>
 | 
						|
 | 
						|
<?php
 | 
						|
$x=1;
 | 
						|
$z= 0;
 | 
						|
$k8=0;
 | 
						|
$o=0;
 | 
						|
while($x < count($char_nick1) - 6) {
 | 
						|
	if($o == 0) {
 | 
						|
		$mul = '#018B8B';
 | 
						|
		$o++;
 | 
						|
	} else {
 | 
						|
		$mul = '#029393';
 | 
						|
		$o--;
 | 
						|
	}
 | 
						|
	echo '<tr><td height="15" valign="middle" bgcolor="'.$mul.'" align="center">';
 | 
						|
 | 
						|
	if(($x * 300) + $dauer[0] < time()) {
 | 
						|
		if($char1[$z] == $win[$z]) {
 | 
						|
			echo '<a href="last_fight2.php?kampf_id='.$id[$z].'&spleoic=turnier_kampf&art='.$art.'"><b>'.$char_nick1[$z].'</b> vs. '.$char_nick2[$z].' -> Runde: '.$round[$z].'</a>';
 | 
						|
		} else {
 | 
						|
			echo '<a href="last_fight2.php?kampf_id='.$id[$z].'&spleoic=turnier_kampf&art='.$art.'">'.$char_nick1[$z].' vs. <b>'.$char_nick2[$z].'</b> -> Runde: '.$round[$z].'</a>';
 | 
						|
		}
 | 
						|
	} else {
 | 
						|
		if($k8 == 0) {
 | 
						|
			echo $char_nick1[$z].' vs. '.$char_nick2[$z].' -> Runde: '.$round[$z];
 | 
						|
			$k8++;
 | 
						|
		}
 | 
						|
	}
 | 
						|
	$z++;
 | 
						|
	$x++;
 | 
						|
	echo '</td></tr>';
 | 
						|
}
 | 
						|
?>
 | 
						|
 | 
						|
</table>
 | 
						|
 | 
						|
</body>
 | 
						|
 | 
						|
</html>
 | 
						|
<?php
 | 
						|
}
 | 
						|
?>
 |