echo '<hr>';
    echo updateVersion($version, $updatefilename) . '<br />';
    echo '<hr>';
    echo '<p><h1 style="text-align:center; color:green; ">';
    echo JText::_('COM_JOOMLEAGUE_DB_UPDATE_CONGRATULATIONS');
    echo '<br />';
    echo JText::_('COM_JOOMLEAGUE_DB_UPDATE_ALL_STEPS_FINISHED');
    echo '<br />';
    echo JText::_('COM_JOOMLEAGUE_DB_UPDATE_USE_NOW');
    echo '</h1></p>';
    setUpdatePart(0);
} else {
    echo '<h3 style="text-align:center; ">';
    echo '<a href="javascript:location.reload(true)">';
    echo '<strong>';
    echo JText::sprintf('COM_JOOMLEAGUE_DB_UPDATE_CLICK_HERE', getUpdatePart() + 1, $totalUpdateParts) . '<br />';
    echo JText::_('COM_JOOMLEAGUE_DB_UPDATE_MAY_NEED_TIME') . '<br />';
    echo '</strong>';
    echo '</a>';
    echo '</h3>';
    echo '<p style="text-align:center; ">';
    echo JText::sprintf('COM_JOOMLEAGUE_DB_UPDATE_TIME_MEMORY_SET', $maxImportTime, $maxImportMemory) . '<br />';
    echo JText::_('COM_JOOMLEAGUE_DB_UPDATE_INFO_TIMEOUT_ERROR') . '<br />';
    echo JText::_('COM_JOOMLEAGUE_DB_UPDATE_INFO_LOCAL_UPDATE') . '<br />';
    echo '</p>';
    echo '<h2 style="text-align:center; color:orange; ">';
    echo JText::_('COM_JOOMLEAGUE_DB_UPDATE_BE_PATIENT');
    echo '</h2>';
}
if (JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0)) {
    echo '<center><hr>';
    echo '<p><b>';
    echo JText::sprintf('Please remember that this update routine has totally %1$s update steps!', $totalUpdateParts) . '</b><br />';
    echo JText::_('So please go to the bottom of this page to check if there are errors and more update steps to do!');
    echo '</p>';
    echo '<p style="color:red; font-weight:bold; ">';
    echo JText::_('DANGER!!!') . '<br />';
    echo JText::_('This script WILL MAKE CHANGES in your DATABASE without any more warning!!!') . '<br />';
    echo JText::_('It is recommended that you make a backup of your Database before!!!') . '<br />';
    echo '</p>';
    echo '<hr>';
}
if (getUpdatePart() == $totalUpdateParts) {
    echo '<hr />';
    echo ImportTables();
    echo '<br /><center><hr />';
    echo JText::sprintf('Memory Limit is %1$s', ini_get('memory_limit')) . '<br />';
    echo JText::sprintf('Memory Peak Usage was %1$s Bytes', number_format(memory_get_peak_usage(true), 0, '', '.')) . '<br />';
    echo JText::sprintf('Time Limit is %1$s seconds', ini_get('max_execution_time')) . '<br />';
    $mtime = microtime();
    $mtime = explode(" ", $mtime);
    $mtime = $mtime[1] + $mtime[0];
    $endtime = $mtime;
    $totaltime = $endtime - $starttime;
    echo JText::sprintf('This page was created in %1$s seconds', $totaltime);
    echo '<hr /></center>';
    setUpdatePart(0);
} else {
    echo '<a href="javascript:location.reload(true)" ><b>';
    echo JText::sprintf('Click here to do step %1$s of %2$s steps to finish the update. PLEASE BY SURE WHAT YOU DO BY CLICKING HERE!', getUpdatePart() + 1, $totalUpdateParts);
    echo '</b></a>';
}
    echo '<hr>';
    echo updateVersion($version, $updatefilename) . '<br />';
    echo '<hr>';
    echo '<p><h1 style="text-align:center; color:green; ">';
    echo JText::_('JL_DB_UPDATE_CONGRATULATIONS');
    echo '<br />';
    echo JText::_('JL_DB_UPDATE_ALL_STEPS_FINISHED');
    echo '<br />';
    echo JText::_('JL_DB_UPDATE_USE_NOW');
    echo '</h1></p>';
    setUpdatePart(0);
} else {
    echo '<h3 style="text-align:center; ">';
    echo '<a href="javascript:location.reload(true)">';
    echo '<strong>';
    echo JText::sprintf('JL_DB_UPDATE_CLICK_HERE', getUpdatePart() + 1, $totalUpdateParts) . '<br />';
    echo JText::_('JL_DB_UPDATE_MAY_NEED_TIME') . '<br />';
    echo '</strong>';
    echo '</a>';
    echo '</h3>';
    echo '<p style="text-align:center; ">';
    echo JText::sprintf('JL_DB_UPDATE_TIME_MEMORY_SET', $maxImportTime, $maxImportMemory) . '<br />';
    echo JText::_('JL_DB_UPDATE_INFO_TIMEOUT_ERROR') . '<br />';
    echo JText::_('JL_DB_UPDATE_INFO_LOCAL_UPDATE') . '<br />';
    echo '</p>';
    echo '<h2 style="text-align:center; color:orange; ">';
    echo JText::_('JL_DB_UPDATE_BE_PATIENT');
    echo '</h2>';
}
if (JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0)) {
    echo '<center><hr>';
if (getUpdatePart() < $totalUpdateParts) {
    echo '<p><b>';
    echo JText::sprintf('Please remember that this update routine has totally %1$s update steps!', $totalUpdateParts) . '</b><br />';
    echo JText::_('So please go to the bottom of this page to check if there are errors and more update steps to do!');
    echo '</p>';
    echo '<p style="color:red; font-weight:bold; ">';
    echo JText::_('We recommend a database backup before the update!!!') . '<br />';
    echo '</p>';
    echo '<hr>';
}
if (getUpdatePart() == $totalUpdateParts) {
    echo '<hr />';
    require_once JPATH_ADMINISTRATOR . '/components/com_joomleague/models/databasetools.php';
    echo JoomleagueModelDatabaseTools::ImportTables();
    echo '<br /><center><hr />';
    echo JText::sprintf('Memory Limit is %1$s', ini_get('memory_limit')) . '<br />';
    echo JText::sprintf('Memory Peak Usage was %1$s Bytes', number_format(memory_get_peak_usage(true), 0, '', '.')) . '<br />';
    echo JText::sprintf('Time Limit is %1$s seconds', ini_get('max_execution_time')) . '<br />';
    $mtime = microtime();
    $mtime = explode(" ", $mtime);
    $mtime = $mtime[1] + $mtime[0];
    $endtime = $mtime;
    $totaltime = $endtime - $starttime;
    echo JText::sprintf('This page was created in %1$s seconds', $totaltime);
    echo '<hr /></center>';
    setUpdatePart(0);
} else {
    echo '<input type="button" onclick="document.body.innerHTML=\'please wait...\';location.reload(true)" value="';
    echo JText::sprintf('Click here to do step %1$s of %2$s steps to finish the update.', getUpdatePart() + 1, $totalUpdateParts);
    echo '" />';
}