- // Starting day
- $content['s_sec'] = addSelectionBox('sec' , date('s', $content['start_time']), 'start', $id);
- $content['s_min'] = addSelectionBox('min' , date('i', $content['start_time']), 'start', $id);
- $content['s_hour'] = addSelectionBox('hour' , date('G', $content['start_time']), 'start', $id);
- $content['s_day'] = addSelectionBox('day' , date('d', $content['start_time']), 'start', $id);
- $content['s_month'] = addSelectionBox('month', date('m', $content['start_time']), 'start', $id);
- $content['s_year'] = addSelectionBox('year' , date('Y', $content['start_time']), 'start', $id);
-
- // Ending day
- $content['e_sec'] = addSelectionBox('sec' , date('s', $content['end_time']) , 'end' , $id);
- $content['e_min'] = addSelectionBox('min' , date('i', $content['end_time']) , 'end' , $id);
- $content['e_hour'] = addSelectionBox('hour' , date('G', $content['end_time']) , 'end' , $id);
- $content['e_day'] = addSelectionBox('day' , date('d', $content['end_time']) , 'end' , $id);
- $content['e_month'] = addSelectionBox('month', date('m', $content['end_time']) , 'end' , $id);
- $content['e_year'] = addSelectionBox('year' , date('Y', $content['end_time']) , 'end' , $id);
-
- // Remember other values
- $content['templ'] = addReferalRallyeTemplateSelection('templ['.$id.']', $content['template']);
- $content['sw'] = $SW;
- $content['id'] = $id;
+ // Only for editing ...
+ if ($mode == 'edit') {
+ // Starting day
+ $content['s_min'] = addSelectionBox('mi', getMinute($content['start_time']) , 'start_time', $id);
+ $content['s_hour'] = addSelectionBox('ho', getShortHour($content['start_time']), 'start_time', $id);
+ $content['s_day'] = addSelectionBox('da', getDay($content['start_time']) , 'start_time', $id);
+ $content['s_month'] = addSelectionBox('mo', getMonth($content['start_time']) , 'start_time', $id);
+ $content['s_year'] = addSelectionBox('ye', getYear($content['start_time']) , 'start_time', $id);
+
+ // Ending day
+ $content['e_min'] = addSelectionBox('mi', getMinute($content['end_time']) , 'end_time' , $id);
+ $content['e_hour'] = addSelectionBox('ho', getShortHour($content['end_time']) , 'end_time' , $id);
+ $content['e_day'] = addSelectionBox('da', getDay($content['end_time']) , 'end_time' , $id);
+ $content['e_month'] = addSelectionBox('mo', getMonth($content['end_time']) , 'end_time' , $id);
+ $content['e_year'] = addSelectionBox('ye', getYear($content['end_time']) , 'end_time' , $id);
+
+ // Remember other values
+ $content['templ'] = addReferralRallyeTemplateSelection('templ[' . $id . ']', $content['template']);
+ } else {
+ // Convert timestamps into human-readable
+ $content['start_time'] = generateDateTime($content['start_time'], '2');
+ $content['end_time'] = generateDateTime($content['end_time'] , '2');
+ }
+
+ // Remember id number
+ $content['rallye_id'] = bigintval($id);