<style>
	@media (max-width: 1024px) {
		.header-logo-box-on-mobile{
			display: block;
		}
		
		.platform-announcement-message{
			margin-top: 0px !important;
			margin-bottom:10px;	
		}	
	}	
</style>

<div class="container page-content clearfix">    
    <div class="complete-user-profile-page">		

		<form action="" method="post" id="account-form" class="form-horizontal single-column-form" role="form" enctype="multipart/form-data">
		    {{ csrf_field() }}
			<div class="account-setup-form ride-profile-community-form">

				<div class="row">
					<div class="col-sm-8 col-sm-offset-2">		
						<p class="complete-the-following-heading">Complete the following:</p>
						
						<p class="must-be-filled-in">* Must be filled in</p>
					</div>	
				</div>
				
				<?php
					$fullName=$user->fullname;
					
					$firstName = "";
					$lastName = "";
					
					if($user->first_name){
						$firstName=$user->first_name;
					}
					
					if($user->last_name){
						$lastName=$user->last_name;
					}

					$fullNameExp=explode(" ",$fullName);
					
					if($firstName=="" and isset($fullNameExp[0])){
						$firstName=$fullNameExp[0];
					}

					if($lastName==""){
						if(isset($fullNameExp[1])){
							$lastName=$fullNameExp[1];
						}else{
							$lastName=$firstName;
						}		
					}		
				?>
			
				<div class="row">
					<div class="col-sm-8 col-sm-offset-2">	
						<form method="post">
						    {{ csrf_field() }}
							<div class="account-info-row">
								<input autocomplete="off" type="text" name="first_name" value="{{$firstName}}" class="account-form-field form-control" id="first_name" placeholder="First Name*" required>						
							</div>
							  
							<div class="account-info-row">
								<input autocomplete="off" type="text" name="last_name" value="{{$lastName}}" class="account-form-field form-control @if($lastName == '') highlightedBox @endif" id="last_name" placeholder="Last Name*" required>
							</div>
							
							<div class='account-info-row'>
								<input autocomplete="off" type="text" name="email_address" value="{{$user->email_address}}" class="account-form-field form-control" placeholder="Email Address*" autocomplete="off" required readonly>
							</div>
							
							<div class='account-info-row'>
								<?php
									$currentYear=date("Y");
									$lastYear=$currentYear-100;
								?>
								<select name="year_of_birth" class="form-control account-select-input-field" style="color: #555;" required>
										<option value="">Birth Year*</option>
										
										<?php
											for($i=$currentYear; $i >= $lastYear; $i--)
											{	
										?>
												<option value="{{$i}}" {{($user->birth_year == $i) ? 'selected' :null}}>{{$i}}</option>
										<?php } ?>
								</select>								
							</div>
							
							<!--<div class='account-info-row communityWeightToggleOuterRow'>
								<input autocomplete="off" type="text" name="weight" value="{{$user->weight}}" class="account-form-field form-control" placeholder="Weight" autocomplete="off">
								
								<span class="communityWeightToggleOuter">
									<input type="checkbox" id="communityWeightToggle" name="weight_in" class="communityWeighttoggleCheckbox" @if($user->weight_in=="kg") value="kg" @else value="lb" @endif />
									<label for="communityWeightToggle" class='communityWeightToggleContainer'>
									  <div>lb</div>   
									  <div>kg</div>
									</label>
								</span>
							</div>
							
							<div class='account-info-row communityHeightToggleOuterRow'>
								<input autocomplete="off" type="text" name="height" value="{{$user->height}}" class="account-form-field form-control" placeholder="Height" autocomplete="off">
								
								<span class="communityHeightToggleOuter">
									<input type="checkbox" id="communityHeightToggle" name="height_in" class="communityHeighttoggleCheckbox" @if($user->height_in=="cm") value="cm" @else value="m" @endif />
									<label for="communityHeightToggle" class='communityHeightToggleContainer'>
									  <div>cm</div>   
									  <div>m</div>
									</label>
								</span>
							</div>
							
							<div class='account-info-row'>
								<select name="gender" class="form-control account-select-input-field" style="color: #555;">
										<option value="">Select One (He/She/They/None)</option>
										<option {{($user->genre == 'Male') ? 'selected' :null}} value="Male">He</option>
										<option {{($user->genre == 'Female') ? 'selected' :null}} value="Female">She</option>
										<option {{($user->genre == 'Non-Binary') ? 'selected' :null}} value="Non-Binary">They</option>
										<option {{($user->genre == 'No Answer') ? 'selected' :null}} value="No Answer">None</option>
								</select>
							</div>-->
							
							<div class='account-info-row'>
								<?php //<input autocomplete="off" type="text" name="cell_no" value="{{$user->phone_number}}" class="account-form-field form-control" placeholder="Your cell no. i.e xxx xxx xxxx" autocomplete="off"> ?>
								
								<input type="hidden" id="my_existing_phone_number" value="{{$user->phone_number}}">
								<input type="hidden" id="my_carrier_country_code" value="{{$user->country_iso_code}}">
								
								<div class="input-phone-number"></div>
								<div class="phone-number-custom-error-container"></div>
							</div>
														
							<div class='account-info-row'>
								<label style="font-size:14px;">Your favourite SIM location:</label>
								<select class="form-control" required="required" name="preferred_location" style="height:39px;">
										
										@if($myActivelocations)
											<option selected="selected" value="{{$myActivelocations->id}}">{{$myActivelocations->location}}</option>
										@else
											<option value="">Select a location for news/event updates*</option>
											@foreach($locations as $location)
												<option @if($user->preferred_location==$location->id) selected="selected" @endif value="{{$location->id}}">{{$location->location}}</option>
											@endforeach
										@endif	
								</select>									
							</div>
							
							<div class="account-info-row">
								<button type="submit" class="btn pull-right ride-community-profile-submit">UPDATE</button>
							</div>
						</form>	
					</div>
				</div>
			</div> 	
	    </form>		
    </div>		
</div>
