Esempio n. 1
0
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();
}
Esempio n. 2
0
 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);
         }
     }
 }
Esempio n. 3
0
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();
}
Esempio n. 4
0
 /**
  * Display the specified resource.
  * GET /eventos/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     return json_encode(Areas::find($id));
 }