@@ -106,7 +106,7 @@ |
||
| 106 | 106 | $query_parameters .= 'AND month IN (' . implode(",", array_keys($months)) . ') '; |
| 107 | 107 | if (count($unit_ids) > 0) { |
| 108 | 108 | // Unit ids are defined so add this as a filter |
| 109 | - $query_parameters .= 'AND unit_id in (' . implode("," , $unit_ids) . ') '; |
|
| 109 | + $query_parameters .= 'AND unit_id in (' . implode(",", $unit_ids) . ') '; |
|
| 110 | 110 | } |
| 111 | 111 | $year_count++; |
| 112 | 112 | } |
@@ -53,20 +53,20 @@ |
||
| 53 | 53 | //var_dump($period); |
| 54 | 54 | //var_dump($unit); |
| 55 | 55 | //var_dump($unit_events); |
| 56 | - foreach ($unit_events as $event){ |
|
| 57 | - if ($unit == $this->unit->getUnitId()){ |
|
| 56 | + foreach ($unit_events as $event) { |
|
| 57 | + if ($unit == $this->unit->getUnitId()) { |
|
| 58 | 58 | foreach ($period as $dt) { |
| 59 | 59 | // If event in period involved add value of event |
| 60 | 60 | // If event is not completely in period involved then add just the percentage that is |
| 61 | 61 | print_r("Event is: "); |
| 62 | - print_r($event->getStartDate()->format('Y-m-d H:i:s') ." to "); |
|
| 63 | - print_r($event->getEndDate()->format('Y-m-d H:i:s') ."\n"); |
|
| 62 | + print_r($event->getStartDate()->format('Y-m-d H:i:s') . " to "); |
|
| 63 | + print_r($event->getEndDate()->format('Y-m-d H:i:s') . "\n"); |
|
| 64 | 64 | print_r("Period is: "); |
| 65 | - print_r($dt->format('Y-m-d H:i:s') ."\n"); |
|
| 66 | - if ($event->dateIsInRange($dt)){ |
|
| 65 | + print_r($dt->format('Y-m-d H:i:s') . "\n"); |
|
| 66 | + if ($event->dateIsInRange($dt)) { |
|
| 67 | 67 | print_r("In range adding: " . $event->getValue() . " to event.\n"); |
| 68 | 68 | $value = $value + $event->getValue(); |
| 69 | - print_r("Current Value " .$value . "\n"); |
|
| 69 | + print_r("Current Value " . $value . "\n"); |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | } |
@@ -158,11 +158,9 @@ |
||
| 158 | 158 | } else { |
| 159 | 159 | $text .= 'must be at least @minimum_stay and at most @maximum_stay'; |
| 160 | 160 | } |
| 161 | - } |
|
| 162 | - elseif ($minimum_stay) { |
|
| 161 | + } elseif ($minimum_stay) { |
|
| 163 | 162 | $text .= 'must be for at least @minimum_stay'; |
| 164 | - } |
|
| 165 | - elseif ($maximum_stay) { |
|
| 163 | + } elseif ($maximum_stay) { |
|
| 166 | 164 | $text .= 'cannot be more than @maximum_stay'; |
| 167 | 165 | } |
| 168 | 166 | |