Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use yii\helpers\Html;
- use yii\widgets\ActiveForm;
- use yii\helpers\ArrayHelper;
- use yii\helpers\Url;
- /* @var $this yii\web\View */
- /* @var $model backend\modules\master\models\Department */
- /* @var $form yii\widgets\ActiveForm */
- ?>
- <div class="department-form">
- <?php $form = ActiveForm::begin(); ?>
- <?= $form->field($model, 'departement')->textInput(['maxlength' => 150]) ?>
- <?php
- $dataCompany=ArrayHelper::map(\backend\modules\master\models\Company::find()->asArray()->all(), 'id', 'company');
- echo $form->field($model, 'id_company')->dropDownList($dataCompany,
- ['prompt'=>'- Select Company -',
- 'onchange'=>'$.post("'.Yii::$app->urlManager->createUrl('master/factory/lists&id=').'"+$(this).val(),function( data )
- {$( "select#factory" ).html( data );});'
- ]);
- ?>
- <?php
- $dataFactory=ArrayHelper::map(\backend\modules\master\models\Factory::find()->asArray()->all(), 'id', 'factory');
- echo $form->field($model, 'id_factory')->dropDownList($dataFactory,
- ['prompt'=>'- Select Factory -'])
- ?>
- <?= $form->field($model, 'function')->textInput(['maxlength' => 250]) ?>
- <div class="form-group">
- <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
- </div>
- <?php ActiveForm::end(); ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement