Files
        @ 6012ec60a8b0
    
        
              Branch filter: 
        
    Location: SlatePermutate/statsGraph.php - annotation
        
            
            6012ec60a8b0
            969 B
            text/x-php
        
        
    
    Consistently provide the JS frontend with unescaped values for add_section_n() and add_class_n() calls, whereas in the past the autocomplete data didn't htmlentities() escape the values while editing a saved schedule did. Now properly handle unescaped data in the javascript.
    0913b2b63e96 0913b2b63e96 0913b2b63e96 0913b2b63e96 0913b2b63e96 0913b2b63e96 0913b2b63e96 8985d9de9faa 8985d9de9faa 0913b2b63e96 0913b2b63e96 0913b2b63e96 0913b2b63e96 8985d9de9faa 8985d9de9faa 8985d9de9faa 0913b2b63e96 0913b2b63e96 8985d9de9faa 8985d9de9faa 0913b2b63e96 0913b2b63e96 8985d9de9faa 0913b2b63e96 0913b2b63e96 0913b2b63e96 0913b2b63e96 0913b2b63e96 8985d9de9faa 0913b2b63e96 0913b2b63e96 0913b2b63e96 0913b2b63e96 8985d9de9faa 0913b2b63e96 0913b2b63e96 8985d9de9faa 8985d9de9faa 8985d9de9faa 8985d9de9faa 0913b2b63e96 0913b2b63e96 0913b2b63e96  | <?php
  include_once 'inc/class.graph.php';
  // Make array of values
  $arr = array();
  $startDate = strtotime("-1 month");
  $stopDate = time(); // now
  $dir = 'saved_schedules/';
  // Do this the new fun php5 OO-way
  foreach(new DirectoryIterator($dir) as $key => $file) {
    if(is_numeric($file->getFilename())){
      $uCtime = $file->getCTime();
      $strCtime = date("m/d/Y",$uCtime);
      $ctime = strtotime($strCtime); // Results in a day-specific unix timestamp
      if($ctime < $stopDate && $ctime > $startDate) {
        if(!isset($arr[$ctime])) {
          $arr[$ctime] = 1;
        }
        else { 
          $arr[$ctime]++;
        }
      }
    }
  }
  $gphArr = array();
  $i = 0;
  foreach($arr as $index => $item) {
    $gphArr[$i]['count'] = $item;
    $gphArr[$i]['label'] = date("n/j", $index);
    $i++;
  }
/*
echo "<pre>";
  print_r($arr);
  print_r($gphArr);  */
  // Graph array
  $myGraph = new barGraph($gphArr, 900, 100);
?>
 |