<?php
mt_srand();
$index = mt_rand(1, 9999);
?>
<div id="pjWrapper" style="display:none;">
	<div class="container-fluid pjVpContainer">
		<?php 
		include_once ROOT_PATH . PJ_TEMPLATE_PATH . 'default/elements/header.php';
		
		?>
		<div class="pjVpBody">
			<div class="panel panel-default pjVpPanelAccess">
				<div class="panel-heading">
					<p class="panel-title"><?php __('front_menu_register');?></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="pjVpRegisterForm_<?php echo $index;?>" name="pjVpRegisterForm" action="<?php echo $register_url; ?>" method="post" class="form-horizontal" data-toggle="validator" role="form">
								<input type="hidden" name="register" value="1" />
								<input type="hidden" name="folder" value="<?php echo PJ_INSTALL_FOLDER; ?>" />
								
								<?php
								if (isset($_GET['err']))
								{
									$register_status = __('register_status', true);
									if($_GET['err'] == 9900)
									{
										if(isset($_SESSION['REGISTER_STATUS']))
										{
											$statuses = $_SESSION['REGISTER_STATUS'];
											?>
											<div class="alert alert-danger">
												<ul>
													<?php
													foreach($statuses as $k => $v)
													{
														?><li><?php echo $register_status[$v];?></li><?php
													}
													?>
												</ul>
											</div>
											<?php
										}
									}else{
										?><div class="alert alert-success"><?php echo $register_status[$_GET['err']]; ?></div><?php
									}
								}
								$post = isset($_SESSION['REGISTER_DATA']) ? $_SESSION['REGISTER_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_name'); ?></label>
								
									<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
										<input type="text" name="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><!-- /.col-lg-9 col-md-9 col-sm-9 col-xs-12 -->
								</div><!-- /.form-group -->
							
								<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="email" 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">
									<label for="" class="col-lg-3 col-md-3 col-sm-3 col-xs-12 control-label"><?php __('front_label_password'); ?></label>
								
									<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
										<input type="password" id="pjVpRegisterPassword" 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><!-- /.col-lg-9 col-md-9 col-sm-9 col-xs-12 -->
								</div><!-- /.form-group -->

								<div class="form-group">
									<label for="" class="col-lg-3 col-md-3 col-sm-3 col-xs-12 control-label"><?php __('front_label_retype_password'); ?></label>
								
									<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
										<input type="password" name="retype_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><!-- /.col-lg-9 col-md-9 col-sm-9 col-xs-12 -->
								</div><!-- /.form-group -->
							
								<div class="form-group pjVpFormGroupCaptcha">
									<label for="" class="col-lg-3 col-md-3 col-sm-3 col-xs-12 control-label"><?php __('front_label_captcha'); ?></label>
								
									<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
										<div class="row">
											<div class="col-lg-5 col-md-6 col-sm-6 col-xs-7">
												<input id="pjVpCaptchaField" type="text" name="captcha" class="form-control required" maxlength="6" autocomplete="off" data-msg-required="<?php __('front_field_required');?>" data-msg-remote="<?php __('front_captcha_incorrect');?>"/>
											</div><!-- /.col-lg-3 col-md-4 col-sm-4 col-xs-5 -->
			
											<div class="col-lg-3 col-md-3 col-sm-4 col-xs-5">
												<img id="pjVpCaptchaImage" class="property-captcha" src="<?php echo PJ_INSTALL_FOLDER;?>index.php?controller=pjFront&amp;action=pjActionCaptcha&amp;rand=<?php echo rand(1, 999999); ?>" alt="CAPTCHA" style="vertical-align: middle;cursor: pointer;" />
											</div><!-- /.col-lg-3 col-md-3 col-sm-4 col-xs-5 -->
										</div><!-- /.row -->
										<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 pjVpFormGroupCaptcha -->
							
								<div class="form-group">
									<label for="" class="col-lg-3 col-md-3 col-sm-3 col-xs-12 control-label">&nbsp;</label>
									<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
										<button type="submit" class="btn btn-default pjVpBtn pjVpBtnPrimary"><?php __('front_button_register', false);?></button>
									</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_register_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';?>