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
0b2bb244
Commit
0b2bb244
authored
Jun 10, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
maintenance screen for project and project team
parent
33fbb268
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
366 additions
and
84 deletions
+366
-84
database/migrations/2022_06_08_172639_create_project_team_table.php
+1
-0
packages/portal/timesheet/resources/views/dashboard/borangBolehCaj.blade.php
+38
-14
packages/portal/timesheet/resources/views/dashboard/penambahanProject.blade.php
+38
-0
packages/portal/timesheet/resources/views/dashboard/penambahanProjectTeam.blade.php
+67
-0
packages/portal/timesheet/resources/views/dashboard/senaraiProject.blade.php
+55
-0
packages/portal/timesheet/resources/views/dashboard/senaraiProjectTeam.blade.php
+53
-0
packages/portal/timesheet/routes/web.php
+9
-1
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+70
-59
packages/portal/timesheet/src/Model/Project.php
+4
-0
packages/portal/timesheet/src/Model/Pteam.php
+4
-1
packages/portal/timesheet/src/ServiceProvider.php
+27
-9
No files found.
database/migrations/2022_06_08_172639_create_project_team_table.php
View file @
0b2bb244
...
@@ -19,6 +19,7 @@ class CreateProjectTeamTable extends Migration
...
@@ -19,6 +19,7 @@ class CreateProjectTeamTable extends Migration
$table
->
integer
(
'fk_project_id'
)
->
unsigned
()
->
nullable
();
$table
->
integer
(
'fk_project_id'
)
->
unsigned
()
->
nullable
();
$table
->
string
(
'pt_project_description'
,
50
)
->
nullable
();
$table
->
string
(
'pt_project_description'
,
50
)
->
nullable
();
$table
->
string
(
'pt_team'
,
50
)
->
nullable
();
$table
->
string
(
'pt_team'
,
50
)
->
nullable
();
$table
->
integer
(
'pt_staff_id'
)
->
unsigned
()
->
nullable
();
$table
->
integer
(
'pt_project_task_sts'
)
->
unsigned
()
->
nullable
();
$table
->
integer
(
'pt_project_task_sts'
)
->
unsigned
()
->
nullable
();
$table
->
timestamps
();
$table
->
timestamps
();
...
...
packages/portal/timesheet/resources/views/dashboard/borangBolehCaj.blade.php
View file @
0b2bb244
...
@@ -21,9 +21,7 @@ input[type=number] {
...
@@ -21,9 +21,7 @@ input[type=number] {
<br>
<br>
<hr>
<hr>
Day =
{
{$day}
}
Day =
{
{$day}
}
<br>
{
{$sampleTimesheet_dtl[0]['td_date']}
}
<br>
Timesheet for month =
{
{$month}
}
<br>
Timesheet for month =
{
{$month}
}
<br>
Year =
{
{$year}
}
<br>
Year =
{
{$year}
}
<br>
Phase =
{
{$phase}
}
Phase =
{
{$phase}
}
...
@@ -48,8 +46,8 @@ input[type=number] {
...
@@ -48,8 +46,8 @@ input[type=number] {
</th>
</th>
</tr>
</tr>
<tr>
<tr>
<th>Project Code</th>
<th
class="
single
line
"
>Project Code</th>
<th>Project Name</th>
<th
class="
single
line
"
>Project Name</th>
@if(
$phase
== 1)
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
...
@@ -68,12 +66,14 @@ input[type=number] {
...
@@ -68,12 +66,14 @@ input[type=number] {
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
@foreach(
$sampleTimesheet_dtl
as
$key
=>
$project
)
@foreach(
$projectlist
as
$key
=>
$project
)
<?php
$total
= 0; ?>
<tr>
<tr>
<td>
<td
class="
single
line
"
>
{
{$project['td_project_code']}
}
{
{$project['td_project_code']}
}
</td>
</td>
<td>
<td
class="
single
line
"
>
{
{$project['td_project_name']}
}
{
{$project['td_project_name']}
}
</td>
</td>
@if(
$phase
== 1)
@if(
$phase
== 1)
...
@@ -81,11 +81,21 @@ input[type=number] {
...
@@ -81,11 +81,21 @@ input[type=number] {
<?php
<?php
$valuehour
= '';
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if(
$hour
)
{
$valuehour
=
$hour->where
('td_date','=',
$date
)
$valuehour
=
$hour->where
('td_date','=',
$date
)
->where('td_project',
$project['td_project']
)
->where('td_project',
$project['td_project']
)
->where('tm_phase',
$phase
)
->where('tm_phase',
$phase
)
->first();
->first();
$total
+=
$valuehour->td_hours
;
}
?>
?>
<td >
<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
']}}'
);
">
<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
']}}'
);
">
...
@@ -93,17 +103,31 @@ input[type=number] {
...
@@ -93,17 +103,31 @@ input[type=number] {
@endfor
@endfor
@else
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
@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 >
<td >
@if(
$project['td_date']
==
$i
+1)
<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
']}}'
);
">
<input type="
text
" onkeypress="
onlynumber
(
event
)
" name="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" id="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" value="
{{
$project
[
'td_hours'
]}}
" min="
0
" max="
24
" style="
padding
:
2
px
;
margin
:
unset
;
color
:
#A0A0A0;" onchange="limiter(this,'{{$project['td_project']}}');" readonly="readonly">
@
else
<
input
type
=
"text"
onkeypress
=
"onlynumber(event)"
id
=
"hour[
{
{$project['td_project']}}][{{$i+1}
}
]"
name
=
"hour[
{
{$project['td_project']}}][{{$i+1}
}
]"
value
=
""
min
=
"0"
max
=
"24"
style
=
"padding:2px;margin:unset"
onchange
=
"limiter(this,'
{
{$project['td_project']}
}
');"
>
@
endif
</td>
</td>
@endfor
@endfor
@endif
@endif
<td>
<td>
<
input
type
=
"text"
onkeypress
=
"onlynumber(event)"
name
=
"total-
{
{$project['td_project']}
}
"
id
=
"total-
{
{$project['td_project']}
}
"
style
=
"padding-right: 4px;padding-left: 4px;"
onchange
=
"limiter(this,'
{
{$project['td_project']}
}
');"
readonly
=
""
>
<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>
</td>
</tr>
</tr>
@endforeach
@endforeach
...
...
packages/portal/timesheet/resources/views/dashboard/penambahanProject.blade.php
0 → 100644
View file @
0b2bb244
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Add New Project</a>
<br><br>
<form class="
ui
form
" action="
{{
route
(
'timesheet::dashboard.addnewproject'
)}}
" method="
POST
">
{
{csrf_field()}
}
<div class="
field
">
<label>Project Code</label>
<input type="
text
" name="
projectcode
" placeholder="
Project
Code
">
</div>
<div class="
field
">
<label>Project Name</label>
<input type="
text
" name="
projectname
" placeholder="
Project
Name
">
</div>
<div class="
field
">
<label>Project Manager</label>
<select name="
projectmanager
" class="
ui
fluid
dropdown
">
<option value="">Project Manager</option>
<option value="
845
">Rashdan</option>
<option value="
865
">Maimunah</option>
</select>
</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
button
" type="
submit
">Submit</button>
</form>
</div>
@endsection
packages/portal/timesheet/resources/views/dashboard/penambahanProjectTeam.blade.php
0 → 100644
View file @
0b2bb244
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Add New Project Team</a>
<br><br>
<form class="
ui
form
">
{
{csrf_field()}
}
<div class="
field
">
<label>Project Code</label>
<input type="
text
" name="
projectcode
" placeholder="
Project
Code
">
</div>
<div class="
field
">
<label>Department</label>
<select name="
department
" class="
ui
fluid
dropdown
">
<option value="">Department</option>
<option value="
1
">TMS</option>
<option value="
2
">PSS</option>
<option value="
3
">PMS</option>
<option value="
4
">PCS</option>
<option value="
5
">SPD</option>
<option value="
6
">Finance | HR | Admin</option>
</select>
</div>
<div class="
field
">
<label>Staff Name</label>
<div class="
ui
fluid
multiple
search
selection
dropdown
">
<input type="
hidden
" name="
staffId
">
<i class="
dropdown
icon
"></i>
<div class="
default
text
">Staff Name</div>
<div class="
menu
">
<div class="
item
" data-value="
fezrul
" data-text="
Fezrul
">
Fezrul
</div>
<div class="
item
" data-value="
afif
" data-text="
Afif
">
Afif
</div>
<div class="
item
" data-value="
rizuan
" data-text="
Ridzuan
">
Wan Ridzuan
</div>
<div class="
item
" data-value="
rafezah
" data-text="
Rafezah
">
Rafezah
</div>
<div class="
item
" data-value="
fahmi
" data-text="
Fahmi
">
Fahmi
</div>
<div class="
item
" data-value="
shameel
" data-text="
Shameel
">
Shameel
</div>
</div>
</div>
</div>
<div class="
field
">
<label>Project Status</label>
<select 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
">Save</button>
<button class="
ui
green
button
" type="
button
" onclick="
window
.
location
.
href
=
''
;
">Back</button>
</form>
</div>
@endsection
packages/portal/timesheet/resources/views/dashboard/senaraiProject.blade.php
0 → 100644
View file @
0b2bb244
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Senarai Project</a>
<div class="
ui
right
floated
small
primary
labeled
icon
button
">
<i class="
plus
icon
"></i></i> Add New Project
</div>
<br>
<table class="
ui
celled
padded
table
">
<thead>
<tr>
<th>No</th>
<th>Project Code</th>
<th>Project Name</th>
<th>Project Manager</th>
<th>Status</th>
<th>Project Team</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
<a href="">Project Team</a>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<th colspan="
6
">
<div class="
ui
right
floated
pagination
menu
">
<a class="
icon
item
">
<i class="
left
chevron
icon
"></i>
</a>
<a class="
item
">1</a>
<a class="
item
">2</a>
<a class="
item
">3</a>
<a class="
item
">4</a>
<a class="
icon
item
">
<i class="
right
chevron
icon
"></i>
</a>
</div>
</th>
</tr>
</tfoot>
</table>
</div>
@endsection
packages/portal/timesheet/resources/views/dashboard/senaraiProjectTeam.blade.php
0 → 100644
View file @
0b2bb244
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Senarai Project Team</a>
<div class="
ui
right
floated
small
primary
labeled
icon
button
">
<i class="
plus
icon
"></i></i> Add New Project Team
</div>
<br>
<table class="
ui
celled
padded
table
">
<thead>
<tr>
<th>No</th>
<th>Project Code</th>
<th>Project Name</th>
<th>Project Team</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
<tfoot>
<tr>
<th colspan="
6
">
<div class="
ui
right
floated
pagination
menu
">
<a class="
icon
item
">
<i class="
left
chevron
icon
"></i>
</a>
<a class="
item
">1</a>
<a class="
item
">2</a>
<a class="
item
">3</a>
<a class="
item
">4</a>
<a class="
icon
item
">
<i class="
right
chevron
icon
"></i>
</a>
</div>
</th>
</tr>
</tfoot>
</table>
</div>
@endsection
packages/portal/timesheet/routes/web.php
View file @
0b2bb244
...
@@ -11,15 +11,24 @@ Route::group(
...
@@ -11,15 +11,24 @@ Route::group(
Route
::
get
(
'home'
,[
'uses'
=>
'DashboardController@index'
,
'as'
=>
'dashboard.index'
]);
Route
::
get
(
'home'
,[
'uses'
=>
'DashboardController@index'
,
'as'
=>
'dashboard.index'
]);
Route
::
get
(
'pengurusan'
,[
'uses'
=>
'DashboardController@pengurusan'
,
'as'
=>
'dashboard.pengurusan'
]);
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'
]);
Route
::
get
(
'senaraiProjectTeam'
,[
'uses'
=>
'DashboardController@senaraiProjectTeam'
,
'as'
=>
'dashboard.senaraiProjectTeam'
]);
Route
::
get
(
'penambahanProjectTeam'
,[
'uses'
=>
'DashboardController@penambahanProjectTeam'
,
'as'
=>
'dashboard.penambahanProjectTeam'
]);
Route
::
post
(
'addnewproject'
,[
'uses'
=>
'DashboardController@addnewproject'
,
'as'
=>
'dashboard.addnewproject'
]);
Route
::
get
(
'perkhidmatan'
,[
'uses'
=>
'DashboardController@perkhidmatan'
,
'as'
=>
'dashboard.perkhidmatan'
]);
Route
::
get
(
'perkhidmatan'
,[
'uses'
=>
'DashboardController@perkhidmatan'
,
'as'
=>
'dashboard.perkhidmatan'
]);
Route
::
get
(
'borangBolehCaj'
,[
'uses'
=>
'DashboardController@borangBolehCaj'
,
'as'
=>
'dashboard.borangBolehCaj'
]);
Route
::
get
(
'borangBolehCaj'
,[
'uses'
=>
'DashboardController@borangBolehCaj'
,
'as'
=>
'dashboard.borangBolehCaj'
]);
Route
::
get
(
'kalendarCharge'
,[
'uses'
=>
'DashboardController@kalendarCharge'
,
'as'
=>
'dashboard.kalendarCharge'
]);
Route
::
get
(
'kalendarCharge'
,[
'uses'
=>
'DashboardController@kalendarCharge'
,
'as'
=>
'dashboard.kalendarCharge'
]);
Route
::
get
(
'kalendarNonCharge'
,[
'uses'
=>
'DashboardController@kalendarNonCharge'
,
'as'
=>
'dashboard.kalendarNonCharge'
]);
Route
::
get
(
'kalendarNonCharge'
,[
'uses'
=>
'DashboardController@kalendarNonCharge'
,
'as'
=>
'dashboard.kalendarNonCharge'
]);
Route
::
get
(
'kalendar'
,[
'uses'
=>
'DashboardController@kalendar'
,
'as'
=>
'dashboard.kalendar'
]);
Route
::
get
(
'kalendar'
,[
'uses'
=>
'DashboardController@kalendar'
,
'as'
=>
'dashboard.kalendar'
]);
Route
::
get
(
'timesheet_approval'
,[
'uses'
=>
'DashboardController@timesheetApproval'
,
'as'
=>
'dashboard.timesheetApproval'
]);
Route
::
get
(
'timesheet_approval'
,[
'uses'
=>
'DashboardController@timesheetApproval'
,
'as'
=>
'dashboard.timesheetApproval'
]);
Route
::
get
(
'timesheet_report'
,[
'uses'
=>
'DashboardController@timesheetReport'
,
'as'
=>
'dashboard.timesheetReport'
]);
Route
::
get
(
'timesheet_report'
,[
'uses'
=>
'DashboardController@timesheetReport'
,
'as'
=>
'dashboard.timesheetReport'
]);
Route
::
get
(
'timesheet_review'
,[
'uses'
=>
'DashboardController@timesheetReview'
,
'as'
=>
'dashboard.timesheetReview'
]);
Route
::
get
(
'timesheet_review'
,[
'uses'
=>
'DashboardController@timesheetReview'
,
'as'
=>
'dashboard.timesheetReview'
]);
Route
::
get
(
'timesheet_viewer'
,[
'uses'
=>
'DashboardController@timesheetViewer'
,
'as'
=>
'dashboard.timesheetViewer'
]);
Route
::
get
(
'timesheet_viewer'
,[
'uses'
=>
'DashboardController@timesheetViewer'
,
'as'
=>
'dashboard.timesheetViewer'
]);
Route
::
post
(
'savechargeablehours'
,[
'uses'
=>
'DashboardController@savechargeablehours'
,
'as'
=>
'dashboard.savechargeablehours'
]);
Route
::
post
(
'savechargeablehours'
,[
'uses'
=>
'DashboardController@savechargeablehours'
,
'as'
=>
'dashboard.savechargeablehours'
]);
}
}
);
);
...
@@ -27,7 +36,6 @@ Route::group(
...
@@ -27,7 +36,6 @@ Route::group(
//enable this if you want
//enable this if you want
// Route::group(
// Route::group(
// [
// 'namespace' => '\Portal\Timesheet\Http\Controllers',
// 'namespace' => '\Portal\Timesheet\Http\Controllers',
// 'prefix' => '',
// 'prefix' => '',
// 'as' => 'web::',
// 'as' => 'web::',
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
0b2bb244
...
@@ -9,6 +9,7 @@ use Portal\Timesheet\Model\Users;
...
@@ -9,6 +9,7 @@ use Portal\Timesheet\Model\Users;
use
Portal\Timesheet\Model\Ts_master
;
use
Portal\Timesheet\Model\Ts_master
;
use
Portal\Timesheet\Model\Ts_detail
;
use
Portal\Timesheet\Model\Ts_detail
;
use
Portal\Timesheet\Model\Project
;
use
Portal\Timesheet\Model\Project
;
use
Portal\Timesheet\Model\Pteam
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Input
;
use
Illuminate\Support\Facades\Input
;
use
File
;
use
File
;
...
@@ -71,6 +72,43 @@ class DashboardController extends Controller
...
@@ -71,6 +72,43 @@ class DashboardController extends Controller
return
view
(
'timesheet::dashboard.pengurusan'
);
return
view
(
'timesheet::dashboard.pengurusan'
);
}
}
public
function
senaraiProject
()
{
return
view
(
'timesheet::dashboard.senaraiProject'
);
}
public
function
penambahanProject
()
{
return
view
(
'timesheet::dashboard.penambahanProject'
);
}
public
function
addnewproject
(
Request
$request
)
{
$user
=
users
::
where
(
'id'
,
Auth
::
id
())
->
first
();
// $userId = $user->u_staffID;
$project
=
new
Project
;
$project
->
p_project_code
=
$request
->
projectcode
;
$project
->
p_project_description
=
$request
->
projectname
;
$project
->
p_project_task_team
=
$request
->
projectmanager
;
$project
->
p_project_sts
=
$request
->
status
;
$project
->
updated_by
=
$user
->
u_staffID
;
// dd($project);
$project
->
save
();
return
redirect
()
->
route
(
'timesheet::dashboard.penambahanProject'
);
}
public
function
senaraiProjectTeam
()
{
return
view
(
'timesheet::dashboard.senaraiProjectTeam'
);
}
public
function
penambahanProjectTeam
()
{
return
view
(
'timesheet::dashboard.penambahanProjectTeam'
);
}
public
function
perkhidmatan
()
public
function
perkhidmatan
()
{
{
return
view
(
'timesheet::dashboard.perkhidmatan'
);
return
view
(
'timesheet::dashboard.perkhidmatan'
);
...
@@ -81,42 +119,39 @@ class DashboardController extends Controller
...
@@ -81,42 +119,39 @@ class DashboardController extends Controller
$userId
=
Auth
::
id
();
$userId
=
Auth
::
id
();
$user
=
users
::
where
(
'id'
,
Auth
::
id
())
->
first
();
$user
=
users
::
where
(
'id'
,
Auth
::
id
())
->
first
();
$project
=
Pteam
::
where
(
'pt_staff_id'
,
$user
->
u_staffID
)
->
get
();
// nanti project code query dari table project:
// nanti project code query dari table project:
$sampleTimesheet_dtl
[]
=
[
foreach
(
$project
as
$key
=>
$value
)
{
'td_id'
=>
'1'
,
'td_date'
=>
date
(
'j-n-Y'
,
strtotime
(
'6/5/2022'
)),
'td_project'
=>
'1'
,
'fk_tm_id'
=>
'1'
,
'project_type'
=>
'1'
,
'fk_o_id'
=>
''
,
'tm_year'
=>
'2022'
,
'tm_month'
=>
'6'
,
'tm_phase'
=>
'1'
,
'td_project_code'
=>
'LHD2022'
,
'td_project_name'
=>
'SMART'
,
'td_hours'
=>
'5'
];
$projectlist
[]
=
[
$sampleTimesheet_dtl
[]
=
[
'td_project'
=>
$value
->
fk_project_id
,
'td_project_code'
=>
$value
->
toProject
->
p_project_code
,
'td_id'
=>
'2'
,
'td_project_name'
=>
$value
->
toProject
->
p_project_description
,
'td_date'
=>
date
(
'j-n-Y'
,
strtotime
(
'6/5/2022'
)),
'td_project'
=>
'2'
,
'fk_tm_id'
=>
'1'
,
'project_type'
=>
'1'
,
'fk_o_id'
=>
''
,
'tm_year'
=>
'2022'
,
'tm_month'
=>
'6'
,
'tm_phase'
=>
'1'
,
'td_project_code'
=>
'LHD2021'
,
'td_project_name'
=>
'APIM'
,
'td_hours'
=>
'3'
,
];
];
}
// $sampleTimesheet_dtl[] = [
// 'td_project' => '1',
// 'td_project_code' => 'nani',
// 'td_project_name' => 'kore',
// ];
// $sampleTimesheet_dtl[] = [
// 'td_project' => '2',
// 'td_project_code' => 'nani2',
// 'td_project_name' => 'kore2',
// ];
// dd($sampleTimesheet_dtl[0]['td_date']);
// dd($sampleTimesheet_dtl[0]['td_date']);
...
@@ -167,40 +202,18 @@ class DashboardController extends Controller
...
@@ -167,40 +202,18 @@ class DashboardController extends Controller
//kalau ada, dia gi ke edit
//kalau ada, dia gi ke edit
if
(
$check
)
if
(
$check
)
{
{
$hour
=
Ts_detail
::
where
(
'fk_tm_id'
,
$check
->
id
)
->
get
();
$hour
=
Ts_detail
::
where
(
'fk_tm_id'
,
$check
->
id
)
// ->with('project:p_project_code')
->
get
();
}
}
//klu xde g create.php
//klu xde g create.php
else
else
{
{
$hour
=
null
;
$hour
=
null
;
}
}
// dd($hour);
//kalau ada juga = bawak data details
// check timesheet detail
// $checkTimesheetDetail = Ts_detail::where('fk_tm_staff_id', $user->u_staffID)
// ->where('fk_tm_year', $year)
// ->where('fk_tm_month', $month)
// ->where('tm_phase', $phase)
// ->whereNotNull('td_hours')
// ->first();
// // kalau ada, dia gi ke edit
// if($checkTimesheetDetail)
// {
// $data = Ts_detail::where('id',$request->id)->first();
// }
// //klu xde g create.php
// else
// {
// $data = [];
// }
// dd($checkTimesheetDetail);
// dd($hour);
return
view
(
'timesheet::dashboard.borangBolehCaj'
,
compact
(
'
userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'sampleTimesheet_dtl
'
,
'day'
,
'hour'
));
return
view
(
'timesheet::dashboard.borangBolehCaj'
,
compact
(
'
projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year
'
,
'day'
,
'hour'
));
}
}
public
function
kalendarCharge
()
public
function
kalendarCharge
()
...
@@ -246,6 +259,7 @@ class DashboardController extends Controller
...
@@ -246,6 +259,7 @@ class DashboardController extends Controller
else
else
{
{
$check
=
new
Ts_master
;
$check
=
new
Ts_master
;
$check
->
tm_staff_id
=
$user
->
u_staffID
;
$check
->
tm_year
=
$request
->
year
;
$check
->
tm_year
=
$request
->
year
;
$check
->
tm_month
=
$request
->
month
;
$check
->
tm_month
=
$request
->
month
;
$check
->
tm_phase
=
$request
->
phase
;
$check
->
tm_phase
=
$request
->
phase
;
...
@@ -321,12 +335,9 @@ class DashboardController extends Controller
...
@@ -321,12 +335,9 @@ class DashboardController extends Controller
//update total ke master;
//update total ke master;
//buat query sum td_hours where condition :
//buat query sum td_hours where condition :
$sumdetailhour
=
Ts_detail
::
where
(
'td_project'
,
$projectid
)
$sumdetailhour
=
Ts_detail
::
where
(
'td_project_type'
,
$chargeable
)
->
where
(
'td_project_type'
,
$chargeable
)
// ->where('td_date', $date)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
sum
(
'td_hours'
);
->
sum
(
'td_hours'
);
// dd($sumdetailhour);
// checktotalhours
// checktotalhours
$checktotalhours
=
Ts_master
::
where
(
'id'
,
$tmasterid
)
->
first
();
$checktotalhours
=
Ts_master
::
where
(
'id'
,
$tmasterid
)
->
first
();
...
...
packages/portal/timesheet/src/Model/Project.php
View file @
0b2bb244
...
@@ -13,6 +13,10 @@ class Project extends Model
...
@@ -13,6 +13,10 @@ class Project extends Model
*/
*/
protected
$table
=
'project'
;
protected
$table
=
'project'
;
// public function project_code()
// {
// return $this->hasMany('Portal\Timesheet\Model\Ts_detail','td_project','id');
// }
/**
/**
* undocumented function
* undocumented function
...
...
packages/portal/timesheet/src/Model/Pteam.php
View file @
0b2bb244
...
@@ -12,7 +12,10 @@ class Pteam extends Model
...
@@ -12,7 +12,10 @@ class Pteam extends Model
* @var string
* @var string
*/
*/
protected
$table
=
'project_team'
;
protected
$table
=
'project_team'
;
public
function
toProject
()
{
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Project'
,
'id'
,
'fk_project_id'
);
}
/**
/**
* undocumented function
* undocumented function
...
...
packages/portal/timesheet/src/ServiceProvider.php
View file @
0b2bb244
...
@@ -75,16 +75,23 @@ class ServiceProvider extends BaseServiceProvider
...
@@ -75,16 +75,23 @@ class ServiceProvider extends BaseServiceProvider
->
active
(
'timesheetReport/*'
)
->
active
(
'timesheetReport/*'
)
->
data
(
'permission'
,
Permission
::
kehadiran
);
->
data
(
'permission'
,
Permission
::
kehadiran
);
$menu
=
$this
->
app
[
'laravolt.menu'
]
->
add
(
__
(
'Pengurusan'
))
->
data
(
'icon'
,
'align justify'
);
$pengurusanProject
=
$this
->
app
[
'laravolt.menu'
]
->
add
(
__
(
'Pengurusan Project'
))
->
data
(
'icon'
,
'align justify'
);
$menu
->
add
(
__
(
'Pengurusan Peranan'
),
route
(
'timesheet::dashboard.pengurusan'
))
$pengurusanProject
->
add
(
__
(
'Senarai Project'
),
route
(
'timesheet::dashboard.senaraiProject'
))
->
data
(
'icon'
,
'users icon'
)
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
pengurusan
);
$pengurusanProject
->
add
(
__
(
'Penambahan Project'
),
route
(
'timesheet::dashboard.penambahanProject'
))
->
data
(
'icon'
,
'users icon'
)
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
pengurusan
);
$pengurusanProject
->
add
(
__
(
'Senarai Project Team'
),
route
(
'timesheet::dashboard.senaraiProjectTeam'
))
->
data
(
'icon'
,
'users icon'
)
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
pengurusan
);
$pengurusanProject
->
add
(
__
(
'Penambahan Project Team'
),
route
(
'timesheet::dashboard.penambahanProjectTeam'
))
->
data
(
'icon'
,
'users icon'
)
->
data
(
'icon'
,
'users icon'
)
->
active
(
'pengurusan/*'
)
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
pengurusan
);
->
data
(
'permission'
,
Permission
::
pengurusan
);
$menu
->
add
(
__
(
'Perkhidmatan'
),
url
(
'/perkhidmatan/'
))
->
data
(
'icon'
,
'handshake icon'
)
->
active
(
'perkhidmatan/*'
)
->
data
(
'permission'
,
Permission
::
perkhidmatan
);
$calendar
=
$this
->
app
[
'laravolt.menu'
]
->
add
(
__
(
'Kalendar'
))
->
data
(
'icon'
,
'calendar alternate'
);
$calendar
=
$this
->
app
[
'laravolt.menu'
]
->
add
(
__
(
'Kalendar'
))
->
data
(
'icon'
,
'calendar alternate'
);
$calendar
->
add
(
__
(
'Kalendar'
),
route
(
'timesheet::dashboard.kalendar'
))
$calendar
->
add
(
__
(
'Kalendar'
),
route
(
'timesheet::dashboard.kalendar'
))
...
@@ -102,12 +109,12 @@ class ServiceProvider extends BaseServiceProvider
...
@@ -102,12 +109,12 @@ class ServiceProvider extends BaseServiceProvider
// ->data('permission', Permission::kehadiran);
// ->data('permission', Permission::kehadiran);
$form
=
$this
->
app
[
'laravolt.menu'
]
->
add
(
__
(
'Borang'
))
->
data
(
'icon'
,
'align justify'
);
$form
=
$this
->
app
[
'laravolt.menu'
]
->
add
(
__
(
'Borang'
))
->
data
(
'icon'
,
'align justify'
);
$form
->
add
(
__
(
'Borang
Boleh Caj
'
),
url
(
'/borangBolehCaj/'
))
$form
->
add
(
__
(
'Borang
Chargeable
'
),
url
(
'/borangBolehCaj/'
))
->
data
(
'icon'
,
'circle outline'
)
->
data
(
'icon'
,
'circle outline'
)
->
active
(
'borangBolehCaj/*'
)
->
active
(
'borangBolehCaj/*'
)
->
data
(
'permission'
,
Permission
::
kehadiran
);
->
data
(
'permission'
,
Permission
::
kehadiran
);
$form
->
add
(
__
(
'Borang
Tidak Boleh Di Caj
'
))
$form
->
add
(
__
(
'Borang
Non-Chargeable
'
))
->
data
(
'icon'
,
'circle outline'
);
->
data
(
'icon'
,
'circle outline'
);
$form
->
add
(
__
(
'Overhed'
))
$form
->
add
(
__
(
'Overhed'
))
...
@@ -117,5 +124,15 @@ class ServiceProvider extends BaseServiceProvider
...
@@ -117,5 +124,15 @@ class ServiceProvider extends BaseServiceProvider
// ->data('icon', 'circle outline')
// ->data('icon', 'circle outline')
// ->active('quota/*')
// ->active('quota/*')
// ->data('permission', Permission::MAKLUMAT_CUTI);
// ->data('permission', Permission::MAKLUMAT_CUTI);
$pengurusan
=
$this
->
app
[
'laravolt.menu'
]
->
add
(
__
(
'Pengurusan'
))
->
data
(
'icon'
,
'align justify'
);
$pengurusan
->
add
(
__
(
'Pengurusan Peranan'
),
route
(
'timesheet::dashboard.pengurusan'
))
->
data
(
'icon'
,
'users icon'
)
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
pengurusan
);
$pengurusan
->
add
(
__
(
'Perkhidmatan'
),
url
(
'/perkhidmatan/'
))
->
data
(
'icon'
,
'handshake icon'
)
->
active
(
'perkhidmatan/*'
)
->
data
(
'permission'
,
Permission
::
perkhidmatan
);
}
}
}
}
\ No newline at end of file
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