Пример #1
0
 public static function existeGrupo($ngrupo)
 {
     $group = Grupo::where('nombre', $ngrupo)->first();
     if (isset($group)) {
         return 1;
     }
     return -1;
 }
Пример #2
0
 public function editar($id)
 {
     $header = 'Editar Producto';
     $breadcrumb = 'Editar Producto';
     $accion = 'Guardar';
     $producto = Producto::where('codigo', $id)->first();
     $grupo = Grupo::where('codigo', $producto->marca_id)->first();
     $padreGrupo = Grupo::where('id', $grupo->tipo)->first();
     $hijos = Grupo::where('tipo', $padreGrupo->id)->get();
     $padres = Grupo::where('tipo', 1)->get();
     $colores = Color::all();
     return view('productos.edit', compact('header', 'breadcrumb', 'padres', 'padreGrupo', 'hijos', 'producto', 'accion', 'colores'));
 }
 public function delete($id)
 {
     $grupo = Grupo::where('gru_codigo', '=', $id)->first();
     return view('grupos.excluir', ['grupo' => $grupo]);
 }
Пример #4
0
 public function getListaGrupos(Request $request, $estId, $turno)
 {
     $grupos = \App\Grupo::where('fk_est_id', $estId)->where('grp_turno', $turno)->whereNull('deleted_at')->get();
     return $grupos->toJson();
 }
Пример #5
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     // obtendo os dados do usuário
     $usuario = Usuario::findOrNew($id);
     // obtendo os grupos do usuário
     $usuario_grupos = $this->usuario_model->getGrupos($usuario->id);
     // injetando os grupos na classe de usuário
     $usuario->grupos = $usuario_grupos;
     // obtendo os grupos
     $grupos = Grupo::where('ativo', 1)->get();
     // configurando o titulo e os breadcrumbs
     $titulo = 'Cadastro';
     $breadcrumb = [['nome' => 'Usuário', 'ultimo' => false], ['nome' => 'Editar Usuário', 'ultimo' => true]];
     // enviando dados para a view
     return view('usuario.form')->with('registro', $usuario)->with('grupos', $grupos)->with('paginaTitulo', $titulo)->with('paginaBreadcrumb', $breadcrumb);
 }
Пример #6
0
 public function hijos($padre_id)
 {
     $hijos = Grupo::where('tipo', $padre_id)->get();
     return response()->json($hijos);
 }
 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');
 }
 public function delete($idGrupo, $idLista, $id)
 {
     $grupo = Grupo::where('gru_codigo', '=', $idGrupo)->first();
     $lista = Lista::where('lis_codigo', '=', $idLista)->first();
     $item = Item::where('ite_codigo', '=', $id)->first();
     return view('itens.excluir', ['item' => $item, 'grupo' => $grupo, 'lista' => $lista]);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index($id)
 {
     $grupo = Grupo::where('gru_codigo', '=', $id)->first();
     $membro = Membro::where('gru_codigo', '=', $id)->get();
     return view('membros.index', ['membros' => $membro, 'grupo' => $grupo]);
 }
 public function delete($idGrupo, $id)
 {
     $grupo = Grupo::where('gru_codigo', '=', $id)->first();
     $lista = Lista::where('lis_codigo', '=', $id)->first();
     return view('listas.excluir', ['lista' => $lista, 'grupo' => $grupo]);
 }
Пример #11
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $estabelecimento = Auth::user()->estabelecimento->est_id;
     $turnos = DB::select("SELECT DISTINCT grp_turno FROM tb_grupo WHERE " . "fk_est_id = :est_id", ['est_id' => $estabelecimento]);
     $profissionais = Profissional::where('fk_est_id', '=', $estabelecimento)->get();
     $tratamento = \App\Tratamento::findOrFail($id);
     $turnoAtual = $tratamento->grupos[0]->grp_turno;
     $gruposAtual = array();
     $substanciasAtual = array();
     foreach ($tratamento->grupos as $grupo) {
         $gruposAtual[] = $grupo->grp_id;
     }
     foreach ($tratamento->paciente->substancias as $substancia) {
         $substanciasAtual[] = $substancia->sub_id;
     }
     $todosGrupos = \App\Grupo::where('fk_est_id', '=', $estabelecimento)->where('grp_turno', '=', $turnoAtual)->whereNull('deleted_at')->get();
     return View('tratamento.edit', ['tratamento' => $tratamento, 'profissionais' => $profissionais, 'turnos' => $turnos, 'turno_atual' => $turnoAtual, 'todos_grupos' => $todosGrupos, 'grupos_atual' => $gruposAtual, 'tecnico_ref' => $tratamento->fk_prof_id, 'substanciasAtual' => $substanciasAtual, 'substancias' => $this->substancias]);
 }
 public function lista(Request $request)
 {
     $categoria = $request->categoria;
     $nome = $request->nome;
     $grupos = Grupo::paginate(15);
     if ($categoria) {
         $grupos = Grupo::where('categoria', $categoria)->paginate(15);
     }
     if ($nome) {
         $grupos = Grupo::where('nome', $nome)->paginate(15);
     }
     return view('grupo.listagem')->with('grupos', $grupos);
 }