<?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 pjJlFormAccessLogin">
				<div class="pjJlFormTabs">

				  	<div class="tab-content">
			  			<br/>
			  			<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_btn_login');?></p><!-- /.pjJlFormTitle -->
			
								<p><?php __('front_label_employer_login_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_login', true);
										?>
										<div class="alert alert-danger"><?php echo $reg_message[$_GET['err']] ?></div>
										<?php
									} 
									?>
									<?php
									if(isset($_GET['social_err']) && $_GET['tab'] == 'employer')
									{
										$reg_message = __('front_employer_reg', true); 
										?>
										<div class="alert alert-warning"><?php echo $reg_message[$_GET['social_err']] ?></div>
										<?php
									} 
									?>
									<form id="frmEmployerLogin" name="frmEmployerLogin" action="<?php echo $_SERVER['PHP_SELF'];?>?controller=pjLoad&amp;action=pjActionLogin" method="post" autocomplete="off" enctype="multipart/form-data" class="form-dyna xs-4">
										<input type="hidden" name="employer_login" value="1" />
										<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_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']?>"/>
													<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_password'); ?>: </label>
													<input type="password" 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-12 col-md-12 col-sm-12 col-xs-12 pjJlFormActions">
												<button type="submit" class="btn btn-default pjJlBtn pjJlBtnPrimary"><?php __('front_btn_login');?></button>
											
												<?php
												if ($tpl['option_arr']['o_seo_url'] == 'No')
												{
													$forgot_url = $_SERVER['PHP_SELF'] . '?controller=pjLoad&amp;action=pjActionForgotPassword';
												} else {
													$forgot_url = $path .'/job-forgot-password.html';
												} 
												?>
												<a href="<?php echo $forgot_url; ?>" class="btn btn-link pjJlBtn pjJlBtnLink"><?php __('front_link_forgot_password');?></a>
											</div><!-- /.col-lg-12 col-md-12 col-sm-12 col-xs-12 pjJlFormActions -->
											<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 pjJlFormActions">
												<?php
												if($tpl['option_arr']['o_allow_facebook_login'] == 'Yes')
												{ 
													?>
													<a href="<?php echo $tpl['social_urls']['facebook_employer'];?>" class="btn btn-default 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 pjJlBtn pjJlBtnPrimary pjJlBtnPrimaryLinkedin">
														<i class="fa fa-linkedin"></i>
														<?php __('front_sign_in_with_linkedin');?>
													</a>
													<?php
												} 
												?>
											</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_dont_have_account');?></p><!-- /.pjJlFormBoxTitle -->
										<?php
										if ($tpl['option_arr']['o_seo_url'] == 'No')
										{
											$register_url = $_SERVER['PHP_SELF'] . '?controller=pjLoad&amp;action=pjActionRegister&amp;tab=employer';
										} else {
											$register_url = $path .'/job-register.html?tab=employer';
										} 
										?>
										<a href="<?php echo $register_url; ?>" class="btn btn-default btn-block pjJlBtn pjJlBtnPrimary"><?php __('front_register');?></a>
									</div><!-- /.thumbnail pjJlFormBox -->
								</aside><!-- /.col-lg-3 col-md-3 col-sm-4 col-xs-12 pjJlFormAside -->
							</div><!-- /.row pjJlFormBody -->
			  			</div><!-- /Employer Tab -->
			  			
			  			<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_btn_login');?></p><!-- /.pjJlFormTitle -->
			
								<p><?php __('front_label_candidate_login_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_login', true);
										?>
										<div class="alert alert-danger"><?php echo $reg_message[$_GET['err']] ?></div>
										<?php
									} 
									?>
									<?php
									if(isset($_GET['social_err']) && $_GET['tab'] == 'candidate')
									{
										$reg_message = __('front_candidate_reg', true);
										if(isset($reg_message[$_GET['social_err']]))
										{
											?>
											<div class="alert alert-warning"><?php echo $reg_message[$_GET['social_err']]; ?></div>
											<?php
										}
									} 
									?>
									<form id="frmCandidateLogin" name="frmCandidateLogin" action="<?php echo $_SERVER['PHP_SELF'];?>?controller=pjLoad&amp;action=pjActionLogin" method="post" autocomplete="off" enctype="multipart/form-data" class="form-dyna xs-4">
										<input type="hidden" name="candidate_login" value="1" />
										<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_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']?>"/>
													<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_password'); ?>: </label>
													<input type="password" 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-12 col-md-12 col-sm-12 col-xs-12 pjJlFormActions">
												<button type="submit" class="btn btn-default pjJlBtn pjJlBtnPrimary"><?php __('front_btn_login');?></button>
												<?php
												if ($tpl['option_arr']['o_seo_url'] == 'No')
												{
													$forgot_url = $_SERVER['PHP_SELF'] . '?controller=pjLoad&amp;action=pjActionForgotPassword';
												} else {
													$forgot_url = $path .'/job-forgot-password.html';
												} 
												?>
												<a href="<?php echo $forgot_url; ?>" class="btn btn-link pjJlBtn pjJlBtnLink"><?php __('front_link_forgot_password');?></a>
											</div><!-- /.col-lg-12 col-md-12 col-sm-12 col-xs-12 pjJlFormActions -->
											<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 pjJlFormActions">
												<?php
												if($tpl['option_arr']['o_allow_facebook_login'] == 'Yes')
												{ 
													?>
													<a href="<?php echo $tpl['social_urls']['facebook_candidate'];?>" class="btn btn-default 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 pjJlBtn pjJlBtnPrimary pjJlBtnPrimaryLinkedin">
														<i class="fa fa-linkedin"></i>
														<?php __('front_sign_in_with_linkedin');?>
													</a>
													<?php
												} 
												?>
											</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_dont_have_account');?></p><!-- /.pjJlFormBoxTitle -->
										<?php
										if ($tpl['option_arr']['o_seo_url'] == 'No')
										{
											$register_url = $_SERVER['PHP_SELF'] . '?controller=pjLoad&amp;action=pjActionRegister&amp;tab=candidate';
										} else {
											$register_url = $path .'/job-register.html?tab=candidate';
										} 
										?>
										<a href="<?php echo $register_url; ?>" class="btn btn-default btn-block pjJlBtn pjJlBtnPrimary"><?php __('front_register');?></a>
									</div><!-- /.thumbnail pjJlFormBox -->
								</aside><!-- /.col-lg-3 col-md-3 col-sm-4 col-xs-12 pjJlFormAside -->
							</div><!-- /.row pjJlFormBody -->
			  			</div><!-- /Candidate Tab -->
			  		</div><!-- /.tab-content -->
				</div><!-- pjJlFormTabs -->
			</div><!-- /.pjJlForm pjJlFormAccess pjJlFormAccessLogin -->
		</div><!-- /.pjJlBody -->
	</div><!-- /.container-fluid pjJlContainer -->
</div><!-- /.pjWrapper -->