<?php
mt_srand();
$index = mt_rand(1, 9999);
?>
<div id="pjWrapper">
	<div class="container-fluid pjVpContainer">
		<?php 
		include_once ROOT_PATH . PJ_TEMPLATE_PATH . 'default/elements/header.php';
		
		$forgot_url = pjUtil::buildFrontUrl($_SERVER['PHP_SELF']. '?controller=pjListings&amp;action=pjActionForgotPassword', $_GET);
		?>
		<div class="pjVpBody">
			<div class="panel panel-default pjVpPanelAccess">
				<div class="panel-heading">
					<p class="panel-title"><?php __('front_label_forgot_password');?></p><!-- /.panel-title -->
				</div><!-- /.panel-heading -->
							
				<div class="panel-body">
					<div class="row pjVpForm pjVpFormAccess">
						<div class="col-md-7 col-sm-7 col-xs-12 pjVpFormContent">
							<form id="frmVpForgotForm_<?php echo $index;?>" name="frmVpForgotForm" action="<?php echo $forgot_url;?>" method="post"  class="form-horizontal" data-toggle="validator" role="form">
								<input type="hidden" name="forgot_password" value="1" />
								<?php
								if (isset($_GET['err']))
								{
									$forgot_status = __('forgot_status', true);
									if($_GET['err'] == 9900)
									{
										if(isset($_SESSION['FORGOT_STATUS']))
										{
											$statuses = $_SESSION['FORGOT_STATUS'];
											?>
											<div class="alert alert-danger">
												<ul>
													<?php
													foreach($statuses as $k => $v)
													{
														?><li><?php echo $forgot_status[$v];?></li><?php
													}
													?>
												</ul>
											</div>
											<?php
										}
									}else{
										?><div class="alert alert-success"><?php echo $forgot_status[$_GET['err']]; ?></div><?php
									}
								}
								$post = isset($_SESSION['FORGOT_DATA']) ? $_SESSION['FORGOT_DATA'] : null;
								?>
								<div class="form-group">
									<label for="" class="col-lg-3 col-md-3 col-sm-3 col-xs-12 control-label"><?php __('front_label_email'); ?></label>
								
									<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
										<input type="email" name="forgot_email" value="<?php echo !empty($post) && !empty($post['forgot_email']) ? $post['forgot_email'] : null; ?>" class="form-control required pjVpEmail" data-msg-required="<?php __('front_field_required');?>" data-msg-pjVpEmail="<?php __('front_email_invalid');?>"/>
										
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.col-lg-9 col-md-9 col-sm-9 col-xs-12 -->
								</div><!-- /.form-group -->
							
								<div class="form-group">
									<div class="col-sm-9 col-sm-offset-3">
										<button type="submit" class="btn btn-default pjVpBtn pjVpBtnPrimary"><?php __('front_button_send'); ?></button>
	
										<a href="<?php echo $_SERVER['PHP_SELF']?>?controller=pjListings&amp;action=pjActionLogin" class="btn btn-link pjVpBtn pjVpBtnLink"><?php __('front_menu_login', false); ?></a>
										<a href="<?php echo $_SERVER['PHP_SELF']?>?controller=pjListings&amp;action=pjActionRegister" class="btn btn-link pjVpBtn pjVpBtnLink"><?php __('front_menu_register', false); ?></a>
									</div><!-- /.col-sm-9 col-sm-offset-3 -->
								</div><!-- /.form-group -->
							</form><!-- /.form-horizontal -->
						</div><!-- /.col-md-7 col-sm-7 col-xs-12 pjVpFormContent -->
							
						<div class="col-md-5 col-sm-5 col-xs-12 pjVpFormAside">
							<p><?php __('front_forgot_info');?></p>
						</div><!-- /.col-md-5 col-sm-5 col-xs-12 pjVpFormAside -->
					</div><!-- /.row pjVpForm pjVpFormAccess -->
				</div><!-- /.panel-body -->
			</div><!-- /.panel panel-default pjVpPanelAccess -->
		</div>
	</div>
</div>
<?php include_once ROOT_PATH . PJ_TEMPLATE_PATH . 'default/elements/loadjs.php';?>