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
6b07bca0
Commit
6b07bca0
authored
Jun 14, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
overhead maintenance screen and non-chargeable form
parent
816246a0
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
588 additions
and
50 deletions
+588
-50
database/migrations/2022_06_14_163215_drop_o_id_column.php
+32
-0
packages/portal/timesheet/resources/views/dashboard/chargeableForm.blade.php
+265
-0
packages/portal/timesheet/resources/views/dashboard/editProjectTeam.blade.php
+30
-0
packages/portal/timesheet/resources/views/dashboard/nonChargeableForm.blade.php
+5
-18
packages/portal/timesheet/resources/views/dashboard/penambahanOverhead.blade.php
+25
-0
packages/portal/timesheet/resources/views/dashboard/penambahanProject.blade.php
+2
-2
packages/portal/timesheet/resources/views/dashboard/penambahanProjectTeam.blade.php
+2
-5
packages/portal/timesheet/resources/views/dashboard/senaraiOverhead.blade.php
+29
-0
packages/portal/timesheet/resources/views/dashboard/senaraiProjectTeam.blade.php
+1
-1
packages/portal/timesheet/routes/web.php
+15
-3
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+163
-15
packages/portal/timesheet/src/ServiceProvider.php
+19
-6
No files found.
database/migrations/2022_06_14_163215_drop_o_id_column.php
0 → 100644
View file @
6b07bca0
<?php
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
class
DropOIdColumn
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'overhead'
,
function
(
Blueprint
$table
)
{
$table
->
dropColumn
(
'o_id'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
table
(
'overhead'
,
function
(
Blueprint
$table
)
{
$table
->
integer
(
'o_id'
)
->
nullable
()
->
unsigned
();
});
}
}
packages/portal/timesheet/resources/views/dashboard/chargeableForm.blade.php
0 → 100644
View file @
6b07bca0
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
style
>
/* Chrome, Safari, Edge, Opera */
input
::-
webkit
-
outer
-
spin
-
button
,
input
::-
webkit
-
inner
-
spin
-
button
{
-
webkit
-
appearance
:
none
;
margin
:
0
;
}
/* Firefox */
input
[
type
=
number
]
{
-
moz
-
appearance
:
textfield
;
}
</
style
>
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Chargeable Form</a>
<br>
<br>
<form class="
ui
form
">
<div class="
field
">
<div class="
four
fields
">
<div class="
two
wide
field
">
<label>Day</label>
<input type="
text
" placeholder="
Day
" value="
{{
$day
}}
">
</div>
<div class="
two
wide
field
">
<label>Month</label>
<input type="
text
" placeholder="
Month
" value="
{{
$month
}}
">
</div>
<div class="
two
wide
field
">
<label>Year</label>
<input type="
text
" placeholder="
Year
" value="
{{
$year
}}
">
</div>
<!-- <div class="
two
wide
field
">
<label>Phase</label>
<select class="
ui
fluid
dropdown
">
<option value="">
{
{$phase}
}
</option>
<option value="
1
">1</option>
<option value="
2
">2</option>
</div> -->
</div>
</div>
</form>
<br>
<form class="
ui
form
" action="
{{
route
(
'timesheet::dashboard.savechargeablehours'
)}}
" method="
POST
">
{
{csrf_field()}
}
<input type="
hidden
" name="
userId
" value="
{{
$userId
}}
">
<input type="
hidden
" name="
year
" value="
{{
$year
}}
">
<input type="
hidden
" name="
month
" value="
{{
$month
}}
">
<input type="
hidden
" name="
phase
" value="
{{
$phase
}}
">
<table class="
ui
celled
structured
table
">
<thead>
<tr>
<th colspan="
2
">Chargeable</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th>
<button type="
submit
" class="
fluid
center
aligned
ui
blue
compact
labeled
icon
button
">
<i class="
save
icon
"></i>
Save
</button>
</th>
</tr>
<tr>
<th class="
single
line
">Project Code</th>
<th class="
single
line
">Project Name</th>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th>
{
{$i+1}
}
</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th>
{
{$i+1}
}
</th>
@endfor
@endif
<th>Total Hours</th>
</tr>
<tr>
</tr>
</thead>
<tbody>
@foreach(
$projectlist
as
$key
=>
$project
)
<?php
$total
= 0; ?>
<tr>
<td class="
single
line
">
{
{$project['td_project_code']}
}
</td>
<td class="
single
line
">
{
{$project['td_project_name']}
}
</td>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$valuehour
= '';
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if(
$hour
)
{
$valuehour
=
$hour->where
('td_date','=',
$date
)
->where('td_project',
$project['td_project']
)
->where('tm_phase',
$phase
)
->first();
$total
+=
$valuehour->td_hours
;
}
?>
<td >
<input type="
text
" onkeypress="
onlynumber
(
event
)
" id="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" name="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" value="
@
if
(
$valuehour
){{
$valuehour
->
td_hours
}}
@
else
@
endif
" min="
0
" max="
24
" style="
padding
:
2
px
;
margin
:
unset
" onchange="
limiter
(
this
,
'{{$project['
td_project
']}}'
);
">
</td>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
$valuehour
= '';
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if(
$hour
)
{
$valuehour
=
$hour->where
('td_date','=',
$date
)
->where('td_project',
$project['td_project']
)
->where('tm_phase',
$phase
)
->first();
$total
+=
$valuehour->td_hours
;
}
?>
<td >
<input type="
text
" onkeypress="
onlynumber
(
event
)
" id="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" name="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" value="
@
if
(
$valuehour
){{
$valuehour
->
td_hours
}}
@
else
@
endif
" min="
0
" max="
24
" style="
padding
:
2
px
;
margin
:
unset
" onchange="
limiter
(
this
,
'{{$project['
td_project
']}}'
);
">
</td>
@endfor
@endif
<td>
<input type="
text
" onkeypress="
onlynumber
(
event
)
" name="
total
-
{{
$project
[
'td_project'
]}}
" id="
total
-
{{
$project
[
'td_project'
]}}
" style="
padding
-
right
:
4
px
;
padding
-
left
:
4
px
;
" onchange="
limiter
(
this
,
'{{$project['
td_project
']}}'
);
" readonly="" value=
{
{$total}
}
>
</td>
</tr>
@endforeach
</tbody>
</table>
</form>
<br>
@if(
$phase
== 1)
<button class="
center
aligned
ui
green
compact
right
labeled
icon
button
" onclick="
phase2
(
$phase
);
" id="
phase2
">
<i class="
angle
double
right
icon
"></i>
Phase 2
</button>
@else
<button class="
center
aligned
ui
green
compact
labeled
icon
button
" onclick="
phase1
(
$phase
);
" id="
phase1
">
<i class="
angle
double
left
icon
"></i>
Phase 1
</button>
@endif
</div>
@endsection
@push('script')
<script>
var phase = 0;
function phase2(p)
{
phase = p;
phase = phase+1;
document.getElementById('phase2') = phase;
}
function phase1(p)
{
phase = p;
phase = phase-1;
document.getElementById('phase1') = phase;
}
</script>
<script>
function onlynumber(evt)
{
var theEvent = evt || window.event;
var key = theEvent.keyCode || theEvent.which;
key = String.fromCharCode(key);
var regex = /[0-9]|\./;
if( !regex.test(key) )
{
theEvent.returnValue = false;
if(theEvent.preventDefault) theEvent.preventDefault();
}
}
</script>
<script>
$().ready(function() {
});
function limiter(input,pid) {
var currenttotal = 0;
if (input.value < 0) input.value = 0;
if (input.value > 24) input.value = 24;
input.value = parseFloat(parseFloat(input.value).toFixed(1));
for(var i = 0; i < 32; i++){
var value = 0;
var hourValue = document.getElementById('hour['+pid+']['+i+']');
if(hourValue){
hourValue = hourValue.value;
value = parseFloat(parseFloat(hourValue).toFixed(1));
console.log(isNaN(value));
if(isNaN(value)){
value = 0;
}
if(typeof value === 'number'){
// console.log(value);
currenttotal += value;
}
}
}
console.log("
currenttotal
-->
" + currenttotal);
// var currentTtotal = document.getElementById('total-'+pid).value;
// var total = document.getElementById('total-'+pid).value;
// if(total == null || total == 0){
// total = 0;
// }else{
// total = document.getElementById('total-'+pid).value;
// }
// if (input.value < 0) input.value = 0;
// if (input.value > 24) input.value = 24
// else total = Number(input.value)+Number(currentTtotal);
document.getElementById('total-'+pid).value = currenttotal;
}
</script>
@endpush
\ No newline at end of file
packages/portal/timesheet/resources/views/dashboard/editProjectTeam.blade.php
0 → 100644
View file @
6b07bca0
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Edit Project Team</a>
<br><br>
<form class="
ui
form
" action="
{{
route
(
'timesheet::dashboard.updateprojectteam'
)}}
" method="
POST
">
{
{csrf_field()}
}
<input type="
hidden
" name="
id
" value="
{{
$team
->
id
}}
">
<input type="
hidden
" name="
pid
" value="
{{
$team
->
fk_project_id
}}
">
<div class="
field
">
<label for="
projectteam
">Project Team</label>
<input onselect="
myDepartment
()
" type="
text
" name="
projectteam
" value="
{{
$team
->
pt_team
}}
">
</div>
<div class="
field
">
<label>Project Status</label>
<select name="
status
" class="
ui
fluid
dropdown
">
<option value="">Project Status</option>
<option value="
1
">Active</option>
<option value="
2
">Inactive</option>
</select>
</div>
<button class="
ui
blue
button
" type="
submit
">Update</button>
<button class="
ui
green
button
" type="
button
" onclick="
window
.
location
.
href
=
'{{ route('
timesheet
::
dashboard
.
senaraiProjectTeam
', ['
id
'=> $pid] ) }} '
;
">Back</button>
</form>
</div>
@endsection
\ No newline at end of file
packages/portal/timesheet/resources/views/dashboard/
borangBolehCaj
.blade.php
→
packages/portal/timesheet/resources/views/dashboard/
nonChargeableForm
.blade.php
View file @
6b07bca0
...
...
@@ -17,7 +17,7 @@ input[type=number] {
</
style
>
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Chargeable Form</a>
<a class="
ui
blue
left
ribbon
label
">
Non
Chargeable Form</a>
<br>
<hr>
Day =
{
{$day}
}
<br>
...
...
@@ -35,7 +35,7 @@ input[type=number] {
<table class="
ui
celled
structured
table
">
<thead>
<tr>
<th colspan="
2
">Chargeable</th>
<th colspan="
2
">
Non-
Chargeable</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th>
<button type="
submit
" class="
fluid
center
aligned
ui
blue
compact
labeled
icon
button
">
...
...
@@ -79,8 +79,6 @@ input[type=number] {
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$valuehour
= '';
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
...
...
@@ -90,6 +88,7 @@ input[type=number] {
$valuehour
=
$hour->where
('td_date','=',
$date
)
->where('td_project',
$project['td_project']
)
->where('tm_phase',
$phase
)
// ->where('td_project_type',
$nonchargeable
)
->first();
$total
+=
$valuehour->td_hours
;
...
...
@@ -226,21 +225,8 @@ input[type=number] {
console.log("
currenttotal
-->
" + currenttotal);
// var currentTtotal = document.getElementById('total-'+pid).value;
// var total = document.getElementById('total-'+pid).value;
// if(total == null || total == 0){
// total = 0;
// }else{
// total = document.getElementById('total-'+pid).value;
// }
// if (input.value < 0) input.value = 0;
// if (input.value > 24) input.value = 24
// else total = Number(input.value)+Number(currentTtotal);
document.getElementById('total-'+pid).value = currenttotal;
}
</script>
@endpush
\ No newline at end of file
packages/portal/timesheet/resources/views/dashboard/penambahanOverhead.blade.php
0 → 100644
View file @
6b07bca0
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Add New Overhead Lookup</a>
<br><br>
<form class="
ui
form
" action="
{{
route
(
'timesheet::dashboard.addoverheadlookup'
)}}
" method="
POST
">
{
{csrf_field()}
}
<div class="
field
">
<label>Overhead Lookup</label>
<input type="
text
" name="
overheadlookup
" placeholder="
Enter
new
lookup
overhead
">
</div>
<div class="
field
">
<label>Overhead Status</label>
<select name="
status
" class="
ui
fluid
dropdown
">
<option value="">Overhead Status</option>
<option value="
1
">Active</option>
<option value="
2
">Inactive</option>
</select>
</div>
<button class="
ui
button
" type="
submit
">Submit</button>
</form>
</div>
@endsection
\ No newline at end of file
packages/portal/timesheet/resources/views/dashboard/penambahanProject.blade.php
View file @
6b07bca0
...
...
@@ -32,7 +32,6 @@
</div>
<button class="
ui
button
" type="
submit
">Submit</button>
</form>
</div>
</div>
@endsection
\ No newline at end of file
packages/portal/timesheet/resources/views/dashboard/penambahanProjectTeam.blade.php
View file @
6b07bca0
...
...
@@ -43,10 +43,9 @@
</select>
</div>
<button class="
ui
blue
button
" type="
submit
">Save</button>
<button class="
ui
green
button
" type="
button
" onclick="
window
.
location
.
href
=
''
;
">Back</button>
<button class="
ui
green
button
" type="
button
" onclick="
window
.
location
.
href
=
'
{{ route('
timesheet
::
dashboard
.
senaraiProjectTeam
', ['
id
'=> $pid] ) }}
'
;
">Back</button>
</form>
</div>
<!-- <p id="
demo
"></p> -->
</div>
@endsection
...
...
@@ -59,8 +58,6 @@ function myDepartment() {
<script>
function selectDepartment(i) {
// var selectBox = document.getElementById("
department
");
// var selectedValue = selectBox.options[selectBox.selectedIndex].value;
alert(i);
}
</script>
...
...
packages/portal/timesheet/resources/views/dashboard/senaraiOverhead.blade.php
0 → 100644
View file @
6b07bca0
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Senarai Overhead</a>
<a href="
{{
route
(
'timesheet::dashboard.penambahanOverhead'
)}}
" class="
ui
right
floated
small
primary
labeled
icon
button
"><i class="
plus
icon
"></i>Penambahan Lookup Overhead
</a>
<br>
<table class="
ui
celled
padded
table
">
<thead>
<tr>
<th>No</th>
<th>Overhead Lookup</th>
<th>Status</th>
</tr>
</thead>
<tbody>
@foreach(
$overheads
as
$key
=>
$overhead
)
<tr>
<td>
{
{$key+1}
}
</td>
<td>
{
{$overhead['lkp_overhead']}
}
</td>
<td>
{
{$overhead['status']}
}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection
\ No newline at end of file
packages/portal/timesheet/resources/views/dashboard/senaraiProjectTeam.blade.php
View file @
6b07bca0
...
...
@@ -26,7 +26,7 @@
<td>
{
{$project['projectname']}
}
</td>
<td>
{
{$project['projectteam']}
}
</td>
<td>
{
{$project['status']}
}
</td>
<td><a href="">Edit</a></td>
<td><a href="
{{
route
(
'timesheet::dashboard.editprojectteam'
,
[
'id'
=>
$project
[
'id'
]])}}
">Edit</a></td>
</tr>
@endforeach
</tbody>
...
...
packages/portal/timesheet/routes/web.php
View file @
6b07bca0
...
...
@@ -10,7 +10,6 @@ Route::group(
function
()
{
Route
::
get
(
'home'
,[
'uses'
=>
'DashboardController@index'
,
'as'
=>
'dashboard.index'
]);
Route
::
get
(
'pengurusan'
,[
'uses'
=>
'DashboardController@pengurusan'
,
'as'
=>
'dashboard.pengurusan'
]);
Route
::
get
(
'senaraiProject'
,[
'uses'
=>
'DashboardController@senaraiProject'
,
'as'
=>
'dashboard.senaraiProject'
]);
Route
::
get
(
'penambahanProject'
,[
'uses'
=>
'DashboardController@penambahanProject'
,
'as'
=>
'dashboard.penambahanProject'
]);
...
...
@@ -18,9 +17,16 @@ Route::group(
Route
::
get
(
'penambahanProjectTeam'
,[
'uses'
=>
'DashboardController@penambahanProjectTeam'
,
'as'
=>
'dashboard.penambahanProjectTeam'
]);
Route
::
post
(
'addnewproject'
,[
'uses'
=>
'DashboardController@addnewproject'
,
'as'
=>
'dashboard.addnewproject'
]);
Route
::
post
(
'addprojectteam'
,[
'uses'
=>
'DashboardController@addprojectteam'
,
'as'
=>
'dashboard.addprojectteam'
]);
Route
::
get
(
'editprojectteam'
,[
'uses'
=>
'DashboardController@editprojectteam'
,
'as'
=>
'dashboard.editprojectteam'
]);
Route
::
post
(
'updateprojectteam'
,[
'uses'
=>
'DashboardController@updateprojectteam'
,
'as'
=>
'dashboard.updateprojectteam'
]);
Route
::
get
(
'senaraiOverhead'
,[
'uses'
=>
'DashboardController@senaraiOverhead'
,
'as'
=>
'dashboard.senaraiOverhead'
]);
Route
::
get
(
'penambahanOverhead'
,[
'uses'
=>
'DashboardController@penambahanOverhead'
,
'as'
=>
'dashboard.penambahanOverhead'
]);
Route
::
post
(
'addoverheadlookup'
,[
'uses'
=>
'DashboardController@addoverheadlookup'
,
'as'
=>
'dashboard.addoverheadlookup'
]);
Route
::
get
(
'chargeableForm'
,[
'uses'
=>
'DashboardController@chargeableForm'
,
'as'
=>
'dashboard.chargeableForm'
]);
Route
::
get
(
'nonChargeableForm'
,[
'uses'
=>
'DashboardController@nonChargeableForm'
,
'as'
=>
'dashboard.nonChargeableForm'
]);
Route
::
get
(
'overheadForm'
,[
'uses'
=>
'DashboardController@overheadForm'
,
'as'
=>
'dashboard.overheadForm'
]);
Route
::
get
(
'perkhidmatan'
,[
'uses'
=>
'DashboardController@perkhidmatan'
,
'as'
=>
'dashboard.perkhidmatan'
]);
Route
::
get
(
'borangBolehCaj'
,[
'uses'
=>
'DashboardController@borangBolehCaj'
,
'as'
=>
'dashboard.borangBolehCaj'
]);
Route
::
get
(
'kalendarCharge'
,[
'uses'
=>
'DashboardController@kalendarCharge'
,
'as'
=>
'dashboard.kalendarCharge'
]);
Route
::
get
(
'kalendarNonCharge'
,[
'uses'
=>
'DashboardController@kalendarNonCharge'
,
'as'
=>
'dashboard.kalendarNonCharge'
]);
Route
::
get
(
'kalendar'
,[
'uses'
=>
'DashboardController@kalendar'
,
'as'
=>
'dashboard.kalendar'
]);
...
...
@@ -31,6 +37,12 @@ Route::group(
Route
::
get
(
'timesheet_viewer'
,[
'uses'
=>
'DashboardController@timesheetViewer'
,
'as'
=>
'dashboard.timesheetViewer'
]);
Route
::
post
(
'savechargeablehours'
,[
'uses'
=>
'DashboardController@savechargeablehours'
,
'as'
=>
'dashboard.savechargeablehours'
]);
Route
::
get
(
'pengurusan'
,[
'uses'
=>
'DashboardController@pengurusan'
,
'as'
=>
'dashboard.pengurusan'
]);
Route
::
get
(
'perkhidmatan'
,[
'uses'
=>
'DashboardController@perkhidmatan'
,
'as'
=>
'dashboard.perkhidmatan'
]);
}
);
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
6b07bca0
...
...
@@ -12,6 +12,7 @@ use Portal\Timesheet\Model\Project;
use
Portal\Timesheet\Model\Department
;
use
Portal\Timesheet\Model\Pteam
;
use
Portal\Timesheet\Model\Staff_info
;
use
Portal\Timesheet\Model\Overhead
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Input
;
use
File
;
...
...
@@ -137,6 +138,7 @@ class DashboardController extends Controller
'projectname'
=>
$value
->
pt_project_description
,
'projectteam'
=>
$value
->
pt_team
,
'status'
=>
$value
->
pt_project_task_sts
,
'pid'
=>
$value
->
fk_project_id
,
];
}
...
...
@@ -146,6 +148,7 @@ class DashboardController extends Controller
public
function
penambahanProjectTeam
(
Request
$request
)
{
$pid
=
$request
->
id
;
$project
=
Project
::
where
(
'id'
,
$request
->
id
)
->
first
();
//find($request->id);
$departments
=
Department
::
all
()
...
...
@@ -158,7 +161,7 @@ class DashboardController extends Controller
// dd($value->id);
}
return
view
(
'timesheet::dashboard.penambahanProjectTeam'
,
compact
(
'project'
,
'departments'
,
'staffs'
));
return
view
(
'timesheet::dashboard.penambahanProjectTeam'
,
compact
(
'project'
,
'departments'
,
'staffs'
,
'pid'
));
}
public
function
addprojectteam
(
Request
$request
)
...
...
@@ -186,20 +189,44 @@ class DashboardController extends Controller
$pt
->
save
();
}
// dd($request->staffId);
return
redirect
()
->
route
(
'timesheet::dashboard.penambahanProjectTeam'
);
}
// $data = new Pteam;
// $data->fk_project_id = $project->id;
// // $data->pt_team = $staff->fullname;
// $data->pt_staff_id = explode(',', $request->staffId);
// $data->pt_project_description = $project->p_project_description;
// $data->pt_project_task_sts = $request->status;
// $data->updated_by = $user->u_staffID;
public
function
editprojectteam
(
Request
$request
)
{
$team
=
Pteam
::
where
(
'id'
,
$request
->
id
)
->
first
();
$pid
=
$team
->
fk_project_id
;
// $data->save();
return
view
(
'timesheet::dashboard.editprojectteam'
,
compact
(
'team'
,
'pid'
));
}
public
function
updateprojectteam
(
Request
$request
)
{
$pid
=
$request
->
pid
;
$user
=
Users
::
where
(
'id'
,
Auth
::
id
())
->
first
();
$team
=
Pteam
::
where
(
'id'
,
$request
->
id
)
->
first
();
$team
->
pt_project_task_sts
=
$request
->
status
;
$team
->
update
();
$project
=
Pteam
::
where
(
'fk_project_id'
,
$request
->
pid
)
->
get
();
$projectlist
=
[];
foreach
(
$project
as
$key
=>
$value
)
{
$projectlist
[]
=
[
'id'
=>
$value
->
id
,
'projectcode'
=>
$value
->
toProject
->
p_project_code
,
'projectname'
=>
$value
->
pt_project_description
,
'projectteam'
=>
$value
->
pt_team
,
'status'
=>
$value
->
pt_project_task_sts
,
];
return
redirect
()
->
route
(
'timesheet::dashboard.penambahanProjectTeam'
);
}
return
view
(
'timesheet::dashboard.senaraiProjectTeam'
,
compact
(
'projectlist'
,
'project'
,
'pid'
));
}
public
function
perkhidmatan
()
...
...
@@ -207,13 +234,13 @@ class DashboardController extends Controller
return
view
(
'timesheet::dashboard.perkhidmatan'
);
}
public
function
borangBolehCaj
(
Request
$request
)
public
function
chargeableForm
(
Request
$request
)
{
$userId
=
Auth
::
id
();
$user
=
users
::
where
(
'id'
,
Auth
::
id
())
->
first
();
$project
=
Pteam
::
where
(
'pt_staff_id'
,
$user
->
u_staffID
)
->
get
();
// dd($project);
$projectlist
=
[];
// nanti project code query dari table project:
...
...
@@ -284,9 +311,92 @@ class DashboardController extends Controller
}
return
view
(
'timesheet::dashboard.borangBolehCaj'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
));
return
view
(
'timesheet::dashboard.chargeableForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
));
}
public
function
nonchargeableForm
()
{
$userId
=
Auth
::
id
();
$user
=
users
::
where
(
'id'
,
Auth
::
id
())
->
first
();
$project
=
Pteam
::
where
(
'pt_staff_id'
,
$user
->
u_staffID
)
->
get
();
$nonchargeable
=
2
;
// dd($project);
$projectlist
=
[];
// nanti project code query dari table project:
foreach
(
$project
as
$key
=>
$value
)
{
$projectlist
[]
=
[
'td_project'
=>
$value
->
fk_project_id
,
'td_project_code'
=>
$value
->
toProject
->
p_project_code
,
'td_project_name'
=>
$value
->
toProject
->
p_project_description
,
];
}
//sample dulu
$phase
=
1
;
$month
=
date
(
'n'
);
$year
=
date
(
'Y'
);
$day
=
date
(
'j'
);
if
(
isset
(
$request
->
phase
))
{
$phase
=
$request
->
phase
;
}
if
(
isset
(
$request
->
month
))
{
$month
=
$request
->
month
;
}
if
(
isset
(
$request
->
year
))
{
$year
=
$request
->
year
;
}
$daymonth
=
cal_days_in_month
(
CAL_GREGORIAN
,
$month
,
$year
);
// dd($phase);
//check dlam db, kalau dah ada detail hours, kuar form edit, kalau belum, kuar form create
$user
=
users
::
where
(
'id'
,
Auth
::
id
())
->
first
();
// dd($user);
// check timesheet master
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$user
->
u_staffID
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
->
where
(
'tm_phase'
,
$phase
)
->
first
();
// dd($check);
//kalau ada, dia gi ke edit
if
(
$check
)
{
$hour
=
Ts_detail
::
where
(
'fk_tm_id'
,
$check
->
id
)
// ->where('td_project_type', $nonchargeable)
// ->with('project:p_project_code')
->
get
();
// dd($hour);
}
//klu xde g create.php
else
{
$hour
=
null
;
}
return
view
(
'timesheet::dashboard.nonchargeableForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
,
'nonchargeable'
));
}
public
function
kalendarCharge
()
{
return
view
(
'timesheet::dashboard.kalendarCharge'
);
...
...
@@ -417,8 +527,46 @@ class DashboardController extends Controller
// return redirect::to('mobile/profile');
return
redirect
()
->
route
(
'timesheet::dashboard.borangBolehCaj'
,
[
'phase'
=>
$request
->
phase
,
'month'
=>
$request
->
month
,
'year'
,
$request
->
year
])
->
with
(
'success'
,
'Timesheet Updated'
);
return
redirect
()
->
route
(
'timesheet::dashboard.chargeableForm'
,
[
'phase'
=>
$request
->
phase
,
'month'
=>
$request
->
month
,
'year'
,
$request
->
year
])
->
with
(
'success'
,
'Timesheet Updated'
);
}
public
function
senaraiOverhead
()
{
$overhead
=
Overhead
::
all
();
$overheads
=
[];
foreach
(
$overhead
as
$key
=>
$value
)
{
$overheads
[]
=
[
'id'
=>
$value
->
id
,
'lkp_overhead'
=>
$value
->
o_overhead_desc
,
'status'
=>
$value
->
o_overhead_sts
,
];
}
return
view
(
'timesheet::dashboard.senaraiOverhead'
,
compact
(
'overheads'
));
}
public
function
penambahanOverhead
()
{
return
view
(
'timesheet::dashboard.penambahanOverhead'
);
}
public
function
addoverheadlookup
(
Request
$request
)
{
$user
=
Users
::
where
(
'id'
,
Auth
::
id
())
->
first
();
$data
=
new
Overhead
;
$data
->
o_overhead_desc
=
$request
->
overheadlookup
;
$data
->
o_overhead_sts
=
$request
->
status
;
$data
->
updated_by
=
$user
->
u_staffID
;
$data
->
save
();
return
redirect
()
->
route
(
'timesheet::dashboard.senaraiOverhead'
);
}
public
function
timesheetApproval
()
...
...
packages/portal/timesheet/src/ServiceProvider.php
View file @
6b07bca0
...
...
@@ -92,12 +92,21 @@ class ServiceProvider extends BaseServiceProvider
->
data
(
'icon'
,
'users icon'
)
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
pengurusan
);
$pengurusanProject
->
add
(
__
(
'Senarai Overhead'
),
route
(
'timesheet::dashboard.senaraiOverhead'
))
->
data
(
'icon'
,
'users icon'
)
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
pengurusan
);
$pengurusanProject
->
add
(
__
(
'Penambahan Overhead'
),
route
(
'timesheet::dashboard.penambahanOverhead'
))
->
data
(
'icon'
,
'users icon'
)
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
pengurusan
);
$calendar
=
$this
->
app
[
'laravolt.menu'
]
->
add
(
__
(
'Kalendar'
))
->
data
(
'icon'
,
'calendar alternate'
);
$calendar
->
add
(
__
(
'Kalendar'
),
route
(
'timesheet::dashboard.kalendar'
))
->
data
(
'icon'
,
'calendar alternate outline'
)
->
active
(
'kalendar/*'
)
->
data
(
'permission'
,
Permission
::
calendar
);
// $calendar->add(__('Chargeable'), route('timesheet::dashboard.kalendarCharge'))
// ->data('icon', 'calendar alternate outline')
// ->active('kalendarCharge/*')
...
...
@@ -109,16 +118,20 @@ class ServiceProvider extends BaseServiceProvider
// ->data('permission', Permission::kehadiran);
$form
=
$this
->
app
[
'laravolt.menu'
]
->
add
(
__
(
'Borang'
))
->
data
(
'icon'
,
'align justify'
);
$form
->
add
(
__
(
'Borang Chargeable'
),
url
(
'/
borangBolehCaj
/'
))
$form
->
add
(
__
(
'Borang Chargeable'
),
url
(
'/
chargeableForm
/'
))
->
data
(
'icon'
,
'circle outline'
)
->
active
(
'
borangBolehCaj
/*'
)
->
active
(
'
chargeableForm
/*'
)
->
data
(
'permission'
,
Permission
::
kehadiran
);
$form
->
add
(
__
(
'Borang Non-Chargeable'
))
->
data
(
'icon'
,
'circle outline'
);
$form
->
add
(
__
(
'Borang Non-Chargeable'
),
route
(
'timesheet::dashboard.nonChargeableForm'
))
->
data
(
'icon'
,
'circle outline'
)
->
active
(
'nonChargeableForm/*'
)
->
data
(
'permission'
,
Permission
::
kehadiran
);
$form
->
add
(
__
(
'Overhed'
))
->
data
(
'icon'
,
'circle outline'
);
$form
->
add
(
__
(
'Overhead'
),
route
(
'timesheet::dashboard.overheadForm'
))
->
data
(
'icon'
,
'circle outline'
)
->
active
(
'overheadForm/*'
)
->
data
(
'permission'
,
Permission
::
kehadiran
);
// $menu->add(__('Maklumat Cuti'), route('ecuti::quota.index'))
// ->data('icon', 'circle outline')
...
...
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