registerJs($js, View::POS_READY); $js = <<< JS $('#order-phone, #order-phone2').mask('+38(000)000-00-00', { placeholder: '+38(___)___-__-__' }); JS; $this->registerJs($js, View::POS_READY); ?>
isNewRecord ? 'Create' : 'Update', [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ] ) ?>
field($model, 'deadline') ->widget( DatePicker::className(), [ ] ) ?> field($model, 'pay') ->widget( SwitchInput::className(), [ 'name' => 'pay', 'pluginOptions' => [ 'onText' => \Yii::t('app', 'Оплачено'), 'offText' => \Yii::t('app', 'Не оплачено'), ], ] ); ?> field($model, 'reason') ->dropDownList( [ 1 => 'То', 2 => 'Сё', ], [ 'prompt' => 'Выберите причину' ] ) ?> field($model, 'label') ->dropDownList( ArrayHelper::map( Label::find() ->asArray() ->all(), 'id', 'label' ), [ 'prompt' => 'Выберите метку' ] ); ?> field($model, 'name') ?> field($model, 'phone') ?> field($model, 'phone2') ?> field($model, 'email') ?> field( $model, 'numbercard' ) ->textInput([ 'readonly' => true ]) ?> field($model, 'comment') ->textarea([ 'rows' => '3' ]) ?> field($model, 'delivery') ->dropDownList( ArrayHelper::map( Delivery::find() ->joinWith('lang') ->asArray() ->all(), 'id', 'lang.title' ), [ 'prompt' => \Yii::t('app', 'Выберите доставку ...') ] ) ?>
field($model, 'declaration') ?> field($model, 'stock') ?> field($model, 'consignment') ?> field($model, 'payment') ->dropDownList( ArrayHelper::map( OrderPayment::find() ->joinWith('lang') ->where([ 'status' => OrderPayment::ACTIVE ]) ->asArray() ->all(), 'id', 'lang.title' ), [ 'prompt' => 'Способ оплаты ...' ] ); ?> field($model, 'insurance') ?> field($model, 'amount_imposed') ?> field($model, 'shipping_by') ->dropDownList( ArrayHelper::getColumn(Order::SHIPPING_BY, 'label'), [ 'prompt' => 'Оплата доставки ...' ] ); ?> field($model, 'city') ?> field($model, 'adress') ?> field($model, 'body') ->textarea([ 'rows' => '3' ]) ?> field($model, 'check') ?> field($model, 'sms') ?>
$dataProvider, 'layout' => '{items}{pager}', 'columns' => [ 'id', 'product_name', 'sku', [ 'class' => 'kartik\grid\EditableColumn', 'attribute' => 'count', 'editableOptions' => [ 'header' => \Yii::t('app', 'Количество'), 'inputType' => kartik\editable\Editable::INPUT_SPIN, 'options' => [ 'pluginOptions' => [ 'min' => 0, 'max' => 5000, ], ], ], 'format' => [ 'decimal', 0, ], 'pageSummary' => false, ], [ 'class' => 'yii\grid\ActionColumn', 'template' => '{delete}', ], ], 'responsive' => true, 'hover' => true, 'pjax' => true, 'pjaxSettings' => [ 'options' => [ 'scrollTo' => 'false', 'id' => 'order-products-grid', ], ], ] ); ?>
yii\helpers\Url::to([ 'add' ]), 'id' => 'add-product-form', ] ); $newOrderProduct = new OrderProduct(); ?>
field($newOrderProduct, 'id') ->widget( Select2::className(), [ 'options' => [ 'placeholder' => 'Search for a product ...' ], 'pluginOptions' => [ 'allowClear' => true, 'disabled' => $model->isNewRecord ? true : false, 'minimumInputLength' => 3, 'language' => [ 'errorLoading' => new JsExpression( "function () { return 'Waiting for results...'; }" ), ], 'ajax' => [ 'url' => \yii\helpers\Url::to([ 'find-product' ]), 'dataType' => 'json', 'data' => new JsExpression( 'function(params) { return {q:params.term}; }' ), ], 'escapeMarkup' => new JsExpression( 'function (markup) { return markup; }' ), 'templateResult' => new JsExpression( 'function(data) { return data.sku; }' ), 'templateSelection' => new JsExpression( 'function (data) { return data.sku; }' ), ], ] ); ?>
field($newOrderProduct, 'count') ->input('number'); ?>
$model->isNewRecord ? 'btn btn-primary disabled' : 'btn btn-primary', ] ) ?>
field($newOrderProduct, 'order_id') ->hiddenInput( [ 'value' => $model->id, ] ) ->label(false) ?>