<?php use Fisharebest\Webtrees\I18N; ?>

<form method="POST" autocomplete="off">
	<input name="route" type="hidden" value="setup">
	<input name="lang" type="hidden" value="<?= e($lang) ?>">
	<input name="dbhost" type="hidden" value="<?= e($dbhost) ?>">
	<input name="dbport" type="hidden" value="<?= e($dbport) ?>">
	<input name="dbuser" type="hidden" value="<?= e($dbuser) ?>">
	<input name="dbpass" type="hidden" value="<?= e($dbpass) ?>">
	<input name="dbname" type="hidden" value="<?= e($dbname) ?>">
	<input name="tblpfx" type="hidden" value="<?= e($tblpfx) ?>">

	<h2><?= I18N::translate('Administrator account') ?></h2>

	<p>
		<?= I18N::translate('You need to set up an administrator account. This account can control all aspects of this webtrees installation. Please choose a strong password.') ?>
	</p>

	<?php if ($wt_user_error): ?>
		<p class="alert alert-danger">
			<?= $wt_user_error ?>
		</p>
	<?php endif ?>

	<div class="row form-group">
		<label class="col-form-label col-sm-3" for="wtname">
			<?= I18N::translate('Your name') ?>
		</label>
		<div class="col-sm-9">
			<input class="form-control" dir="ltr" id="wtname" name="wtname" required type="text" value="<?= e($wtname) ?>">
			<p class="small text-muted">
				<?= I18N::translate('This is your real name, as you would like it displayed on screen.') ?>
			</p>
		</div>
	</div>

	<div class="row form-group">
		<label class="col-form-label col-sm-3" for="wtuser">
			<?= I18N::translate('Username') ?>
		</label>
		<div class="col-sm-9">
			<input class="form-control" dir="ltr" id="wtuser" name="wtuser" required type="text" value="<?= e($wtuser) ?>">
			<p class="small text-muted">
				<?= I18N::translate('You will use this to sign in to webtrees.') ?>
			</p>
		</div>
	</div>

	<div class="row form-group">
		<label class="col-form-label col-sm-3" for="wtpass">
			<?= I18N::translate('Password') ?>
		</label>
		<div class="col-sm-9">
			<input class="form-control" dir="ltr" id="wtpass" name="wtpass" pattern=".{6,}" required type="password" value="<?= e($wtpass) ?>">
			<p class="small text-muted">
				<?= I18N::translate('This must be at least six characters long. It is case-sensitive.') ?>
			</p>
		</div>
	</div>

	<div class="row form-group">
		<label class="col-form-label col-sm-3" for="wtemail">
			<?= I18N::translate('Email address') ?>
		</label>
		<div class="col-sm-9">
			<input class="form-control" dir="ltr" id="wtemail" name="wtemail" required type="email" value="<?= e($wtemail) ?>">
			<p class="small text-muted">
				<?= I18N::translate('This email address will be used to send password reminders, website notifications, and messages from other family members who are registered on the website.') ?>
			</p>
		</div>
	</div>

	<hr>

	<button class="btn btn-primary" name="step" type="submit" value="6">
		<?= I18N::translate('next') ?>
	</button>

	<button class="btn btn-link" name="step" type="submit" value="4">
		<?= I18N::translate('previous') ?>
	</button>
</form>
