$DB->sql_put("COMMIT"); print l_t('Processed.'); } } } catch (Exception $e) { if ($e->getMessage() == "Abandoned" || $e->getMessage() == "Cancelled") { $DB->sql_put("COMMIT"); print l_t('Abandoned.'); } else { $DB->sql_put("ROLLBACK"); print l_t('Crashed: "%s".', $e->getMessage()); } } print '<br />'; } // If it took over 30 secs there may still be games to process if (time() - $startTime >= 30) { /* * For when you're developing and just reloaded the DB from a backup, * you usually have to refresh a few times before it runs out of games * to process */ header('refresh: 4; url=gamemaster.php'); print '<p class="notice">' . l_t('Timed-out; re-running') . '</p>'; } else { // Finished all remaining games with time to spare; update the civil disorder and NMR counts //libGameMaster::updateCDNMRCounts(); } print '</div>'; libHTML::footer();
/** * Wipe everything done so far, output a notice and end the script. Can be run in * the event of errors. * * @param string $title The title to display * @param string $message The message/notice to show */ public static function notice($title, $message) { ob_clean(); libHTML::starthtml($title); print '<div class="content-notice"><p>' . $message . '</p></div>'; print '</div>'; libHTML::footer(); }