<?php
/**
 * Page Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2011 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_login_default.php 18695 2011-05-04 05:24:19Z drbyte $
 */
?>
<div class="centerColumn" id="loginDefault">

<?php if ($messageStack->size('login') > 0) echo $messageStack->output('login'); ?>

<?php if ( USE_SPLIT_LOGIN_MODE == 'True' || $ec_button_enabled ) { ?>
<?php //if(false){ ?>
<!--BOF PPEC split login- DO NOT REMOVE-->
<div class="split-layout">
	<div class="row">
		<div class="login-column col-md-6 clearfix">
			<h3 class="section-title"><?php echo HEADING_RETURNING_CUSTOMER_SPLIT; ?></h3>
			<p class="information"><?php echo TEXT_RETURNING_CUSTOMER_SPLIT; ?></p>

			<?php echo zen_draw_form('login', zen_href_link(FILENAME_LOGIN, 'action=process', 'SSL'), 'post', 'id="loginForm"'); ?>
			<div class="form-group">
				<label class="inputLabel" for="login-email-address"><?php echo str_replace(':', '', ENTRY_EMAIL_ADDRESS); ?></label>
				<?php echo zen_draw_input_field('email_address', '', 'size="50" id="login-email-address"'); ?>
			</div>

			<div class="form-group">
				<label class="inputLabel" for="login-password"><?php echo str_replace(':', '', ENTRY_PASSWORD); ?></label>
				<?php echo zen_draw_password_field('password', '', 'size="50" id="login-password"'); ?>
			</div>

			<div class="buttonRow pull-right"><input type="submit" class="pt-button pt-button-vs" value="<?php echo BUTTON_LOGIN_ALT; ?>"></div>
			<div class="buttonRow pull-left"><?php echo '<a href="' . zen_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>'; ?></div>
			</form>
		</div>
		<div class="col-md-6">
			<h3 class="section-title"><?php echo HEADING_NEW_CUSTOMER_SPLIT; ?></h3>
			<?php // ** BEGIN PAYPAL EXPRESS CHECKOUT ** ?>
			<?php if ($ec_button_enabled) { ?>
			<p class="information"><?php echo TEXT_NEW_CUSTOMER_INTRODUCTION_SPLIT; ?></p>

			<p class="center"><?php require(DIR_FS_CATALOG . DIR_WS_MODULES . 'payment/paypal/tpl_ec_button.php'); ?></p>
			<hr />
			<?php //echo TEXT_NEW_CUSTOMER_POST_INTRODUCTION_DIVIDER; ?>
			<?php } ?>
			<?php // ** END PAYPAL EXPRESS CHECKOUT ** ?>
			<p class="information"><?php echo TEXT_NEW_CUSTOMER_POST_INTRODUCTION_SPLIT; ?></p>

			<?php echo zen_draw_form('create', zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL')); ?>
			<div class="buttonRow pull-right"><input type="submit" class="pt-button pt-button-vs" name="registrationButton" value="<?php echo BUTTON_CREATE_ACCOUNT_ALT; ?>"></div>
			</form>
		</div>
	</div>
</div>
<!--EOF PPEC split login- DO NOT REMOVE-->
<?php } else { ?>
<!--BOF normal login-->
<div class="stacked-layout">
	<?php if ($_SESSION['cart']->count_contents() > 0) { ?>
	<p class="advisory text-danger"><?php echo TEXT_VISITORS_CART; ?></p>
	<?php } ?>

	<?php echo zen_draw_form('login', zen_href_link(FILENAME_LOGIN, 'action=process', 'SSL'), 'post', 'id="loginForm"'); ?>
	<h2><?php echo HEADING_RETURNING_CUSTOMER; ?></h2>
	<div class="form-group">
		<label class="inputLabel" for="login-email-address"><?php echo str_replace(':', '', ENTRY_EMAIL_ADDRESS); ?></label>
		<?php echo zen_draw_input_field('email_address', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', '40') . ' id="login-email-address"'); ?>
	</div>
	<div class="form-group">
		<label class="inputLabel" for="login-email-address"><?php echo str_replace(':', '', ENTRY_PASSWORD); ?></label>
		<?php echo zen_draw_password_field('password', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_password') . ' id="login-password"'); ?>
	</div>
	<?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>

	<div class="buttonRow pull-right"><input type="submit" class="pt-button" value="<?php echo BUTTON_LOGIN_ALT; ?>"></div>
	<div class="buttonRow pull-left"><?php echo '<a href="' . zen_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>'; ?></div>
	<div class="clearfix"></div>
	</form>

	<?php echo zen_draw_form('create_account', zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'post', 'onsubmit="return check_form(create_account);" id="createAccountForm"') . zen_draw_hidden_field('action', 'process') . zen_draw_hidden_field('email_pref_html', 'email_format'); ?>
	<h2><?php echo HEADING_NEW_CUSTOMER; ?></h2>

	<p><?php echo TEXT_NEW_CUSTOMER_INTRODUCTION; ?></p>

	<?php require($template->get_template_dir('tpl_modules_create_account.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_create_account.php'); ?>

	<br>
	<div class="buttonRow pull-right"><input type="submit" class="pt-button" value="<?php echo BUTTON_SUBMIT_ALT; ?>"></div>
	</form>
</div>
<!--EOF normal login-->
<?php } ?>
</div>