/**
  * Displays a single Manufacturers model.
  * @param integer $id
  * @return mixed
  */
 public function actionView($id)
 {
     $searchModel = new ProductsSearch();
     $searchModel->ManufacturerID = $id;
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('view', ['model' => $this->findModel($id), 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Exemple #2
0
    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

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

</div>

<div class="form-group">
    <!-- Search product popup window -->
    <?php 
$searchModel = new ProductsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$popup_title = Yii::t('app', 'Products');
\yii\bootstrap\Modal::begin(['id' => 'search-product-popup', 'header' => '<h2>' . Yii::t('app', 'Products') . '</h2>', 'size' => \yii\bootstrap\Modal::SIZE_LARGE]);
echo $this->render('/products/select', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'document_id' => $model->Document]);
\yii\bootstrap\Modal::end();
?>

    <!-- Create product popup window -->
    <?php 
$productmodel = new Products();
$popup_title = Yii::t('app', 'Products');
\yii\bootstrap\Modal::begin(['id' => 'create-product-popup', 'header' => '<h2>' . Yii::t('app', 'Create') . '</h2>', 'size' => \yii\bootstrap\Modal::SIZE_LARGE]);
echo $this->render('/products/_form', ['model' => $productmodel, 'did' => $model->Document]);
\yii\bootstrap\Modal::end();
//echo Html::a(Yii::t('app', Yii::t('app', 'Create new')), ['/warehouse/products/create', 'id' => $model->Document], ['class' => 'btn btn-primary', 'target'=>'_blank']);
 /**
  * Returns Product.ID
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param integer $id
  * @return mixed
  */
 public function actionSelect($id)
 {
     $searchModel = new ProductsSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->renderPartial('select', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'document_id' => $id]);
 }