<div id="module_<?php echo($module_instance_id); ?>" class="module shop-account-module <?php echo($module_class); ?>">
	<h2>Edit Account Information</h2>

	<div class="alert alert-danger"><?php echo validation_errors(); ?></div>

	<?php
	if(isset($saved) && $saved == true)
	{
		?><div class="alert alert-success">Your account information was saved.</div><?php
	}
	?>

	<form name="account_info" id="account_info" method="post" action="<?php echo($page); ?>">
		<?php
		csrf();
		FeralHidden("user_id", $user->user_id);
		FeralHidden("joined", $user->joined);
		FeralHidden("joined_site_id", $user->joined_site_id);
		FeralHidden("last_login", $user->last_login);
		FeralHidden("active", $user->active);
		FeralHidden("shopper_group_id", $user->shopper_group_id);
		FeralHidden("task", "save_info");
		?>

		<div class="row">
			<div class="<?php echo(TWO_COL); ?>">
				<fieldset>
					<legend>Login Information</legend>

					<div class="<?php echo(FORM_ROW); ?>">
						<div class="<?php echo(LABEL_COL); ?>"><label for="username">Username</label></div>
						<div class="<?php echo(FIELD_COL); ?>"><input type="text" name="username" id="username" value="<?php echo($user->username); ?>" required class="form-control" /></div>
					</div>

					<div class="<?php echo(FORM_ROW); ?>">
						<div class="<?php echo(LABEL_COL); ?>"><label for="password"><?php echo(($user->user_id ? "Change" : "Create")); ?> Password</label></div>
						<div class="<?php echo(FIELD_COL); ?>"><input type="password" name="password" id="password" <?php echo(($user->user_id ? "" : "required")); ?> pattern=".{8,255}" title="Enter a password at least 8 characters long." class="form-control" /></div>
					</div>

					<div class="<?php echo(FORM_ROW); ?>">
						<div class="<?php echo(LABEL_COL); ?>"><label for="password2">Confirm Password</label></div>
						<div class="<?php echo(FIELD_COL); ?>"><input type="password" name="password2" id="password2" <?php echo(($user->user_id ? "" : "required")); ?> pattern=".{8,255}" title="Enter a password at least 8 characters long." class="form-control" /></div>
					</div>
				</fieldset>
			</div>

			<div class="<?php echo(TWO_COL); ?>">
				<fieldset>
					<legend>Contact Information</legend>

					<div class="<?php echo(FORM_ROW); ?>">
						<div class="<?php echo(LABEL_COL); ?>"><label for="fname">First Name</label></div>
						<div class="<?php echo(FIELD_COL); ?>"><input type="text" name="fname" id="fname" value="<?php echo($user->fname); ?>" required class="form-control" /></div>
					</div>

					<div class="<?php echo(FORM_ROW); ?>">
						<div class="<?php echo(LABEL_COL); ?>"><label for="lname">Last Name</label></div>
						<div class="<?php echo(FIELD_COL); ?>"><input type="text" name="lname" id="lname" value="<?php echo($user->lname); ?>" class="form-control" /></div>
					</div>

					<div class="<?php echo(FORM_ROW); ?>">
						<div class="<?php echo(LABEL_COL); ?>"><label for="company">Company</label></div>
						<div class="<?php echo(FIELD_COL); ?>"><input type="text" name="company" id="company" value="<?php echo($user->company); ?>" class="form-control" /></div>
					</div>

					<div class="<?php echo(FORM_ROW); ?>">
						<div class="<?php echo(LABEL_COL); ?>"><label for="email">Email Address</label></div>
						<div class="<?php echo(FIELD_COL); ?>"><input type="email" name="email" id="email" value="<?php echo($user->email); ?>" required class="form-control" /></div>
					</div>

					<div class="<?php echo(FORM_ROW); ?>">
						<div class="<?php echo(LABEL_COL); ?>"><label for="phone">Phone Number</label></div>
						<div class="<?php echo(FIELD_COL); ?>"><input type="tel" name="phone" id="phone" value="<?php echo($user->phone); ?>" class="form-control" /></div>
					</div>

					<div class="<?php echo(FORM_ROW); ?>">
						<div class="<?php echo(LABEL_COL); ?>"><label for="shipping_address">Address</label></div>
						<div class="<?php echo(FIELD_COL); ?>"><input type="text" name="shipping_address" id="shipping_address" value="<?php echo($user->shipping_address); ?>" class="form-control" /></div>
					</div>

					<div class="<?php echo(FORM_ROW); ?>">
						<div class="<?php echo(LABEL_COL); ?>"><label for="shipping_city">City</label></div>
						<div class="<?php echo(FIELD_COL); ?>"><input type="text" name="shipping_city" id="shipping_city" value="<?php echo($user->shipping_city); ?>" class="form-control" /></div>
					</div>

					<div class="<?php echo(FORM_ROW); ?>">
						<div class="<?php echo(LABEL_COL); ?>"><label for="shipping_postalcode">Postal Code</label></div>
						<div class="<?php echo(FIELD_COL); ?>"><input type="text" name="shipping_postalcode" id="shipping_postalcode" value="<?php echo($user->shipping_postalcode); ?>" class="form-control" /></div>
					</div>

					<div class="<?php echo(FORM_ROW); ?>">
						<div class="<?php echo(LABEL_COL); ?>"><label for="shipping_province">Province</label></div>
						<div class="<?php echo(FIELD_COL); ?>"><input type="text" name="shipping_province" id="shipping_province" value="<?php echo(($user->shipping_province ? $user->shipping_province : "ON")); ?>" maxlength="2" class="form-control" /></div>
					</div>

					<div class="<?php echo(FORM_ROW); ?>">
						<div class="<?php echo(LABEL_COL); ?>"><label for="shipping_country">Country</label></div>
						<div class="<?php echo(FIELD_COL); ?>"><input type="text" name="shipping_country" id="shipping_country" value="<?php echo(($user->shipping_country ? $user->shipping_country : "CA")); ?>" maxlength="2" class="form-control" /></div>
					</div>
				</fieldset>
			</div>

			<div class="col-12 text-center">
				<button type="submit" id="submit" value="true" class="btn btn-primary"><em class="fas fa-save" aria-hidden="true"></em> Save</button>
			</div>
		</div>
	</form>
</div>
