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 = Servicios::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->joinWith('iDCOL'); $query->andFilterWhere(['ID_SERVICE' => $this->ID_SERVICE]); $query->andFilterWhere(['like', 'NAME_SERVICE', $this->NAME_SERVICE])->andFilterWhere(['like', 'DESCRIPCION_SERVICE', $this->DESCRIPCION_SERVICE])->andFilterWhere(['like', 'perfil_colaborador.NAME_COL', $this->ID_COL]); //nombre de la tabla y su atributo comparado con el id return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getServicios() { return $this->hasMany(Servicios::className(), ['ID_COL' => 'ID_COL']); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $socioD = \App\Models\SocioDemografico::where('id_solicitud', '=', $id)->get(); $socio['vivienda'] = \App\Models\tipoVivienda::find(unserialize($socioD[0]['id_viviendas'])); $socio['paredes'] = \App\Models\tipoParedes::find(unserialize($socioD[0]['id_paredes'])); $socio['pisos'] = \App\Models\tipoPisos::find(unserialize($socioD[0]['id_pisos'])); $socio['techos'] = \App\Models\tipoTechos::find(unserialize($socioD[0]['id_techos'])); $socio['agua'] = \App\Models\Servicios::find(unserialize($socioD[0]['id_agua'])); $socio['gas'] = \App\Models\Servicios::find(unserialize($socioD[0]['id_gas'])); $socio['basura'] = \App\Models\Servicios::find(unserialize($socioD[0]['id_basura'])); $socio['aguaServida'] = \App\Models\Servicios::find(unserialize($socioD[0]['id_agua_servida'])); $socio['comunidad'] = \App\Models\Servicios_comunidad::find(unserialize($socioD[0]['id_comunidad'])); $socio['comite'] = \App\Models\Comites::find(unserialize($socioD[0]['id_comite'])); $socio['misiones'] = \App\Models\Misiones::find(unserialize($socioD[0]['id_misiones'])); $informe = \App\Models\Solicitudes::with('egresos_grupo', 'beneficiario.estado', 'beneficiario.ocupacion', 'beneficiario.municipio', 'beneficiario.parroquia', 'beneficiario.edoCivil', 'solicitante.estado', 'solicitante.ocupacion', 'solicitante.municipio', 'solicitante.parroquia', 'solicitante.edoCivil', 'ingresos_grupo.parentesco', 'ingresos_grupo.ocupacion', 'ingresos_grupo.consulta_ingresos', 'ingresos_grupo.nivel_instruccion', 'socio_demografico')->find($id); //$dos=[$informe,$socio]; // $data=['informe' => $informe]; /* $view = \View::make('informe_socioeconomico.informe',$data)->render(); $pdf = \App::make('dompdf.wrapper'); $pdf->loadHTML($view); return $pdf->stream('lalala');*/ return view("informe_socioeconomico.informe", ['informe' => $informe]); }
protected function showInforme($id) { $socioD = \App\Models\SocioDemografico::where('id_solicitud', '=', $id)->get(); $socio['vivienda'] = \App\Models\tipoVivienda::find(unserialize($socioD[0]['id_viviendas'])); $socio['paredes'] = \App\Models\tipoParedes::find(unserialize($socioD[0]['id_paredes'])); $socio['pisos'] = \App\Models\tipoPisos::find(unserialize($socioD[0]['id_pisos'])); $socio['techos'] = \App\Models\tipoTechos::find(unserialize($socioD[0]['id_techos'])); $socio['agua'] = \App\Models\Servicios::find(unserialize($socioD[0]['id_agua'])); $socio['gas'] = \App\Models\Servicios::find(unserialize($socioD[0]['id_gas'])); $socio['basura'] = \App\Models\Servicios::find(unserialize($socioD[0]['id_basura'])); $socio['aguaServida'] = \App\Models\Servicios::find(unserialize($socioD[0]['id_agua_servida'])); $socio['comunidad'] = \App\Models\Servicios_comunidad::find(unserialize($socioD[0]['id_comunidad'])); $socio['comite'] = \App\Models\Comites::find(unserialize($socioD[0]['id_comite'])); $socio['misiones'] = \App\Models\Misiones::find(unserialize($socioD[0]['id_misiones'])); $informe = \App\Models\Solicitudes::with('egresos_grupo', 'beneficiario.estado', 'beneficiario.ocupacion', 'beneficiario.municipio', 'beneficiario.parroquia', 'beneficiario.edoCivil', 'solicitante.estado', 'solicitante.ocupacion', 'solicitante.municipio', 'solicitante.parroquia', 'solicitante.edoCivil', 'ingresos_grupo.parentesco', 'ingresos_grupo.ocupacion', 'ingresos_grupo.consulta_ingresos', 'ingresos_grupo.nivel_instruccion', 'socio_demografico')->find($id); return $socio; }
/** * Finds the Servicios model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Servicios the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Servicios::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }