Shitty PHP


SUBMITTED BY: Guest

DATE: Nov. 18, 2013, 2:51 a.m.

FORMAT: Text only

SIZE: 785 Bytes

HITS: 859

  1. <?php
  2. require_once("../conf.php");
  3. ?>
  4. <!DOCTYPE HTML>
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  8. <title>phpChart - Basic Chart</title>
  9. </head>
  10. <body>
  11. <?php
  12. $csvdata = file_get_contents("https://c9.io/taiiwo/js_vne/workspace/moneylog.csv");
  13. //convert to correct format
  14. $linebyline = explode('\n', $csvdata);
  15. foreach $linebyline as $line{
  16. line = explode(', ', $line);
  17. }
  18. $graphme = array();
  19. for ($i = 0; $i < strlen($linebyline)) {
  20. foreach $linebyline as $line{
  21. $graphme->append(array());
  22. $graphme[$i]->append($line[$i]);
  23. }
  24. }
  25. $pc = new C_PhpChartX($graphme,'basic_chart');
  26. $pc->draw();
  27. ?>
  28. </body>
  29. </html>

comments powered by Disqus