From 9b0f531f0eb7611bf8b8211349f16934ecd44bdd Mon Sep 17 00:00:00 2001
From: CMDR furrycat Stations
+Missing station name!
Error adding station: " . $e->getMessage() . "
\n"; + } + return false; + } + + function module_station($action) { + if ($_POST['add_station']) { + if (add_station($_POST["system_id"], $_POST["type"], $_POST["name"])) unset($_POST); + } + + $q = new StationQuery; + $q->joinWith('Station.System'); + $stations = $q->orderBy('System.Name')->orderByName()->find(); + foreach ($stations as $station) { + $station_name = $station->getName(); + $system_name = $station->getSystem()->getName(); + $type = $station->getType(); + echo "$station_name $type in $system_name
\n"; + } + + echo "Add systems before adding stations.
\n"; + return; + } + form(); + echo "Add a new station: "; + echo "System: \n"; + echo "type: \n"; + input("name", $_POST["name"]); + echo "\n"; + + submit("add_station", "Add"); + echo "
\n"; + end_form(); + } +?> + diff --git a/lib/system.php b/lib/system.php new file mode 100644 index 0000000..57027f1 --- /dev/null +++ b/lib/system.php @@ -0,0 +1,43 @@ +Error adding system: " . $e->getMessage() . "
\n"; + } + return false; + } + + function module_system($action) { + if ($_POST['add_system']) { + if (add_system($_POST["system_name"])) unset($_POST); + } + + $q = new SystemQuery; + $systems = $q->orderByName()->find(); + if (! count($systems)) echo "No systems
\n"; + foreach ($systems as $system) { + $system_name = $system->getName(); + echo "$system_name
\n"; + } + + echo "Add a new system: "; + input("system_name", $_POST['system_name']); + submit("add_system", "Add"); + echo "
\n"; + end_form(); + } + +?> diff --git a/propel/build/classes/buckyball/Station.php b/propel/build/classes/buckyball/Station.php new file mode 100644 index 0000000..c9c4571 --- /dev/null +++ b/propel/build/classes/buckyball/Station.php @@ -0,0 +1,31 @@ +getOrbital()) { + if ($this->getLargePad()) return "Starport"; + else return "Outpost"; + } + else { + if ($this->getLargePad()) return "Base"; + else return "Settlement"; + } + } +} diff --git a/propel/schema.xml b/propel/schema.xml index 23b8ffc..510b77c 100644 --- a/propel/schema.xml +++ b/propel/schema.xml @@ -73,6 +73,8 @@