Пример #1
0
 public function run()
 {
     $i = 1;
     DB::table('directiva')->delete();
     $directiva[] = array("nombre" => "Fulano de Tal", "Cargo" => "Presidente de la junta Directiva", "email" => "*****@*****.**", "telefono" => "123456789");
     $directiva[] = array("nombre" => "Mengana", "Cargo" => "Secretario", "email" => "*****@*****.**", "telefono" => "123456789");
     $directiva[] = array("nombre" => "Pedro Pérez", "Cargo" => " Tesorero", "email" => "*****@*****.**", "telefono" => "123456789");
     $directiva[] = array("nombre" => "Ana Rojas", "Cargo" => "Administrador", "email" => "*****@*****.**", "telefono" => "123456789");
     $directiva[] = array("nombre" => "Juan Gonzalez", "Cargo" => "Consejal", "email" => "*****@*****.**", "telefono" => "123456789");
     Directiva::insert($directiva);
     $this->command->info('Directiva Table Seed!');
 }
Пример #2
0
 public function Directiva($action)
 {
     if (isset($action)) {
         if ($action == "create") {
             $data = Directiva::firstOrCreate(Input::all());
             return $respuesta = array('Record' => $data, 'Result' => "OK");
         }
         if ($action == "edit") {
             Directiva::where("id", Input::get("id"))->update(Input::except("id"));
             return $respuesta = array('Record' => Directiva::find(Input::get('id')), 'Result' => "OK");
         }
         if ($action == "remove") {
             Directiva::where('id', Input::get("id"))->delete();
             return '{"Result":"OK"}';
         }
         if ($action == "list") {
             $Records = Directiva::get();
             $respuesta = array('Records' => $Records, 'Result' => "OK");
             return json_encode($respuesta);
         }
     }
 }
Пример #3
0
 /**
  * Display a listing of the resource.
  * GET /directivas
  *
  * @return Response
  */
 public function index()
 {
     return Directiva::all();
 }
Пример #4
0
 public function verdirectiva()
 {
     $directiva = Directiva::select("nombre", "cargo", "telefono", "email")->get();
     return View::make('directiva')->with('directiva', $directiva);
 }