/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Adendos::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', 'adendos', $this->adendos]);
     return $dataProvider;
 }
    ?>
          <?php 
    echo "</div></a>";
}
?>
    </li>
    </ul>
    

    <p><strong>LISTA DE ADENDOS</strong></p>
    <ul class="list-group">
    <li class='list-group-item'>
        
    <?php 
$query_adendo = "SELECT * FROM adendos WHERE processo_id = '" . $id . "' ";
$adendo = Adendos::findBySql($query_adendo)->all();
foreach ($adendo as $adendos) {
    $Adendos = $adendos["adendos"];
    $arquivoAdendos = substr($Adendos, strrpos($Adendos, '/') + 1);
    ?>
          <?php 
    echo "<div class='row'>";
    ?>
          <?php 
    echo '<a href="../web/uploads/adendos/' . $arquivoAdendos . '" target="_blank">';
    ?>
          <?php 
    echo "<button type='button' class='btn btn-link'></button>";
    echo $arquivoAdendos;
    ?>
          <?php 
 /**
  * Finds the Adendos model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Adendos the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Adendos::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }