public function __construct()
 {
     $this->middleware('auth');
     $this->edo_civil = \App\Models\EdoCivil::all()->lists('descripcion', 'id');
     $this->estados = \App\Models\Estados::all()->lists('nombre', 'id');
     $this->municipios = \App\Models\Municipios::all()->lists('nombre', 'id');
     $this->parroquias = \App\Models\Parroquias::all()->lists('nombre', 'id');
     $this->ocupacion = \App\Models\Ocupacion::all()->lists('nombre', 'id');
     $this->recepcion = \App\Models\Recepcion::all()->lists('nombre', 'id') + ['' => 'SELECCIONE..'];
     $this->discapacidad = \App\Models\discapacidad::all()->lists('nombre', 'id') + ['' => 'SELECCIONE..'];
     $this->gradoDis = \App\Models\GradoDiscapacidad::where('estatus', '=', 1)->lists('nombre', 'id') + ['' => 'SELECCIONE..'];
     $this->modalidad = \App\Models\TipoAtencion::all()->lists('nombre', 'id') + ['' => 'SELECCIONE..'];
     $this->comites = \App\Models\Comites::all()->lists('nombre', 'id');
     $this->misiones = \App\Models\Misiones::all()->lists('nombre', 'id');
     $this->vivienda = \App\Models\tipoVivienda::all()->lists('nombre', 'id');
     $this->pisos = \App\Models\tipoPisos::all()->lists('nombre', 'id');
     $this->paredes = \App\Models\tipoParedes::all()->lists('nombre', 'id');
     $this->techos = \App\Models\tipoTechos::all()->lists('nombre', 'id');
     $this->suministro_agua = \App\Models\Servicios::where('padre', '=', 1)->lists('nombre', 'id');
     $this->gas = \App\Models\Servicios::where('padre', '=', 2)->lists('nombre', 'id');
     $this->desecho = \App\Models\Servicios::where('padre', '=', 3)->lists('nombre', 'id');
     $this->agua_ser = \App\Models\Servicios::where('padre', '=', 8)->lists('nombre', 'id');
     $this->servicios = \App\Models\Servicios::where('padre', '=', null)->lists('nombre', 'id');
     $this->servicios_comunidad = \App\Models\Servicios_comunidad::all()->lists('nombre', 'id');
     $this->realidad = \App\Models\RealidadSocioeconomica::all()->lists('pregunta', 'id');
     $this->casa_comercial = \App\Models\CasaComercial::all()->lists('nombre', 'id');
     $this->sub_secretaria = \App\Models\Sub_secretaria::where('estatus', '=', 1)->lists('descripcion', 'id');
     $this->consulta_ingreso = \App\Models\consulta_ingreso::where('estatus', '=', 1)->lists('nombre', 'id');
     $this->nivel_instruccion = \App\Models\nivel_instruccion::where('estatus', '=', 1)->lists('nombre', 'id');
     $this->parentesco = \App\Models\parentesco::where('estatus', '=', 1)->lists('nombre', 'id');
     $this->anexos = \App\Models\Anexos::where('estatus', '=', 1)->lists('nombre', 'id');
     $this->atencion = \App\Models\TipoAtencion::where('estatus', 1)->lists('nombre', 'id');
 }
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Anexos::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', 'anexo', $this->anexo]);
     return $dataProvider;
 }
    ?>
          <?php 
    echo "</a></div>";
}
?>
    </li>
</ul>


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