<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
    'id'=>'vehicle-owner-form',
    'enableAjaxValidation'=>false,
)); ?>

<p class="help-block">
	<?php echo(t('Fields with <span class="required">*</span> are required.')); ?>
</p>

<?php 

echo $form->errorSummary($model);

if(user()->checkAccess('vehicle_owner_management_full') || user()->checkAccess('vehicle_owner_create'))
{
  echo $form->textFieldRow($model,'Nome',array('class'=>'span5','maxlength'=>250));

  echo $form->textFieldRow($model,'Cognome',array('class'=>'span5','maxlength'=>250));

  echo $form->textFieldRow($model,'ID1',array('class'=>'span5','maxlength'=>20));

  echo $form->textFieldRow($model,'ID2',array('class'=>'span5','maxlength'=>20));

  echo $form->textFieldRow($model,'Categoria',array('class'=>'span5','maxlength'=>20));

  echo $form->textFieldRow($model,'epoch',array('class'=>'span5'));

  echo $form->textFieldRow($model,'list_code',array('class'=>'span5'));

  echo $form->textFieldRow($model,'email',array('class'=>'span5','maxlength'=>255));

  echo $form->textFieldRow($model,'address',array('class'=>'span5','maxlength'=>255));

  echo $form->textFieldRow($model,'city',array('class'=>'span5','maxlength'=>255));

  echo $form->textFieldRow($model,'phone',array('class'=>'span5','maxlength'=>255));

  echo $form->textAreaRow($model,'Note',array('class'=>'span5','maxlength'=>250));
}
else 
if(user()->checkAccess('vehicle_owner_management_identity'))
{
  echo $form->textFieldRow($model,'Nome',array('class'=>'span5','maxlength'=>250));

  echo $form->textFieldRow($model,'Cognome',array('class'=>'span5','maxlength'=>250));

  echo $form->textFieldRow($model,'email',array('class'=>'span5','maxlength'=>255));

  echo $form->textFieldRow($model,'address',array('class'=>'span5','maxlength'=>255));

  echo $form->textFieldRow($model,'city',array('class'=>'span5','maxlength'=>255));

  echo $form->textFieldRow($model,'phone',array('class'=>'span5','maxlength'=>255));

  echo $form->textAreaRow($model,'Note',array('class'=>'span5','maxlength'=>250));
  
}
else
if(user()->checkAccess('vehicle_owner_management_contacts'))
{
  echo("<h2>$model->FullName</h2>");
  
  echo $form->textFieldRow($model,'email',array('class'=>'span5','maxlength'=>255));

  echo $form->textFieldRow($model,'address',array('class'=>'span5','maxlength'=>255));

  echo $form->textFieldRow($model,'city',array('class'=>'span5','maxlength'=>255));

  echo $form->textFieldRow($model,'phone',array('class'=>'span5','maxlength'=>255));

  echo $form->textAreaRow($model,'Note',array('class'=>'span5','maxlength'=>250));

}


?>

<div class="form-actions">
	<?php $this->widget('bootstrap.widgets.TbButton', array(
	    'buttonType'=>'submit',
	    'type'=>'primary',
	    'label'=>$model->isNewRecord ? 'Create' : 'Save',
		)); ?>
</div>

<?php $this->endWidget(); ?>
