=Certificate Changes
This commit is contained in:
parent
00eddaa10e
commit
f02b3ed81c
|
|
@ -71,7 +71,7 @@ class AnalyticController extends LocalController
|
||||||
$exceldata = [];
|
$exceldata = [];
|
||||||
$exceldata[] = $fields;
|
$exceldata[] = $fields;
|
||||||
foreach($response->data->items as $item) {
|
foreach($response->data->items as $item) {
|
||||||
$item = [$item->name,$item->email,$item->phone,isset($item->date_of_birth)?$item->date_of_birth:'-',isset($item->gender)?$item->gender:'-',$item->alternate_phone,$item->city,$item->state,$item->highlight_qualification,$item->specialization,$item->type_of_setup,$item->designation,$item->clinic_institute_name,isset($item->present) && $item->present == 'yes' ? 'Present':'Absent'];
|
$item = [$item->name ?? '',$item->email ?? '',$item->phone ?? '',$item->date_of_birth ?? '-',$item->gender ?? '-',$item->alternate_phone ?? '',$item->city ?? '',$item->state ?? '',$item->highlight_qualification ?? '',$item->specialization ?? '',is_array($item->type_of_setup ?? null) ? implode(', ', $item->type_of_setup) : ($item->type_of_setup ?? ''),$item->designation ?? '',$item->clinic_institute_name ?? '',isset($item->present) && $item->present == 'yes' ? 'Present':'Absent'];
|
||||||
$exceldata[] = $item;
|
$exceldata[] = $item;
|
||||||
}
|
}
|
||||||
return Excel::download(new InvoicesExport($exceldata), 'report.xlsx');
|
return Excel::download(new InvoicesExport($exceldata), 'report.xlsx');
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,24 @@ class SessionController extends LocalController
|
||||||
return Response::download($folder.'/'.$filename, 'certificate.png',$headers);
|
return Response::download($folder.'/'.$filename, 'certificate.png',$headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function certificatepreview(Request $request) {
|
||||||
|
$type = $request->input('type', 'casper_plus');
|
||||||
|
$session = (object) [
|
||||||
|
'type' => $type,
|
||||||
|
'code' => 'preview',
|
||||||
|
'start_date' => $request->input('date', date('Y-m-d')),
|
||||||
|
];
|
||||||
|
$doctor = (object) [
|
||||||
|
'name' => $request->input('name', 'Sample Doctor Name'),
|
||||||
|
'id' => 'preview-' . time(),
|
||||||
|
];
|
||||||
|
$output = Creation::certificate($session, $doctor);
|
||||||
|
|
||||||
|
return response()->file($output['folder'] . '/' . $output['filename'], [
|
||||||
|
'Content-Type' => 'image/png',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
public function agenda(Request $request) {
|
public function agenda(Request $request) {
|
||||||
$id = $request->input('id', 0);
|
$id = $request->input('id', 0);
|
||||||
if($id === 0) {
|
if($id === 0) {
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,18 @@ class Creation
|
||||||
}
|
}
|
||||||
if($session->type == 'casper_plus'){
|
if($session->type == 'casper_plus'){
|
||||||
$font = storage_path('app').'/fonts/pala.ttf';
|
$font = storage_path('app').'/fonts/pala.ttf';
|
||||||
$white = imagecolorallocate($outputImage, 0, 0, 0);
|
$color = imagecolorallocate($outputImage, 0, 0, 0);
|
||||||
imagettftext($outputImage, 30, 0, 590, 514, $white, $font, $doctor->name );
|
$nameSize = 30;
|
||||||
imagettftext($outputImage, 30, 0, 988, 684, $white, $font, date("d M Y", strtotime($session->start_date)) );
|
$dateSize = 30;
|
||||||
|
$nameX = 590;
|
||||||
|
$nameY = 514;
|
||||||
|
$dateX = 988;
|
||||||
|
$dateY = 684;
|
||||||
|
$certificateDate = !empty($session->start_date)
|
||||||
|
? date('d M Y', strtotime($session->start_date))
|
||||||
|
: date('d M Y');
|
||||||
|
imagettftext($outputImage, $nameSize, 0, $nameX, $nameY, $color, $font, $doctor->name);
|
||||||
|
imagettftext($outputImage, $dateSize, 0, $dateX, $dateY, $color, $font, $certificateDate);
|
||||||
}
|
}
|
||||||
if($session->type == 'APFT'){
|
if($session->type == 'APFT'){
|
||||||
$font = storage_path('app').'/fonts/pala.ttf';
|
$font = storage_path('app').'/fonts/pala.ttf';
|
||||||
|
|
|
||||||
|
|
@ -60,19 +60,19 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach($doctors as $item)
|
@foreach($doctors as $item)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{$item->name}}</td>
|
<td>{{ $item->name ?? '' }}</td>
|
||||||
<td>{{$item->email}}</td>
|
<td>{{ $item->email ?? '' }}</td>
|
||||||
<td>{{$item->phone}}</td>
|
<td>{{ $item->phone ?? '' }}</td>
|
||||||
<td>{{isset($item->date_of_birth)?$item->date_of_birth:''}}</td>
|
<td>{{ $item->date_of_birth ?? '' }}</td>
|
||||||
<td>{{isset($item->gender)?$item->gender:''}}</td>
|
<td>{{ $item->gender ?? '' }}</td>
|
||||||
<td>{{$item->alternate_phone}}</td>
|
<td>{{ $item->alternate_phone ?? '' }}</td>
|
||||||
<td>{{$item->city}}</td>
|
<td>{{ $item->city ?? '' }}</td>
|
||||||
<td>{{$item->state}}</td>
|
<td>{{ $item->state ?? '' }}</td>
|
||||||
<td>{{$item->highlight_qualification}}</td>
|
<td>{{ $item->highlight_qualification ?? '' }}</td>
|
||||||
<td>{{$item->specialization}}</td>
|
<td>{{ $item->specialization ?? '' }}</td>
|
||||||
<td>{{ is_array($item->type_of_setup) ? implode(', ', $item->type_of_setup) : $item->type_of_setup }}</td>
|
<td>{{ is_array($item->type_of_setup ?? null) ? implode(', ', $item->type_of_setup) : ($item->type_of_setup ?? '') }}</td>
|
||||||
<td>{{$item->designation}}</td>
|
<td>{{ $item->designation ?? '' }}</td>
|
||||||
<td>{{$item->clinic_institute_name}}</td>
|
<td>{{ $item->clinic_institute_name ?? '' }}</td>
|
||||||
<td>{{isset($item->present) && $item->present == 'yes' ? 'Present':'Absent'}}</td>
|
<td>{{isset($item->present) && $item->present == 'yes' ? 'Present':'Absent'}}</td>
|
||||||
<td>{{isset($item->feedback) && $item->feedback == 'yes' ? 'Yes':'-'}}</td>
|
<td>{{isset($item->feedback) && $item->feedback == 'yes' ? 'Yes':'-'}}</td>
|
||||||
<td>{!!isset($item->present) && $item->present == 'yes' && isset($item->feedback) && $item->feedback == 'yes' ? '<a href="/session/certificate?code='.$session->code.'&doctor='.$item->id.'">Download</a>':''!!}</td>
|
<td>{!!isset($item->present) && $item->present == 'yes' && isset($item->feedback) && $item->feedback == 'yes' ? '<a href="/session/certificate?code='.$session->code.'&doctor='.$item->id.'">Download</a>':''!!}</td>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue