function editEventFormSucceeded(\Nette\Forms\BootstrapUIForm $form)
 {
     $values = $form->getHttpData($form::DATA_TEXT);
     $date_start = \DateTime::createFromFormat('j. n. Y', $form->values->date_event);
     $date1 = $date_start->format('Y-m-d');
     $date_start = \DateTime::createFromFormat('j. n. Y', $form->values->date_event_end);
     $date2 = $date_start->format('Y-m-d');
     if ($form->values->date_event == '') {
         $dateEvent = null;
     } else {
         if ($form->values->allday) {
             $dateEvent = $date1 . ' 00:00:00';
         } else {
             $dateEvent = $date1 . ' ' . $values["hour_event"] . ':' . $values["minute_event"];
         }
     }
     if ($form->values->date_event_end == '') {
         $dateEventEnd = null;
     } else {
         if ($form->values->allday) {
             $dateEventEnd = $date2 . ' 23:55:00';
         } else {
             $dateEventEnd = $date2 . ' ' . $values["hour_event_end"] . ':' . $values["minute_event_end"];
         }
     }
     $arr = array("date_event" => $dateEvent, "date_event_end" => $dateEventEnd, "all_day" => $form->values->allday, "price" => $form->values->price, "capacity" => $form->values->capacity, "capacity_start" => $form->values->capacity_start, "time_range" => $form->values->time_range);
     if ($form->values->contact) {
         $arr["contacts_id"] = $form->values->contact;
     }
     $this->database->table("events")->get($form->values->event_id)->update($arr);
     $this->presenter->redirect(":Admin:Events:detail", array("id" => $form->values->id));
 }
 function editSettingsSucceeded(\Nette\Forms\BootstrapUIForm $form)
 {
     $values = $form->getHttpData($form::DATA_TEXT);
     // get value from html input
     foreach ($values["set"] as $key => $value) {
         $this->database->table("settings")->where(array("setkey" => $key))->update(array("setvalue" => $value));
     }
     $this->presenter->redirect(this, array("id" => $form->values->category_id));
 }