/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Edital::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, 'processo_id' => $this->processo_id]); $session = Yii::$app->session; $query->andFilterWhere(['processo_id' => $session['sess_processo']])->andFilterWhere(['like', 'edital', $this->edital]); return $dataProvider; }
/** * Finds the Edital model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Edital the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Edital::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
echo '<li class="list-group-item">' . $Cargos . '</li>'; } ?> </ul> </div> <div class="panel panel-primary"> <!-- Default panel contents --> <div class="panel-heading">Documentos para Download</div> <div class="panel-body"> <p><strong>LISTA DE EDITAIS</strong></p> <ul class="list-group"> <li class='list-group-item'> <?php $query_edital = "SELECT * FROM edital WHERE processo_id = '" . $id . "' "; $edital = Edital::findBySql($query_edital)->all(); foreach ($edital as $editals) { $Editals = $editals["edital"]; $arquivoEditals = substr($Editals, strrpos($Editals, '/') + 1); ?> <?php echo "<div class='row'>"; ?> <?php echo '<a href="../web/uploads/editais/' . $arquivoEditals . '" target="_blank">'; ?> <?php echo "<button type='button' class='btn btn-link'></button>"; echo $arquivoEditals; ?> <?php