if ($ta2_set && $cdate->validDate($time_allow2)) { $year_end = $cdate->getDate('Y', $time_allow2); } } if (isset($_REQUEST["m"])) { $m = getParameter("m", "number"); } else { if ($slm != "00") { $m = $slm; } else { if ($ta2_set && $year_end > 0) { //compare which one is more $year_allow2 = $cdate->getDate('Y', $time_allow2); if ($year_allow2 >= $year_end) { //use time_allow2 $m = $cdate->dateBefore($time_allow2) ? $cdate->getDate("m") : $cdate->getDate('m', $time_allow2); } else { //use year_end $m = $year_end > $cdate->getDate("Y") ? $cdate->getDate("m") : 12; } } elseif ($ta2_set) { $m = $cdate->dateBefore($time_allow2) ? $cdate->getDate("m") : $cdate->getDate('m', $time_allow2); } elseif ($year_end > 0) { $m = $year_end > $cdate->getDate("Y") ? $cdate->getDate("m") : 12; //date('m') } else { $m = $cdate->getDate("m"); } } } if ($m < 1 && $m > 12) {
switch ($sp_type) { case 0: default: //disabled specific and enabled others $dateLink = $sp_found ? false : true; break; case 1: //enabled specific and disabled others $dateLink = $sp_found ? true : false; break; } } } if ($date_pair_value) { //check date_pair1 & 2 if ($date_pair1 && $date_pair_value != "0000-00-00" && $cdate->dateAfter($date_pair_value, $date_str) && ($slm > 0 && $sld > 0 && $sly > 0 && $cdate->dateBefore("{$sly}-{$slm}-{$sld}", $date_str))) { //set date only after date_pair1 if (!in_array("select", $htmlClass)) { $htmlClass[] = "select"; } } if ($date_pair2 && $date_pair_value != "0000-00-00" && $cdate->dateBefore($date_pair_value, $date_str) && ($slm > 0 && $sld > 0 && $sly > 0 && $cdate->dateAfter("{$sly}-{$slm}-{$sld}", $date_str))) { //set date only before date_pair2 if (!in_array("select", $htmlClass)) { $htmlClass[] = "select"; } } } $htmlClass[] = strtolower($day_txt); if ($dateLink) { if (in_array($date_str, $select_days) && !in_array("select", $htmlClass)) {