Added stuff to order form
This commit is contained in:
+26
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user