<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\date\DatePicker;
use yii\db\Expression;
use yii\behaviors\TimestampBehavior;

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

<div class="mvoting-form">

    <?php $form = ActiveForm::begin(); ?>

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

    <?= $form->field($model, 'periode_awal')->widget(DatePicker::classname(),
        [
            'value' => date('d-M-Y', strtotime('+2 days')),
            'options' => ['placeholder' => 'Tanggal Mulai Voting ...'],
            'pluginOptions' => [
                'format' => 'yyyy-m-d',
                'todayHighlight' => true
            ]
        ]);
    ?>

    <?= $form->field($model, 'periode_tutup')->widget(DatePicker::classname(),
        [
            'value' => date('d-M-Y', strtotime('+2 days')),
            'options' => ['placeholder' => 'Tanggal Selesai Voting ...'],
            'pluginOptions' => [
                'format' => 'yyyy-m-d',
                'todayHighlight' => true
            ]
        ]);
    ?>

    <?= $form->field($model, 'status_aktif')->dropDownList([ 0 => 'TIDAK AKTIF', 1 => 'AKTIF']) ?>


    <div class="form-group">
        <center>
        	<?= Html::submitButton('SIMPAN DATA', ['class' => 'btn btn-success']) ?>
        </center>
    </div>

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

</div>
