From 5d47b62eb3d811c6242a6e9edf47d48b0c602db8 Mon Sep 17 00:00:00 2001 From: Lillem4n Date: Wed, 11 Jan 2012 10:44:28 +0100 Subject: [PATCH] Fixed bug with years and month selector in wages --- classes/controller/admin/wages.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/controller/admin/wages.php b/classes/controller/admin/wages.php index 4d86d80..fa66dc5 100644 --- a/classes/controller/admin/wages.php +++ b/classes/controller/admin/wages.php @@ -23,8 +23,11 @@ public function action_index() } $periods = array(); - while ($year <= $current_year && $month <= $current_month) + while (1 == 1) { + if ($year > $current_year) break; + elseif ($year == $current_year && $month > $current_month) break; + $periods[$year.$month.'option'] = array( '@value' => $year.'-'.$month, $year.' '.date('F', mktime(0,0,0,$month,1)) @@ -37,6 +40,7 @@ public function action_index() $month = 1; } } + xml::to_XML($periods, $this->xml_content->appendChild($this->dom->createElement('periods'))); if ( ! isset($_GET['period']) || ! preg_match('/^\d{4}-\d{1,2}$/', $_GET['period']))