<?php
namespace Modules\Admin\AgencyCreditCards;

class View_Utils_FormDetails extends \App\Mvc\View_Utils_FormAbstract
{

	/**
	 * (non-PHPdoc)
	 * @see \App\Mvc\View_Utils_FormAbstract::getForm()
	 */
	public function getForm()
	{
		$form=\Engine\Form\General::create();

		// add container
		$fieldset=\Engine\Form\Container\Fieldset::create();
		$form->addContainer($fieldset);

		$fld = new \Engine\Form\Input\Label();
		$fld->setStyle('noLabel', true);
		$fld->setDetails($this->lang['details']['label']);
		$form->addElement($fld);
		
		// name
		$name = \Engine\Form\Input\Text::create($this->lang['details']['name'], 'name', $this->values['ccName']);
		$name->setDisabled();
		$fieldset->addElement($name);
		
		// masked/unmasked number
		$ccNumber = \Engine\Form\Input\Text::create($this->lang['details']['ccNumber'], 'ccNumber', $this->values['ccNumber']);
		$ccNumber->setDisabled();
		$fieldset->addElement($ccNumber);
		
		// expire date
		$ccExpireDate = \Engine\Form\Input\Text::create($this->lang['details']['ccExpireDate'], 'ccExpireDate', $this->values['ccExpireYm']);
		$ccExpireDate->setDisabled();
		$fieldset->addElement($ccExpireDate);
		
		// company
		$ccCompany = \Engine\Form\Input\Text::create($this->lang['details']['ccCompany'], 'ccCompany', $this->values['ccCompany']);
		$ccCompany->setDisabled();
		$fieldset->addElement($ccCompany);
		
		$form->addElement(\Engine\Form\Input\Hidden::create('', $this->submitButtonName, 1));
		return $form;

	}

}