Exemplo n.º 1
0
 public function delete()
 {
     $success = false;
     try {
         $suggestion = Suggestion::find(Input::get("id"));
         $suggestion->delete();
         $success = true;
         $response = "Registro eliminado correctamente.";
     } catch (Exception $ex) {
         $response = "No se ha podido eliminar el registro seleccionado. " . $ex->getMessage();
     }
     return Response::json(array("response" => $response, "success" => $success));
 }
Exemplo n.º 2
0
 public static function toggleProcessed($id)
 {
     if (self::get_user_admin() == null) {
         Redirect::to('/home');
     }
     $suggestion = Suggestion::find($id);
     if (!$suggestion->processed) {
         $suggestion->processed = 1;
     } else {
         $suggestion->processed = 0;
     }
     $suggestion->update();
     Redirect::to('/suggestions', array('message' => 'Updated!'));
 }