Beispiel #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Size::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['size_id' => $this->size_id, 'flag_active' => 1, 'date_added' => $this->date_added, 'date_update' => $this->date_update]);
     $query->andFilterWhere(['like', 'size_name', $this->size_name]);
     return $dataProvider;
 }
Beispiel #2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Size::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at]);
     $query->andFilterWhere(['like', 'name', $this->name]);
     return $dataProvider;
 }
 public function actionSize($q = null, $id = null)
 {
     \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
     if (is_null($q)) {
         $q = "";
     }
     $out = ['results' => []];
     $jobs = Size::find()->where('name LIKE :q')->params([':q' => '%' . $q . '%'])->asArray()->all();
     foreach ($jobs as $job) {
         $out['results'][] = ['id' => $job['id'], 'text' => $job['name']];
     }
     return $out;
 }
Beispiel #4
0
    
    <div class="form-group">
      <label class="col-sm-3 control-label">Size</label>
      <div class="col-sm-6">
        <?php 
echo $form->field($model, 'size')->label(false)->textInput(['maxlength' => 11, 'placeholder' => 'Enter number only.', 'class' => 'form-control', 'parsley-type' => 'number']);
?>
  
      </div>
    </div><!--/form-group--> 
    
    <div class="form-group">
      <label class="col-sm-3 control-label">Size Measure</label>
      <div class="col-sm-6">
        <?php 
echo $form->field($model, 'size_id')->label(false)->dropDownList(ArrayHelper::map(Size::find()->all(), 'size_id', 'size_name'), ['prompt' => 'Select Size Name', 'class' => 'form-control']);
?>
      </div>
    </div><!--/form-group--> 
    
    <div class="form-group">
      <label class="col-sm-3 control-label">Qty on Sale</label>
      <div class="col-sm-6">
        <?php 
echo $form->field($model, 'qty_onsale')->label(false)->textInput(['maxlength' => 11, 'placeholder' => 'Enter number only.', 'class' => 'form-control', 'parsley-type' => 'number']);
?>
  
      </div>
    </div><!--/form-group--> 
    
    <div class="form-group">
Beispiel #5
0
 public function actionStep1()
 {
     Yii::$app->session['carPartTotal'] = 0.0;
     $carPart = new CarPart();
     $sizes = ArrayHelper::map(Size::find()->asArray()->all(), 'id', 'name');
     $colors = ArrayHelper::map(Color::find()->asArray()->all(), 'id', 'name');
     $damages = ArrayHelper::map(Damage::find()->asArray()->all(), 'id', 'name');
     return $this->render('step1', ['carPart' => $carPart, 'sizes' => $sizes, 'colors' => $colors, 'damages' => $damages]);
 }