Пример #1
0
 public function action_down()
 {
     $code = $this->request->param('id');
     $portfolio = new Model_Portfolio();
     $portfolio->setDown($code);
     HTTP::redirect($_SERVER['HTTP_REFERER']);
 }
Пример #2
0
 public function action_index()
 {
     $data = Model_Portfolio::getAll();
     $content = View::factory('homeview');
     $content->bind('data', $data);
     $this->template->content = $content;
 }
Пример #3
0
 public function action_deletePortfolio($id = null)
 {
     try {
         is_null($id) and Response::redirect('employee');
         if ($portfolio = Model_Portfolio::find($id)) {
             $employee_id = $portfolio->employee_id;
             $portfolio->delete();
             Session::set_flash('success', 'Deleted Portfolio #' . $id);
             Response::redirect('employee/portfolio/' . $employee_id);
         } else {
             Session::set_flash('error', 'Could not delete Portfolio #' . $id);
             Response::redirect('employee');
         }
     } catch (Exception $e) {
         die($e->getMessage());
     }
 }