| @@ 51-53 (lines=3) @@ | ||
| 48 | ||
| 49 | // With the day events taken care off let's cycle through hours |
|
| 50 | while( $data = $results[Event::BAT_HOUR]->fetchAssoc()) { |
|
| 51 | for ($i = 0; $i<=23; $i++) { |
|
| 52 | $db_events[$data['unit_id']][Event::BAT_HOUR][$data['year']][$data['month']][$data['day']]['h'. $i] = $data['h'.$i]; |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||
| 56 | // With the hour events taken care off let's cycle through minutes |
|
| @@ 52-54 (lines=3) @@ | ||
| 49 | // Figure out how many days the current month has |
|
| 50 | $temp_date = new \DateTime($data['year'] . "-" . $data['month']); |
|
| 51 | $days_in_month = (int)$temp_date->format('t'); |
|
| 52 | for ($i = 1; $i<=$days_in_month; $i++) { |
|
| 53 | $db_events[$data['unit_id']][Event::BAT_DAY][$data['year']][$data['month']]['d' . $i] = $data['d'.$i]; |
|
| 54 | } |
|
| 55 | } |
|
| 56 | ||
| 57 | // With the day events taken care off let's cycle through hours |
|
| @@ 59-61 (lines=3) @@ | ||
| 56 | ||
| 57 | // With the day events taken care off let's cycle through hours |
|
| 58 | foreach ($results[Event::BAT_HOUR]->fetchAll() as $data) { |
|
| 59 | for ($i = 0; $i<=23; $i++) { |
|
| 60 | $db_events[$data['unit_id']][Event::BAT_HOUR][$data['year']][$data['month']][$data['day']]['h'. $i] = $data['h'.$i]; |
|
| 61 | } |
|
| 62 | } |
|
| 63 | ||
| 64 | // With the hour events taken care off let's cycle through minutes |
|