<!--Add new user -->


<div class="row">
	<div class="col s12">
		<div class="widget-holder hoverable fadeIn" id="dashboard-add-user">
			<div class="widget-heading">
				<h2 class="widget-heading-thick"><?php echo $title; ?></h2>
			</div>

			<div class="widget-content">
				<?php echo Form::open(array('route' => 'postProfile', 'role' => 'form', 'class' => 'form-horizontal', 'autocomplete' => 'off', 'id' => 'user-form')); ?>


				<div class="row">
					<div class="col l12 m12 s12">


						<div class="inputs-wrapper">
							<div class="row">

								<div class="input-field col s12 m6">
									<?php echo Form::text('first_name', isset($user->first_name) ? $user->first_name : null, array('id' => 'first_name')); ?>

									<?php if(isset($errors) && ($errors->first('first_name') != '' || $errors->first('first_name') != null)): ?>
										<p><small class="error"><?php echo $errors->first('first_name'); ?></small></p>
									<?php endif; ?>
									<label for="first-name"><?php echo Lang::get('user.label_first_name'); ?>*</label>
								</div>

								<div class="input-field col s12 m6">
									<?php echo Form::text('last_name', isset($user->last_name) ? $user->last_name : null, array('id' => 'last_name')); ?>

									<?php if(isset($errors) && ($errors->first('last_name') != '' || $errors->first('last_name') != null)): ?>
										<p><small class="error"><?php echo $errors->first('last_name'); ?></small></p>
									<?php endif; ?>
									<label for="last-name"><?php echo Lang::get('user.label_last_name'); ?>*</label>
								</div>


								<div class="input-field col s12 m6">
									<?php echo Form::text('email', isset($user->email) ? $user->email : null, array()); ?>

									<?php if(isset($errors) && ($errors->first('email') != '' || $errors->first('email') != null)): ?>
										<p><small class="error"><?php echo $errors->first('email'); ?></small></p>
									<?php endif; ?>
									<label ><?php echo Lang::get('user.label_email'); ?>*</label>
								</div>

								<div class="input-field col s12 m6">

										<?php echo Form::password('password', array('id' => 'pwd', "autocomplete"=>"new-password")); ?>

									<?php if(isset($errors) && ($errors->first('password') != '' || $errors->first('password') != null)): ?>
										<p><small class="error"><?php echo $errors->first('password'); ?></small></p>
									<?php endif; ?>
									<label for="pwd"><?php echo Lang::get('user.label_new_password'); ?>*</label>
								</div>

								<div class="input-field col s12 m6">
									<?php echo Form::text('address', isset($user->address) ? $user->address : null, array('id' => 'address')); ?>

									<?php if(isset($errors) && ($errors->first('address') != '' || $errors->first('address') != null)): ?>
										<p><small class="error"><?php echo $errors->first('address'); ?></small></p>
									<?php endif; ?>
									<label for="address"><?php echo Lang::get('user.label_address'); ?></label>
								</div>

								<div class="input-field col s12 m6">
									<?php echo Form::text('city', isset($user->city) ? $user->city : null, array('id' => 'city')); ?>

									<?php if(isset($errors) && ($errors->first('city') != '' || $errors->first('city') != null)): ?>
										<p><small class="error"><?php echo $errors->first('city'); ?></small></p>
									<?php endif; ?>
									<label for="city"><?php echo Lang::get('user.label_city'); ?></label>
								</div>

								<div class="input-field col s12 m6">
									<?php echo Form::text('phone', isset($user->phone) ? $user->phone : null, array('id' => 'phone')); ?>

									<?php if(isset($errors) && ($errors->first('phone') != '' || $errors->first('phone') != null)): ?>
										<p><small class="error"><?php echo $errors->first('phone'); ?></small></p>
									<?php endif; ?>
									<label for="phone-number"><?php echo Lang::get('user.label_phone'); ?></label>
								</div>

								<div class="input-field col s12 m6">
									<?php echo Form::text('job_title', isset($user->job_title) ? $user->job_title : null, array('id' => 'job_title')); ?>

									<?php if(isset($errors) && ($errors->first('job_title') != '' || $errors->first('job_title') != null)): ?>
										<p><small class="error"><?php echo $errors->first('job_title'); ?></small></p>
									<?php endif; ?>
									<label for="job-title"><?php echo Lang::get('user.label_job_title'); ?></label>
								</div>

							</div>
						</div>

						<div class="inputs-wrapper">
							<div class="row">

								<div class="input-field col s12 m3">
									<?php echo Form::select('language', $languages, isset($user->language_id) ? $user->language_id : null, array('id' => 'language', 'class' => 'form-control')); ?>

									<?php if(isset($errors) && ($errors->first('language') != '' || $errors->first('language') != null)): ?>
										<p><small class="error"><?php echo $errors->first('language'); ?></small></p>
									<?php endif; ?>
									<label><?php echo Lang::get('user.label_language'); ?></label>
								</div>



							</div>
						</div>
					</div>
				</div>
				<div class="row center-align">
					<div class="col s12">
						<a href="<?php echo URL::route('getUsersList'); ?>"  class="waves-effect waves-light btn btn-cancel" id="new-user-buttons-cancel"><?php echo Lang::get('core.cancel'); ?></a>
						<?php echo Form::button('<span class="icon icon-done"></span> ' . Lang::get('core.save'), array('type' => 'submit', 'class' => 'waves-effect waves-light btn btn-primary')); ?>


					</div>
				</div>
				<?php echo Form::close(); ?>


			</div>

		</div>

	</div>
</div>
<!--Add new user end-->


