Added stuff to order form

This commit is contained in:
Frank Schubert
2021-08-03 20:20:10 +02:00
parent 0a5e447587
commit 86b69bd7a0
6 changed files with 97 additions and 37 deletions
+26 -2
View File
@@ -16,11 +16,35 @@ class Layout extends mfLayout {
return self::$instance;
}
public function dotToComma($num) {
public static function dotToComma($num) {
return str_replace(".", ",", $num);
}
public function commaToDot($num) {
public static function commaToDot($num) {
return str_replace(",", ".", $num);
}
public static function dateToInt($date) {
if(!preg_match('/^(\d\d)\.(\d\d)\.(\d\d\d\d)$/',$date, $m)) {
return false;
} else {
$day = intval($m[1]);
$month = intval($m[2]);
$year = intval($m[3]);
if($day > 31 || $day < 1
|| $month > 12 || $month < 1
|| $year > date('Y')+1 || $year < date('Y'))
{
return false;
}
$date_ts = mktime(0,0,0,$month,$day,$year);
return $date_ts;
}
}
public static function intToDate($int) {
return date("d.m.Y", $int);
}
}