Upload Files Booking, Mails, Attachments,

This commit is contained in:
Kevin Adametz 2020-04-17 15:51:22 +02:00
parent 5daea268f7
commit 68b9d1ff88
92 changed files with 2837 additions and 1778 deletions

View file

@ -93,7 +93,7 @@ class CreateCouponPDF {
$pdf->SetFont('Helvetica', '', 10);
$customerName = ($this->coupon->customer && $this->coupon->customer->salutation ? $this->coupon->customer->salutation->name . ' ' : '' )
. ($this->coupon->customer->title ? $$this->coupon->customer->title . ' ' : '' )
. ($this->coupon->customer->title ? $this->coupon->customer->title . ' ' : '' )
. $this->coupon->customer->fullName();
$customerStreet = $this->coupon->customer ? $this->coupon->customer->street : '';
$customerRegion = $this->coupon->customer->zip ? $this->coupon->customer->zip." " : '';

View file

@ -93,7 +93,7 @@ class Util
$clean = ($anal) ? preg_replace("/[^a-zA-Z0-9]/", "", $clean) : $clean ;
if($substr){
$clean = (strlen($clean) > 33) ? substr($clean,-33) : $clean;
$clean = (strlen($clean) > 33) ? substr($clean,0,33) : $clean;
}
return ($force_lowercase) ?
@ -172,4 +172,31 @@ class Util
$charset = mb_detect_encoding($value, "UTF-8, ISO-8859-1, ISO-8859-15", true);
return mb_convert_encoding($value, "Windows-1252", $charset);
}
public static function getMimeFromHeader($http_response_header){
$pattern = "/^content-type\s*:\s*(.*)$/i";
if (($header = array_values(preg_grep($pattern, $http_response_header))) &&
(preg_match($pattern, $header[0], $match) !== false))
{
return $match[1];
}
return "";
}
public static function getExtensionFromMime($mine){
$mime_types = [
'application/pdf' => 'pdf',
'image/png' => 'png',
'image/jpg' => 'jpg',
'image/jpeg' => 'jpg',
'text/html; charset=UTF-8' => 'html',
'text/html' => 'html',
];
return isset($mime_types[$mine]) ? $mime_types[$mine] : "";
}
}