示例#1
0
文件: team.php 项目: Yanrs/PkmnChan
 if ($pid == 0) {
     echo '
         <tr>
             <td>
                 <img src="images/pokemon/EMPTY.png" alt="Empty" /><br />
                 Empty
             </td>
             <td>-</td>
             <td>-</td>
             <td>-</td>
             <td>-</td>
 		</tr>
 	';
     continue;
 }
 $pokemon = getUserPokemon($pid);
 echo '
     <tr>
         <td>
             <img src="images/pokemon/' . $pokemon['name'] . '.png" alt="' . $pokemon['name'] . '" /><br />
             ' . $pokemon['name'] . '
         </td>
         <td>' . $pokemon['level'] . '</td>
         <td>' . number_format($pokemon['exp']) . '</td>
         <td>
             ' . $pokemon['move1'] . '<br />
             ' . $pokemon['move2'] . '<br />
             ' . $pokemon['move3'] . '<br />
             ' . $pokemon['move4'] . '<br />
         </td>
         <td>
   ' . $pokemon['name'] . ' has been placed in your team!
  </div>
 ';
   } else {
       echo '
  <div style="text-align: center;">
   <img src="images/pokemon/' . $pokemon['name'] . '.png" /><br />
   ' . $pokemon['name'] . '<br />
   Level: ' . $pokemon['level'] . '<br />
   Exp: ' . $pokemon['exp'] . '
  </div>
 ';
       $cells = array();
       $pos = 1;
       foreach ($teamIds as $pokeid) {
           $poke = getUserPokemon($pokeid);
           if ($poke === false) {
               break;
           }
           $cells[] = '
   <img src="images/pokemon/' . $poke['name'] . '.png" /><br />
   ' . $poke['name'] . '<br />
   Level: ' . $poke['level'] . '<br />
   Exp: ' . $poke['exp'] . '<br /><br />
   
   <form method="post">
    <input type="hidden" name="pos" value="' . $pos . '" />
    <input type="submit" value="Swap ' . $poke['name'] . ' for ' . $pokemon['name'] . '" />
   </form>
  ';
           $pos++;
示例#3
0
if ($banned->banned == 1) {
	include '_header.php';
	printHeader('ERROR');
	echo '<div class="error">You can not battle with banned user!</div>';
	include '_footer.php';
	die();
}*/
$userTeam = getUserTeamIds($uid);
if ($userTeam == false) {
    die;
}
$query = mysql_query("SELECT `username` FROM `users` WHERE `id`='{$uid}'");
$row = mysql_fetch_assoc($query);
$username = $row['username'];
$x = 0;
for ($i = 1; $i <= 6; $i++) {
    $pid = $userTeam['poke' . $i];
    if ($pid == 0) {
        continue;
    }
    $pokeRow = getUserPokemon($pid);
    $_SESSION['battle']['opponent'][$x] = $pokeRow;
    $_SESSION['battle']['opponent'][$x]['maxhp'] = maxHp($pokeRow['name'], $pokeRow['level']);
    $_SESSION['battle']['opponent'][$x]['hp'] = maxHp($pokeRow['name'], $pokeRow['level']);
    $x++;
}
$_SESSION['battle']['captcha'] = time();
$_SESSION['battle']['onum'] = 0;
$_SESSION['battle']['rebattlelink'] = '<a href="battle_user.php?id=' . $uid . '">Rebattle ' . cleanHtml($username) . '</a>';
$_SESSION['battle']['uid'] = $uid;
redirect('battle.php');