/** * getPlans * -------------------------------------------------- * @return Renders the Plans and Pricing page * -------------------------------------------------- */ public function getPlans() { /* Get all plans */ $plans = Plan::all(); /* Render the page */ return View::make('payment.plans', ['plans' => $plans]); }
public function testCreateRetrieveAll() { self::authorizeFromEnv(); $planID = 'gold-' . self::randomString(); $p = Plan::create(array('amount' => 2000, 'interval' => 'month', 'currency' => self::CURRENCY, 'name' => 'Plan', 'id' => $planID)); $plan_retrieve = Plan::retrieve($planID); $this->assertSame($planID, $plan_retrieve->id); $planID_2 = 'foobar-2-' . self::randomString(); $p_2 = Plan::create(array('amount' => 3000, 'interval' => 'month', 'currency' => self::CURRENCY, 'name' => 'Plan_2', 'id' => $planID_2)); $plans = Plan::all(array('limit' => 2, 'offset' => 0)); $this->assertSame(2, count($plans['data'])); }
public function editarProyecto() { $idProyecto = Input::get('p'); //Obtiene el id del proyecto a trabajar. $ciclo = Proyecto::select('ciclo')->where('id', $idProyecto)->get(); $semestres = []; if (sizeof($ciclo) > 0) { if ($ciclo[0]->ciclo == "Enero-Julio") { $semestres = [2, 4, 6, 8]; } else { $semestres = [1, 3, 5, 7, 9]; } return View::make('proyectos.plantilla')->with('planes', Plan::all())->with('semestres', $semestres)->with('id', $idProyecto)->with('plantillas', Plantilla::select('plantillas.*', 'p.nombre as plan', 's.semestre')->join('subjects as s', 's.id', '=', 'plantillas.id_subject')->join('plans as p', 'p.id', '=', 's.id_plan')->where('id_proyecto', $idProyecto)->groupBy('s.semestre')->groupBy('plantillas.grupo')->get()); } else { return Redirect::to('proyectos'); } }
public function get_overview() { return View::make('page.admin.plan.overview')->with('plans', Plan::all()); }
public function get_index() { return View::make('page.plan')->with('plans', Plan::all())->with('settings', IniHandle::readini()); }
public function update() { $id = Input::get('id'); $tabla = Input::get('tabla'); switch ($tabla) { case '0': $clave = Input::get('clave'); $appat = Input::get('ap_pat'); $apmat = Input::get('ap_mat'); $nombre = Input::get('nombre'); $segnombre = Input::get('seg_nombre'); $tipo = Input::get('tipo'); $grado = Input::get('grado'); $tutorias = Input::get('tutorias'); $gestion = Input::get('gestion'); $investigacion = Input::get('investigacion'); $dependencias = Input::get('dependencias'); $edit = Professor::find($id); $edit->clave = $clave; $edit->ap_pat = $appat; $edit->ap_mat = $apmat; $edit->nombre = $nombre; $edit->seg_nombre = $segnombre; $edit->tipo = $tipo; $edit->id_grado = $grado; $edit->tutorias = $tutorias; $edit->gestion = $gestion; $edit->investigacion = $investigacion; $edit->dependencias = $dependencias; $edit->save(); return View::make('crud.crudMaestros')->with('professors', Professor::all()); break; case '1': $nombre = Input::get('nombre'); $semestre = Input::get('semestre'); $plan = Input::get('idPlan'); $edit = Subject::find($id); $edit->nombre = $nombre; $edit->semestre = $semestre; $edit->id_plan = $plan; $edit->save(); return View::make('crud.crudMaterias')->with('subjects', Subject::all()); break; case '2': $nombre = Input::get('nombre'); $edit = Aula::find($id); $edit->nombre = $nombre; $edit->save(); return View::make('crud.crudAulas')->with('aulas', Aula::all()); break; case '3': $nombre = Input::get('nombre'); $edit = Plan::find($id); $edit->nombre = $nombre; $edit->save(); return View::make('crud.crudPlanes')->with('plans', Plan::all()); break; default: //aqui me redirecciona a una pagina vacia solo con un mensaje 404 return View::make('landing'); break; } }