<?php

// login.tpl
// -----------------------------------------------------------------------------
// Login template
//
// Revision   > $Rev: 109 $
// Date		  > $Date: 2009-08-06 13:44:56 +0100 (Thu, 06 Aug 2009) $
// Author     > RAK for DML
// Copyright  > (C) Digital Mail Limited (2005-2009)
// -----------------------------------------------------------------------------

?>

<!--------------------->
<!-- LOGIN COMPONENT -->
<!--------------------->

<script language="javascript" type="text/javascript">

// CREATE 'PUBLIC' JS INTERFACE FOR COMPONENT
dmx.<?=$comp_name;?> = new Object();
dmx.<?=$comp_name;?>.name  = '<?=$comp_name;?>';
dmx.<?=$comp_name;?>.xclass = 'login';

</script>

<div class="dmb0" style="<?=$comp_width;?>">
<div class="dmx">
<div class="login">
<div class="<?=$variant;?>">
<div class="<?=$comp_name;?>">

<?php if ($showheader && $showborder) : ?>
<h1 class="bordered">Login to your account</h1>
<?php elseif ($showheader) : ?>
<h1>Login to your account</h1>
<?php endif; ?>

<?php if ($showborder) : ?>
<div class="border" style="<?=$box_size;?>">
<?php else: ?>
<div style="<?=$box_size;?>">
<?php endif; ?>

<?php if (!$err_msg) : ?>

<?php if ($showpreamble) : ?>
<p>
<b>If you are a new customer</b> <a href="<?=DMX_SELF;?>?dmx_action=go_to_register&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=login">create&nbsp;an&nbsp;account</a> that includes your contact and security details.
</p>

<p>
<b>If you are an existing customer</b> login to your account to receive special offers and discounts, and to complete your order.
</p>
<?php endif; ?>

<form action="<?=DMX_SELF;?>" method="post" name="<?=$comp_name?>">
<input type="hidden" name="dmx_comp_class" value="login">
<input type="hidden" name="dmx_comp_name" value="<?=$comp_name?>">
<input type="hidden" name="dmx_rc" value="<?=$rc_forms;?>">

<?php if ($comp_err_msg) : ?>
<span class="error"><?=$comp_err_msg;?><br></span>
<?php elseif ($comp_msg) : ?>
<?=$comp_msg;?><br>
<?php endif; ?>

<?php if ($variant == 'full') : ?>
	<table>
	<tr>
		<td style="text-align: right">
			<span class="infotext">Email address<span class="tipcontents"><b>Email address:</b> The email address you used to create your account</span></span>
			&nbsp;
		</td>
		<td><input name="dmx_email" type="text" value="<?=$form['value']['dmx_email'];?>" class="form_text_field<?=$form['error']['dmx_email'];?>" size="20" maxlength="60"></td>
	</tr>
	<tr>
		<td style="text-align: right">
			<span class="infotext">PIN<span class="tipcontents"><b>PIN:</b> The 4-digit security code you chose when you first created an account with us</span></span>
			&nbsp;
		</td>
		<td><input name="dmx_pin" type="password" class="form_text_field<?=$form['error']['dmx_pin']?>" size="20" maxlength="10"></td>
	</tr>
	<tr><td colspan="2"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="5" alt=""></td></tr>
	<tr>
		<td></td>
		<td>
			<input type="hidden" name="dmx_action" value="login">
			<div class="grabut_left_<?=$grabut_suffix;?>"><ul><li><a href="" onclick="tst_submit_form(document.forms.<?=$comp_name;?>); event.cancelBubble=true; return false;">Login</a></li></ul></div>
		</td>
	</tr>
	<?php if (!$showpreamble) : ?>
	<tr>
		<td></td>
		<td>
			<p>
			<a href="" onclick="b0_set_form_field('<?=$comp_name;?>', 'dmx_action', 'reminder'); tst_submit_form(document.forms.<?=$comp_name;?>); event.cancelBubble=true; return false;" class="infotext">PIN Reminder<span class="tipcontents"><b>PIN Reminder:</b> Enter your email address then click 'PIN Reminder' to receive a reminder of your PIN</span></a>
			&nbsp;|&nbsp;
			<a href="<?=DMX_SELF;?>?dmx_action=go_to_register&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=login" class="infotext">Create&nbsp;account<span class="tipcontents"><b>Create account:</b> If you are a new customer register your security and contact details</span></a>
			</p>
		</td>
	</tr>
	<?php endif; ?>
	</table>
<?php endif; ?>
				
<?php if ($variant == 'compact') : ?>
	<form action="<?=DMX_SELF;?>" method="post" name="<?=$comp_name?>">
	<table>
	<tr>
		<td style="text-align: right">
			<span class="infotext">Email<span class="tipcontents"><b>Email address:</b> The email address you used to create your account</span></span>
			&nbsp;
		</td>
		<td colspan="2"><input name="dmx_email" value="<?=$form['value']['dmx_email'];?>" type="text" class="form_text_field<?=$form['error']['dmx_email'];?>" size="20" maxlength="60"></td>
	</tr>
	<tr>
		<td style="text-align: right">
			<span class="infotext">PIN<span class="tipcontents"><b>PIN:</b> The 4-digit security code you chose when you first created an account with us</span></span>
			&nbsp;
		</td>
		<td colspan="2"><input name="dmx_pin" type="password" class="form_text_field<?=$form['error']['dmx_pin'];?>" size="20" maxlength="10"></td>
	</tr>
	<tr><td colspan="3"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="5" alt=""></td></tr>
	<tr>
		<td></td>
		<td>
			<input type="hidden" name="dmx_action" value="login">
			<div class="grabut_left_<?=$grabut_suffix;?>"><ul><li><a href="" onclick="tst_submit_form(document.forms.<?=$comp_name;?>); event.cancelBubble=true; return false;">Login</a></li></ul></div>
		</td>
		<td></td>
	</tr>
	<?php if (!$showpreamble) : ?>
	<tr><td colspan="3"></td></tr>
	<tr>
		<td colspan="3">
			<a href="" onclick="b0_set_form_field('<?=$comp_name;?>', 'dmx_action', 'reminder'); tst_submit_form(document.forms.<?=$comp_name;?>); event.cancelBubble=true; return false;" class="infotext">PIN&nbsp;Reminder<span class="tipcontents"><b>PIN Reminder:</b> Enter your email address then click 'PIN Reminder' to receive a reminder of your PIN</span></a>
			&nbsp;&nbsp;&nbsp;
			<a href="<?=DMX_SELF;?>?dmx_action=go_to_register&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=login" class="infotext:>Create&nbsp;Account<span class="tipcontents"><b>Create account:</b> If you are a new customer register your security and contact details</span></a>
		</td>
	</tr>
	<?php endif; ?>
	</tr>
	</table>
<?php endif; ?>

</form>
	
<?php if ($showpreamble) : ?>
<p>
If you have forgotten your PIN number, just enter your email address and click <a href="" onclick="b0_set_form_field('<?=$comp_name;?>', 'dmx_action', 'reminder'); tst_submit_form(document.forms.<?=$comp_name;?>); event.cancelBubble=true; return false;">PIN Reminder</a>, and we will email you a reminder.
</p>
<?php endif; ?>

<?php else : ?>
<!-- ERROR HANDLING -->
	<div style="vertical-align: middle;">
	<img src="<?=$dmx_glib;?>interface/error_32.gif" alt="" width="36" height="32" border="0" style="float: left; padding: 0 10px 0 0;"><span class="error">ERROR<br><?=$err_msg;?>
	</div>
<!-- END ERROR HANDLING -->
<?php endif; ?>

</div>

</div>
</div>
</div>
</div>
</div>

<!------------------------->
<!-- END LOGIN COMPONENT -->
<!------------------------->
