<?php
function selectionHeader($text, $acctype) {
	echo '<div class="row">';
	echo '<div class="col-12">';
	echo '	<div class="alert alert-light" role="alert">';
	
	if ($acctype == '1') {
		echo '<img src="theme/v1/images/cw/icon.png" />&nbsp;';
	}
	elseif ($acctype == '2') {
		echo '<img src="images/icons/wew.png" height="32" width="32" />&nbsp;';
	}

	echo $text . '</div>';
	echo '</div>';
	echo '</div>';
}

function selectionRace($arr) {
	echo '<div class="row">';
	for ($i = 0; $i < count($arr); $i++) {
		echo '<label class="col">';
		echo '<input type="radio" name="race" value="' . $arr[$i][1] . '" data-text="' . $arr[$i][0] . '" data-id="' . $arr[$i][1] . '" />';
		echo '<img src="theme/v1/images/chars/' . $arr[$i][1] . '/0.jpg" class="rounded selectable" alt="' . $arr[$i][0] . '" title="' . $arr[$i][0] . '" height=250 width=250 />';
		echo '<br />' . $arr[$i][0];
		echo '</label>';
	}
	echo '</div>';
}

function selectionFace($arr) {
	echo '<div class="row">';
	for ($i = 0; $i < count($arr); $i++) {
		echo '<label class="col">';
		echo '<input type="radio" name="face" value="' . $arr[$i][1] . '" data-id="' . $arr[$i][1] . '" data-text="' . $arr[$i][0] . '" />';
		echo '<img src="theme/v1/images/chars/1/'. $arr[$i][1] . '.jpg" class="rounded selectable" alt="' . $arr[$i][0] . '" title="' . $arr[$i][0] . '" data-id="' . $arr[$i][1] . '" height=250 width=250 />';
		echo '<br />' . $arr[$i][0];
		echo '</label>';
	}
	echo '</div>';
}

function selectionJob($arr) {
	echo '<div class="row">';
	for ($i = 0; $i < count($arr); $i++) {
		echo '<label class="col-4">';
		echo '<input type="radio" name="job" value="' . $arr[$i][1] . '" data-text="' . $arr[$i][0] . '" />';
		echo '<img src="theme/v1/images/jobs/' . $arr[$i][1] . '.jpg" class="rounded selectable" alt="' . $arr[$i][0] . '" title="' . $arr[$i][0] . '" height=250 width=250 />';
		echo '<br />' . $arr[$i][0];
		echo '</label>';
	}
	echo '</div>';
}

function selectionNation($arr) {
	echo '<div class="row">';
	for ($i = 0; $i < count($arr); $i++) {
		echo '<label class="col-4">';
		echo '<input type="radio" name="nation" value="' . $arr[$i][1] . '" data-text="' . $arr[$i][0] . '" />';
		echo '<img src="theme/v1/images/nations/' . $arr[$i][1] . '/flag.png" class="rounded selectable" alt="' . $arr[$i][0] . '" title="' . $arr[$i][0] . '" height=250 width=250 />';
		echo '<br />' . $arr[$i][0];
		echo '</label>';
	}
	echo '</div>';
}
function selectionNationCW($arr) {
	echo '<div class="row">';
	for ($i = 0; $i < count($arr); $i++) {
		echo '<label class="col-4">';
		echo '<input type="radio" name="nation" value="' . $arr[$i][1] . '" data-text="' . $arr[$i][0] . '" />';
		echo '<img src="theme/v1/images/nations/starting/' . $arr[$i][1] . '.png" class="rounded selectable" alt="' . $arr[$i][0] . '" title="' . $arr[$i][0] . '" height=250 width=250 />';
		echo '</label>';
	}
	echo '</div>';
}

function selectionNationDesc($arr) {
	echo '<div class="row">';
	for ($i = 0; $i < count($arr); $i++) {
		echo '<div class="col starting-desc">';
		echo '<div class="starting-area" id="starting-' . $arr[$i][0] . '">' . $arr[$i][1] . '</div>';
		echo '<span class="starting-nation">(' . $arr[$i][2] . ')</span>';
		echo '<p>' . $arr[$i][3] . '</p>';
		echo '</div>';
	}
	echo '</div>';
}

$stepMessage =
[
	"Select your character's race and gender:",
	"Select your character's appearance:",
	"Select your character's size:",
	"Select your character's starting job:",
	"Select your character's starting nation:",
	"Name your character:"
	
];

if ($accounttype == '1') {
	$stepMessage =
	[
		"Select your Crystal Warrior's race and gender:",
		"Select your Crystal Warrior's appearance:",
		"Select your Crystal Warrior's size:",
		"Select your Crystal Warrior's starting job:",
		"Select your Crystal Warrior's starting area and nation:",
		"Name your Crystal Warrior:"
	];
}
?>