Файловый менеджер - Редактировать - /home/clickysoft/public_html/travel-guru.clickysoft.net/app/Exports/DataExport.php
Назад
<?php namespace App\Exports; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithMultipleSheets; class DataExport implements WithHeadings, WithMultipleSheets { protected $data; protected $menu_totals; protected $otherData; public function __construct($data, $menu_totals, $other_data) { $this->data = $data; $this->menu_totals = $menu_totals; $this->otherData = $other_data; } public function headings() :array { return [ 'vendor', 'vendor_name', 'item', 'price', 'total_items', 'total_amount', ]; } public function sheets(): array { $sheets = []; foreach ($this->data as $key => $data){ $sheets[] = new DataSheet($key, $data, $this->menu_totals[$key]); } if (isset($this->otherData['annual_dues'])){ $sheets[] = new AnnualDuesSheet("Annual Dues", $this->otherData['annual_dues']); } if (isset($this->otherData['graduation_contribution'])){ $sheets[] = new AnnualGraduationSheet("Graduation Contribution", $this->otherData['graduation_contribution']); } if (isset($this->otherData['class_funds'])){ $sheets[] = new ClassFundsSheet("Class Funds", $this->otherData['class_funds']); } if (isset($this->otherData['school_directories'])){ $sheets[] = new SchoolDirectoriesSheet("School Directories", $this->otherData['school_directories']); } return $sheets; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка