<commit_before><?php

if ($ShowRoles) { ?>
	<form class="standard" method="POST" action="<?php echo $SaveAllianceRolesHREF; ?>"><?php
} ?>


<div align="center">
	<div id="alliance-desc" class="ajax"><?php
		echo bbifyMessage($Alliance->getDescription()); ?>
	</div><?php
	if(isset($EditAllianceDescriptionHREF)) { ?>
		<br />
		<div class="buttonA"><a class="buttonA" href="<?php echo $EditAllianceDescriptionHREF; ?>">Edit</a></div>
		<br /><?php
	} ?>

	<br />

	<table class="standard inset">
		<tr>
			<th>Alliance Name</th>
			<th>Total Experience</th>
			<th>Average Experience</th>
			<th>Members</th>
		</tr>
		<tr id="alliance-info" class="ajax bold">
			<td><?php echo $Alliance->getAllianceName(); ?></td>
			<td class="center shrink"><?php echo number_format($AllianceExp); ?></td>
			<td class="center shrink"><?php echo number_format($AllianceAverageExp); ?></td>
			<td class="center shrink"><?php echo number_format($Alliance->getNumMembers()); ?></td>
		</tr>
	</table>
	<br />

	<h2>Current Members</h2><br />

	<table id="alliance-roster" class="standard fullwidth">
		<thead>
			<tr>
				<th class="shrink">&nbsp;</th>
				<th class="sort" data-sort="name">Trader Name</th>
				<th class="sort shrink" data-sort="race">Race</th>
				<th class="sort" data-sort="experience">Experience</th><?php
				if($ShowRoles) { ?>
					<th class="sort shrink" data-sort="role">Role</th><?php
				}
				if(isset($ActiveIDs)) { ?>
					<th class="sort shrink" data-sort="status">Status</th><?php
				} ?>
			</tr>
		</thead>
		<tbody class="list"><?php
			$Count = 1;
			foreach ($AlliancePlayers as $AlliancePlayer) {
				$Class = '';
				// check if this guy is the current guy
				if ($ThisPlayer->equals($AlliancePlayer)) {
					$Class .= ' bold';
				}
				if ($AlliancePlayer->hasNewbieStatus()) {
					$Class.= ' newbie';
				} ?>
				<tr id="player-<?php echo $AlliancePlayer->getPlayerID(); ?>" class="ajax<?php echo $Class; ?>">
					<td class="center"><?php
						if ($AlliancePlayer->getAccountID() == $Alliance->getLeaderID()) { ?>*<?php }
						echo $Count++; ?>
					</td>
					<td class="name"><?php
						echo $AlliancePlayer->getLevelName(); ?>&nbsp;<?php echo $AlliancePlayer->getLinkedDisplayName(false); ?>
					</td>
					<td class="center race"><?php
						echo $ThisPlayer->getColouredRaceName($AlliancePlayer->getRaceID()); ?>
					</td>
					<td class="center experience"><?php
						echo number_format($AlliancePlayer->getExperience()); ?>
					</td><?php
					if ($ShowRoles) { ?>
						<td class="role"><?php
							$PlayerRole = $AlliancePlayer->getAllianceRole();
							if ($CanChangeRoles && $AlliancePlayer->getAccountID() != $Alliance->getLeaderID()) { ?>
								<select name="role[<?php echo $AlliancePlayer->getAccountID(); ?>]" class="InputFields"><?php
									foreach ($Roles as $RoleID => $Role) { ?>
										<option value="<?php echo $RoleID; ?>"<?php
										if ($RoleID == $PlayerRole) { ?>
											selected="selected"<?php
										} ?>><?php
											echo $Role; ?>
										</option><?php
									} ?>
								</select><?php
							} else {
								echo $Roles[$PlayerRole];
							} ?>
						</td><?php
					}
					if($ThisPlayer->getAllianceID() == $Alliance->getAllianceID()) { ?>
						<td class="center status"><?php
							if(in_array($AlliancePlayer->getAccountID(), $ActiveIDs)) { ?>
								<span class="green">Online</span><?php
							}
							else if($ThisPlayer->getAccountID() == $Alliance->getLeaderID() && $Disabled = SmrAccount::getAccount($AlliancePlayer->getAccountID())->isDisabled()) { ?>
								<span class="red">Banned Until:<br/><?php echo date(DATE_FULL_SHORT_SPLIT,$Disabled['Time']); ?></span><?php
							}
							else { ?>
								<span class="red">Offline</span><?php
							} ?>
						</td><?php
					} ?>
				</tr><?php
			} ?>
		</tbody>
	</table>
</div><?php

if ($Alliance->getAllianceID() == $ThisPlayer->getAllianceID()) { ?>
	<br /><h2>Options</h2><br /><?php
	if ($ShowRoles && $CanChangeRoles) { ?>
		<input class="submit" type="submit" name="action" value="Save Alliance Roles">&nbsp;&nbsp;<?php
	} ?>
	<div class="buttonA"><a class="buttonA" href="<?php echo $ToggleRolesHREF; ?>"><?php if ($ShowRoles) { ?>Hide Alliance Roles<?php } else { ?>Show Alliance Roles<?php } ?></a></div>
	</form><?php
}

if ($CanJoin === true) { ?>
	<br />
	<form class="standard" method="POST" action="<?php echo $JoinHREF; ?>">
		Enter password to join alliance<br /><br />
		<input type="password" name="password" size="30">&nbsp;<input class="submit" type="submit" name="action" value="Join">
	</form><?php
}
else if($CanJoin !== false) { ?>
	<br /><?php
	echo $CanJoin;
}<commit_msg>alliance_roster.php: fix stray </form><commit_after><?php

if ($ShowRoles) { ?>
	<form class="standard" method="POST" action="<?php echo $SaveAllianceRolesHREF; ?>"><?php
} ?>


<div align="center">
	<div id="alliance-desc" class="ajax"><?php
		echo bbifyMessage($Alliance->getDescription()); ?>
	</div><?php
	if(isset($EditAllianceDescriptionHREF)) { ?>
		<br />
		<div class="buttonA"><a class="buttonA" href="<?php echo $EditAllianceDescriptionHREF; ?>">Edit</a></div>
		<br /><?php
	} ?>

	<br />

	<table class="standard inset">
		<tr>
			<th>Alliance Name</th>
			<th>Total Experience</th>
			<th>Average Experience</th>
			<th>Members</th>
		</tr>
		<tr id="alliance-info" class="ajax bold">
			<td><?php echo $Alliance->getAllianceName(); ?></td>
			<td class="center shrink"><?php echo number_format($AllianceExp); ?></td>
			<td class="center shrink"><?php echo number_format($AllianceAverageExp); ?></td>
			<td class="center shrink"><?php echo number_format($Alliance->getNumMembers()); ?></td>
		</tr>
	</table>
	<br />

	<h2>Current Members</h2><br />

	<table id="alliance-roster" class="standard fullwidth">
		<thead>
			<tr>
				<th class="shrink">&nbsp;</th>
				<th class="sort" data-sort="name">Trader Name</th>
				<th class="sort shrink" data-sort="race">Race</th>
				<th class="sort" data-sort="experience">Experience</th><?php
				if($ShowRoles) { ?>
					<th class="sort shrink" data-sort="role">Role</th><?php
				}
				if(isset($ActiveIDs)) { ?>
					<th class="sort shrink" data-sort="status">Status</th><?php
				} ?>
			</tr>
		</thead>
		<tbody class="list"><?php
			$Count = 1;
			foreach ($AlliancePlayers as $AlliancePlayer) {
				$Class = '';
				// check if this guy is the current guy
				if ($ThisPlayer->equals($AlliancePlayer)) {
					$Class .= ' bold';
				}
				if ($AlliancePlayer->hasNewbieStatus()) {
					$Class.= ' newbie';
				} ?>
				<tr id="player-<?php echo $AlliancePlayer->getPlayerID(); ?>" class="ajax<?php echo $Class; ?>">
					<td class="center"><?php
						if ($AlliancePlayer->getAccountID() == $Alliance->getLeaderID()) { ?>*<?php }
						echo $Count++; ?>
					</td>
					<td class="name"><?php
						echo $AlliancePlayer->getLevelName(); ?>&nbsp;<?php echo $AlliancePlayer->getLinkedDisplayName(false); ?>
					</td>
					<td class="center race"><?php
						echo $ThisPlayer->getColouredRaceName($AlliancePlayer->getRaceID()); ?>
					</td>
					<td class="center experience"><?php
						echo number_format($AlliancePlayer->getExperience()); ?>
					</td><?php
					if ($ShowRoles) { ?>
						<td class="role"><?php
							$PlayerRole = $AlliancePlayer->getAllianceRole();
							if ($CanChangeRoles && $AlliancePlayer->getAccountID() != $Alliance->getLeaderID()) { ?>
								<select name="role[<?php echo $AlliancePlayer->getAccountID(); ?>]" class="InputFields"><?php
									foreach ($Roles as $RoleID => $Role) { ?>
										<option value="<?php echo $RoleID; ?>"<?php
										if ($RoleID == $PlayerRole) { ?>
											selected="selected"<?php
										} ?>><?php
											echo $Role; ?>
										</option><?php
									} ?>
								</select><?php
							} else {
								echo $Roles[$PlayerRole];
							} ?>
						</td><?php
					}
					if($ThisPlayer->getAllianceID() == $Alliance->getAllianceID()) { ?>
						<td class="center status"><?php
							if(in_array($AlliancePlayer->getAccountID(), $ActiveIDs)) { ?>
								<span class="green">Online</span><?php
							}
							else if($ThisPlayer->getAccountID() == $Alliance->getLeaderID() && $Disabled = SmrAccount::getAccount($AlliancePlayer->getAccountID())->isDisabled()) { ?>
								<span class="red">Banned Until:<br/><?php echo date(DATE_FULL_SHORT_SPLIT,$Disabled['Time']); ?></span><?php
							}
							else { ?>
								<span class="red">Offline</span><?php
							} ?>
						</td><?php
					} ?>
				</tr><?php
			} ?>
		</tbody>
	</table>
</div><?php

if ($Alliance->getAllianceID() == $ThisPlayer->getAllianceID()) { ?>
	<br /><h2>Options</h2><br />
	<div class="buttonA">
		<a class="buttonA" href="<?php echo $ToggleRolesHREF; ?>"><?php
			if ($ShowRoles) { ?>Hide Alliance Roles<?php } else { ?>Show Alliance Roles<?php } ?>
		</a>
	</div><?php
	if ($ShowRoles && $CanChangeRoles) { ?>
		&nbsp;&nbsp;
		<input class="submit" type="submit" name="action" value="Save Alliance Roles">
		</form><?php
	}
}

if ($CanJoin === true) { ?>
	<br />
	<form class="standard" method="POST" action="<?php echo $JoinHREF; ?>">
		Enter password to join alliance<br /><br />
		<input type="password" name="password" size="30">&nbsp;<input class="submit" type="submit" name="action" value="Join">
	</form><?php
}
else if($CanJoin !== false) { ?>
	<br /><?php
	echo $CanJoin;
}
{'fraction_non_alphanumeric': 0.2191561900703175, 'fraction_numerical': 0.0014915832090347326, 'mean_word_length': 3.6701492537313434, 'pattern_counts': {'":': 0, '<': 309, '<?xml version=': 0, '>': 361, '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': '1081670', 'n_tokens_mistral': 3901, 'n_tokens_neox': 3182, 'n_words': 599}