No support for HTML 5 canvas element
array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w") ); $process = proc_open('gnuplot', $descriptorspec, $pipes); $tmpfile = tempnam("/tmp", "bliep"); $tmphandle = fopen($tmpfile, "w"); $gnuplot =<< 0.0, "bel" => 0.0, "int" => 0.0, "opw" => 0.0 ); } $row[1] = floatval(intval($row[1])*0.01); if(strpos($row[2], "sms") !== FALSE){ $data[$row[0]]["sms"] += -$row[1]; } else if (strpos($row[2], "Bellen") !== FALSE){ preg_match_all('!\d+!', $row[2], $matches); $nulnegen = strstr("0900", $matches[0][0]); if($nulnegen === FALSE || $nulnegen != 0){ if($matches[0][0][0] === "0"){ $data[$row[0]]["bel"] += -$row[1]; } } } else if (strpos($row[2], "pwaardering") !== FALSE){ $data[$row[0]]["opw"] += $row[1]; } else { $data[$row[0]]["int"] += -$row[1]; } } foreach($data as $key => $row){ fwrite($tmphandle, sprintf("%d\t%.2f\t%.2f\t%.2f\n", intval($key), $row["int"], $row["bel"], $row["sms"])); } fclose($tmphandle); fwrite($pipes[0], sprintf(" plot '%s' using 2 t 'internet',\ '' using 3 t 'bellen',\ '' using 4 t 'sms'\ \n", $tmpfile)); fwrite($pipes[0], "quit\n"); fclose($pipes[0]); $javascript = stream_get_contents($pipes[1]); fclose($pipes[1]); echo "err: " . stream_get_contents($pipes[2]); fclose($pipes[2]); $return_value = proc_close($process); unlink($tmpfile); $r = mysqli_query($conn, " SELECT amount, date, description FROM data ORDER BY date DESC LIMIT 25"); if($r === FALSE){ die(sprintf("Query error: %s\n", mysqli_error($conn))); } echo "\n\n"; echo "\n"; while($row = mysqli_fetch_array($r)){ printf("\n", $row[1], intval($row[0])*0.01, $row[2]); } echo "
DateAmountDescription
%s€%.2f%s
\n"; mysqli_close($conn); echo ""; ?>