function showMagicsTowns($bdd, $townID) { global $atown19, $atown23; $showMagicTown = $bdd->prepare('SELECT * FROM Caranille_Towns_Magics WHERE Town_Magic_Town_ID = ? ORDER BY Town_Magic_ID desc'); $showMagicTown->execute([$townID]); ?> <br> <table class="table"> <tr> <th>Magic</th> <th></th> </tr> <?php while ($magic = $showMagicTown->fetch()) { $magicID = stripslashes($magic['Town_Magic_Magic_ID']); $townMagicID = stripslashes($magic['Town_Magic_ID']); ?> <tr> <td> <?php echo newMagic($bdd, $magicID)->getName(); ?> </td> <td> <form method="POST" action="Delete.php"> <input type="hidden" name="townMagicID" value="<?php echo $townMagicID; ?> "> <input type="hidden" name="townID" value="<?php echo $townID; ?> "> <input class="btn btn-warning" type="submit" value="<?php echo $atown23; ?> "> </form> </td> </tr> <?php } ?> </table> <?php $showMagicTown->closeCursor(); }
<?php $timeStart = microtime(true); session_start(); ob_start(); if (empty($_SESSION)) { exit(header("Location: ../../index.php")); } require_once $_SESSION['File_Root'] . '/Kernel/Include.php'; require_once $_SESSION['File_Root'] . '/HTML/Header.php'; require_once 'Functions/SQL.php'; redirectToLogin($accountID, $linkRoot); $battle = findBattle($bdd, $characterID); $magicID = htmlspecialchars(addslashes($_POST['magicID'])); $magic = newMagic($bdd, $magicID); ?> <div class="panel panel-warning"> <div class="panel-heading"> <img src="<?php echo $monsterPicture; ?> " alt=""> </div> <div class="panel-body"> <?php if ($characterMP >= $magic->getMPCost()) { $magicEffect = round($magic->getEffect() + $characterMagic / 100); if ($totalDamageMonster <= 0) { $totalDamageMonster = 0; }