Code Duplication    Length = 25-29 lines in 2 locations

other/upgrade.php 2 locations

@@ 4126-4150 (lines=25) @@
4123
				echo ' Successful!';
4124
			echo '<br>' . $item;
4125
		}
4126
		if (!empty($upcontext['changes_complete']))
4127
		{
4128
			if ($is_debug)
4129
			{
4130
				$active = time() - $upcontext['started'];
4131
				$hours = floor($active / 3600);
4132
				$minutes = intval(($active / 60) % 60);
4133
				$seconds = intval($active % 60);
4134
4135
				$totalTime = '';
4136
				if ($hours > 0)
4137
					$totalTime .= $hours . ' hour' . ($hours > 1 ? 's' : '') . ' ';
4138
				if ($minutes > 0)
4139
					$totalTime .= $minutes . ' minute' . ($minutes > 1 ? 's' : '') . ' ';
4140
				if ($seconds > 0)
4141
					$totalTime .= $seconds . ' second' . ($seconds > 1 ? 's' : '') . ' ';
4142
			}
4143
4144
			if ($is_debug && !empty($totalTime))
4145
				echo ' Successful! Completed in ', $totalTime, '<br><br>';
4146
			else
4147
				echo ' Successful!<br><br>';
4148
4149
			echo '
4150
					<span id="commess" style="font-weight: bold;">', $txt['upgrade_db_complete'], '</span><br>';
4151
		}
4152
	}
4153
	else
@@ 4165-4193 (lines=29) @@
4162
					<br>
4163
					<span id="commess" style="font-weight: bold; display: ', !empty($upcontext['changes_complete']) || $upcontext['current_debug_item_num'] == $upcontext['debug_items'] ? 'inline' : 'none', ';">', $txt['upgrade_db_complete2'], '</span>';
4164
4165
		if ($is_debug)
4166
		{
4167
			if ($upcontext['current_debug_item_num'] == $upcontext['debug_items'])
4168
			{
4169
				$active = time() - $upcontext['started'];
4170
				$hours = floor($active / 3600);
4171
				$minutes = intval(($active / 60) % 60);
4172
				$seconds = intval($active % 60);
4173
4174
				$totalTime = '';
4175
				if ($hours > 0)
4176
					$totalTime .= $hours . ' hour' . ($hours > 1 ? 's' : '') . ' ';
4177
				if ($minutes > 0)
4178
					$totalTime .= $minutes . ' minute' . ($minutes > 1 ? 's' : '') . ' ';
4179
				if ($seconds > 0)
4180
					$totalTime .= $seconds . ' second' . ($seconds > 1 ? 's' : '') . ' ';
4181
			}
4182
4183
			echo '
4184
					<br>
4185
					<span id="upgradeCompleted">';
4186
4187
			if (!empty($totalTime))
4188
				echo 'Completed in ', $totalTime, '<br>';
4189
4190
			echo '
4191
					</span>
4192
					<div id="debug_section" style="height: 59px; overflow: auto;">
4193
						<span id="debuginfo"></span>
4194
					</div>';
4195
		}
4196
	}