Fewo Mails / Booking Country Services

This commit is contained in:
Kevin Adametz 2020-05-28 19:03:42 +02:00
parent b9c26d06d0
commit 48a6eb2282
154 changed files with 7761 additions and 1643 deletions

View file

@ -33,6 +33,13 @@ class Util
return \Carbon::parse($date)->format(\Util::formatDateDB());
}
public static function _reformat_date($date, $to = 'date'){
if($to === 'datetime'){
return \Carbon::parse($date)->format('Y-m-d - H:i');
}
return \Carbon::parse($date)->format('Y-m-d');
}
public static function _format_number($value){
return preg_replace("/[^0-9,]/", "", $value);
@ -62,7 +69,7 @@ class Util
if(is_array($value)){
return implode($glue, $value);
}
return "";
return $value;
}
public static function _clean_float($value){
@ -191,5 +198,21 @@ class Util
return isset($mime_types[$mine]) ? $mime_types[$mine] : "";
}
public static function getURLasContent($url, $base=false){
$arrContextOptions=array(
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false,
),
);
$content = file_get_contents($url, false, stream_context_create($arrContextOptions));
if($base){
$type = pathinfo($url, PATHINFO_EXTENSION);
$base64Data = base64_encode($content);
return 'data:image/' . $type . ';base64,' . $base64Data;
}
return $content;
}
}