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
27511bf4
Commit
27511bf4
authored
Sep 01, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
export to excel, page report summary
parent
86b99787
Show whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
284 additions
and
7 deletions
+284
-7
app/Exports/RingkasanExport.php
+63
-0
app/Exports/UsersExport.php
+31
-0
packages/portal/timesheet/resources/views/exports/exportRingkasan.blade.php
+89
-0
packages/portal/timesheet/resources/views/exports/users.blade.php
+17
-0
packages/portal/timesheet/resources/views/form/notelist.blade.php
+1
-1
packages/portal/timesheet/resources/views/report/ringkasan.blade.php
+1
-1
packages/portal/timesheet/routes/web.php
+4
-0
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+1
-1
packages/portal/timesheet/src/Http/Controllers/ExportController.php
+60
-0
packages/portal/timesheet/src/Http/Controllers/ReportController.php
+17
-4
storage/framework/laravel-excel/laravel-excel-05hQgT09xodLPU6tgcZC45xtEh8MF6iM.html
+0
-0
storage/framework/laravel-excel/laravel-excel-3bZWxdQaNyo3tbxlanOEqHkbfBp3FSMG.html
+0
-0
storage/framework/laravel-excel/laravel-excel-Gkyzqfoyju6aLKWN8ZjTeJnZed3zBnSv.html
+0
-0
storage/framework/laravel-excel/laravel-excel-Ihwch2zS90gNJ5MlDz25oa96fwYnfqmi.html
+0
-0
storage/framework/laravel-excel/laravel-excel-Lh5D7SCaVDTFFRaw70uSJaORPpLAujIb.html
+0
-0
storage/framework/laravel-excel/laravel-excel-Ma5CPq0BBsQ8a9AsKBAxOEPHKAflv0d5.html
+0
-0
storage/framework/laravel-excel/laravel-excel-MbldViGLwVMVR52rxqjcY4OyygWqPpUi.html
+0
-0
storage/framework/laravel-excel/laravel-excel-U8cCaERAV9xD00SYOebdKHtGn89Tnmac.html
+0
-0
storage/framework/laravel-excel/laravel-excel-eRjVQSOWkfkz06FGMmQLCGQN30l59xyD.html
+0
-0
storage/framework/laravel-excel/laravel-excel-kAa2sHi0qcU263SiM4h2BQRzitrh4H66.html
+0
-0
storage/framework/laravel-excel/laravel-excel-kDP1dc2iaNGMji0cYX2ErsyagwyFFn5J.html
+0
-0
storage/framework/laravel-excel/laravel-excel-lgAYTIKiYdJrI2xIBtMw9GiW0aJKzsqY.html
+0
-0
storage/framework/laravel-excel/laravel-excel-o3pmDKKOeUAUTlQTelzA4G4avmFPGlpr.html
+0
-0
storage/framework/laravel-excel/laravel-excel-qrUK8FAVzu2zen5SJikiNS0Pl9Mpf7sk.html
+0
-0
storage/framework/laravel-excel/laravel-excel-so2wzC713jNUeibBd88PMaElBEF09Twu.html
+0
-0
storage/framework/laravel-excel/laravel-excel-uQ9RZHiFtimjhjPc3aHpuOV1S8j5yo5k.html
+0
-0
storage/framework/laravel-excel/laravel-excel-w8DexckpEQyBK6KbwOwBQ6dVGLj6A4dt.html
+0
-0
storage/framework/laravel-excel/laravel-excel-yUh0bwuNV6UIgyjFgeBnZjEOB5PtOxlo.html
+0
-0
storage/framework/laravel-excel/laravel-excel-zNWKdefGPJyODl6yuVSDpvchBB9bckK3.html
+0
-0
storage/framework/laravel-excel/laravel-excel-zghEnMByPWhetWclLwr0taAfiTnVCff0.html
+0
-0
No files found.
app/Exports/RingkasanExport.php
0 → 100644
View file @
27511bf4
<?php
namespace
App\Exports
;
use
App\User
;
use
Portal\Timesheet\Model\Overhead
;
use
Portal\Timesheet\Model\VwStaff
;
use
Portal\Timesheet\Model\VwChargeable
;
use
Portal\Timesheet\Model\VwRingkasanLaporan
;
use
Portal\Timesheet\Model\VwNonchargeSummary
;
use
Portal\Timesheet\Model\VwOverheadSummary
;
// use Illuminate\Contracts\Support\Responsable;
use
Illuminate\Contracts\View\View
;
use
Illuminate\Http\Request
;
use
Maatwebsite\Excel\Concerns\Exportable
;
use
Maatwebsite\Excel\Concerns\FromCollection
;
use
Maatwebsite\Excel\Concerns\FromView
;
use
Maatwebsite\Excel\Concerns\ShouldAutoSize
;
// class UsersExport implements FromCollection, Responsable
class
RingkasanExport
implements
FromView
,
ShouldAutoSize
{
use
Exportable
;
// private $fileName = "Ringkasan Laporan.xlsx";
protected
$request
;
function
__construct
(
$request
)
{
$this
->
request
=
$request
;
}
/**
* @return \Illuminate\Support\Collection
*/
public
function
view
()
:
View
{
// dd(VwStaff::all());
$month
=
$this
->
request
[
'month'
];
$year
=
$this
->
request
[
'year'
];
return
view
(
'timesheet::exports.exportRingkasan'
,
[
'staffs'
=>
VwStaff
::
orderby
(
'deptID'
)
->
where
(
'deptID'
,
'!='
,
8
)
->
get
(),
'chargeproject'
=>
VwChargeable
::
all
(),
'overhead'
=>
Overhead
::
where
(
'o_overhead_sts'
,
1
)
->
get
(),
'ringkasan'
=>
VwRingkasanLaporan
::
where
(
'month'
,
$month
)
->
where
(
'year'
,
$year
)
->
get
(),
'projectnc'
=>
VwNonchargeSummary
::
where
(
'month'
,
$month
)
->
where
(
'year'
,
$year
)
->
get
(),
'ovhours'
=>
VwOverheadSummary
::
where
(
'month'
,
$month
)
->
where
(
'year'
,
$year
)
->
get
()
]);
}
}
app/Exports/UsersExport.php
0 → 100644
View file @
27511bf4
<?php
namespace
App\Exports
;
use
App\User
;
// use Illuminate\Contracts\Support\Responsable;
use
Illuminate\Contracts\View\View
;
use
Maatwebsite\Excel\Concerns\Exportable
;
use
Maatwebsite\Excel\Concerns\FromCollection
;
use
Maatwebsite\Excel\Concerns\FromView
;
use
Maatwebsite\Excel\Concerns\ShouldAutoSize
;
// class UsersExport implements FromCollection, Responsable
class
UsersExport
implements
FromView
,
ShouldAutoSize
{
use
Exportable
;
// private $fileName = "Ringkasan Laporan.xlsx";
/**
* @return \Illuminate\Support\Collection
*/
public
function
view
()
:
View
{
// dd(User::all());
return
view
(
'timesheet::exports.users'
,
[
'users'
=>
User
::
all
()
]);
}
}
packages/portal/timesheet/resources/views/exports/exportRingkasan.blade.php
0 → 100644
View file @
27511bf4
<table
class=
"ui unstackable celled table"
style=
"width: 100%"
>
<thead>
<tr>
<th
colspan=
"5"
></th>
<th
colspan=
"{{count($chargeproject)+2}}"
class=
"center aligned"
>
Chargeable
</th>
<th
colspan=
"{{count($overhead)+3}}"
class=
"center aligned"
>
Non-Chargeable
</th>
<th
rowspan=
"2"
class=
"center aligned"
>
Total (Working Days)
</th>
</tr>
<tr>
<th>
No
</th>
<th>
Department
</th>
<th>
Staff Id
</th>
<th>
Staff Name
</th>
<th>
Position
</th>
@foreach($chargeproject as $key => $chargeable)
<th>
{{data_get($chargeable, 'p_project_code')}}
</th>
@endforeach
<th>
Total Hours
</th>
<th>
Total Days
</th>
<th
class=
"center aligned"
>
Project
</th>
@foreach($overhead as $key => $value)
<th>
{{data_get($value,'o_overhead_desc')}}
</th>
@endforeach
<th>
Total Hours
</th>
<th>
Total Days
</th>
</tr>
</thead>
<?php
$totaldays
=
$totalalldays
=
0
;
?>
@foreach($staffs as $key => $staff)
<tbody>
<tr>
<td>
{{$key+1}}
</td>
<td>
{{data_get($staff,'deptCode')}}
</td>
<td>
{{data_get($staff,'staffid')}}
</td>
<td
class=
"single line"
>
{{data_get($staff,'name')}}
</td>
<td></td>
<?php
$totalc
=
0
;
?>
@foreach($chargeproject as $key => $chargeable)
<td>
@foreach($ringkasan as $key => $value)
@if(data_get($value,'staffid') == data_get($staff,'staffid')
&&
data_get($chargeable,'id') == data_get($value,'c_pid'))
{{data_get($value,'total_c_hours')}}
<?php
$totalc
+=
data_get
(
$value
,
'total_c_hours'
);
?>
@endif
@endforeach
</td>
@endforeach
<td
class=
"center aligned"
>
{{$totalc}}
</td>
<td
class=
"center aligned"
>
{{number_format($totalc/8, 1, '.', '')}}
</td>
<td
class=
"center aligned"
>
<?php
$totalnc
=
0
;
?>
@foreach($projectnc as $key => $project)
@if(data_get($project,'staffid') == data_get($staff,'staffid'))
{{data_get($project,'nonchargehours')}}
<?php
$totalnc
+=
data_get
(
$project
,
'nonchargehours'
);
?>
@endif
@endforeach
</td>
@foreach($overhead as $key => $value)
<td>
@foreach($ovhours as $key => $hours)
@if(data_get($staff,'staffid') == data_get($hours,'staffid')
&&
data_get($value,'id') == data_get($hours,'oid'))
{{data_get($hours,'hours')}}
<?php
$totalnc
+=
data_get
(
$hours
,
'hours'
);
?>
@endif
@endforeach
</td>
@endforeach
<td
class=
"center aligned"
>
{{$totalnc}}
</td>
<td
class=
"center aligned"
>
{{number_format($totalnc/8, 1, '.', '')}}
</td>
<?php
$totaldays
=
number_format
(
$totalc
/
8
,
1
,
'.'
,
''
)
+
number_format
(
$totalnc
/
8
,
1
,
'.'
,
''
);
?>
<td>
{{$totaldays}}
</td>
</tr>
</tbody>
<?php
$totalalldays
+=
$totaldays
;
?>
@endforeach
<tfoot>
<tr>
<th
colspan=
"5"
class=
"center aligned"
>
<strong>
Total
</strong>
</th>
<th
colspan=
"{{count($chargeproject)+2+count($overhead)+3}}"
></th>
<th><strong>
{{$totalalldays}}
</strong></th>
</tr>
</tfoot>
</table>
\ No newline at end of file
packages/portal/timesheet/resources/views/exports/users.blade.php
0 → 100644
View file @
27511bf4
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Email
</th>
</tr>
</thead>
<tbody>
@foreach($users as $key => $user)
<tr>
<td>
{{ $user->name }}
</td>
<td>
{{ $user->email }}
</td>
</tr>
@endforeach
</tbody>
</table>
\ No newline at end of file
packages/portal/timesheet/resources/views/form/notelist.blade.php
View file @
27511bf4
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
@
section
(
'content'
)
@
section
(
'content'
)
<
div
class
="
ui
orange
modal
uploadmodal
">
<
div
class
="
ui
tiny
orange
modal
uploadmodal
">
<div class="
header
">
<div class="
header
">
Upload Attachment
Upload Attachment
</div>
</div>
...
...
packages/portal/timesheet/resources/views/report/ringkasan.blade.php
View file @
27511bf4
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
Report Summary
Report Summary
</div>
</div>
<button class="
right
floated
center
aligned
ui
violet
compact
labeled
icon
button
">
<button class="
right
floated
center
aligned
ui
violet
compact
labeled
icon
button
"
onclick="
window
.
location
.
href
=
'{{ route('
timesheet
::
export
.
exportsummary
', ['
month
'=> $intmonth, '
year
'=> $year]) }}'
;
"
>
<i class="
file
excel
outline
icon
"></i>
<i class="
file
excel
outline
icon
"></i>
Export to Excel
Export to Excel
</button>
</button>
...
...
packages/portal/timesheet/routes/web.php
View file @
27511bf4
...
@@ -9,6 +9,10 @@ Route::group(
...
@@ -9,6 +9,10 @@ Route::group(
],
],
function
()
{
function
()
{
//export
Route
::
get
(
'ringkasan/export/'
,
[
'uses'
=>
'ExportController@export'
,
'as'
=>
'export.exportsummary'
]);
Route
::
get
(
'users/export/'
,
[
'uses'
=>
'ReportController@export'
,
'as'
=>
'report.exportsummary'
]);
//dashboard
//dashboard
Route
::
get
(
'home'
,[
'uses'
=>
'DashboardController@index'
,
'as'
=>
'dashboard.index'
]);
Route
::
get
(
'home'
,[
'uses'
=>
'DashboardController@index'
,
'as'
=>
'dashboard.index'
]);
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
27511bf4
...
@@ -407,9 +407,9 @@ class DashboardController extends Controller
...
@@ -407,9 +407,9 @@ class DashboardController extends Controller
$dept
=
Department
::
where
(
'id'
,
$user
->
fk_lkp_department
)
$dept
=
Department
::
where
(
'id'
,
$user
->
fk_lkp_department
)
->
first
();
->
first
();
// dd(Staff_info::all());
$hod
=
Staff_info
::
find
(
$user
->
penyokong
)
$hod
=
Staff_info
::
find
(
$user
->
penyokong
)
->
fullname
;
->
fullname
;
$penyokong
=
Staff_info
::
where
(
'penyokong'
,
0
)
$penyokong
=
Staff_info
::
where
(
'penyokong'
,
0
)
->
get
();
->
get
();
...
...
packages/portal/timesheet/src/Http/Controllers/ExportController.php
0 → 100644
View file @
27511bf4
<?php
namespace
Portal\Timesheet\Http\Controllers
;
use
Illuminate\Routing\Controller
;
use
Carbon\Carbon
;
use
DB
;
use
Portal\Timesheet\Model\Users
;
use
Portal\Timesheet\Model\Ts_master
;
use
Portal\Timesheet\Model\Ts_detail
;
use
Portal\Timesheet\Model\Project
;
use
Portal\Timesheet\Model\Tproject
;
use
Portal\Timesheet\Model\Department
;
use
Portal\Timesheet\Model\Pteam
;
use
Portal\Timesheet\Model\Staff_info
;
use
Portal\Timesheet\Model\Overhead
;
use
Portal\Timesheet\Model\Role
;
use
Portal\Timesheet\Model\VwViewer
;
use
Portal\Timesheet\Model\VwReviewProfile
;
use
Portal\Timesheet\Model\VwReviewDetails
;
use
Portal\Timesheet\Model\VwRingkasanLaporan
;
use
Portal\Timesheet\Model\VwChargeable
;
use
Portal\Timesheet\Model\VwNonChargeable
;
use
Portal\Timesheet\Model\VwStaff
;
use
Portal\Timesheet\Model\VwOverhead
;
use
Portal\Timesheet\Model\VwProject
;
use
Portal\Timesheet\Model\VwNonchargeSummary
;
use
Portal\Timesheet\Model\VwOverheadSummary
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Input
;
use
File
;
use
Redirect
;
use
App\Mail\StatusAccept
;
use
App\Mail\StatusReject
;
use
Mail
;
use
Curl
;
use
Auth
;
use
App\Exports\RingkasanExport
;
use
Maatwebsite\Excel\Facades\Excel
;
class
ExportController
extends
Controller
{
public
function
export
(
Request
$request
)
{
// dd($request);
$month
=
date
(
'F'
,
mktime
(
0
,
0
,
0
,
$request
->
month
,
1
,
date
(
'Y'
)));
$year
=
strval
(
$request
->
year
);
return
(
new
RingkasanExport
(
[
'month'
=>
$request
->
month
,
'year'
=>
$request
->
year
]))
->
download
(
'Ringkasan Laporan '
.
$month
.
' '
.
$year
.
'.xlsx'
);
}
}
\ No newline at end of file
packages/portal/timesheet/src/Http/Controllers/ReportController.php
View file @
27511bf4
...
@@ -35,9 +35,23 @@ use App\Mail\StatusReject;
...
@@ -35,9 +35,23 @@ use App\Mail\StatusReject;
use
Mail
;
use
Mail
;
use
Curl
;
use
Curl
;
use
Auth
;
use
Auth
;
use
App\Exports\UsersExport
;
use
Maatwebsite\Excel\Facades\Excel
;
class
ReportController
extends
Controller
class
ReportController
extends
Controller
{
{
public
function
export
(
Request
$request
)
{
// dd($request);
$month
=
date
(
'F'
,
mktime
(
0
,
0
,
0
,
$request
->
month
,
1
,
date
(
'Y'
)));
$year
=
strval
(
$request
->
year
);
return
(
new
UsersExport
)
->
download
(
'Ringkasan Laporan '
.
$month
.
' '
.
$year
.
'.xlsx'
);
// return new UsersExport;
}
public
function
ringkasanLaporan
()
public
function
ringkasanLaporan
()
{
{
$dept
=
Department
::
all
()
$dept
=
Department
::
all
()
...
@@ -76,21 +90,20 @@ class ReportController extends Controller
...
@@ -76,21 +90,20 @@ class ReportController extends Controller
// dd($ovhours);
// dd($ovhours);
$chargeproject
=
VwChargeable
::
all
();
$chargeproject
=
VwChargeable
::
all
();
$nonchargeproject
=
VwNonChargeable
::
all
();
//
$nonchargeproject = VwNonChargeable::all();
$staffs
=
VwStaff
::
orderby
(
'deptID'
)
$staffs
=
VwStaff
::
orderby
(
'deptID'
)
->
where
(
'deptID'
,
'!='
,
8
)
->
where
(
'deptID'
,
'!='
,
8
)
->
get
();
->
get
();
$year
=
date
(
'Y'
);
$year
=
date
(
'Y'
);
if
(
$request
->
year
)
{
if
(
$request
->
year
)
{
$year
=
$request
->
year
;
$year
=
$request
->
year
;
}
}
$intmonth
=
$request
->
month
;
$month
=
date
(
'F'
,
mktime
(
0
,
0
,
0
,
$request
->
month
,
1
,
date
(
'Y'
)));
$month
=
date
(
'F'
,
mktime
(
0
,
0
,
0
,
$request
->
month
,
1
,
date
(
'Y'
)));
return
view
(
'timesheet::report.ringkasan'
,
compact
(
'
month'
,
'year'
,
'ringkasan'
,
'chargeproject'
,
'non
chargeproject'
,
'staffs'
,
'projectnc'
,
'overhead'
,
'ovhours'
));
return
view
(
'timesheet::report.ringkasan'
,
compact
(
'
intmonth'
,
'month'
,
'year'
,
'ringkasan'
,
'
chargeproject'
,
'staffs'
,
'projectnc'
,
'overhead'
,
'ovhours'
));
}
}
public
function
projectreport
()
public
function
projectreport
()
...
...
storage/framework/laravel-excel/laravel-excel-05hQgT09xodLPU6tgcZC45xtEh8MF6iM.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-3bZWxdQaNyo3tbxlanOEqHkbfBp3FSMG.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-Gkyzqfoyju6aLKWN8ZjTeJnZed3zBnSv.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-Ihwch2zS90gNJ5MlDz25oa96fwYnfqmi.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-Lh5D7SCaVDTFFRaw70uSJaORPpLAujIb.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-Ma5CPq0BBsQ8a9AsKBAxOEPHKAflv0d5.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-MbldViGLwVMVR52rxqjcY4OyygWqPpUi.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-U8cCaERAV9xD00SYOebdKHtGn89Tnmac.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-eRjVQSOWkfkz06FGMmQLCGQN30l59xyD.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-kAa2sHi0qcU263SiM4h2BQRzitrh4H66.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-kDP1dc2iaNGMji0cYX2ErsyagwyFFn5J.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-lgAYTIKiYdJrI2xIBtMw9GiW0aJKzsqY.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-o3pmDKKOeUAUTlQTelzA4G4avmFPGlpr.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-qrUK8FAVzu2zen5SJikiNS0Pl9Mpf7sk.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-so2wzC713jNUeibBd88PMaElBEF09Twu.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-uQ9RZHiFtimjhjPc3aHpuOV1S8j5yo5k.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-w8DexckpEQyBK6KbwOwBQ6dVGLj6A4dt.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-yUh0bwuNV6UIgyjFgeBnZjEOB5PtOxlo.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-zNWKdefGPJyODl6yuVSDpvchBB9bckK3.html
0 → 100644
View file @
27511bf4
storage/framework/laravel-excel/laravel-excel-zghEnMByPWhetWclLwr0taAfiTnVCff0.html
0 → 100644
View file @
27511bf4
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