<?php
/**
 * aheadWorks Co.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://ecommerce.aheadworks.com/LICENSE-M1.txt
 *
 * @category   AW
 * @package    AW_Mobile
 * @copyright  Copyright (c) 2010-2011 aheadWorks Co. (http://www.aheadworks.com)
 * @license    http://ecommerce.aheadworks.com/LICENSE-M1.txt
 */
?>
<div class="page-head">
    <h3><?php echo $this->__('Edit Account Information') ?></h3>
</div>
<div class="account-page">
    <form action="<?php echo $this->getUrl('customer/account/editPost') ?>" method="post" id="form-validate">
    <?php echo $this->getBlockHtml('formkey')?>
    <fieldset class="group-select">
        <h4 class="legend"><?php echo $this->__('Account Information') ?></h4>
        <ul class="form-list">
            <li>
                <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getCustomer())->toHtml() ?>
            </li>
            <li>
                    <div><label for="email"><?php echo $this->__('Email Address') ?> <span class="required">*</span>&nbsp;</label></div>
                    <div class="input-box"><input type="text" name="email" id="email" value="<?php echo $this->htmlEscape($this->getCustomer()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="required-entry validate-email input-text" /></div>
            </li>
<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
<?php if ($_dob && $_dob->isEnabled()): ?>
            <li><?php echo $_dob->setDate($this->getCustomer()->getDob())->toHtml() ?></li>
<?php endif ?>
<?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
<?php if ($_taxvat && $_taxvat->isEnabled()): ?>
            <li><?php echo $_taxvat->setTaxvat($this->getCustomer()->getTaxvat())->toHtml() ?></li>
<?php endif ?>
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
<?php if ($_gender && $_gender->isEnabled()): ?>
    <li><?php echo $_gender->setGender($this->getCustomer()->getGender())->toHtml() ?></li>
<?php endif ?>
        </ul>
    </fieldset>
    <div class="col2-set">
        <div class="col-1"><p class="bottom-space"><input type="checkbox" name="change_password" id="change_password" value="1" onclick="setPasswordForm(this.checked)" title="<?php echo $this->__('Change Password') ?>"<?php if($this->getCustomer()->getChangePassword()==1): ?> checked="checked"<?php endif; ?> /> <label for="change_password"><?php echo $this->__('Change Password') ?></label></p>
         </div>
         <div class="col-2"><p class="required" style="margin-top:5px"><?php echo $this->__('* Required Fields') ?></p>
         </div>
    </div>
  <div class="clear"></div>
    <fieldset class="group-select" style="display:none">
        <h4 class="legend"><?php echo $this->__('Change Password') ?></h4>
        <ul class="form-list bottom-space">
            <li>
                    <div><label for="current_password"><?php echo $this->__('Current Password') ?></label></div>
                    <div class="input-box"><input type="password" class="input-text" name="current_password" id="current_password" /></div>
            </li>
            <li>
                    <div><label for="password"><?php echo $this->__('New Password') ?></label></div>
                    <div class="input-box"><input type="password" class="validate-password input-text" name="password" id="password" /></div>
            </li>
            <li>
                    <div><label for="confirmation"><?php echo $this->__('Confirm New Password') ?></label></div>
                    <div class="input-box"><input type="password" class="validate-cpassword input-text" name="confirmation" id="confirmation" /></div>
            </li>
        </ul>
    </fieldset>
        
        <div class="a-center">
            <div class="form-buttons">
                <button type="submit" class="form-button"><span><?php echo $this->__('Save') ?></span></button>
            </div>
        </div>
    </form><br />
</div>
<script type="text/javascript">
    var dataForm = new VarienForm('form-validate', true);
    function setPasswordForm(arg){
        if(arg){
            $('current_password').up(3).show();
            $('current_password').addClassName('required-entry');
            $('password').addClassName('required-entry');
            $('confirmation').addClassName('required-entry');

        }else{
            $('current_password').up(3).hide();
            $('current_password').removeClassName('required-entry');
            $('password').removeClassName('required-entry');
            $('confirmation').removeClassName('required-entry');
        }
    }
    <?php if($this->getCustomer()->getChangePassword()): ?>
        setPasswordForm(true);
    <?php endif; ?>
</script>
