diff --git a/src/webserver/admin/index.php b/src/webserver/admin/index.php
index ab06111..1c397b8 100644
--- a/src/webserver/admin/index.php
+++ b/src/webserver/admin/index.php
@@ -9,8 +9,11 @@
Tables
Players
+
Points of Interest
NPCs
+NPCs assigned to POIs
+
Items
+
+
+Wander Admin
+
+POI NPCs
+
+Create New POI
+Create New NPC
+
+
+
+
+
+ ID |
+ POI |
+ NPC |
+ Group Size |
+
+query('SELECT * FROM "POI-NPCs"');
+ while ($row = $results->fetchArray()) {
+ $poiRes = $conn->query('SELECT * FROM POIs WHERE id = ' . $row['poi_id']);
+ if ($poiRes) {
+ $thisPoi = $poiRes->fetchArray();
+ }
+ $npcRes = $conn->query('SELECT * FROM NPCs WHERE id = ' . $row['npc_id']);
+ if ($npcRes) {
+ $thisNpc = $npcRes->fetchArray();
+ }
+ ?>
+
+ '>= $row['id'] ?> |
+ = $thisPoi['name'] ?> |
+ = $thisNpc['description'] ?> |
+ = $row['group_size'] ?> |
+
+
+
+
+query('SELECT * FROM NPCs WHERE id = ' . $npc_id);
+ if ($npcRes) {
+ $thisNpc = $npcRes->fetchArray();
+ }
+ $groupSize = rand($thisNpc['minimum_group'], $thisNpc['maximum_group']);
+ $createQuery = 'INSERT INTO "POI-NPCs" (poi_id, npc_id, group_size) VALUES (' . $poi_id . ', ' . $npc_id . ', ' . $groupSize . ')';
+ $createRes = $conn->query($createQuery);
+ if ($createRes) {
+ echo "NPC added to POI. < View POI-NPCs
\n";
+ } else {
+ echo "oopsie! There was a problem adding the NPC to the POI. Check the logs!
\n";
+ echo "last error: " . $conn->lastErrorMsg() . "
\n";
+ echo "query: " . $createQuery . "
\n";
+ }
+ break;
+ case 'edit':
+ case 'save':
+ default:
+ echo "Unknown action: " . $_GET['action'];
+ }
+ }
+
+?>
+
+< back to Admin
+
+
diff --git a/src/webserver/admin/pois.php b/src/webserver/admin/pois.php
index 25840f6..65d34ae 100644
--- a/src/webserver/admin/pois.php
+++ b/src/webserver/admin/pois.php
@@ -25,6 +25,7 @@
Longitude |
Radius |
Map Marker |
+ |
query('SELECT * FROM POIs');
@@ -38,7 +39,16 @@
= $row['latitude'] ?> |
= $row['longitude'] ?> |
= $row['radius'] ?> |
- = $row['map_marker_icon'] ?> |
+ = $row['map_marker_icon'] ?> |
+
+ |