Example #1
0
File: form.php Project: fijj/map
?>
                    </div>
                    <div class="col-lg-8">
                        <?php 
echo $form->field($model, 'address');
?>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-8">
                        <?php 
echo $form->field($model, 'location');
?>
                    </div>
                    <div class="col-lg-4">
                        <?php 
echo $form->field($model, 'driverId')->dropDownList(\app\models\Drivers::driversArr(), ['prompt' => 'Водитель по умолчанию...']);
?>
                    </div>
                </div>
                <?php 
echo $form->field($model, 'comment')->textarea();
?>
                <?php 
echo Html::submitButton('Сохранить', ['class' => 'btn btn-primary pull-right']);
?>
            </div>
        </div>
    </div>
    <?php 
ActiveForm::end();
Example #2
0
File: Drivers.php Project: fijj/map
 public static function driversArr()
 {
     return ArrayHelper::map(Drivers::find()->asArray()->all(), 'id', 'name');
 }
Example #3
0
File: Orders.php Project: fijj/map
 function getDrivers()
 {
     return $this->hasOne(Drivers::className(), ['id' => 'driverId']);
 }
Example #4
0
 public function actionRemove($id)
 {
     $model = Drivers::findOne($id);
     $model->delete();
     return $this->redirect(['/drivers/index']);
 }
Example #5
0
File: popover.php Project: fijj/map
            <?php 
    echo $form->field($model, $attr)->label(false);
    ?>
        <?php 
} elseif ($attr == 'deliveryId') {
    ?>
            <?php 
    echo $form->field($model, $attr)->dropDownList(\app\models\Delivery::deliveryArr())->label(false);
    ?>
        <?php 
} elseif ($attr == 'payment') {
    ?>
            <?php 
    echo $form->field($model, $attr)->dropDownList($model->paymentArr)->label(false);
    ?>
        <?php 
} elseif ($attr == 'driverId') {
    ?>
            <?php 
    echo $form->field($model, $attr)->dropDownList(\app\models\Drivers::driversArr())->label(false);
    ?>
        <?php 
}
?>

        <?php 
echo Html::submitButton(Html::tag('span', '', ['class' => 'glyphicon glyphicon-ok']), ['class' => 'btn btn-primary btn-sm']);
?>

<?php 
ActiveForm::end();