$recurrence_date_start = Rsys::mysql_datetime_to_timestamp($values['start']);
         $recurrence_date_end = Rsys::mysql_datetime_to_timestamp($values['end']);
         $recurrence_period_end = Rsys::mysql_datetime_to_timestamp($values['recurrence_until']);
         $recurrence_subscribe_from = Rsys::mysql_datetime_to_timestamp($values['subscribe_from']);
         $count = 0;
         $recurrence_date_start = $recurrence_date_start + 60 * 60 * 24 * $values['repeater'] * $values['recurrence_selector'];
         $recurrence_date_end = $recurrence_date_end + 60 * 60 * 24 * $values['repeater'] * $values['recurrence_selector'];
         while ($recurrence_date_end < $recurrence_period_end) {
             if ($values['forever'] == 0) {
                 $recurrence_subscribe_from = 0;
                 $recurrence_subscribe_until = 0;
             } else {
                 $recurrence_subscribe_from = $recurrence_subscribe_from + 60 * 60 * 24 * $values['repeater'] * $values['recurrence_selector'];
                 $recurrence_subscribe_until = $recurrence_subscribe_until + 60 * 60 * 24 * $values['repeater'] * $values['recurrence_selector'];
             }
             $errors[] = Rsys::add_reservation($values['itemid'], $values['auto_accept'], $values['maxuser'], Rsys::timestamp_to_datetime($recurrence_date_start), Rsys::timestamp_to_datetime($recurrence_date_end), $values['forever'] == 0 ? 0 : Rsys::timestamp_to_datetime($recurrence_subscribe_from), $values['forever'] == 0 ? 0 : Rsys::timestamp_to_datetime($recurrence_subscribe_until), $values['notes'], $values['timepicker'], $values['min'], $values['max'], $Inserted_id);
             if ($errors[$count] != 0) {
                 $msg .= str_replace('#START#', "<b>" . Rsys::timestamp_to_datetime($recurrence_date_start) . "</b>", str_replace('#END#', "<b>" . Rsys::timestamp_to_datetime($recurrence_date_end) . "</b>", get_lang('ReservationFromUntilError')));
             }
             $count++;
             $recurrence_date_start = $recurrence_date_start + 60 * 60 * 24 * $values['repeater'] * $values['recurrence_selector'];
             $recurrence_date_end = $recurrence_date_end + 60 * 60 * 24 * $values['repeater'] * $values['recurrence_selector'];
         }
     }
     if (!empty($msg)) {
         Display::display_normal_message($msg);
     }
     echo $buffer;
     break;
 case 'edit':
     if (isset($_GET["id"])) {