Example #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function postStore($nome, $senha, $email, $admin)
 {
     //Validar
     if (isset($nome) && isset($senha) && isset($email) && isset($admin)) {
         $agente = new Agente();
         $agente->name = $nome;
         $agente->password = bcrypt($senha);
         $agente->email = $email;
         $agente->admin = $admin;
         $agente->save();
         return "true";
     } else {
         return "false";
     }
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $agente = Agente::lists('nombre', 'id')->all();
     $agente = array('' => 'Seleccionar...') + $agente;
     $dependencia = Dependencia::lists('nombre', 'id')->all();
     $dependencia = array('' => 'Seleccionar...') + $dependencia;
     return view('deposito.create', compact('agente', 'dependencia'));
 }
Example #3
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $input = Input::all();
     $attempt = Auth::attempt(['name' => $input['name'], 'password' => $input['password']]);
     if ($attempt) {
         $agente = Agente::where('id', '=', Auth::id())->first();
         return View::make('main')->with("agente", $agente);
     } else {
         return View::make('login_error');
     }
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $producto = Producto::findOrFail($id);
     if ($producto->tip_destino == 1) {
         $ubicacion = Deposito::findOrFail($producto->cod_destino);
     }
     if ($producto->tip_destino == 2) {
         $ubicacion = Dependencia::findOrFail($producto->cod_destino);
     }
     if ($producto->tip_destino == 3) {
         $ubicacion = Agente::findOrFail($producto->cod_destino);
     }
     if ($producto->tip_destino == 4) {
         $ubicacion = Producto::findOrFail($producto->cod_destino);
     }
     return view('producto.show', compact('producto', 'ubicacion'));
 }
Example #5
0
 /**
  * Create a new user instance after a valid registration.
  * For custom classe...
  * @param  array  $data
  * @return Agente
  */
 protected function create(array $data)
 {
     return Agente::create(['name' => $data['name'], 'senha' => bcrypt($data['password'])]);
 }
Example #6
0
 public function editCursoPagoCheque($id)
 {
     //
     $pago_cheque = PagoCheque::find($id);
     $docente = DPagoCheque::getDatosDocenteById($pago_cheque->docente_id);
     $curso = DPagoCheque::getDatosCursoById($pago_cheque->curso_id);
     //print_r($id);
     //exit;
     //Traer Docente y Actividad
     $helper = new Helper();
     $disponible = $helper->getHelperByDominio('disponible_id');
     $entregado_por = Agente::get();
     $nro_memo = Remitidos::where('remitidos_id', '=', $pago_cheque->nro_memo_id)->first();
     $nro_recibo = $this->traeUltimoNroRecibo();
     return view('cheques.editCursoPagoCheque')->with('pago_cheque', $pago_cheque)->with('docente', $docente)->with('curso', $curso)->with('disponible', $disponible)->with('entregado_por', $entregado_por)->with('nro_memo', $nro_memo)->with('nro_recibo', $nro_recibo);
 }
 private function listProduc($datas)
 {
     $data = [];
     $ubicacion = null;
     foreach ($datas as $value) {
         if ($value->tip_destino == 1) {
             $deposito = Deposito::findOrFail($value->cod_destino);
             $ubicacion = $deposito->nombre;
         } else {
             if ($value->tip_destino == 2) {
                 $dependencia = Dependencia::findOrFail($value->cod_destino);
                 $ubicacion = $dependencia->nombre;
             } else {
                 if ($value->tip_destino == 3) {
                     $agente = Agente::findOrFail($value->cod_destino);
                     $ubicacion = $agente->apellido . ' ' . $agente->nombre;
                 } else {
                     $producto = Producto::findOrFail($value->cod_destino);
                     $ubicacion = $producto->nombre;
                 }
             }
         }
         array_push($data, array('id' => $value->id, 'nombre' => $value->nombre, 'nro_serie' => $value->nro_serie, 'id_patrimonial' => $value->id_patrimonial, 'ubicacion' => $ubicacion, 'detalle' => $value->detalle));
     }
     return $data;
 }
Example #8
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Agente::destroy($id);
     return redirect('agente');
 }
Example #9
0
 public function altaActuacion()
 {
     //if(session_status() == 1)
     //return Redirect::to('/');
     //
     $archivo_actuacion = ArchivoActuacion::get();
     $area_cfj = AreaCfj::get();
     $conste_agente = Agente::get();
     return view('actuacion.altaActuacion')->with('archivo_actuacion', $archivo_actuacion)->with('area_cfj', $area_cfj)->with('conste_agente', $conste_agente);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $agente = Agente::find($id);
     $agente->delete();
     return redirect()->back();
 }