Ejemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Brands::find()->where('status=0');
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['Id' => $this->Id, 'createdBy' => $this->createdBy, 'updatedBy' => $this->updatedBy, 'createdOn' => $this->createdOn, 'updatedOn' => $this->updatedOn, 'status' => $this->status]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'guid', $this->guid])->andFilterWhere(['like', 'logo', $this->logo])->andFilterWhere(['like', 'ip', $this->ip]);
     return $dataProvider;
 }
Ejemplo n.º 2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Brands::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['BrandId' => $this->BrandId, 'IsLogoVisible' => $this->IsLogoVisible, 'created_by' => $this->created_by, 'LastUpdatedBy' => $this->LastUpdatedBy, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, 'deleted_at' => $this->deleted_at]);
     $query->andFilterWhere(['like', 'Name', $this->Name])->andFilterWhere(['like', 'Description', $this->Description])->andFilterWhere(['like', 'Website', $this->Website])->andFilterWhere(['like', 'LogoUrl', $this->LogoUrl])->andFilterWhere(['like', 'Comment', $this->Comment]);
     return $dataProvider;
 }
Ejemplo n.º 3
0
//use yii\adminUi\assetsBundle\AdminUIMultiselect;
use yii\adminUi\widget\Multiselect;
use common\modules\media\widgets\MediaUpload;
//AdminUIMultiselect::register($this);
/* @var $this yii\web\View */
/* @var $model common\models\BrandsCityMap */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="brands-city-map-form">

    <?php 
$form = ActiveForm::begin(['validationUrl' => ['validate']]);
?>

    <?php 
echo $form->field($model, 'chainId', ['enableAjaxValidation' => true])->dropDownList(ArrayHelper::merge(['' => 'Select'], ArrayHelper::map(\common\models\Brands::find()->andWhere(['status' => 1])->orderBy('name')->All(), 'Id', 'name')));
?>
 

    <?php 
echo $form->field($model, 'cityId', ['enableAjaxValidation' => true])->dropDownList(ArrayHelper::merge(['' => 'Select'], ArrayHelper::map(\common\models\City::find()->andWhere(['status' => 1])->All(), 'Id', 'name')));
?>
 

    <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => 225]);
?>
 

    <?php 
echo $form->field($modelBrandsCityField, 'name')->checkbox(['label' => 'Lock']);
Ejemplo n.º 4
0
<?php

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use common\models\Suppliers;
use common\models\Brands;
use common\models\Producttypes;
use common\models\Productcategories;
/* @var $this yii\web\View */
/* @var $model common\models\Products */
/* @var $form yii\bootstrap\ActiveForm */
$dataProductCategory = ArrayHelper::map(Productcategories::find()->asArray()->all(), 'ProductCategoryId', 'Name');
$dataSuppliers = ArrayHelper::map(Suppliers::find()->asArray()->all(), 'SupplierId', 'Name');
$dataBrands = ArrayHelper::map(Brands::find()->asArray()->all(), 'BrandId', 'Name');
$dataProducttypes = ArrayHelper::map(Producttypes::find()->asArray()->all(), 'ProducttypeId', 'Name');
?>
<div class="products-form">

    <?php 
$form = ActiveForm::begin(['layout' => 'horizontal']);
?>

    <?php 
echo $form->field($model, 'Name', ['horizontalCssClasses' => ['wrapper' => 'col-sm-4']])->textInput(['maxlength' => 500]);
?>

    <?php 
echo $form->field($model, 'ProductCategoryId', ['horizontalCssClasses' => ['wrapper' => 'col-sm-3']])->dropDownList($dataProductCategory, ['prompt' => '----------Choose a Category----------']);
?>

    <?php