/**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $docente = new Docente();
     $docente->user()->associate(Auth::user);
     $docente->save();
     return view('admin_principal');
 }
 public function asignar_docente()
 {
     $docentes = Docente::join('users as u', 'id_user', '=', 'u.id')->join('kardex as k', 'u.id_kardex', '=', 'k.id')->select('docente.id', 'k.nombres', 'k.ap_paterno', 'k.ap_materno')->where('k.estado', '=', '1')->get();
     $materias = Materia::select('id', 'asignatura')->get();
     $no_asignadas = Materia::join('curso as c', 'id_curso', '=', 'c.id')->select('c.nombre as cnombre', 'asignatura', 'sigla')->where('id_docente', '=', null)->get();
     return view('Sistema/AsignarDocente', compact('docentes', 'materias', 'no_asignadas'));
 }
 public function creategrupo($mate)
 {
     $materia = Materium::findOrFail($mate);
     $docente = Docente::orderBy('nombre', 'asc')->lists('nombre', 'id');
     return view('admin.grupo.create', compact('mate', 'materia', 'docente'));
 }
 public function save_docente(Request $request)
 {
     $k = new Kardex();
     $k->nombres = $request->nombres;
     $k->ap_paterno = $request->father;
     $k->ap_materno = $request->mother;
     $k->ci = $request->ci;
     $k->sexo = $request->sexo;
     $k->estado = 1;
     $k->save();
     $user_id = Kardex::select('id')->where('ci', '=', $request->ci)->get();
     $u = new User();
     $u->email = $request->email;
     $u->password = \Hash::make($request->ci);
     $u->tipo_usuario = 2;
     $u->id_kardex = $user_id[0]->id;
     $u->save();
     $st_id = User::select('id')->where('email', '=', $request->email)->get();
     $e = new Docente();
     $e->antiguedad = $request->ant;
     $e->id_user = $st_id[0]->id;
     $e->save();
     return Redirect::back()->with(['success' => ' ']);
 }
 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');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     Docente::destroy($id);
     Session::flash('flash_message', 'Docente deleted!');
     return redirect('admin/docentes');
 }
Beispiel #7
0
 public function __construct()
 {
     $variable10 = Image::where("filename", "=", 'fcytlogo')->first();
     if (empty($variable10)) {
         $variable10 = new Image();
         $variable10->original_name = 'fcytlogo';
         $variable10->filename = 'fcytlogo';
         $variable10->save();
     }
     $variable10 = Image::where("filename", "=", 'fcyt')->first();
     if (empty($variable10)) {
         $variable10 = new Image();
         $variable10->original_name = 'fcyt';
         $variable10->filename = 'fcyt';
         $variable10->save();
     }
     $variable10 = Image::where("filename", "=", 'organigramafcyt')->first();
     if (empty($variable10)) {
         $variable10 = new Image();
         $variable10->original_name = 'organigramafcyt';
         $variable10->filename = 'organigramafcyt';
         $variable10->save();
     }
     $variable10 = Image::where("filename", "=", 'avatar1')->first();
     if (empty($variable10)) {
         $variable10 = new Image();
         $variable10->original_name = 'avatar1';
         $variable10->filename = 'avatar1';
         $variable10->save();
     }
     $variable10 = Image::where("filename", "=", 'avatar2')->first();
     if (empty($variable10)) {
         $variable10 = new Image();
         $variable10->original_name = 'avatar2';
         $variable10->filename = 'avatar2';
         $variable10->save();
     }
     $variable10 = Image::where("filename", "=", 'avatar3')->first();
     if (empty($variable10)) {
         $variable10 = new Image();
         $variable10->original_name = 'avatar3';
         $variable10->filename = 'avatar3';
         $variable10->save();
     }
     $variable10 = Image::where("filename", "=", 'avatar4')->first();
     if (empty($variable10)) {
         $variable10 = new Image();
         $variable10->original_name = 'avatar4';
         $variable10->filename = 'avatar4';
         $variable10->save();
     }
     $variable10 = Image::where("filename", "=", 'avatar5')->first();
     if (empty($variable10)) {
         $variable10 = new Image();
         $variable10->original_name = 'avatar5';
         $variable10->filename = 'avatar5';
         $variable10->save();
     }
     $variable9 = Configuracion::where("estado", "=", 1)->first();
     //$variable9= Configuracion::all()->last();
     if (empty($variable9)) {
         $Configuracion = new Configuracion();
         $Configuracion->nombre = 'lugrawibe';
         $Configuracion->estado = 1;
         $Configuracion->logo = 'fcytlogo';
         $Configuracion->facultad = 'fcyt';
         $Configuracion->organigrama = 'organigramafcyt';
         $Configuracion->imgenuno = 'avatar1';
         $Configuracion->imgendos = 'avatar2';
         $Configuracion->imgentres = 'avatar3';
         $Configuracion->imgencuatro = 'avatar4';
         $Configuracion->imgencinco = 'avatar5';
         $Configuracion->save();
         $variable9 = Configuracion::findOrFail($Configuracion->id);
     }
     $variable8 = Materium::all()->last();
     if (!empty($variable8)) {
         $variable8 = $variable8->codigo + 1;
     }
     if (empty($variable8)) {
         $variable8 = 400;
     }
     $variable7 = Sistemapg::all()->last();
     if (!empty($variable7)) {
         $variable7 = $variable7->nombre_de_facultad;
     }
     if (empty($variable7)) {
         $Sistema = new Sistemapg();
         $Sistema->nombre_de_facultad = 'Lugrawibe';
         $Sistema->save();
         $variable7 = 'Lugrawibe';
     }
     $variable6 = Autoridad::all()->last();
     if (!empty($variable6)) {
         $variable6 = $variable6->codigo + 1;
     }
     if (empty($variable6)) {
         $variable6 = 400;
     }
     $variable5 = Docente::all()->last();
     if (!empty($variable5)) {
         $variable5 = $variable5->codigo + 1;
     }
     if (empty($variable5)) {
         $doc = new Docente();
         $doc->nombre = 'por designar';
         $doc->codigo = 399;
         $doc->save();
         $variable5 = 400;
     }
     $variable4 = Carrera::all()->last();
     if (!empty($variable4)) {
         $variable4 = $variable4->codigo + 1;
     }
     if (empty($variable4)) {
         $variable4 = 400;
     }
     $variable3 = Area::all()->last();
     if (!empty($variable3)) {
         $variable3 = $variable3->codigo + 1;
     }
     if (empty($variable3)) {
         $variable3 = 400;
     }
     $variable2 = tema::all()->last();
     if (!empty($variable2)) {
         $variable2 = $variable2->tema;
     }
     if (empty($variable2)) {
         $tema = new tema();
         $tema->tema = 'skin-black';
         $tema->menu = 'sidebar-mini';
         $tema->save();
         $variable2 = 'skin-black';
     }
     $variable1 = tema::all()->last();
     if (!empty($variable1)) {
         $variable1 = $variable1->menu;
     }
     if (empty($variable1)) {
         $variable1 = 'sidebar-mini';
     }
     $variablefecha = Carbon::now();
     $variablefecha = $variablefecha->format('d-m-Y');
     View::share('variablefecha', $variablefecha);
     View::share('variable1', $variable1);
     View::share('variable2', $variable2);
     View::share('variable3', $variable3);
     View::share('variable4', $variable4);
     View::share('variable5', $variable5);
     View::share('variable6', $variable6);
     View::share('variable7', $variable7);
     View::share('variable8', $variable8);
     View::share('variable9', $variable9);
 }
Beispiel #8
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update()
 {
     //
     //echo $id;
     $input = Request::all();
     $docente = Docente::find($input['_id']);
     $docente->doc_nombre = $input['docente_nombre'];
     $docente->doc_apellido = $input['docente_apellido'];
     $docente->doc_telefono = $input['docente_telefono'];
     $docente->doc_celular = $input['docente_celular'];
     $docente->doc_email = $input['docente_email'];
     $docente->doc_domicilio = $input['docente_domicilio'];
     $docente->doc_cp = $input['docente_cp'];
     $docente->doc_dni = $input['docente_dni'];
     $docente->doc_cuit = $input['docente_cuit'];
     $docente->save();
     $cursos_docente = DB::table('curso')->join('curso_docente', 'curso.cur_id', '=', 'curso_docente.cdo_cur_id')->join('grupo_curso3', 'curso.cur_gcu3_id', '=', 'grupo_curso3.gcu3_id')->select('*')->where('curso_docente.cdo_doc_id', '=', $input['_id'])->get();
     return view('docente.editDocente')->with('docente', $docente)->with('cursos_docente', $cursos_docente)->with('edited', true);
 }