Mistři v programování na #hovnokod

PHP #1128

nevim co bych k tomu mel dodat :-)

function snizeni_mesice_o_jednicku($month, $year) {
//pouziti pouze u filter-volba-mesice.php
                switch ($month) {
                               case '01':
                                               $new_month = '12';
                                               $new_year = $year - 1;
                                               break;
                               case '02':
                                               $new_month = '01';
                                               $new_year = $year;
                                               break;
                               case '03':
                                               $new_month = '02';
                                               $new_year = $year;
                                               break;
                               case '04':
                                               $new_month = '03';
                                               $new_year = $year;
                                               break;
                               case '05':
                                               $new_month = '04';
                                               $new_year = $year;
                                               break;
                               case '06':
                                               $new_month = '05';
                                               $new_year = $year;
                                               break;
                               case '07':
                                               $new_month = '06';
                                               $new_year = $year;
                                               break;
                               case '08':
                                               $new_month = '07';
                                               $new_year = $year;
                                               break;
                               case '09':
                                               $new_month = '08';
                                               $new_year = $year;
                                               break;
                               case '10':
                                               $new_month = '09';
                                               $new_year = $year;
                                               break;
                               case '11':
                                               $new_month = '10';
                                               $new_year = $year;
                                               break;
                               case '12':
                                               $new_month = '11';
                                               $new_year = $year;
                                               break;
                }//switch ($month){

                $pole_mesic_rok = array("new_month" => "$new_month", "new_year" => "$new_year");
                return $pole_mesic_rok;
}

Zdeněk Sotolář,