<?php
mt_srand();
$index = mt_rand(1, 9999);
?>
<div id="pjWrapper">
	<div class="container-fluid pjYpContainer">
		<?php include_once ROOT_PATH . PJ_TEMPLATE_PATH . 'default/elements/header.php';?>
		
		<div class="row pjYpBody">
			<div class="col-lg-5 col-md-5 col-sm-6 col-xs-12">
				<div class="panel panel-default">
					<header class="panel-heading">
						<p class="panel-title"><?php __('label_login');?></p><!-- /.panel-title pjYpAccessTitle -->
					</header><!-- /.panel-heading -->

					<div class="panel-body">
						<form id="frmYpLogin_<?php echo $index;?>" action="<?php echo PJ_INSTALL_URL;?>index.php?controller=pjAdmin&amp;action=pjActionLogin" target="_blank"  method="post" class="pjYpAccessForm" data-toggle="validator" role="form">
							<input type="hidden" name="login_user" value="1" />
							<p><?php __('label_login_text');?></p>

							<div class="form-group">
								<label for=""><?php __('label_email'); ?>: </label>
								<input type="email" id="login_email" name="login_email" class="form-control required email" data-msg-required="<?php __('label_email_required');?>" data-msg-email="<?php __('label_email_invalid');?>" />

								<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
							</div><!-- /.form-group -->

							<div class="form-group">
								<label for=""><?php __('label_password'); ?>:</label>
								<input type="password" name="login_password" id="login_password" class="form-control required" autocomplete="off" data-msg-required="<?php __('label_password_required');?>"/>
								<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
							</div><!-- /.form-group -->

							<div class="pjYpFormActions">
								<button type="submit" class="btn btn-primary"><?php __('label_login'); ?></button>

								<a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjListings&amp;action=pjActionForgot" class="btn btn-link pjYpBtn pjYpBtnLink"><?php __('label_forgot_password');?></a>
							</div><!-- /.pjYpFormActions -->
						</form><!-- /.pjYpAccessForm -->
					</div><!-- /.panel-body -->
				</div><!-- /.panel panel-default -->
			</div><!-- /.col-lg-5 col-md-5 col-sm-6 col-xs-12 -->

			<div class="col-lg-7 col-md-7 col-sm-6 col-xs-12">
				<div class="panel panel-default">
					<header class="panel-heading">
						<p class="panel-title"><?php __('label_register');?></p><!-- /.panel-title pjYpAccessTitle -->
					</header><!-- /.panel-heading -->

					<div class="panel-body">
						<?php
						$action_url =  $_SERVER['PHP_SELF'] . '?controller=pjListings&amp;action=pjActionAccount';
						if ($tpl['option_arr']['o_seo_url'] == 'Yes')
						{
							$action_url = $tpl['option_arr']['o_listing_page'] . '?controller=pjListings&amp;action=pjActionAccount'; 
						}
						?>
						<form id="frmYpRegister_<?php echo $index;?>" action="<?php echo $action_url; ?>" method="post" class="pjYpAccessForm" data-toggle="validator" role="form">
							<p><?php __('label_register_text');?></p>
							
							<input type="hidden" name="register" value="1" />
							
							<?php
							if(isset($_GET['err']))
							{
								$register_error = __('register_error', true);
								if($_GET['err'] != '9998' && $_GET['err'] != '9999')
								{
									?><div class="alert alert-danger" role="alert"><?php echo $register_error[$_GET['err']]?></div><?php
								}else{
									?><div class="alert alert-success" role="alert"><?php echo $register_error[$_GET['err']]?></div><?php
								}
							} 
							?>
							
							<div class="form-group">
								<label for=""><?php __('label_email'); ?>:</label>
								<input type="email" name="email" value="<?php echo isset($_GET['email']) ? htmlspecialchars(stripslashes($_GET['email'])) : NULL; ?>" class="form-control required email" data-msg-required="<?php __('label_email_required');?>" data-msg-email="<?php __('label_email_invalid');?>"/>

								<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
							</div><!-- /.form-group -->

							<div class="form-group">
								<label for=""><?php __('label_password'); ?>:</label>
								<input type="password" name="password" value="<?php echo isset($_GET['password']) ? htmlspecialchars(stripslashes($_GET['password'])) : NULL; ?>" class="form-control required" data-msg-required="<?php __('label_password_required');?>"/>
								<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
							</div><!-- /.form-group -->

							<div class="form-group">
								<label for=""><?php __('label_full_name'); ?>:</label>
								<input type="text" name="name" value="<?php echo isset($_GET['name']) ? htmlspecialchars(stripslashes($_GET['name'])) : NULL; ?>" class="form-control required" data-msg-required="<?php __('label_name_required');?>"/>
								<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
							</div><!-- /.form-group -->

							<div class="form-group pjYpCaptcha">
								<label for=""><?php __('label_captcha'); ?>: </label>
								<div>
									<input type="text" name="captcha" class="form-control required" maxlength="6" autocomplete="off" data-msg-required="<?php __('label_captcha_required');?>" data-msg-remote="<?php __('label_captcha_incorrect');?>"/>
									<img src="<?php echo PJ_INSTALL_URL; ?>index.php?controller=pjFront&amp;action=pjActionCaptcha&amp;rand=<?php echo rand(1, 999999); ?>" alt="" />
								</div>
								<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
							</div><!-- /.form-group pjYpCaptcha -->

							<div class="pjYpFormActions">
								<button type="submit" class="btn btn-primary"><?php __('label_register'); ?></button>
							</div><!-- /.pjYpFormActions -->
						</form><!-- /.pjYpAccessForm -->
					</div><!-- /.panel-body -->
				</div><!-- /.panel panel-default pjYpAccess -->
			</div><!-- /.col-lg-7 col-md-7 col-sm-6 col-xs-12 -->
		</div><!-- /.row pjYpBody -->
	</div><!-- /.container-fluid pjYpContainer -->
</div><!-- /#pjWrapper -->