/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Cpv::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(['like', 'uid', $this->uid])->andFilterWhere(['like', 'cpv_label', $this->cpv_label]); return $dataProvider; }
/* @var $this yii\web\View */ /* @var $model app\models\Decisions */ /* @var $form ActiveForm */ $this->title = 'Αναζήτηση'; $this->params['breadcrumbs'][] = $this->title; $connection = \Yii::$app->db; // Select Organisations : // 1. Get Data From Preferences $currentOrgs = Organisations::dropdownSearch(); // Select Decision Types : // 1. Get Data From Preferences $currentTypes = Preferences::getSelectedTypes(); // Select Date Range: // 1. Get Data From Preferences $currentDates = Preferences::getSelectedDates(); $currentCPV = Cpv::dropdownSearch(); ?> <h1><?php echo Html::encode($this->title); ?> </h1> <h1 style="text-align: center;"> Αποφάσεις Β.2.1 - Έγκριση Δαπανών</h1> <div class="row"> <div style="text-align: justify;" class="col-lg-4"> <h4> Αποφάσεις ανά μήνα για Οργανισμό </h4> <?php // Form 1 : Decisions per month pew organizations echo Html::beginForm('index.php?r=results/resultsb21a', 'post'); // 2. Show selected Organisations
/** * Finds the Cpv model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $id * @return Cpv the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Cpv::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }