Exemplo n.º 1
0
     // delete checkbox set ?
     // then the record is simply dropped and processing stops at this point
     zef_delete_record($id);
     break;
 }
 logfile(implode(" : ", $data));
 // check if the posted time values are possible
 $setTimeValue = 0;
 // 0 means the values are incorrect. now we check if this is true ...
 $edit_in_day = expand_date_shortcut($_REQUEST['edit_in_day']);
 $edit_out_day = expand_date_shortcut($_REQUEST['edit_out_day']);
 $edit_in_time = expand_time_shortcut($_REQUEST['edit_in_time']);
 $edit_out_time = expand_time_shortcut($_REQUEST['edit_out_time']);
 $new_in = "{$edit_in_day}-{$edit_in_time}";
 $new_out = "{$edit_out_day}-{$edit_out_time}";
 if (check_time_format($new_in) && check_time_format($new_out)) {
     // if this is TRUE the values PASSED the test!
     $setTimeValue = 1;
 } else {
     break;
 }
 $new_time = convert_time_strings($new_in, $new_out);
 logfile("new_time: " . serialize($new_time));
 // if the difference between in and out value is zero or below this can't be correct ...
 // TIME WRONG - NEW ENTRY
 if (!$new_time['diff'] && !$id) {
     // if this is an ADD record dialog it makes no sense to create the record
     // when it doesn't have any TIME attached ... so this stops the processing.
     // TODO: throw a warning message when this happens ...
     break;
 }
Exemplo n.º 2
0
 $data['exp_refundable'] = isset($_REQUEST['refundable']);
 $data['erase'] = isset($_REQUEST['erase']);
 if ($data['erase']) {
     // delete checkbox set ?
     // then the record is simply dropped and processing stops at this point
     exp_delete_record($id);
     break;
 }
 logfile(implode(" : ", $data));
 // check if the posted time values are possible
 $setTimeValue = 0;
 // 0 means the values are incorrect. now we check if this is true ...
 $edit_day = expand_date_shortcut($_REQUEST['edit_day']);
 $edit_time = expand_time_shortcut($_REQUEST['edit_time']);
 $new = "{$edit_day}-{$edit_time}";
 if (!check_time_format($new)) {
     // if this is TRUE the values PASSED the test!
     //$setTimeValue = 1;
     break;
 }
 $new_time = convert_time_strings($new, $new);
 $data['exp_timestamp'] = $new_time['in'];
 //logfile("new_time: " .serialize($new_time));
 $data['exp_multiplier'] = str_replace($kga['conf']['decimalSeparator'], '.', $data['exp_multiplier']);
 $data['exp_value'] = str_replace($kga['conf']['decimalSeparator'], '.', $data['exp_value']);
 if ($id) {
     // TIME RIGHT - NEW OR EDIT ?
     // TIME RIGHT - EDIT ENTRY
     logfile("exp_edit_record: " . $id);
     exp_edit_record($id, $data);
 } else {