<?php

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

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

<div class="comment-form">

    <?php $form = ActiveForm::begin(); ?>
    <?=
    $form->field($model, 'bookId')->dropDownList(ArrayHelper::map(\backend\models\Book::find()->all(), 'id', 'title'),array('prompt'=>'Select Book','disabled' => true))
    ?>

    <?=
    $form->field($model, 'chapterId')->dropDownList(ArrayHelper::map(\backend\models\Chapter::find()->all(), 'id', 'title'),array('prompt'=>'Select Chapter','disabled' => true))
    ?>

    <?= $form->field($model, 'name')->textInput(['maxlength' => 50,'disabled' => true]) ?>

    <?= $form->field($model, 'content')->textInput(['maxlength' => 250]) ?>

    <?= $form->field($model, 'datetime')->textInput(['disabled' => true]) ?>


    <?=
    $form->field($model, 'status')->dropDownList(array(1=>'Active',0=>'Inactive'),array('prompt'=>'Select Status'))
    ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
		<a href="<?php echo \Yii::$app->urlManager->createUrl(['comment/index']) ?>" class="btn btn-danger">Back</a>
    </div>

    <?php ActiveForm::end(); ?>

</div>
