diff --git a/data.db b/data.db index ed3292d..2146630 100644 Binary files a/data.db and b/data.db differ diff --git a/main.go b/main.go index 282a7d8..46bbf91 100644 --- a/main.go +++ b/main.go @@ -60,7 +60,11 @@ var ( "Terrapin", "Vulture", "Hull-A", "Hull-C", "Zeus ES", "Zeus CL", // …weitere Capital- und Concept-Schiffe sind ebenfalls bekannt! } - waren = []string{"", "Laranite", "Titanium", "Medical Supplies", "Gold", "Agricium", "Hydrogen", "Nitrogen", "Astatine", "Iodine", "Aluminium", "Copper", "Lithium", "Silicon", "Tungsten", "Aphorite", "Beryl", "Bexalite", "Corundum", "Diamond", "Dolivine", "Hadanite", "Hephaestanite", "Laranite", "Quartz", "Taranite"} + waren = []string{ + "", "Laranite", "Titanium", "Medical Supplies", "Gold", "Agricium", "Hydrogen", "Nitrogen", "Astatine", + "Iodine", "Aluminium", "Copper", "Lithium", "Silicon", "Tungsten", "Aphorite", "Beryl", "Bexalite", + "Corundum", "Diamond", "Dolivine", "Hadanite", "Hephaestanite", "Laranite", "Quartz", "Taranite", + } ) type POI struct { @@ -218,8 +222,10 @@ func main() { } orte = append(orte, "") for _, poi := range pois { - formatted := fmt.Sprintf("%s - %s - %s (%s)", poi.System, poi.Planet, poi.PoiName, poi.Type) - orte = append(orte, formatted) + if poi.System == "Stanton" || poi.System == "Pyro" { + formatted := fmt.Sprintf("%s - %s - %s (%s)", poi.System, poi.Planet, poi.PoiName, poi.Type) + orte = append(orte, formatted) + } } // if err != nil { @@ -333,10 +339,11 @@ func main() { startort := r.FormValue("startort") zielort := r.FormValue("zielort") schiff := r.FormValue("schiff") - ware := r.FormValue("ware") + ware := r.Form["ware"] + wareStr := strings.Join(ware, ", ") zeitaufwand, _ := strconv.ParseFloat(r.FormValue("zeitaufwand"), 64) - _, err := db.Exec(`INSERT INTO eintraege (anfangsbestand, endbestand, prozentwert, abgabe, created_at, startort, zielort, schiff, ware, zeitaufwand) VALUES (?, ?, ?, ?, datetime('now'), ?, ?, ?, ?, ?)`, anfang, ende, prozent, abgabe, startort, zielort, schiff, ware, zeitaufwand) + _, err := db.Exec(`INSERT INTO eintraege (anfangsbestand, endbestand, prozentwert, abgabe, created_at, startort, zielort, schiff, ware, zeitaufwand) VALUES (?, ?, ?, ?, datetime('now'), ?, ?, ?, ?, ?)`, anfang, ende, prozent, abgabe, startort, zielort, schiff, wareStr, zeitaufwand) if err != nil { http.Error(w, "Fehler beim Einfügen", http.StatusInternalServerError) return @@ -664,7 +671,7 @@ const htmlTemplate = `