<?php

use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\widgets\ActiveForm;
use yii\widgets\FileInput;

/* @var $this yii\web\View */
/* @var $model backend\models\Quote */
/* @var $form yii\widgets\ActiveForm */

?>

<div class="quote-form">

    <?php $form = ActiveForm::begin([
        'options'=>['enctype'=>'multipart/form-data']
    ]); ?>

    <?= $form->field($model, 'quoteIndex')->textInput() ?>

    <?= $form->field($model, 'content')->textarea(['rows' => 6]) ?>


    <?=
    $form->field($model, 'chapterId')->dropDownList(ArrayHelper::map(\backend\models\Chapter::find()->where('bookId='.$_GET["bookid"])->all(), 'id', 'title'),array('prompt'=>'Select Chapter','disabled'=>'disabled'))
    ?>

    <?= $form->field($model, 'file')->fileInput() ?>
    <?php
        //if ($model->id):
        //$check = \backend\models\Quote::
    ?>
        <!--div class="form-group"-->

            <!--?= Html::img(Yii::$app->urlManager->baseUrl . '/images/quote/'.$model->image,['width'=>'200']) ?-->
        <!--/div-->
    <?php /*endif;*/ ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
        &nbsp;<a href="javascript:history.go(-1)" class="btn btn-danger">Back</a>
    </div>
