/** * Remove the specified resource from storage. * * @param int $id * * @return Response */ public function destroy($id) { $JustificaionGeneral = JustificaionGeneral::findOrFail($id); JustificaionGeneral::destroy($id); Session::flash('flash_message', 'JustificaionGeneral deleted!'); $planglobal = $JustificaionGeneral->plan_global_id; return redirect('admin/materia/' . $planglobal . '/showplanglobal'); }
public function printplanglobal($id) { $this->edit($id); //$materium = Materium::findOrFail($id); // $pdf = \PDF::loadView('admin.planglobal.print', array('data' => $data) ) // ->setOrientation('portrait')->setPaper('a4'); // return $pdf->stream('PlanGlobal.pdf'); $planglobal = PlanGlobal::findOrFail($id); $grupo = Grupo::where("materium_id", "=", $planglobal->materium_id)->where("control_de_plan_global", "=", 1)->first(); if (empty($grupo)) { $docentep = Docente::where("nombre", "=", "por designar")->first(); $grupo = new Grupo(); $grupo->materium_id = $planglobal->materium_id; $grupo->docente_id = $docentep->id; $grupo->control_de_plan_global = 1; $grupo->save(); $grupo = Grupo::findOrFail($grupo->id); } $docente = Docente::where("id", "=", $grupo->docente_id)->first(); $justificaiongeneral = JustificaionGeneral::where("plan_global_id", "=", $id)->first(); $propositosgenerale = PropositosGenerale::where("plan_global_id", "=", $id)->first(); $objetivosgenerale = ObjetivosGenerale::where("plan_global_id", "=", $id)->first(); $evaluacion = Evaluacion::where("plan_global_id", "=", $id)->first(); $unidades = $planglobal->unidade; $view = view('admin.planglobal.print', compact('planglobal', 'docente', 'justificaiongeneral', 'propositosgenerale', 'objetivosgenerale', 'unidades', 'evaluacion')); $pdf = App::make('dompdf.wrapper'); $pdf->loadHTML($view); return $pdf->stream('PlanGlobal.pdf'); }