<?php
if (isset($tpl['status']))
{
	$status = __('status', true);
	switch ($tpl['status'])
	{
		case 2:
			pjUtil::printNotice(NULL, $status[2]);
			break;
	}
} else {
	include_once PJ_VIEWS_PATH . 'pjLayouts/elements/custmenu.php';
	pjUtil::printNotice(__('infoAddCustomerTitle', true), __('infoAddCustomerDesc', true)); 
	?>
	<form action="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminCustomers&amp;action=pjActionCreate" method="post" id="frmCreateCustomer" class="form pj-form" autocomplete="off">
		<input type="hidden" name="customer_create" value="1" />
		<?php
		foreach($tpl['token_arr'] as $token)
		{ 
			?>
			<p>
				<label class="title"><?php echo pjSanitize::html($token['title']); ?></label>
				<span class="inline_block">
					<input type="text" name="token_<?php echo $token['id']?>" class="pj-form-field w300<?php echo in_array($token['id'], array(1, 2, 3)) ? ' required' : null; ?><?php echo in_array($token['id'], array(3)) ? ' email' : null; ?>" data-msg-required="<?php __('lblFieldRequired');?>"<?php echo $token['id'] == 3 ? ' data-msg-email="'.__('lblEmailInvalid', true).'"' : null;?><?php echo $token['id'] == 3 ? ' data-msg-remote="'.__('lblEmailUsed', true).'"' : null;?>/>
				</span>
			</p>
			<?php
		} 
		?>
		<p>
			<label class="title"><?php __('lblStatus'); ?></label>
			<span class="inline_block">
				<select name="status" id="status" class="pj-form-field required" data-msg-required="<?php __('lblFieldRequired');?>" >
					<option value="">-- <?php __('lblChoose'); ?>--</option>
					<?php
					foreach (__('u_statarr', true) as $k => $v)
					{
						?><option value="<?php echo $k; ?>"<?php echo $k == 'T' ? ' selected="selected"' : NULL;?>><?php echo $v; ?></option><?php
					}
					?>
				</select>
			</span>
		</p>
		<p>
			<label class="title">&nbsp;</label>
			<input type="submit" value="<?php __('btnSave'); ?>" class="pj-button" />
			<input type="button" value="<?php __('btnCancel'); ?>" class="pj-button" onclick="window.location.href='<?php echo PJ_INSTALL_URL; ?>index.php?controller=pjAdminCustomers&action=pjActionIndex';" />
		</p>
	</form>
	<?php
}
?>