Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
3
3f-timesheet
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dockers
3f-timesheet
Commits
d01c49bb
Commit
d01c49bb
authored
Sep 20, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
laravel excel changes
parent
691029d2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
89 additions
and
11 deletions
+89
-11
app/Exports/DepartmentExport.php
+25
-1
app/Exports/ProjectExport.php
+41
-1
app/Exports/RingkasanExport.php
+15
-1
packages/portal/timesheet/resources/views/exports/exportDepartment.blade.php
+6
-6
packages/portal/timesheet/resources/views/report/project.blade.php
+2
-2
storage/framework/laravel-excel/laravel-excel-pZPxG2qeMgj14tQ6PUWXTxKXHKbMRkdQ.html
+0
-0
No files found.
app/Exports/DepartmentExport.php
View file @
d01c49bb
...
...
@@ -15,10 +15,13 @@ use Maatwebsite\Excel\Concerns\Exportable;
use
Maatwebsite\Excel\Concerns\FromCollection
;
use
Maatwebsite\Excel\Concerns\FromView
;
use
Maatwebsite\Excel\Concerns\ShouldAutoSize
;
use
Maatwebsite\Excel\Concerns\WithColumnWidths
;
use
Maatwebsite\Excel\Concerns\WithStyles
;
use
PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
;
// class UsersExport implements FromCollection, Responsable
class
DepartmentExport
implements
FromView
,
ShouldAutoSize
class
DepartmentExport
implements
FromView
,
ShouldAutoSize
,
WithColumnWidths
,
WithStyles
{
use
Exportable
;
...
...
@@ -33,6 +36,27 @@ class DepartmentExport implements FromView, ShouldAutoSize
/**
* @return \Illuminate\Support\Collection
*/
public
function
styles
(
Worksheet
$sheet
)
{
$sheet
->
getStyle
(
'1'
)
->
getFont
()
->
setBold
(
true
);
$sheet
->
getStyle
(
'2'
)
->
getFont
()
->
setBold
(
true
);
$sheet
->
getStyle
(
'4'
)
->
getFont
()
->
setBold
(
true
);
}
public
function
columnWidths
()
:
array
{
return
[
'A'
=>
50
,
'B'
=>
20
,
'C'
=>
20
,
'D'
=>
20
,
'E'
=>
20
,
'F'
=>
20
];
}
public
function
view
()
:
View
{
// dd($this->request);
...
...
app/Exports/ProjectExport.php
View file @
d01c49bb
...
...
@@ -11,10 +11,13 @@ use Maatwebsite\Excel\Concerns\Exportable;
use
Maatwebsite\Excel\Concerns\FromCollection
;
use
Maatwebsite\Excel\Concerns\FromView
;
use
Maatwebsite\Excel\Concerns\ShouldAutoSize
;
use
Maatwebsite\Excel\Concerns\WithColumnWidths
;
use
Maatwebsite\Excel\Concerns\WithStyles
;
use
PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
;
// class UsersExport implements FromCollection, Responsable
class
ProjectExport
implements
FromView
,
ShouldAutoSize
class
ProjectExport
implements
FromView
,
ShouldAutoSize
,
WithColumnWidths
,
WithStyles
{
use
Exportable
;
...
...
@@ -29,6 +32,43 @@ class ProjectExport implements FromView, ShouldAutoSize
/**
* @return \Illuminate\Support\Collection
*/
public
function
styles
(
Worksheet
$sheet
)
{
$sheet
->
getStyle
(
'1'
)
->
getFont
()
->
setBold
(
true
);
$sheet
->
getStyle
(
'2'
)
->
getFont
()
->
setBold
(
true
);
$sheet
->
getStyle
(
'4'
)
->
getFont
()
->
setBold
(
true
);
}
// public function styles(Worksheet $sheet)
// {
// return [
// // Style the first row as bold text.
// '1' => ['font' => ['bold' => true]],
// '2' => ['font' => ['bold' => true]],
// '4' => ['font' => ['bold' => true]],
// '10' => ['font' => ['bold' => true]]
// // Styling a specific cell by coordinate.
// // 'B2' => ['font' => ['italic' => true]],
// // Styling an entire column.
// // 'C' => ['font' => ['size' => 16]],
// ];
// }
public
function
columnWidths
()
:
array
{
return
[
'A'
=>
50
,
'B'
=>
20
,
'C'
=>
15
,
'D'
=>
15
];
}
public
function
view
()
:
View
{
// dd($this->request);
...
...
app/Exports/RingkasanExport.php
View file @
d01c49bb
...
...
@@ -16,10 +16,11 @@ use Maatwebsite\Excel\Concerns\Exportable;
use
Maatwebsite\Excel\Concerns\FromCollection
;
use
Maatwebsite\Excel\Concerns\FromView
;
use
Maatwebsite\Excel\Concerns\ShouldAutoSize
;
use
Maatwebsite\Excel\Concerns\WithColumnWidths
;
// class UsersExport implements FromCollection, Responsable
class
RingkasanExport
implements
FromView
,
ShouldAutoSize
class
RingkasanExport
implements
ShouldAutoSize
,
FromView
,
WithColumnWidths
{
use
Exportable
;
...
...
@@ -34,6 +35,19 @@ class RingkasanExport implements FromView, ShouldAutoSize
/**
* @return \Illuminate\Support\Collection
*/
public
function
columnWidths
()
:
array
{
return
[
'A'
=>
5
,
'B'
=>
12
,
'D'
=>
50
,
'H'
=>
12
,
'I'
=>
12
];
}
public
function
view
()
:
View
{
// dd(VwStaff::all());
...
...
packages/portal/timesheet/resources/views/exports/exportDepartment.blade.php
View file @
d01c49bb
...
...
@@ -15,12 +15,12 @@
<table>
<thead>
<tr>
<th>
staff
</th>
<th>
project type
</th>
<th>
project code / task
</th>
<th>
description
</th>
<th>
total hours
</th>
<th>
total days
</th>
<th>
{{strtoupper('staff')}}
</th>
<th>
{{strtoupper('project type')}}
</th>
<th>
{{strtoupper('project code / task')}}
</th>
<th>
{{strtoupper('description')}}
</th>
<th>
{{strtoupper('total hours')}}
</th>
<th>
{{strtoupper('total days')}}
</th>
</tr>
</thead>
<?php
$totalhours
=
$totaldays
=
$staffhours
=
$staffdays
=
0
;
?>
...
...
packages/portal/timesheet/resources/views/report/project.blade.php
View file @
d01c49bb
...
...
@@ -21,12 +21,12 @@
<tr>
<th style="
width
:
10
%
">Project </th>
<th style="
width
:
1
%
">:</th>
<th colspan="
3
">
{
{data_get($pdetail,'pcode')}
}
-
{
{data_get($pdetail,'pname')}
}
</th>
<th colspan="
2
">
{
{data_get($pdetail,'pcode')}
}
-
{
{data_get($pdetail,'pname')}
}
</th>
</tr>
<tr>
<th style="
width
:
10
%
"> Month/Year</th>
<th style="
width
:
1
%
">:</th>
<th colspan="
3
">
{
{$month}
}
{
{$year}
}
</th>
<th colspan="
2
">
{
{$month}
}
{
{$year}
}
</th>
</tr>
</thead>
</table>
...
...
storage/framework/laravel-excel/laravel-excel-pZPxG2qeMgj14tQ6PUWXTxKXHKbMRkdQ.html
0 → 100644
View file @
d01c49bb
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment