<?php
mt_srand();
$index = mt_rand(1, 9999);
$front_err = __('front_error', true);
$path = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
$path = $path == '/' ? '' : $path;
?>
<div id="pjWrapper">
	<div class="container-fluid pjJlContainer">
		<?php include_once dirname(__FILE__) . '/elements/header.php';?>
		
		<div class="pjJlBody">
			<div class="pjJlForm pjJlFormAccess pjJlFormAccessRegister">
				<div class="pjJlFormTabs">
					
			  		<div class="tab-content">
			  			<br/>
			  			<?php
			  			if($tpl['option_arr']['o_is_adding_job_allowed'] == 'Yes')
			  			{ 
				  			?>
					    	<div role="tabpanel" class="tab-pane<?php echo isset($_GET['tab']) ? ($_GET['tab'] == 'employer' ? ' active' : NULL) : NULL ;?>" id="pjJLEmployerTab">
					    		<header class="pjJlFormHead">
									<p class="pjJlFormTitle"><?php __('front_register');?></p><!-- /.pjJlFormTitle -->
				
									<p><?php __('front_label_employer_register_intro');?></p>
								</header><!-- /.pjJlFormHead -->
								<?php
								if($tpl['option_arr']['o_is_adding_job_allowed'] == 'Yes')
								{ 
									?>
									<div class="row pjJlFormBody">
										<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
											<label class="radio-inline"><input type="radio" id="tab_employer_radio_1" name="employer_radio"<?php echo isset($_GET['tab']) ? ($_GET['tab'] == 'candidate' ? ' checked="checked"' : NULL) : ' checked="checked"';?>><?php __('front_radio_candidate');?></label>
											<label class="radio-inline"><input type="radio" id="tab_employer_radio_2" name="employer_radio"<?php echo isset($_GET['tab']) ? ($_GET['tab'] == 'employer' ? ' checked="checked"' : NULL) : NULL;?>><?php __('front_radio_employer');?></label>
										</div>
										<br/><br/>
									</div>
									<?php
								} 
								?>
								<div class="row pjJlFormBody">
									<div class="col-lg-9 col-md-9 col-sm-8 col-xs-12 pjJlFormContent">
										<?php
										if(isset($_GET['err']) && $_GET['tab'] == 'employer')
										{
											$reg_message = __('front_employer_reg', true); 
											$class = in_array($_GET['err'], array('0', '3', 'data_inv', '5', '6')) ? ' alert-danger' : ' alert-success';
											?><div class="alert<?php echo $class;?>" role="alert"><?php echo $reg_message[$_GET['err']] ?></div><?php
										} 
										?>
										<form id="frmEmployerRegister" name="frmEmployerRegister" action="<?php echo $_SERVER['PHP_SELF'];?>?controller=pjLoad&amp;action=pjActionRegister" method="post" autocomplete="off" enctype="multipart/form-data" class="form-dyna xs-4">
											<input type="hidden" name="employer_register" value="1" />
											<div class="row">
												<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_email'); ?>: </label>
														<input type="text" name="email" class="form-control required email" data-msg-required="<?php echo $front_err['email']?>" data-msg-email="<?php echo $front_err['email_inv']?>" data-msg-remote="<?php echo $front_err['email_used']?>"/>
														<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
													</div><!-- /.form-group -->
												</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
											</div>
											<div class="row">
												<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_password'); ?>: </label>
														<input type="password" id="pjJLEmployerPassword" name="password" class="form-control required" data-msg-required="<?php echo $front_err['password']?>"/>
														<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
													</div><!-- /.form-group -->
												</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
												<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_cpassword'); ?>: </label>
														<input type="password" name="cpassword" class="form-control required" data-msg-required="<?php echo $front_err['cpassword']?>" data-msg-equalTo="<?php echo $front_err['password_match']?>"/>
														<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
													</div><!-- /.form-group -->
												</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
											</div>
											<div class="row">
												<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_company_name'); ?>: </label>
														<input type="text" name="company_name" class="form-control required" data-msg-required="<?php echo $front_err['company_name']?>"/>
														<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
													</div><!-- /.form-group -->
												</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
												<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_contact_name'); ?>: </label>
														<input type="text" name="contact_name" class="form-control"/>
														<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
													</div><!-- /.form-group -->
												</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
											</div>
											<div class="row">
												<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_website'); ?>: </label>
														<input type="text" name="url" class="form-control" placeholder="http://www.domain.com" />
													</div><!-- /.form-group -->
												</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
												<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_phone'); ?>: </label>
														<input type="text" name="phone" class="form-control"/>
													</div><!-- /.form-group -->
												</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
											</div>
											<div class="row">
												<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_logo'); ?>: </label>
													
														<div class="row pjJlAddFile">
															<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
																<input type="text" class="form-control pjJlUploadedFiles" placeholder="<?php __('front_choose_file');?>" />
															</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
													
															<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
																<div class="btn btn-default pjJlBtn pjJlBtnSecondary pjJlBtnUpload">
																	<?php __('front_btn_browse');?>
																												
																	<input type="file" id="pjJlLogo_<?php echo $index;?>" name="logo" class="pjJlFileUploadField" data-extension="png|gif|jpg|jpeg|pjpeg"/>
																</div>
																												
																<a href="#" class="btn btn-default pjJlBtn pjJlBtnBordered pjJlBtnRemoveFile" style="display: none;"><?php __('front_btn_delete');?></a>
															</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
														</div><!-- /.row pjJlAddFile -->
														<div id="pjJlLogoErrorWrapper" class="help-block with-errors" style="display: none;"><ul class="list-unstyled"><li><?php __('front_logo_file_not_in_format');?></li></ul></div>
													</div><!-- /.form-group -->
												</div>									
												<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
													<div class="form-group pjJlFormGroupCaptcha">
														<div class="pjJlCaptchaImage">
															<img id="pjJlEmployerCaptchaImage_<?php echo $index;?>" src="<?php echo PJ_INSTALL_FOLDER; ?>index.php?controller=pjFront&amp;action=pjActionCaptcha&amp;rand=<?php echo rand(1, 999999); ?>&amp;pjType=Employer" alt="" style="cursor: pointer;"/>
														</div><!-- /.pjJlCaptchaImage -->
												
														<input type="text" id="pjJlEmployerCaptchaField_<?php echo $index;?>" name="captcha" class="form-control pjJlCaptchaField required" data-msg-required="<?php echo $front_err['captcha']?>" data-msg-remote="<?php echo $front_err['captcha_inc']?>"/>
														<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
													</div><!-- /.form-group pjJlFormGroupCaptcha -->
												</div><!-- /.col-lg-6 col-md-12 col-sm-12 col-xs-12 -->
													
												<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 pjJlFormActions">
													<button type="submit" class="btn btn-default pjJlBtn pjJlBtnPrimary"><?php __('front_button_register');?></button>
												</div><!-- /.col-lg-12 col-md-12 col-sm-12 col-xs-12 pjJlFormActions -->
											</div>
										</form>
									</div><!-- /.col-lg-9 col-md-9 col-sm-8 col-xs-12 pjJlFormContent -->
									
									<aside class="col-lg-3 col-md-3 col-sm-4 col-xs-12 pjJlFormAside">
										<div class="thumbnail pjJlFormBox">
											<p class="pjJlFormBoxTitle"><?php __('front_have_account');?>:</p><!-- /.pjJlFormBoxTitle -->
											
											<?php
											if ($tpl['option_arr']['o_seo_url'] == 'No')
											{
												?>
												<a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionLogin&amp;tab=employer" class="btn btn-default btn-block pjJlBtn pjJlBtnPrimary"><?php __('front_btn_login');?></a>
												<a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionForgotPassword" class="btn btn-link pjJlBtn pjJlBtnLink"><?php __('front_link_forgot_password');?></a>
												<?php
											}else{
												?>
												<a href="<?php echo $path; ?>/job-login.html?tab=employer" class="btn btn-default btn-block pjJlBtn pjJlBtnPrimary"><?php __('front_btn_login');?></a>
												<a href="<?php echo $path; ?>/job-forgot-password.html" class="btn btn-link pjJlBtn pjJlBtnLink"><?php __('front_link_forgot_password');?></a>
												<?php
											} 
											?>
											
											<?php
											if($tpl['option_arr']['o_allow_facebook_login'] == 'Yes' || $tpl['option_arr']['o_allow_linkedin_login'] == 'Yes')
											{ 
												?><p class="pjJlFormBoxSeparator"><?php __('front_or');?></p><!-- /.pjJlFormBoxSeparator --><?php
											}
											if($tpl['option_arr']['o_allow_facebook_login'] == 'Yes')
											{ 
												?>
												<a href="<?php echo $tpl['social_urls']['facebook_employer'];?>" class="btn btn-default btn-block pjJlBtn pjJlBtnPrimary pjJlBtnPrimaryFacebook">
													<i class="fa fa-facebook"></i>
													<?php __('front_sign_in_with_facebook');?>
												</a>
												<?php
											}
											if($tpl['option_arr']['o_allow_linkedin_login'] == 'Yes')
											{ 
												?>
												<a href="<?php echo $tpl['social_urls']['linkedin_employer'];?>" class="btn btn-default btn-block pjJlBtn pjJlBtnPrimary pjJlBtnPrimaryLinkedin">
													<i class="fa fa-linkedin"></i>
													<?php __('front_sign_in_with_linkedin');?>
												</a>
												<?php
											} 
											?>
										</div><!-- /.thumbnail pjJlFormBox -->
									</aside><!-- /.col-lg-3 col-md-3 col-sm-4 col-xs-12 pjJlFormAside -->
								</div><!-- /.row pjJlFormBody -->
					    	</div>
					    	<?php
			  			} 
					    ?>
				    	<?php
			  			if($tpl['option_arr']['o_is_applying_job_allowed'] == 'Yes')
			  			{ 
				  			?>
					    	<div role="tabpanel" class="tab-pane<?php echo isset($_GET['tab']) ? ($_GET['tab'] == 'candidate' ? ' active' : NULL) : ' active' ;?>" id="pjJLCandidateTab">
					    		<header class="pjJlFormHead">
									<p class="pjJlFormTitle"><?php __('front_register');?></p><!-- /.pjJlFormTitle -->
				
									<p><?php __('front_label_candidate_register_intro');?></p>
								</header><!-- /.pjJlFormHead -->
								<?php
								if($tpl['option_arr']['o_is_adding_job_allowed'] == 'Yes')
								{ 
									?>
									<div class="row pjJlFormBody">
										<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
											<label class="radio-inline"><input type="radio" id="tab_candidate_radio_1" name="candidate_radio"<?php echo isset($_GET['tab']) ? ($_GET['tab'] == 'candidate' ? ' checked="checked"' : NULL) : ' checked="checked"';?>><?php __('front_radio_candidate');?></label>
											<label class="radio-inline"><input type="radio" id="tab_candidate_radio_2" name="candidate_radio"<?php echo isset($_GET['tab']) ? ($_GET['tab'] == 'employer' ? ' checked="checked"' : NULL) : NULL;?>><?php __('front_radio_employer');?></label>
										</div>
										<br/><br/>
									</div>
									<?php
								} 
								?>
								<div class="row pjJlFormBody">
									<div class="col-lg-9 col-md-9 col-sm-8 col-xs-12 pjJlFormContent">
										<?php
										if(isset($_GET['err']) && $_GET['tab'] == 'candidate')
										{
											$reg_message = __('front_candidate_reg', true);
											$class = in_array($_GET['err'], array('0', '4', 'data_inv', '5', '6')) ? ' alert-danger' : ' alert-success';
											?>
											<div class="alert<?php echo $class;?>"><?php echo $reg_message[$_GET['err']] ?></div>
											<?php
										} 
										?>
										<form id="frmCandidateRegister" name="frmCandidateRegister" action="<?php echo $_SERVER['PHP_SELF'];?>?controller=pjLoad&amp;action=pjActionRegister" method="post" autocomplete="off" enctype="multipart/form-data" class="form-dyna xs-4">
											<input type="hidden" name="candidate_register" value="1" />
											<div class="row">
												<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_email'); ?>: </label>
														<input type="text" name="email" class="form-control required email" data-msg-required="<?php echo $front_err['email']?>" data-msg-email="<?php echo $front_err['email_inv']?>" data-msg-remote="<?php echo $front_err['email_used']?>"/>
														<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
													</div><!-- /.form-group -->
												</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
											</div>
											<div class="row">
												<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_password'); ?>: </label>
														<input type="password" id="pjJLCandidatePassword" name="password" class="form-control required" data-msg-required="<?php echo $front_err['password']?>"/>
														<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
													</div><!-- /.form-group -->
												</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
												<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_cpassword'); ?>: </label>
														<input type="password" name="cpassword" class="form-control required" data-msg-required="<?php echo $front_err['cpassword']?>" data-msg-equalTo="<?php echo $front_err['password_match']?>"/>
														<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
													</div><!-- /.form-group -->
												</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
											</div>
											<div class="row">
												<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_fname'); ?>: </label>
														<input type="text" name="fname" class="form-control required" data-msg-required="<?php echo $front_err['fname']?>"/>
														<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
													</div><!-- /.form-group -->
												</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
												<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_lname'); ?>: </label>
														<input type="text" name="lname" class="form-control required" data-msg-required="<?php echo $front_err['lname']?>"/>
														<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
													</div><!-- /.form-group -->
												</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
											</div>
											<div class="row">
												<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_phone'); ?>: </label>
														<input type="text" name="phone" class="form-control"/>
													</div><!-- /.form-group -->
												</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
												<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_linkedin'); ?>: </label>
														<input type="text" name="linkedin" class="form-control"/>
													</div><!-- /.form-group -->
												</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
											</div>
											<div class="row">
												<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
													<div class="form-group">
														<label for=""><?php __('front_label_cv'); ?>: </label>
													
														<div class="row pjJlAddFile">
															<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
																<input type="text" class="form-control pjJlUploadedFiles" placeholder="<?php __('front_choose_file');?>" />
															</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
													
															<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
																<div class="btn btn-default pjJlBtn pjJlBtnSecondary pjJlBtnUpload">
																	<?php __('front_btn_browse');?>
																												
																	<input type="file" id="pjJlCV_<?php echo $index;?>" name="cv" class="pjJlFileUploadField" data-extension="doc|docx|pdf"/>
																</div>
																												
																<a href="#" class="btn btn-default pjJlBtn pjJlBtnBordered pjJlBtnRemoveFile" style="display: none;"><?php __('front_btn_delete');?></a>
															</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 -->
														</div><!-- /.row pjJlAddFile -->
														<div id="pjJlFileErrorWrapper" class="help-block with-errors" style="display: none;"><ul class="list-unstyled"><li><?php __('front_cv_file_not_in_format');?></li></ul></div>
													</div><!-- /.form-group -->
												</div>
											</div>
											<div class="row">									
												<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
													<div class="form-group pjJlFormGroupCaptcha">
														<div class="pjJlCaptchaImage">
															<img id="pjJlCandidateCaptchaImage_<?php echo $index;?>" src="<?php echo PJ_INSTALL_FOLDER; ?>index.php?controller=pjFront&amp;action=pjActionCaptcha&amp;rand=<?php echo rand(1, 999999); ?>&amp;pjType=Candidate" alt="" style="cursor: pointer;"/>
														</div><!-- /.pjJlCaptchaImage -->
												
														<input type="text" id="pjJlCandidateCaptchaField_<?php echo $index;?>" name="captcha" class="form-control pjJlCaptchaField required" data-msg-required="<?php echo $front_err['captcha']?>" data-msg-remote="<?php echo $front_err['captcha_inc']?>"/>
														<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
													</div><!-- /.form-group pjJlFormGroupCaptcha -->
												</div><!-- /.col-lg-6 col-md-12 col-sm-12 col-xs-12 -->
												
												<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 pjJlFormActions">
													<button type="submit" class="btn btn-default pjJlBtn pjJlBtnPrimary"><?php __('front_button_register');?></button>
												</div><!-- /.col-lg-12 col-md-12 col-sm-12 col-xs-12 pjJlFormActions -->
											</div><!-- /.row -->
										</form>
									</div><!-- /.col-lg-9 col-md-9 col-sm-8 col-xs-12 pjJlFormContent -->
									
									<aside class="col-lg-3 col-md-3 col-sm-4 col-xs-12 pjJlFormAside">
										<div class="thumbnail pjJlFormBox">
											<p class="pjJlFormBoxTitle"><?php __('front_have_account');?>:</p><!-- /.pjJlFormBoxTitle -->
				
											<?php
											if ($tpl['option_arr']['o_seo_url'] == 'No')
											{ 
												?>
												<a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionLogin&amp;tab=candidate" class="btn btn-default btn-block pjJlBtn pjJlBtnPrimary"><?php __('front_btn_login');?></a>
												<a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionForgotPassword" class="btn btn-link pjJlBtn pjJlBtnLink"><?php __('front_link_forgot_password');?></a>
												<?php
											}else{
												?>
												<a href="<?php echo $path; ?>/job-login.html?tab=candidate" class="btn btn-default btn-block pjJlBtn pjJlBtnPrimary"><?php __('front_btn_login');?></a>
												<a href="<?php echo $path; ?>/job-forgot-password.html" class="btn btn-link pjJlBtn pjJlBtnLink"><?php __('front_link_forgot_password');?></a>
												<?php
											} 
											?>
											
											<?php
											if($tpl['option_arr']['o_allow_facebook_login'] == 'Yes' || $tpl['option_arr']['o_allow_linkedin_login'] == 'Yes')
											{ 
												?>
												<p class="pjJlFormBoxSeparator"><?php __('front_or');?></p><!-- /.pjJlFormBoxSeparator -->
												<?php
											}
											if($tpl['option_arr']['o_allow_facebook_login'] == 'Yes')
											{ 
												?>
												<a href="<?php echo $tpl['social_urls']['facebook_candidate'];?>" class="btn btn-default btn-block pjJlBtn pjJlBtnPrimary pjJlBtnPrimaryFacebook">
													<i class="fa fa-facebook"></i>
													<?php __('front_sign_in_with_facebook');?>
												</a>
												<?php
											}
											if($tpl['option_arr']['o_allow_linkedin_login'] == 'Yes')
											{ 
												?>
												<a href="<?php echo $tpl['social_urls']['linkedin_candidate'];?>" class="btn btn-default btn-block pjJlBtn pjJlBtnPrimary pjJlBtnPrimaryLinkedin">
													<i class="fa fa-linkedin"></i>
													<?php __('front_sign_in_with_linkedin');?>
												</a>
												<?php
											} 
											?>
										</div><!-- /.thumbnail pjJlFormBox -->
									</aside><!-- /.col-lg-3 col-md-3 col-sm-4 col-xs-12 pjJlFormAside -->
								</div><!-- /.row pjJlFormBody -->
					    	</div>
					    	<?php
			  			} 
					    ?>
				  	</div>
				</div><!-- /.pjJlFormTabs -->
			</div><!-- /.pjJlForm pjJlFormAccess pjJlFormAccessRegister -->
		</div><!-- /.pjJlBody -->
	</div><!-- /.container-fluid pjJlContainer -->
</div><!-- /.pjWrapper -->

<?php include_once dirname(__FILE__) . '/elements/loadjs.php';?>