<?php

require __dir__ . '/init.php';

require _SDIR . '/for-new.php';

template::get_header();

template::title("Add New User");

?>
	
	<form method='post' enctype='multipart/form-data'>
		
		<?php echo template::alert( $msg, $status ?? null ); ?>
		
		<div class='row'>
		
			<div class='col-lg-6'>
				<div class='card'>
					<div class='card-header'>
						<h4>Access Info</h4>
					</div>
					<div class='card-body'>
						<div class='form-group'>
							<label class='form-label'>First Name</label>
							<input type='text' name='fname' class='form-control' required>
						</div>
						<div class='form-group'>
							<label class='form-label'>Last Name</label>
							<input type='text' name='lname' class='form-control' required>
						</div>
						<div class='form-group'>
							<label class='form-label'>E-Mail</label>
							<input type='text' name='email' class='form-control' required>
						</div>
						<div class='form-group'>
							<label class='form-label'>Picture</label>
							<input type='file' name='image' class='form-control'>
						</div>
					</div>
				</div>
			</div>
		
			<div class='col-lg-6'>
				<div class='card'>
					<div class='card-header'>
						<h4>Account Info</h4>
					</div>
					<div class='card-body'>
						<div class='form-group'>
							<label class='form-label'>Account Type</label>
							<select required="" name="utype" class="form-control text-capitalize" required>
								<option value="">Please select Account Type</option>
								<?php 
									$accounts = $settings->get('account_types') ?? [];
									foreach( $accounts as $value ): 
								?>
								<option value="<?php echo $value; ?>"><?php echo $value; ?></option>
								<?php endforeach; ?>
							</select>
						</div>
						<div class='form-group'>
							<label class='form-label'>Phone</label>
							<input type='number' name='phone' class='form-control'>
						</div>
						<div class='form-group'>
							<label class='form-label'>Birth Date</label>
							<input type='date' name='bdate' class='form-control' placeholder='MM-DD-YYYY'>
						</div>
						<div class='form-group'>
							<label class='form-label'>Gender</label>
							<select name="gender" class="form-control">
								<option value="">- select -</option>
								<option value="Male">Male</option>
								<option value="Female">Female</option>
							</select>
						</div>
					</div>
				</div>
			</div>
			
			<div class='col-lg-6'>
				<div class='card'>
					<div class='card-header'>
						<h4>Security Info</h4>
					</div>
					<div class='card-body'>
						<div class='form-group'>
							<label class='form-label'>Password</label>
							<input type='text' name='pwd' class='form-control' required>
						</div>
						<div class='form-group'>
							<label class='form-label'>PIN</label>
							<input type='text' name='pin' class='form-control' required>
						</div>
						<div class='form-group'>
							<label class='form-label'>SSN</label>
							<input type='text' class='form-control' name='ssn'>
						</div>
						<div class='form-group'>
							<label class='form-label'>Routing Number</label>
							<input type='text' class='form-control' name='rtn'>
						</div>
					</div>
				</div>
			</div>
			
			<div class='col-lg-6'>
				<div class='card'>
					<div class='card-header'>
						<h4>Location Info</h4>
					</div>
					<div class='card-body'>
						<div class='form-group'>
							<label class='form-label'>Country</label>
							<?php help::countries_dropdown(); ?>
						</div>
						<div class='form-group'>
							<label class='form-label'>Address</label>
							<input type='text' class='form-control' name='address'>
						</div>
						<div class='form-group'>
							<label class='form-label'>ZIP Code</label>
							<input type='text' class='form-control' name='zipcode'>
						</div>
						<div class='form-group'>
							<label class='form-label'>State</label>
							<input type='text' class='form-control' name='state'>
						</div>
						<div class='form-group'>
							<label class='form-label'>City</label>
							<input type='text' class='form-control' name='city'>
						</div>
					</div>
				</div>
			</div>
			
		</div>
		
		
						<hr>
						<div class='form-group'>
							<button class='btn btn-primary btn-block'>
								<i class='fas fa-user-plus'></i> Add User
							</button>
						</div>
		
	</form>
	
<?php template::get_footer(); ?>  