function research_show() { global $project; global $area; $project = new Project(); $project = $project->find($_REQUEST['id']); $areas = new Areas(); $area = $areas->find($project->area_id); render(); }
public function Areas($action) { if (isset($action)) { if ($action == "create") { $data = Areas::firstOrCreate(Input::all()); return $respuesta = array('Record' => $data, 'Result' => "OK"); } if ($action == "edit") { Areas::where("id", Input::get("id"))->update(Input::except("id")); return $respuesta = array('Record' => Areas::find(Input::get('id')), 'Result' => "OK"); } if ($action == "remove") { Areas::where('id', Input::get("id"))->delete(); return '{"Result":"OK"}'; } if ($action == "list") { $Records = Areas::get(); $respuesta = array('Records' => $Records, 'Result' => "OK"); return json_encode($respuesta); } } }
function admin_research_area() { if (isset($_POST['delete'])) { $areas = new Areas(); if ($a = $areas->find($_POST['delete']['area_id'])) { $a->delete(); } } if (isset($_POST['edit'])) { $areas = new Areas(); if ($a = $areas->find($_POST['edit']['area_id'])) { $a->name = $_POST['edit']['name']; $a->description = $_POST['edit']['description']; $a->display = $_POST['edit']['display']; $a->save(); } } if (isset($_POST['new'])) { $a = new Areas(); $a->name = $_POST['new']['name']; $a->description = $_POST['new']['description']; $a->display = $_POST['new']['display']; $a->save(); } global $areas; $areas = new Areas(); $areas = $areas->find(); render(); }
/** * Display the specified resource. * GET /eventos/{id} * * @param int $id * @return Response */ public function show($id) { return json_encode(Areas::find($id)); }