<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'book-form',
	'enableAjaxValidation'=>false,
    'htmlOptions' => array('enctype'=>'multipart/form-data'),
    )
);?>
<fieldset>
    <legend></legend>
	<p class="note"><span class="required">*</span> 字段为必填</p>

	<?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php if (!$model->isNewRecord):?>
            <?php echo CHtml::image($model->getCoverUrl());?>
        <?php endif;?>
		<?php echo $form->labelEx($model,'image'); ?>
		<?php echo $form->fileField($model,'image');?>
		<?php echo $form->error($model,'image'); ?>
	</div>
    
	<div class="row">
		<?php echo $form->labelEx($model,'bookname'); ?>
		<?php echo $form->textField($model,'bookname',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'bookname'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'aliasname'); ?>
		<?php echo $form->textField($model,'aliasname',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'aliasname'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'typeid'); ?>
		<?php echo $form->dropDownList($model,'typeid',CHtml::listData($types, 'typeid', 'typename')); ?>
		<?php echo $form->error($model,'typeid'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'author'); ?>
		<?php echo $form->textField($model,'author',array('size'=>30,'maxlength'=>30)); ?>
		<?php echo $form->error($model,'author'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'bookinfo'); ?>
		<?php echo $form->textArea($model,'bookinfo',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'bookinfo'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'isvip'); ?>
		<?php echo $form->dropDownList($model,'isvip',Books::$_isvip); ?>
		<?php echo $form->error($model,'isvip'); ?>
	</div>
	
    <div class="row">
		<?php echo $form->labelEx($model,'status'); ?>
		<?php echo $form->dropDownList($model,'status',Books::$_status); ?>
		<?php echo $form->error($model,'status'); ?>
	</div>

    <div class="row">
		<?php echo $form->labelEx($model,'view'); ?>
		<?php echo $form->dropDownList($model,'view',Books::$_view); ?>
		<?php echo $form->error($model,'view'); ?>
	</div>

    <div class="row">
		<?php echo $form->labelEx($model,'nature'); ?>
		<?php echo $form->dropDownList($model,'nature',Books::$_nature); ?>
		<?php echo $form->error($model,'nature'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'type'); ?>
		<?php echo $form->dropDownList($model,'type',Books::$_type); ?>
		<?php echo $form->error($model,'type'); ?>
	</div>

    <div class="row">
		<?php echo $form->labelEx($model,'commend'); ?>
		<?php echo $form->dropDownList($model,'commend',Books::$_command); ?>
		<?php echo $form->error($model,'commend'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? '创建' : '保存'); ?>
	</div>
</fieldset>

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

</div>