<?php /* CityHub - Register */ ?>

<div class="container-fluid">
	<div class="row">
		<div class="col-xs-12 col-sm-8 col-sm-offset-2 col-md-4 col-md-offset-4 form-carrier">

			<?php echo Form::open(array('route' => 'postRegister', 'autocomplete' => 'off', 'role' => 'form', 'class' => 'form-container')); ?>


				<div class="form-group text-center">
					<h2><?php echo Lang::get('register.title'); ?></h2>
				</div>
				
				<div class="form-group text-center sign-in-logo">
					<a href="<?php echo URL::route('getHome'); ?>"><img src="<?php echo URL::asset('img/core/logo.svg'); ?>" alt="<?php echo Lang::get('core.cityhub'); ?>"></a>
				</div>

				<div class="form-group">
					<label for="email"><?php echo Lang::get('register.label_email'); ?>:</label>
					<?php echo Form::email('email', null, array('id' => 'email', 'class' => 'form-control', 'required', 'autofocus')); ?>

					<?php if(isset($errors) && ($errors->first('email') != '' || $errors->first('email') != null)): ?>
					<p><small><?php echo $errors->first('email'); ?></small></p>
					<?php endif; ?>
				</div>
				
				<div class="form-group">
					<label for="password"><?php echo Lang::get('register.label_password'); ?></label>
					<?php echo Form::password('password', array('id' => 'password', 'class' => 'form-control', 'required')); ?>

					<?php if(isset($errors) && ($errors->first('password') != '' || $errors->first('password') != null)): ?>
					<p><small><?php echo $errors->first('password'); ?></small></p>
					<?php endif; ?>
				</div>

				<div class="form-group">
					<label for="repeat_password"><?php echo Lang::get('register.label_repeat_password'); ?></label>
					<?php echo Form::password('repeat_password', array('id' => 'repeat_password', 'class' => 'form-control', 'required')); ?>

					<?php if(isset($errors) && ($errors->first('repeat_password') != '' || $errors->first('repeat_password') != null)): ?>
					<p><small><?php echo $errors->first('repeat_password'); ?></small></p>
					<?php endif; ?>
				</div>

				<hr>

				<div class="form-group">
					<label for="first_name"><?php echo Lang::get('register.label_first_name'); ?></label>
					<?php echo Form::text('first_name', null, array('id' => 'first_name', 'class' => 'form-control', 'required')); ?>

					<?php if(isset($errors) && ($errors->first('first_name') != '' || $errors->first('first_name') != null)): ?>
					<p><small><?php echo $errors->first('first_name'); ?></small></p>
					<?php endif; ?>
				</div>

				<div class="form-group">
					<label for="last_name"><?php echo Lang::get('register.label_last_name'); ?></label>
					<?php echo Form::text('last_name', null, array('id' => 'last_name', 'class' => 'form-control', 'required')); ?>

					<?php if(isset($errors) && ($errors->first('last_name') != '' || $errors->first('last_name') != null)): ?>
					<p><small><?php echo $errors->first('last_name'); ?></small></p>
					<?php endif; ?>
				</div>

				<hr>

				<div class="form-group">
					<label for="language"><?php echo Lang::get('register.label_language'); ?></label>
					<?php echo Form::select('language', $languages, null, array('id' => 'language', 'class' => 'form-control', 'required')); ?>

					<?php if(isset($errors) && ($errors->first('language') != '' || $errors->first('language') != null)): ?>
					<p><small><?php echo $errors->first('language'); ?></small></p>
					<?php endif; ?>
				</div>

				<hr>

				<div class="form-group">
					<p class="text-center"><a href="<?php echo URL::route('getSignIn'); ?>"><?php echo Lang::get('register.already_have_account'); ?></a></p>
				</div>
				
				<div class="form-group">
					<p class="text-center"><?php echo Form::button('<span class="icon icon-done"></span> ' . Lang::get('register.submit_button'), array('class' => 'btn btn-primary', 'type' => 'submit')); ?></p>
				</div>

				<hr>

				<div class="form-group text-center mt10 mb10">
					<a href="<?php echo URL::route('getConnectFacebook'); ?>" class="btn btn-sm btn-primary"><?php echo Lang::get('register.connect_via_facebook'); ?></a>
				</div>

				<div class="form-group text-center mt10 mb10">
					<a href="<?php echo URL::route('getConnectGoogle'); ?>" class="btn btn-sm btn-danger"><?php echo Lang::get('register.connect_via_google'); ?></a>
				</div>
				
			<?php echo Form::close(); ?>


		</div>
	</div>
</div>
