<?php
mt_srand();
$index = mt_rand(1, 9999);
?>
<div id="pjWrapper">
	<div class="container-fluid pjMlContainer">
		<?php include_once PJ_VIEWS_PATH . 'pjLoad/elements/header.php';?>
		
		<div class="row pjMlBody pjMlAccess">
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 pjMlForm pjMlFormLogIn">
				<form id="pjMLFormLogIn_<?php echo $index;?>" action="<?php echo $_SERVER['PHP_SELF'];?>?controller=pjLoad&amp;action=pjActionLogin" method="post" data-toggle="validator" role="form">
					<input type="hidden" name="login" value="1" />
					<p class="pjMlFormTitle"><?php __('front_login_to_your_account');?></p><!-- /.pjMlFormTitle -->
					<p><?php __('front_login_notes');?></p>
					
					<div class="pjMlFormBody">
						<?php
						if(isset($_GET['tab']) && $_GET['tab'] == 1)
						{
							if(isset($tpl['err']))
							{
								$front_err = pjSanitize::clean(__('front_err', true));
								?>
								<div class="alert alert-danger" role="alert"><?php echo $front_err[$tpl['err']];?></div>
								<?php
							}
							if(isset($tpl['msg']))
							{
								$front_msg = pjSanitize::clean(__('front_msg', true));
								?>
								<div class="alert alert-success" role="alert"><?php echo $front_msg[$tpl['msg']];?></div>
								<?php
							}
						} 
						?>
						<div class="form-group">
							<label for=""><?php __('front_email_address');?>: </label>
							
							<input type="email" name="email" class="form-control required email" data-msg-required="<?php __('front_field_required');?>" data-msg-email="<?php __('front_email_invalid');?>" data-msg-remote="<?php __('front_email_in_used');?>"/>
							<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
						</div><!-- /.form-group -->
						
						<div class="form-group">
							<label for=""><?php __('front_password');?>: </label>
							
							<input type="password" id="pjMLPassword_<?php echo $index;?>" name="password" class="form-control required" data-msg-required="<?php __('front_field_required');?>"/>
							<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
						</div><!-- /.form-group -->
						
						<div class="pjMlFormActions">
							<button type="submit" class="btn btn-default pjMlBtn pjMlBtnPrimary"><?php __('front_btn_login');?></button>
						
							<a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionForgot" class="btn btn-link pjMlBtn pjMlBtnLink"><?php __('front_forgot_password');?></a>
						</div><!-- /.pjMlFormActions -->
					</div><!-- /.pjMlFormBody -->
				</form>
			</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 pjMlForm pjMlForm -->

			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 pjMlForm pjMlFormRegister">
				<form id="pjMLFormRegister_<?php echo $index; ?>" name="pjMLFormRegister" action="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&action=pjActionRegister" method="post" data-toggle="validator" role="form">
				
					<input type="hidden" value="1" name="register">
					
					<p class="pjMlFormTitle"><?php __('front_create_an_account');?></p><!-- /.pjMlFormTitle -->
					<p><?php __('front_create_an_account_notes');?></p>
					
					<div class="pjMlFormBody">
						<?php
						if(isset($_GET['tab']) && $_GET['tab'] == 2)
						{
							if(isset($tpl['err']))
							{
								$front_err = pjSanitize::clean(__('front_err', true));
								?>
								<div class="alert alert-danger" role="alert"><?php echo $front_err[$tpl['err']];?></div>
								<?php
							}
							if(isset($tpl['msg']))
							{
								$front_msg = pjSanitize::clean(__('front_msg', true));
								?>
								<div class="alert alert-success" role="alert"><?php echo $front_msg[$tpl['msg']];?></div>
								<?php
							}
						} 
						?>
						<div class="form-group">
							<label for=""><?php __('front_name');?>: </label>
							
							<input type="text" name="i18n[<?php echo $controller->pjActionGetLocale(); ?>][name]" class="form-control required" data-msg-required="<?php __('front_field_required');?>"/>
							<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
						</div><!-- /.form-group -->
						
						<div class="form-group">
							<label for=""><?php __('front_email_address');?>: </label>
							
							<input type="email" name="email" class="form-control required email" data-msg-required="<?php __('front_field_required');?>" data-msg-email="<?php __('front_email_invalid');?>" data-msg-remote="<?php __('front_email_in_used');?>"/>
							<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
						</div><!-- /.form-group -->
						
						<div class="form-group">
							<label for=""><?php __('front_password');?>: </label>
							
							<input type="password" id="pjMLPassword" name="password" class="form-control required" data-msg-required="<?php __('front_field_required');?>"/>
							<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
						</div><!-- /.form-group -->
						
						<div class="form-group">
							<label for=""><?php __('front_reenter_password');?>: </label>
							
							<input type="password" name="reenter_password" class="form-control required" data-msg-required="<?php __('front_field_required');?>" data-msg-equalTo="<?php __('front_password_not_match');?>"/>
							<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
						</div><!-- /.form-group -->
						
						<div class="form-group">
							<label for=""><?php __('front_phone');?>: </label>
							
							<input type="text" name="phone" class="form-control" />
						</div><!-- /.form-group -->
						
						<div class="form-group pjMlFormCaptcha">
							<label for=""><?php __('front_captcha');?>: </label>
							
							<input type="text" name="captcha" class="form-control required" data-msg-required="<?php __('front_field_required');?>" data-msg-remote="<?php __('front_captcha_incorrect');?>"/>
							<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
						
							<img class="pjMlFormCaptchaImage" src="<?php echo PJ_INSTALL_FOLDER; ?>index.php?controller=pjFront&amp;action=pjActionCaptcha&amp;rand=<?php echo rand(1, 999999); ?>" alt="CAPTCHA"/>
						</div><!-- /.form-group pjMlFormCaptcha -->
						
						<div class="pjMlFormActions">
							<button type="submit" class="btn btn-default pjMlBtn pjMlBtnPrimary"><?php __('front_btn_register');?></button>
						</div><!-- /.pjMlFormActions -->
					</div><!-- /.pjMlFormBody -->
				</form>
			</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-12 pjMlForm pjMlForm -->
		</div><!-- /.row pjMlBody pjMlAccess -->
	</div><!-- /.container-fluid pjMlContainer -->
</div><!-- /#pjWrapper -->
	
<?php include_once PJ_VIEWS_PATH . 'pjLoad/elements/loadjs.php';?>