<?php

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

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

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

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

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

            <?= $form->field($model, 'status')->dropDownList(['Active' => Yii::t('app', 'Active'), 'Inactive' => Yii::t('app', 'Inactive')]) ?>
            
            <?php if (Yii::$app->controller->action->id == 'update') : ?>
                <?= Alert::widget([
                    'options' => [
                        'class' => 'alert-warning',
                    ],
                    'body' => Yii::t('app' ,'Notice: if you don\'t upload a new image, the old image will remain'),
                ]); ?>
            <?php endif; ?>

            <?= $form->field($model, 'image_path')->fileInput() ?>

            <div class="form-group">
                <?= Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-success']) ?>
            </div>

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