|
@@ 99-101 (lines=3) @@
|
| 96 |
|
// Figure out how many days the current month has |
| 97 |
|
$temp_date = new \DateTime($data['year'] . "-" . $data['month']); |
| 98 |
|
$days_in_month = (int)$temp_date->format('t'); |
| 99 |
|
for ($i = 1; $i<=$days_in_month; $i++) { |
| 100 |
|
$db_events[$data['unit_id']][Event::BAT_DAY][$data['year']][$data['month']]['d' . $i] = $data['d'.$i]; |
| 101 |
|
} |
| 102 |
|
} |
| 103 |
|
|
| 104 |
|
// With the day events taken care off let's cycle through hours |
|
@@ 106-108 (lines=3) @@
|
| 103 |
|
|
| 104 |
|
// With the day events taken care off let's cycle through hours |
| 105 |
|
while( $data = $results[Event::BAT_HOUR]->fetchAssoc()) { |
| 106 |
|
for ($i = 0; $i<=23; $i++) { |
| 107 |
|
$db_events[$data['unit_id']][Event::BAT_HOUR][$data['year']][$data['month']][$data['day']]['h'. $i] = $data['h'.$i]; |
| 108 |
|
} |
| 109 |
|
} |
| 110 |
|
|
| 111 |
|
// With the hour events taken care off let's cycle through minutes |