<commit_before><?php

$template->assign('PageTopic','Ship Integrity Check');

$PHP_OUTPUT.=('<p>');
$db->query('SELECT * FROM ship_type_support_hardware, player, ship_has_hardware, hardware_type ' .
		   'WHERE ship_type_support_hardware.ship_type_id = player.ship_type_id AND ' .
				 'player.account_id = ship_has_hardware.account_id AND ' .
				 'player.game_id = ship_has_hardware.game_id AND ' .
				 'ship_type_support_hardware.hardware_type_id = ship_has_hardware.hardware_type_id AND ' .
				 'ship_has_hardware.hardware_type_id = hardware_type.hardware_type_id AND ' .
				 'amount > max_amount');

if ($db->getNumRows()) {
	$PHP_OUTPUT.= create_table();
	$PHP_OUTPUT.=('<tr>');
	$PHP_OUTPUT.=('<th>Player</th>');
	$PHP_OUTPUT.=('<th>Type</th>');
	$PHP_OUTPUT.=('<th>Amount</th>');
	$PHP_OUTPUT.=('<th>Max Amount</th>');
	$PHP_OUTPUT.=('<th>Action</th>');
	$PHP_OUTPUT.=('</tr>');

	while ($db->nextRecord()) {

		$player_name = stripslashes($db->getField('player_name'));
		$type = $db->getField('hardware_name');
		$amount = $db->getField('amount');
		$max_amount = $db->getField('max_amount');

		$container = array();
		$container['url'] = 'ship_check_processing.php';
		$container['account_id'] = $db->getField('account_id');
		$container['hardware'] = $db->getField('hardware_type_id');
		$container['game_id'] = $db->getField('game_id');
		$container['max_amount'] = $max_amount;
		$PHP_OUTPUT.=create_echo_form($container);

		$PHP_OUTPUT.=('<tr>');
		$PHP_OUTPUT.=('<td>'.$player_name.'</td>');
		$PHP_OUTPUT.=('<td>'.$type.'</td>');
		$PHP_OUTPUT.=('<td align="center">'.$amount.'</td>');
		$PHP_OUTPUT.=('<td align="center">'.$max_amount.'</td>');
		$PHP_OUTPUT.=('<td align="center">');
		$PHP_OUTPUT.=create_submit('Fix');
		$PHP_OUTPUT.=('</td>');
		$PHP_OUTPUT.=('</tr>');
		$PHP_OUTPUT.=('</form>');

	}

	$PHP_OUTPUT.=('</table>');

} else
	$PHP_OUTPUT.=('No overpowered ships!');
$PHP_OUTPUT.=('</p>');<commit_msg>ship_check.php: fix invalid HTML<commit_after><?php

$template->assign('PageTopic','Ship Integrity Check');

$PHP_OUTPUT.=('<br />');
$db->query('SELECT * FROM ship_type_support_hardware, player, ship_has_hardware, hardware_type ' .
		   'WHERE ship_type_support_hardware.ship_type_id = player.ship_type_id AND ' .
				 'player.account_id = ship_has_hardware.account_id AND ' .
				 'player.game_id = ship_has_hardware.game_id AND ' .
				 'ship_type_support_hardware.hardware_type_id = ship_has_hardware.hardware_type_id AND ' .
				 'ship_has_hardware.hardware_type_id = hardware_type.hardware_type_id AND ' .
				 'amount > max_amount');

if ($db->getNumRows()) {
	$PHP_OUTPUT.= create_table();
	$PHP_OUTPUT.=('<tr>');
	$PHP_OUTPUT.=('<th>Player</th>');
	$PHP_OUTPUT.=('<th>Type</th>');
	$PHP_OUTPUT.=('<th>Amount</th>');
	$PHP_OUTPUT.=('<th>Max Amount</th>');
	$PHP_OUTPUT.=('<th>Action</th>');
	$PHP_OUTPUT.=('</tr>');

	while ($db->nextRecord()) {

		$player_name = stripslashes($db->getField('player_name'));
		$type = $db->getField('hardware_name');
		$amount = $db->getField('amount');
		$max_amount = $db->getField('max_amount');

		$PHP_OUTPUT.=('<tr>');
		$PHP_OUTPUT.=('<td>'.$player_name.'</td>');
		$PHP_OUTPUT.=('<td>'.$type.'</td>');
		$PHP_OUTPUT.=('<td align="center">'.$amount.'</td>');
		$PHP_OUTPUT.=('<td align="center">'.$max_amount.'</td>');
		$PHP_OUTPUT.=('<td align="center">');

		$container = create_container('ship_check_processing.php');
		$container['account_id'] = $db->getField('account_id');
		$container['hardware'] = $db->getField('hardware_type_id');
		$container['game_id'] = $db->getField('game_id');
		$container['max_amount'] = $max_amount;
		$PHP_OUTPUT.=create_echo_form($container);
		$PHP_OUTPUT.=create_submit('Fix');
		$PHP_OUTPUT.=('</form>');

		$PHP_OUTPUT.=('</td>');
		$PHP_OUTPUT.=('</tr>');

	}

	$PHP_OUTPUT.=('</table>');

} else
	$PHP_OUTPUT.=('No overpowered ships!');
{'fraction_non_alphanumeric': 0.23856293615921426, 'fraction_numerical': 0.0, 'mean_word_length': 5.837455830388692, 'pattern_counts': {'":': 0, '<': 60, '<?xml version=': 0, '>': 82, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1852570', 'n_tokens_mistral': 1576, 'n_tokens_neox': 1440, 'n_words': 165}