<?php
mt_srand();
$index = mt_rand(1, 9999);
$listing_for = __('listing_for', true);
?>
<div id="ylContainer_<?php echo $index;?>" class="ylContainer">
	<?php include_once ROOT_PATH . PJ_TEMPLATE_PATH . $tpl['option_arr']['o_layout']. '/elements/header.php';?>
	<div class="ylMain">
		<div class="ylDetails">
			<div class="ylDetailsHead">
				<h1><?php __('front_my_account');?></h1>
			</div><!-- /.ylDetailsHead -->
		</div><!-- ylDetails -->
		<div class="ylDetailsInfo ylForm ylDetailsInfoSecondary">
			
			<div class="ylFormCol">
				<form action="<?php echo PJ_INSTALL_URL;?>index.php?controller=pjAdmin&amp;action=pjActionLogin" method="post" target="_blank" id="frmYLLogin_<?php echo $index;?>" name="frmYLLogin">
					<input type="hidden" name="login_user" value="1" />
					<?php
					if (isset($_GET['iframe']))
					{
						?><input type="hidden" name="iframe" value="" /><?php
					}
					?>
					<div class="ylFormRow">
						<h2><?php __('front_login_your_account');?> <small><?php __('front_manage_your_listing');?></small></h2>
					</div><!-- /.ylFormRow -->
					
					<div class="ylFormRow">
						<label><?php __('front_email');?>:</label>

						<input type="email" name="login_email" placeholder="<?php __('front_email');?>" class="ylField required email" data-err="<?php __('front_email_required');?>" data-email="<?php __('front_email_invalid');?>">
					</div><!-- /.ylFormRow -->

					<div class="ylFormRow">
						<label><?php __('front_password');?>:</label>

						<input type="password" name="login_password" placeholder="<?php __('front_password');?>" class="ylField required" data-err="<?php __('front_password_required');?>">
					</div><!-- /.ylFormRow -->

					<div class="ylFormControls">
						<input class="ylBtn ylBtnSubmit" type="submit" value="<?php __('front_login');?>">&nbsp;&nbsp;<a href="?controller=pjListings&amp;action=pjActionForgot"><?php __('front_forgot_password');?></a>
					</div><!-- /.ylFormRow -->
				</form>
			</div><!-- /.ylFormCol -->
			
			<div class="ylFormCol">
				<form action="?controller=pjListings&amp;action=pjActionAccount" method="post" id="frmYLRegister_<?php echo $index;?>" name="frmYLRegister">
					<input type="hidden" name="register" value="1" />
					<div class="ylFormRow">
						<h2><?php __('front_create_an_account');?> <small><?php __('front_manage_your_listing');?></small></h2>
					</div><!-- /.ylFormRow -->
					
					<?php
					if(isset($tpl['err']))
					{ 
						$register_err = __('register_err', true);
						?>
						<div class="ylFormRow">
							<span class="ylFormError"><?php echo $register_err[$tpl['err']];?></span>
						</div>
						<br/>
						<?php
					} 
					?>
					<?php
					if(isset($_GET['status']))
					{ 
						$register_statuses = __('register_statuses', true);
						?>
						<div class="ylFormRow">
							<span class="ylFormSuccess"><?php echo $register_statuses[$_GET['status']];?></span>
						</div>
						<br/>
						<?php
					} 
					?>
					
					<div class="ylFormRow">
						<label><?php __('front_name');?>:</label>
						<input type="text" name="name" class="ylField required" data-err="<?php __('front_name_required');?>" value="<?php echo isset($_POST['name']) ? htmlspecialchars(stripslashes($_POST['name'])) : null;?>"/>
					</div><!-- /.ylFormRow -->
					<div class="ylFormRow">
						<label><?php __('front_email');?>:</label>
						<input type="text" name="email" class="ylField required email" data-err="<?php __('front_email_required');?>" data-email="<?php __('front_email_invalid');?>" value="<?php echo isset($_POST['email']) ? htmlspecialchars(stripslashes($_POST['email'])) : null;?>"/>
					</div><!-- /.ylFormRow -->
					<div class="ylFormRow">
						<label><?php __('front_password');?>:</label>
						<input type="password" name="password" class="ylField required" data-err="<?php __('front_password_required');?>"/>
					</div><!-- /.ylFormRow -->
					<div class="ylFormRow">
						<label><?php __('front_reenter_password');?>:</label>
						<input type="password" name="reenter_password" class="ylField required" data-err="<?php __('front_reenter_password_required');?>" data-match="<?php __('front_password_match');?>"/>
					</div><!-- /.ylFormRow -->
					<div class="ylFormRow">
						<label><?php __('front_phone');?>:</label>
						<input type="text" name="phone" class="ylField" value="<?php echo isset($_POST['phone']) ? htmlspecialchars(stripslashes($_POST['phone'])) : null;?>"/>
					</div><!-- /.ylFormRow -->
					<div class="ylFormRow">
						<label><?php __('front_fax');?>:</label>
						<input type="text" name="phone" class="ylField" value="<?php echo isset($_POST['phone']) ? htmlspecialchars(stripslashes($_POST['phone'])) : null;?>"/>
					</div><!-- /.ylFormRow -->
					<div class="ylFormRow">
						<label><?php __('front_captcha')?>:</label>
						<div class="ylFormColInner">
							<input type="text" name="captcha" class="ylField ylCaptchaField required" maxlength="6" data-folder="<?php echo PJ_INSTALL_FOLDER;?>" data-err="<?php __('front_captcha_required');?>" data-captcha="<?php __('front_captcha_incorrect');?>"/>
							<img 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:top;"/>
						</div>
					</div><!-- /.ylFormRow -->
					<div class="ylFormControls">
						<input class="ylBtn ylBtnSubmit" type="submit" value="<?php __('front_button_create');?>">
					</div><!-- /.ylFormRow -->
				</form>
			</div><!-- /.ylFormCol -->
		</div><!-- ylDetailsInfo -->
	</div><!-- /.ylMain -->
</div>
<?php include_once ROOT_PATH . PJ_TEMPLATE_PATH . $tpl['option_arr']['o_layout']. '/elements/loadjs.php';?>