@php
if($type=="website"){
$base64Image = base64_encode(file_get_contents(public_path($model_image)));
}else{
if($print_image){
$base64Image = base64_encode(file_get_contents(public_path($print_image)));
}else{
$base64Image = base64_encode(file_get_contents(public_path('assets/bg-white.png')));
}
}
$qr_height = $qr_height??300;
$qr_width = $qr_width??300;
@endphp
@foreach ($list_participant as $cert)
@php
$gender = 'السيد/ة';
$realize = 'أنجز/ت';
if($cert->gender=="دكر"){
$gender = 'السيد';
$realize = 'أنجز';
}else if($cert->gender =="انثى"){
$gender = 'السيدة';
$realize = 'أنجزت';
}
$issued_date = $cert->issued_date;
if(!is_string($cert->issued_date)){
$issued_date = $cert->issued_date->format('Y-m-d');
}
$start_date = $cert->start_date;
if(!is_string($cert->start_date)){
$start_date = $cert->start_date->format('Y-m-d');
}
$end_date = $cert->end_date;
if(!is_string($cert->end_date)){
$end_date = $cert->end_date->format('Y-m-d');
}
$qrCode='
 .'>';
if($type==)
course;
$pattern = '/[\x{0600}-\x{06FF}\x{0750}-\x{077F}]+/u';
if( preg_match($pattern, $course) === 1){
$course = preg_replace('/[^\p{Arabic}]/u', ' ', $course);
}
$sourceCode = str_replace([
'{name}','{name_an}','{course}','{course_an}','{company}','{qr_code}',
'{city}','{city_an}','{country}','{country_an}',
'{national_id_type}','{national_id_number}',
'{issued_date}','{start_date}','{end_date}',
'{accreditation_number}','{hours}',
'{id_cert}','{gender}',
'أنجز',' '
],
[
$cert->name??'-',$cert->name_an??'-',$course??'-',$cert->course_an??'-',$cert->company??'-',$qrCode??'-',
$cert->city??'-',$cert->city_an??'-',$cert->country??'-',$cert->country_an??'-',
$cert->national_id_type??'-',$cert->national_id_number??'-',
$issued_date??'-',$start_date??'-',$end_date??'-',
$cert->accreditation_number??'-',$cert->hours??'-',
$cert->id_cert??'-',$cert->gender??'-',
$realize??'-',' '
]
, $sourceCode
);
@endphp
{!! $sourceCode !!}
@if ( $loop->index < count($list_participant)-1)
@endif
@endforeach