<?php
/* @var $this PaperController */
/* @var $model Paper */
/* @var $form CActiveForm */
?>


<div class="form-normal form-horizontal clearfix">
	<div class="col-lg-9 col-md-10">

		<?php $form=$this->beginWidget('CActiveForm', array(
			'id'=>'paper-form',
			'enableAjaxValidation'=>false,
			'enableClientValidation' => true,
			'clientOptions' => array(
				'validateOnSubmit' => true,
			),
			'errorMessageCssClass' => 'label label-info',
			'htmlOptions' => array('enctype' => 'multipart/form-data','autocomplete'=>'off'),
		)); ?>

		<?php echo $form->errorSummary($model, null, null, array('class' => 'alert alert-warning')); ?>


		<?php if($type==1){ ?>
			<div class="form-group">

				<div class="col-sm-4 control-label">
					<?php echo $form->labelEx($model,'paper_file'); ?>
				</div>

				<div class="col-sm-8">
					<?php echo $form->fileField($model,'paper_file',array('class'=>'btn btn-info btn-block')); ?>
					<?php echo $form->error($model,'paper_file'); ?>
				</div>

			</div>
		<?php }else{ ?>
			<div class="form-group">

				<div class="col-sm-4 control-label">
					<?php echo $form->labelEx($model,'paper_image'); ?>
				</div>

				<div class="col-sm-8">
					<?php echo $form->fileField($model,'paper_image',array('class'=>'btn btn-info btn-block')); ?>
					<?php echo $form->error($model,'paper_image'); ?>
				</div>

			</div>
		<?php } ?>



		<div class="form-group">
			<div class="col-md-12">
				<?php echo CHtml::submitButton($model->isNewRecord ? 'Simpan' : 'Upload', array('class' => 'btn btn-info btn-flat pull-right')); ?>
			</div>
		</div>

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

					</div></div><!-- form -->