Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use common\models\product\Item;
- use yii\widgets\ActiveForm;
- use yii\helpers\Html;
- use yii\helpers\ArrayHelper;
- use backend\modules\product\models\Delivery;
- use backend\modules\product\models\Brand;
- use common\models\photo\Album;
- use backend\modules\core\widgets\UriWidget\UriWidget;
- ?>
- <div class="">
- <div class="crud-create">
- <h1 id="description"><?= $title; ?> </h1>
- <div class="crud-form" id="crud-form">
- <?php $form = ActiveForm::begin([
- 'id' => 'id_form',
- 'enableAjaxValidation'=>true,
- ]); ?>
- <ul class="nav nav-tabs" role="tablist">
- <li class="active"><a href="#items" role="tab" data-toggle="tab"><?= Yii::t('admin', 'Item');?></a></li>
- <li><a href="#meta" role="tab" data-toggle="tab"><?= Yii::t('admin', 'Meta')?></a></li>
- </ul>
- <!-- Tab panes -->
- <div class="tab-content">
- <div class="tab-pane active" id="items">
- <?= $form->field($model, 'category_id')->dropDownList($categ, ['prompt'=>Yii::t('admin', 'Choose category'), 'class'=>'form-control', 'id'=>'item-category'])?>
- <?php if($master){
- echo ($form->field($model, 'master_id')->dropDownList([],['prompt'=>Yii::t('admin', 'Choose master product'), 'class'=>'form-control', 'id'=>'item', 'disabled'=>'disabled']));
- }
- ?>
- <?= $form->field($model, 'articul')->textInput(); ?>
- <?= $form->field($model, 'title')->textInput(); ?>
- <?= $form->field($model, 'uri')->widget(UriWidget::className(), [
- 'options' => [
- 'class' => 'form-control',
- ],
- 'nameModel' => call_user_func(array(get_class($model), 'className')),
- 'donorAttribute' => 'title',
- ]); ?>
- <?= $form->field($model, 'small_description')->textArea(['rows' => '5']); ?>
- <?= $form->field($model, 'description')->textArea(['rows'=>'10']); ?>
- <?= $form->field($model, 'price')->textInput(); ?>
- <?= $form->field($model, 'count')->textInput(); ?>
- <?= $form->field($model, 'discount')->dropDownList($model->getDiscounts(), ['prompt' => Yii::t('admin', 'Choose discount')]); ?>
- <?= $form->field($model, 'action_price')->textInput(); ?>
- <?= $form->field($model, 'date_start_action')->widget('trntv\yii\datetime\DateTimeWidget', [
- 'clientOptions' => [
- 'sideBySide' => TRUE,
- ],
- ]); ?>
- <?= $form->field($model, 'date_finish_action')->widget('trntv\yii\datetime\DateTimeWidget', [
- 'clientOptions' => [
- 'sideBySide' => TRUE,
- ],
- ]); ?>
- <?php if ($model->preview) : ?>
- <div class="row">
- <div class="col-lg-3">
- <img src="<?= $model->getPreview(); ?>" alt="" class="img-responsive">
- </div>
- </div>
- <?php endif; ?>
- <?= $form->field($model, 'preview')->fileInput(); ?>
- <?php
- if ($master) {
- echo($form->field($model, 'delivery_id')->dropDownList(ArrayHelper::map(Delivery::find()->all(), 'id', 'title'), ['prompt' => Yii::t('admin', 'Choose delivery'), 'class' => 'myHide form-control']));
- echo($form->field($model, 'brand_id')->dropDownList(ArrayHelper::map(Brand::find()->all(), 'id', 'title'), ['prompt' => Yii::t('admin', 'Choose brand'), 'class'=>'myHide form-control']));
- } else {
- echo($form->field($model, 'delivery_id')->dropDownList(ArrayHelper::map(Delivery::find()->all(), 'id', 'title'), ['prompt' => Yii::t('admin', 'Choose delivery'), 'class' => 'updateHide form-control']));
- echo($form->field($model, 'brand_id')->dropDownList(ArrayHelper::map(Brand::find()->all(), 'id', 'title'), ['prompt' => Yii::t('admin', 'Choose brand'), 'class'=>'updateHide form-control']));
- }
- ?>
- <?= $form->field($model, 'photo_album_id')->dropDownList(ArrayHelper::map(Album::find()->all(), 'id', 'name'), ['prompt' => Yii::t('admin', 'Choose Album')]); ?>
- <?= $form->field($model, 'availability')->dropDownList(Item::getAvailabeList(), ['prompt'=>Yii::t('admin', 'Choose availability'), 'class'=>'form-control'])?>
- <?= $form->field($model, 'active')->checkbox(); ?>
- </div>
- <div class="tab-pane" id="meta">
- <?= $form->field($model, 'meta_title')->textInput(); ?>
- <?= $form->field($model, 'meta_description')->textArea(['rows' => '10']); ?>
- <?= $form->field($model, 'meta_keywords')->textArea(['rows'=>'10']); ?>
- </div>
- </div>
- <div class="form-group">
- <?= Html::submitButton(Yii::t('common', 'Update'), ['class' => 'btn btn-success']); ?>
- </div>
- <?php ActiveForm::end(); ?>
- </div>
- </div>
- </div>
- <div class="hide" id ='updateMaster' data ="<?= $master?>"></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement