} catch (PDOException $e) { print 'Connection failed: ' . $e->getMessage(); } ?> <body> <main> <h1>Attribute Type Edit</h1> <div> <h2>Add new attribute type</h2> <form method="post" action="AttributeTypeAdd.php"> <input type="text" name="Name"> <input type="submit" value="Create"> <input type="reset" value="Restart"> </form> </div> <div> <h2>List of Attribute Types</h2> <ul> <?php $attributeTypeGateway = new CreatureAttributeTypeGateway($database); $attributes = $attributeTypeGateway->selectAll(); foreach ($attributes as $attribute) { print "<li>" . $attribute['name'] . "</li>"; } ?> </ul> </div> </main> </body> </html>
} catch (PDOException $e) { print 'Connection failed: ' . $e->getMessage(); } $printHtml = new \BattleChores\PrintHtml(); echo $printHtml->head("Attribute Type Edit"); ?> <body> <main> <h1>Attribute Edit</h1> <div> <h2>Add new attribute</h2> <form method="post" action="AttributeAdd.php"> <select name="Type"> <?php $creatureAttributeTypeGateway = new CreatureAttributeTypeGateway($database); $results = $creatureAttributeTypeGateway->selectAll(); foreach ($results as $type) { print '<option value="' . $type['id'] . '">' . $type['name'] . '</option>'; } ?> </select><br /> <input type="text" name="Name"> <input type="submit" value="Create"> <input type="reset" value="Restart"> </form> </div> <div> <h2>Attributes</h2> <table> <tr> <td>id</td>