add exports folder for excel
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports\Laporan;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\DataType;
|
||||
use Maatwebsite\Excel\Concerns\FromArray;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Maatwebsite\Excel\Concerns\WithStrictNullComparison;
|
||||
|
||||
class StokAuditBackdateExport implements FromArray,WithStrictNullComparison,WithMapping,WithHeadings
|
||||
{
|
||||
public $data;
|
||||
|
||||
public function __construct($data)
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'tahun',
|
||||
'bulan',
|
||||
'norujukan',
|
||||
'tempoh',
|
||||
'nokp',
|
||||
'berat',
|
||||
'nilaimarhun',
|
||||
'pinjaman',
|
||||
'bakipjm',
|
||||
'kadarupah',
|
||||
'tempohblmbyar',
|
||||
'upahblmbyar',
|
||||
'lanjutan',
|
||||
'utgonepercent',
|
||||
'ujrah',
|
||||
];
|
||||
}
|
||||
|
||||
public function array(): array
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
public function startCell(): string
|
||||
{
|
||||
return 'B2';
|
||||
}
|
||||
|
||||
public function map($data): array
|
||||
{
|
||||
return [
|
||||
// $data['id'],
|
||||
$data['tahun'],
|
||||
$data['bulan'],
|
||||
$data['norujukan'],
|
||||
$data['tempoh'],
|
||||
$data['nokp'],
|
||||
$data['berat'],
|
||||
$data['nilaimarhun'],
|
||||
$data['pinjaman'],
|
||||
$data['bakipjm'],
|
||||
$data['kadarupah'],
|
||||
$data['tempohblmbyar'],
|
||||
$data['upahblmbyar'],
|
||||
$data['lanjutan'],
|
||||
$data['utgonepercent'],
|
||||
$data['ujrah'],
|
||||
];
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
// 'B' => NumberFormat::FORMAT_DATE_DDMMYYYY,
|
||||
'D' => DataType::TYPE_STRING2,
|
||||
'F' => DataType::TYPE_STRING2,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user