public function getEditar($id)
 {
     $material = Material::findOrFail($id);
     $unidades = UnidadEntrega::all();
     $familias = Familia::all();
     $marcas = Marca::all();
     return view('material.material-editar', ['material' => $material, 'unidades' => $unidades, 'familias' => $familias, 'marcas' => $marcas]);
 }
Example #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     try {
         return Marca::all();
     } catch (Exception $exc) {
         echo $exc->getTraceAsString();
     }
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $renglon = \App\Renglon::find($id);
     $trenglon = \App\TipoRenglon::all()->lists('descrip_tipo_renglon', 'id_tipo_renglon');
     $marca = \App\Marca::all()->lists('descrip_marca', 'id_marca');
     $modelo = \App\Modelo::all()->lists('descrip_modelo', 'id_modelo');
     $seriales = DB::table('renglones')->join('seriales', 'renglones.id_renglon', '=', 'seriales.id_renglon')->select('seriales.seriales', 'seriales.id_serial')->where('seriales.id_renglon', '=', $id)->get();
     /*$seriales = Renglon::join('seriales','renglones.id_renglon','=','seriales.id_renglon')
       ->where('seriales.id_renglon','=',$id)
       ->lists('seriales.seriales', 'seriales.id_serial');*/
     /*Friends   // work on friends table
       ->join('users','users.id','=','friends_table.user_id')  // join users table to..
        ->where('friends_table.user_id', $user->id)
            ->lists(DB::raw('concat(first_name," ",last_name)'), 'friend_id')  // ...concatenate its fields*/
     return view('renglon.editar')->with(['renglon' => $renglon, 'marca' => $marca, 'modelo' => $modelo, 'tipo_renglon' => $trenglon, 'seriales' => $seriales]);
 }
Example #4
0
 Route::get('/estoque/peca/editar/{id}', ['as' => 'peca.editar', 'uses' => 'Admin\\PecaController@editar']);
 Route::post('/estoque/peca/cadastrar', ['as' => 'peca.cadastrar', 'uses' => 'Admin\\PecaController@cadastrar']);
 Route::post('/estoque/peca/atualizar', ['as' => 'peca.atualizar', 'uses' => 'Admin\\PecaController@atualizar']);
 Route::post('/estoque', ['as' => 'peca.pesquisa', 'uses' => 'Admin\\PecaController@pesquisar']);
 Route::post('/estoque/excluir', ['as' => 'peca.excluir', 'uses' => 'Admin\\PecaController@excluir']);
 //    Contrato
 Route::get('/contrato', ['as' => 'contrato.index', 'uses' => 'Admin\\ContratoController@index']);
 Route::get('/contrato/novo', ['as' => 'contrato.novo', 'uses' => 'Admin\\ContratoController@novo']);
 Route::get('/contrato/editar/{id}', ['as' => 'contrato.editar', 'uses' => 'Admin\\ContratoController@editar']);
 Route::post('/contrato/cadastrar', ['as' => 'contrato.cadastrar', 'uses' => 'Admin\\ContratoController@cadastrar']);
 Route::post('/contrato/atualizar', ['as' => 'contrato.atualizar', 'uses' => 'Admin\\ContratoController@atualizar']);
 Route::post('/contrato', ['as' => 'contrato.pesquisa', 'uses' => 'Admin\\ContratoController@pesquisar']);
 Route::post('/contrato/addServico', ['as' => 'contrato.addservico', 'uses' => 'Admin\\ContratoController@addServico']);
 Route::post('/contrato/excluir', ['as' => 'contrato.excluir', 'uses' => 'Admin\\ContratoController@excluir']);
 View::composer(['admin.modelo.includes.formulario', 'admin.modelo.index', 'admin.veiculo.includes.formulario'], function ($view) {
     $marcas = \App\Marca::all();
     $dados = [];
     foreach ($marcas as $r) {
         $dados[$r->id] = $r->nome;
     }
     $view->with('marcas', $dados);
 });
 View::composer(['admin.veiculo.index'], function ($view) {
     $modelos = \App\Modelo::all();
     $dados = [];
     foreach ($modelos as $r) {
         $dados[$r->id] = $r->nome;
     }
     $view->with('modelos', $dados);
 });
 View::composer(['admin.veiculo.includes.formulario'], function ($view) {
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $solicitudes = \App\Solicitudes::find($id);
     $oficina = \App\Oficinas::all()->lists('descrip_oficina', 'id_oficina');
     $departamento = \App\Departamentos::all()->lists('descrip_departamento', 'id_departamento');
     $tarticulo = \App\TipoRenglon::all()->lists('descrip_tipo_renglon', 'id_tipo_renglon');
     $marca = \App\Marca::all()->lists('descrip_marca', 'id_marca');
     $articulo = \App\Renglon::all()->lists('descrip_renglon', 'id_renglon');
     return view('solicitudes.editar')->with(['solicitud' => $solicitudes, 'oficina' => $oficina, 't_articulo' => $tarticulo, 'marca' => $marca, 'articulo' => $articulo, 'departamento' => $departamento]);
 }
Example #6
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return response()->json(['status' => 'OK', 'data' => Marca::all()], 200);
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $modelos = Modelo::find($id);
     $marca = \App\Marca::all()->lists('descrip_marca', 'id_marca');
     return view('modelos.editar')->with(['marca' => $marca, 'modelo' => $modelos]);
 }