Show new entry.
authorCMDR furrycat <elite@furrycat.net>
Sun, 7 Feb 2016 08:30:25 +0000 (03:30 -0500)
committerCMDR furrycat <elite@furrycat.net>
Sun, 7 Feb 2016 08:30:25 +0000 (03:30 -0500)
lib/entry.php

index 2ce0d41..b201155 100644 (file)
@@ -81,9 +81,9 @@
       $lap_number++;
     }
 
-    $dbh->commit();
+    if ($dbh->commit()) return $entry;
 
-    return true;
+    return false;
   }
 
   function show_leg($station, $start_finish, $station_id, $system_id, $order, $n) {
         echo "<p>Entry $entry_id: CMDR <strong>$cmdr_name</strong> flying <strong>$ship_name</strong> in $race_name</p>\n";
         echo "<div id=\"plot\"></div>\n";
       }
-      else if (do_entry($race_id, $ship_id, $posted, $allotted_time)) return true;
+      else {
+        $entry = do_entry($race_id, $ship_id, $posted, $allotted_time);
+        if ($entry) return add_entry($race_id, $ship_id, $entry);
+        return true;
+      }
     }
     else echo "//--></script>\n";
     if (! $entry) {