<?php
/**
 * Login Form
 *
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     2.1.0
 */

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

global $woocommerce;

$email_for_username = get_option( 'woocommerce_registration_email_for_username' );

?>

<?php wc_print_notices(); ?>

<?php do_action('woocommerce_before_customer_login_form'); ?>

<div class="row">

	<?php if ( get_option('woocommerce_enable_myaccount_registration') == 'yes' ) { ?>
		<div class="span6">
			<div class="box-wrapper">

				<form method="post" class="register">

					<div class="inside min-height">

						<h4><?php _e( 'Register', 'woocommerce' ); ?></h4>

						<p><?php _e('By creating an account with our store, you will be able to move through the checkout process faster, store multiple shipping addresses, view and track your orders in your account and more.', 'buyshop'); ?></p>

							<div class="<?php echo ( $email_for_username == 'no' ? 'span3' : 'span6' ); ?>">
								<?php if ( $email_for_username == 'no' ) : ?>

									<p><label for="reg_username"><?php _e( 'Username', 'woocommerce' ); ?> <span class="required">*</span></label></p>
									<input type="text" class="input-text" name="username" id="reg_username" value="<?php if (isset($_POST['username'])) echo esc_attr($_POST['username']); ?>" />

								<p>

								<?php else : ?>

									<p>

								<?php endif; ?>

									<label for="reg_email"><?php _e( 'Email', 'woocommerce' ); ?> <span class="required">*</span></label>
								</p>
								<input type="email" class="input-text<?php if ( $email_for_username != 'no' ) { echo ' fullwidth'; } ?>" name="email" id="reg_email" value="<?php if (isset($_POST['email'])) echo esc_attr($_POST['email']); ?>" />
							</div>
							<div class="span3">
								<p><label for="reg_password"><?php _e( 'Password', 'woocommerce' ); ?> <span class="required">*</span></label></p>
								<input type="password" class="input-text" name="password" id="reg_password" value="<?php if (isset($_POST['password'])) echo esc_attr($_POST['password']); ?>" />

								<?php
								if ( $email_for_username != 'no' ) {
									echo '</div><div class="span3">';
								}
								?>

								<p><label for="reg_password2"><?php _e( 'Re-enter password', 'woocommerce' ); ?> <span class="required">*</span></label></p>
								<input type="password" class="input-text" name="password2" id="reg_password2" value="<?php if (isset($_POST['password2'])) echo esc_attr($_POST['password2']); ?>" />
							</div>
							<!-- Spam Trap -->
							<div style="left:-999em; position:absolute;"><label for="trap">Anti-spam</label><input type="text" name="email_2" id="trap" tabindex="-1" /></div>

							<?php do_action( 'register_form' ); ?>

					</div>
					<div class="line"></div>


					<div class="inside">
						<div class="wrapper">
							<div class="pull-right">
								<?php wp_nonce_field('woocommerce-register') ?>
								<input type="submit" class="button button-2x" name="register" value="<?php _e( 'Register', 'woocommerce' ); ?>" />
							</div>
						</div>
					</div>

				</form>
			</div>
		</div>
	<?php } //endif; ?>

	<div class="span6">


		<div class="box-wrapper">

			<form method="post" class="login">

				<div class="inside min-height">
					<h4><?php _e( 'Login', 'woocommerce' ); ?></h4>
					<p><?php _e('If you have an account with us, please log in.', 'buyshop'); ?></p>

					<p><label for="username"><?php _e( 'Username or email', 'woocommerce' ); ?> <span class="required">*</span></label></p>
					<input type="text" class="input-text" name="username" id="username" />

					<p><label for="password"><?php _e( 'Password', 'woocommerce' ); ?> <span class="required">*</span></label></p>
					<input class="input-text" type="password" name="password" id="password" />
					<p> * Required Fields</p>


				</div>
				<div class="line"></div>
				<div class="inside">
					<div class="wrapper">

						<?php wp_nonce_field('woocommerce-login'); ?>

						<div class="pull-left margin-2">

							<a class="lost_password custom_color" href="<?php

							$lost_password_page_id = woocommerce_get_page_id( 'lost_password' );

							if ( $lost_password_page_id ) {
								echo esc_url( get_permalink( $lost_password_page_id ) );
							} else {
								echo esc_url( wp_lostpassword_url( home_url() ) );
							}

							?>"><?php _e( 'Lost Password?', 'woocommerce' ); ?></a>
						</div>
						<div class="pull-right">
							<input type="submit" class="button button-2x" name="login" value="<?php _e( 'Login', 'woocommerce' ); ?>" />
						</div>
					</div>
				</div>
			</form>
		</div>

	</div>



</div>
<?php do_action('woocommerce_after_customer_login_form'); ?>