<?php

define("PERMISSION_TYPE", NULL); // No permission required to visit this page;

require __dir__ . '/init.php';

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

template::$BLANK_PAGE = TRUE;

template::add_script('css', help::url( TEMP_DIR . '/reg/css/gsdk-bootstrap-wizard.css' ));
template::add_script('css', help::url( TEMP_DIR . '/reg/css/demo.css' ));

template::add_script('js', help::url( TEMP_DIR . '/reg/js/jquery.bootstrap.wizard.js' ), false);
template::add_script('js', help::url( TEMP_DIR . '/reg/js/gsdk-bootstrap-wizard.js' ), false);
template::add_script('js', help::url( TEMP_DIR . '/reg/js/jquery.validate.min.js' ), false);

template::get_header();

?>

	<?php bridge::open('col-md-10 col-xl-8 m-auto'); ?>
	
		<!--      Wizard container        -->
		<div class="wizard-container">

			<div class="card wizard-card" data-color="orange" id="wizardProfile">


				<form action="register.php" method="post" enctype="multipart/form-data" >

			 
					<div class="wizard-header">
						<h3 class='px-3'>
						   <b>CREATE </b> YOUR ACCOUNT <br>
						   <small>Please register your account with us to take the benefits of our Online Banking facilities.</small>
						</h3>
					</div>

					<div class='px-3'>
						<?php template::alert( $msg, $insert ?? null ); ?>
					</div>
					
					<div class="wizard-navigation">
						<ul class='nav nav-pills'>
							<li class='nav-item'><a href="#about" data-toggle="tab">Step1</a></li>
							<li><a href="#account" data-toggle="tab">Step2</a></li>
							<li><a href="#address" data-toggle="tab">Step3</a></li>
							<li><a href="#step4" data-toggle="tab">Step4</a></li>
						</ul>

					</div>

					<div class="tab-content">
						
						<div class="tab-pane" id="about">
							  <h4 class="info-text"> Let's start with the basic information </h4>
							  <div class="row">
								  <div class="col-md-4 m-auto">
									 <div class="picture-container">
										  <div class="picture">
											  <img src="<?php echo help::url( TEMP_DIR . '/reg/img/default-avatar.png' ); ?>" class="picture-src" id="wizardPicturePreview" title=""/>
											  <input type="file"  name="image"  id="wizard-picture" />
										  </div>
										  <h6>Choose Picture</h6>
									  </div>
								  </div>
								  <div class="col-md-6 m-auto">
									  <div class="form-group">
										<label>First Name <small>(required)</small></label>
										<input required name="fname" type="text" class="form-control" placeholder="Your firstname" value="<?php echo $_POST['fname'] ?? null; ?>">
									  </div>
									  <div class="form-group">
										<label>Last Name <small>(required)</small></label>
										<input required name="lname" type="text" class="form-control" placeholder="Your Last Name" value="<?php echo $_POST['lname'] ?? null; ?>">
									  </div>
								  </div>
								  <div class="col-md-10 m-auto">
									  <div class="form-group">
										  <label>Email <small>(required)</small></label>
										  <input required name="email" type="email" class="form-control" placeholder="Your Email Address" value="<?php echo $_POST['email'] ?? null; ?>">
									  </div>
								  </div>
							  </div>
						</div>
						
						<!--------- [ PASSWORDS ] -------------->
					
						<div class="tab-pane" id="account">
							<div class="row">
								<div class='col-md-10 m-auto'>
									<div class='row'>
										<div class="col-md-6">
											 <div class="form-group">
												<label>Password</label>
												<input required name="pwd" type="password"  class="form-control" placeholder="Password">
											  </div>
										</div>
									   <div class="col-md-6">
											 <div class="form-group">
												<label>Confirm Password </label>
												<input required name="cpwd" type="password" class="form-control" placeholder="Confirm password">
											  </div>
										</div>
										<div class="col-md-6">
											 <div class="form-group">
												<label>Account Pin</label>
												<input required name="pin" type="password"   class="form-control" placeholder="Acc PIN" value="<?php echo $_POST['pin'] ?? null; ?>">
											  </div>
										</div>
										<div class="col-md-6">
											 <div class="form-group">
												<label>Verify Pin Number</label>
												<input required name="cpin" type="password" class="form-control" placeholder="Verify Pin" value="<?php echo $_POST['cpin'] ?? null; ?>">
											  </div>
										</div>
									</div>
								</div>
							</div>
						</div>
					
						<div class="tab-pane" id="address">
							<div class='row'>
								<div class='col-md-10 m-auto'>
							
									<div class="row">
										<div class="col-md-8">
											 <div class="form-group">
												<label>Phone Number</label>
												<input required name="phone" type="text"class="form-control" placeholder="ie +1xxx_xxx _xxxx" value="<?php echo $_POST['phone'] ?? null; ?>">
											  </div>
										</div>
										<div class="col-md-4">
											 <div class="form-group">
												<label>Date of Birth</label>
												<input required name="bdate" type="date" class="form-control" placeholder="(mm-dd-yyyy)" value="<?php echo $_POST['bdate'] ?? null; ?>">
											  </div> 
										</div>
										<div class="col-md-5">
											 <div class="form-group">
												<label>SSN</label>
												<input required name="ssn" type="text" class="form-control" placeholder="SSN" value="<?php echo $_POST['ssn'] ?? null; ?>">
											  </div>
										</div>
										<div class="col-md-7">
											 <div class="form-group">
												<label>Routing Number</label>
												<input required name="rtn" type="text" class="form-control" placeholder="Routing Number" value="<?php echo $_POST['rtn'] ?? null; ?>">
											  </div>
										</div>
										<div class="col-md-5">
											 <div class="form-group">
												<label>Gender</label><br>
												 <select required name="gender" class="form-control">
													<option value="">Please select your gender</option>
													<option value="Male">Male</option>
													<option value="Female">Female</option>
												</select>
											  </div>
										</div>
										<div class="col-md-7">
											 <div class="form-group">
												<label> Account Type</label><br>
												<select required name="utype" class="form-control text-capitalize">
													<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>
									</div>
										
								</div>
							</div>
						</div>
						
						 <div class="tab-pane" id="step4">
							<div class='row'>
								<div class='col-md-10 m-auto'>
								
									<div class="row">
										<div class="col-md-8">
											 <div class="form-group">
												<label>Address</label>
												<input required name="address"  type="text"class="form-control" placeholder="ie 2,wall street" value="<?php echo $_POST['address'] ?? null; ?>">
											  </div>
										</div>
										<div class="col-md-4">
											 <div class="form-group">
												<label>Zip Code</label>
												<input required name="zipcode" type="text" class="form-control" placeholder="1111111" value="<?php echo $_POST['zipcode'] ?? null; ?>">
											  </div>
										</div>
										<div class="col-md-6">
											 <div class="form-group">
												<label>State</label>
												<input required name="state" type="text" class="form-control" placeholder="New York.." value="<?php echo $_POST['state'] ?? null; ?>">
											  </div>
										</div>
										<div class="col-md-6">
											 <div class="form-group">
												<label>City</label>
												<input required name="city" type="text" class="form-control" placeholder="USA" value="<?php echo $_POST['city'] ?? null; ?>">
											  </div>
										</div>
										 <div class="col-md-12">
											 <div class="form-group">
												<label>Country</label>
												<?php help::countries_dropdown(); ?>
											  </div>
										</div>
									</div>
								
								</div>
							</div>
						</div>
						
					</div> <!--- //tab-content --->
					
					<div class="wizard-footer height-wizard">
					
						<div class="float-right">
							<input type='button' class='btn btn-next btn-fill btn-warning btn-wd btn-sm' name='next' value='Next' />
							<input name="submit" type="submit" class='btn btn-finish btn-fill btn-warning btn-wd btn-sm' value='Register Account!' />
						</div>

						<div class="float-left">
							<input type='button' class='btn btn-previous btn-fill btn-default btn-wd btn-sm' name='previous' value='Previous' />
						</div>
						
						<div class="clearfix"></div>
						
					</div>

				</form>
				
				<hr> 
				
				<div class="mx-auto my-3">
					<a class="btn btn-primary" href='<?php echo help::url(); ?>'>Back To Home</a>
					<a href="<?php echo help::url( PANEL_DIR ); ?>" class="btn btn-primary">Login</a>
				</div>
				
			</div> <!-- wizard card -->
		</div> <!-- wizard container -->

	<?php bridge::close(); ?>
	
<?php template::get_footer(); ?>

