$startDay = $dayArray[0][0]; } if (strtotime($endDayAmi) > strtotime($endDayArrayAmi)) { $endDay = $dayArray[0][count($dayArray[0]) - 1]; } if (strtotime($startDayAmi) > strtotime($endDayAmi)) { echo "Das Startdatum darf nicht größer sein als das Enddatum"; } else { $endIndex = array_search($endDay, $dayArray[0]) + 1; $label = []; $startIndex = array_search($startDay, $dayArray[0]); for ($i = $startIndex; $i < $endIndex; $i++) { array_push($weekArray, array_sum($dayArray[1][$i])); array_push($label, $dayArray[0][$i]); } if (checkIfValid($startDay) && checkIfValid($endDay)) { if ($statistic == 0) { $graph = new Graph(1280, 720); $graph->SetScale("textlin"); $graph->SetShadow(); $graph->img->SetMargin(45, 30, 20, 40); $b1plot = new BarPlot($weekArray); $gbplot = new GroupBarPlot(array($b1plot)); $graph->Add($gbplot); $graph->xaxis->SetTickLabels($label); $graph->title->SetFont(FF_FONT1, FS_BOLD); $graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD); $graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD); $graph->Stroke(); } elseif ($statistic == 1) { $graph = new Graph(1280, 720);
} if ($eingabe[0] <= $monthsofyears[$eingabe[1] - 1]) { if ($eingabe[1] <= 12 && $eingabe[1] >= 1) { if ($eingabe[2] >= 2016 && $eingabe[2] <= \date("Y") && $eingabe[1] <= \date("m")) { return true; } } } return false; } if (!count(debug_backtrace())) { require_once 'src/jpgraph.php'; require_once 'src/jpgraph_bar.php'; require_once "src/jpgraph_line.php"; $day = $_GET["day"]; if (checkIfValid($day)) { $statistic = $_GET["statistic"]; $array = input(); $index = array_search($day, $array[0]); if ($statistic == 0) { $graph = new Graph(1280, 720); $graph->SetScale("textlin"); $graph->SetShadow(); $graph->img->SetMargin(40, 30, 20, 40); $b1plot = new BarPlot($array[1][$index]); $gbplot = new GroupBarPlot(array($b1plot)); $graph->Add($gbplot); $graph->xaxis->SetTickLabels(["7 Uhr", "8 Uhr", "9 Uhr", "10 Uhr", "11 Uhr", "12 Uhr", "13 Uhr", "14 Uhr", "15 Uhr", "16Uhr", "17 Uhr", "18 Uhr", "19 Uhr", "20 Uhr", "21 Uhr"]); $graph->title->SetFont(FF_FONT1, FS_BOLD); $graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD); $graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);