Exemplo n.º 1
0
 public function calendarAction()
 {
     if ($this->isAjax()) {
         $context = $this->model()->buildCalendar(Input::get('month'), Input::get('year'), Input::get('boardroom'));
         echo $this->view('home/calendar', $context);
     }
 }
Exemplo n.º 2
0
 public function sendMailToAllAction()
 {
     $context = [];
     $employee = new Employee();
     if (!$employee->hasPermission('admin')) {
         Redirect::to('home');
     }
     if (Input::exists()) {
         if (!Token::check(Input::get('token'))) {
             Redirect::to();
         }
         $data = ['subject' => Input::get('subject'), 'body' => Input::get('body')];
         $success = $this->model()->sendMailToAll($data);
         if ($success) {
             Redirect::to('employee');
         } else {
             $context['errors'] = $this->model()->getErrors();
             $context['values'] = $data;
         }
     }
     $context['flash'] = Session::flash('home');
     $context['token'] = Token::generate();
     echo $this->view('employee/sendmailtoall', $context);
 }
Exemplo n.º 3
0
 public function deleteAction($id = null, $parent = null)
 {
     if (isset($id) && !empty($id)) {
         if (!Token::check(Input::get('token'))) {
             Redirect::to();
         }
         if (isset($parent) && !empty($parent)) {
             $this->model()->deleteAppointment($id, $parent);
         } else {
             $this->model()->deleteAppointment($id);
         }
         Redirect::to('reservation/confirmation');
     } else {
         http_response_code(404);
         exit("Dude, I think you're lost");
     }
 }