/** * Deletes an existing BoothSchedules model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param integer $id * @return mixed */ public function actionDelete($id) { $booth = \backend\models\BoothSchedules::find()->where(['id' => $id])->one(); $booth = $booth->booth_id; $this->findModel($id)->delete(); return $this->redirect(['index', 'id' => $booth]); }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = BoothSchedules::find(); // add conditions that should always apply here $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 return $dataProvider; } // grid filtering conditions $query->andFilterWhere(['id' => $this->id, 'booth_id' => $this->booth_id, 'attendee_id' => $this->attendee_id, 'function_id' => $this->function_id, 'cost_center_id' => $this->cost_center_id, 'status_id' => $this->status_id, 'catering' => $this->catering, 'created_on' => $this->created_on]); $query->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'product', $this->product])->andFilterWhere(['like', 'literature', $this->literature]); return $dataProvider; }