예제 #1
0
                 default:
                     $check = check_format_values_program($value, "other", $tolerance);
                     break;
             }
         }
         if (count($check) == 0) {
             echo json_encode("error");
         } else {
             echo json_encode($check);
         }
     } else {
         echo json_encode("error");
     }
     return 0;
 case 'month':
     if (!check_format_date("{$value}", $type)) {
         echo "error";
     }
     break;
 case 'date_interval':
     $value = explode('_', $value);
     if (count($value) != 2) {
         echo "error";
         break;
     }
     if (!check_date($value[0], $value[1])) {
         echo "error";
     }
     break;
 case 'numeric':
     if (!check_numeric_value("{$value}")) {
예제 #2
0
$yaxis_array[8] = programs\get_curve_information('power');
$yaxis_array[9] = programs\get_curve_information('program');
// Used to alert user if export is could be done
$check_log = logs\check_export_table_csv("logs", $main_error);
$check_power = logs\check_export_table_csv("power", $main_error);
$sd_card = $GLOBALS['CULTIPI_CONF_TEMP_PATH'];
//More default values:
if (!isset($startday) || empty($startday) || $reload_import) {
    $startday = programs\get_last_day_with_logs();
}
$startday = str_replace(' ', '', "{$startday}");
if ($startday == "") {
    $startday = date('Y') . "-" . date('m') . "-" . date('d');
    $fake_log = true;
} else {
    if (!check_format_date($startday, "days")) {
        $startday = date('Y') . "-" . date('m') . "-" . date('d');
    }
}
if (!isset($startmonth) || empty($startmonth)) {
    $startmonth = "";
    if (isset($_GET['startmonth'])) {
        $startmonth = $_GET['startmonth'];
    } else {
        $startmonth = date('m');
    }
}
if (!isset($startyear) || empty($startyear)) {
    $startyear = "";
    if (isset($_GET['startyear'])) {
        $startyear = $_GET['startyear'];