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
2e58f616
Commit
2e58f616
authored
Jun 02, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes on total up hours for each project/rows for phase 2
parent
4e0e491e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
29 deletions
+53
-29
packages/portal/timesheet/resources/views/dashboard/borangBolehCaj.blade.php
+28
-15
packages/portal/timesheet/routes/web.php
+2
-1
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+23
-13
No files found.
packages/portal/timesheet/resources/views/dashboard/borangBolehCaj.blade.php
View file @
2e58f616
...
@@ -79,16 +79,20 @@ input[type=number] {
...
@@ -79,16 +79,20 @@ input[type=number] {
@for(
$i
= 0;
$i
< 15 ;
$i
++)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<td >
<td >
@if(
$project['td_date']
==
$i
+1)
@if(
$project['td_date']
==
$i
+1)
<input
onblur="
findTotal
()
"
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">
<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
@
else
<
input
onblur
=
"findTotal()"
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']}
}
');"
>
<
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
@
endif
</
td
>
</
td
>
@
endfor
@
endfor
@
else
@
else
@
for
(
$i
=
15
;
$i
<
$daymonth
;
$i
++
)
@
for
(
$i
=
15
;
$i
<
$daymonth
;
$i
++
)
<
td
>
<
td
>
<
input
type
=
"text"
onkeypress
=
"onlynumber(event)"
name
=
"hour[
{
{$project['td_project']}}][{{$i+1}
}
]"
min
=
"0"
max
=
"24"
style
=
"padding:2px;margin:unset"
onchange
=
"limiter(this,'
{
{$project['td_project']}
}
');"
>
@
if
(
$project
[
'td_date'
]
==
$i
+
1
)
<
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:2px;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
...
@@ -99,7 +103,17 @@ input[type=number] {
...
@@ -99,7 +103,17 @@ input[type=number] {
@
endforeach
@
endforeach
</
tbody
>
</
tbody
>
</
table
>
</
table
>
@
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
">
<i class="
angle
double
left
icon
"></i>
Phase 1
</button>
@endif
</form>
</form>
</div>
</div>
...
@@ -108,15 +122,13 @@ input[type=number] {
...
@@ -108,15 +122,13 @@ input[type=number] {
@push('script')
@push('script')
<script>
<script>
function
findTotal
(){
var phase = 0;
// var arr = document.getElementsByName('hour[{{$project['td_project']}}][{{$i+1}}]');
function phase2(p)
// var tot=0;
{
// for(var i=0;i<arr.length;i++){
phase = p;
// if(parseInt(arr[i].value))
phase++;
// tot += parseInt(arr[i].value);
document.getElementById('phase2') = phase;
// }
}
// document.getElementById('total').value = tot;
}
</script>
</script>
<script>
<script>
...
@@ -139,11 +151,12 @@ input[type=number] {
...
@@ -139,11 +151,12 @@ input[type=number] {
</script>
</script>
<script>
<script>
$
(
document
)
.
ready
(
function
()
{
$().ready(function() {
});
});
function limiter(input,pid) {
function limiter(input,pid) {
var currenttotal = 0;
var currenttotal = 0;
if (input.value < 0) input.value = 0;
if (input.value < 0) input.value = 0;
...
@@ -166,7 +179,7 @@ input[type=number] {
...
@@ -166,7 +179,7 @@ input[type=number] {
}
}
if(typeof value === 'number'){
if(typeof value === 'number'){
console
.
log
(
value
);
//
console.log(value);
currenttotal += value;
currenttotal += value;
}
}
}
}
...
...
packages/portal/timesheet/routes/web.php
View file @
2e58f616
...
@@ -16,7 +16,8 @@ Route::group(
...
@@ -16,7 +16,8 @@ Route::group(
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('phase1/{phase}',['uses' => 'DashboardController@phase1', 'as' => 'dashboard.phase1']);
// Route::get('phase2/{phase}',['uses' => 'DashboardController@phase2', 'as' => 'dashboard.phase2']);
Route
::
post
(
'saveHours'
,[
'uses'
=>
'DashboardController@saveHours'
,
'as'
=>
'dashboard.saveHours'
]);
Route
::
post
(
'saveHours'
,[
'uses'
=>
'DashboardController@saveHours'
,
'as'
=>
'dashboard.saveHours'
]);
}
}
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
2e58f616
...
@@ -102,41 +102,40 @@ class DashboardController extends Controller
...
@@ -102,41 +102,40 @@ class DashboardController extends Controller
$sampleTimesheet_dtl
[]
=
[
$sampleTimesheet_dtl
[]
=
[
'td_id'
=>
'
2
'
,
'td_id'
=>
'
1
'
,
'td_date'
=>
date
(
'j-n-Y'
,
strtotime
(
'6/5/2022'
)),
'td_date'
=>
date
(
'j-n-Y'
,
strtotime
(
'6/5/2022'
)),
'td_project'
=>
'
2
'
,
'td_project'
=>
'
1
'
,
'tm_id'
=>
'1'
,
'tm_id'
=>
'1'
,
'tm_staff_id'
=>
'1000'
,
'tm_staff_id'
=>
'1000'
,
'project_type'
=>
'1'
,
'project_type'
=>
'1'
,
'fk_o_id'
=>
''
,
'fk_o_id'
=>
''
,
'tm_month'
=>
'6'
,
'tm_month'
=>
'6'
,
'tm_phase'
=>
'1'
,
'tm_phase'
=>
'1'
,
'td_project_code'
=>
'LHD2021'
,
'td_project_code'
=>
'LHD2021
2
'
,
'td_project_name'
=>
'
APIM
'
,
'td_project_name'
=>
'
SMART
'
,
'td_hours'
=>
'
3'
,
'td_hours'
=>
'
5'
];
];
$sampleTimesheet_dtl
[]
=
[
$sampleTimesheet_dtl
[]
=
[
'td_id'
=>
'
1
'
,
'td_id'
=>
'
2
'
,
'td_date'
=>
date
(
'j-n-Y'
,
strtotime
(
'6/5/2022'
)),
'td_date'
=>
date
(
'j-n-Y'
,
strtotime
(
'6/5/2022'
)),
'td_project'
=>
'
1
'
,
'td_project'
=>
'
2
'
,
'tm_id'
=>
'1'
,
'tm_id'
=>
'1'
,
'tm_staff_id'
=>
'1000'
,
'tm_staff_id'
=>
'1000'
,
'project_type'
=>
'1'
,
'project_type'
=>
'1'
,
'fk_o_id'
=>
''
,
'fk_o_id'
=>
''
,
'tm_month'
=>
'6'
,
'tm_month'
=>
'6'
,
'tm_phase'
=>
'1'
,
'tm_phase'
=>
'1'
,
'td_project_code'
=>
'LHD2021
2
'
,
'td_project_code'
=>
'LHD2021'
,
'td_project_name'
=>
'
SMART
'
,
'td_project_name'
=>
'
APIM
'
,
'td_hours'
=>
'
5'
'td_hours'
=>
'
3'
,
];
];
// dd($sampleTimesheet_dtl[0]['td_date']);
// dd($sampleTimesheet_dtl[0]['td_date']);
// if (day == $i+1)
// if (day == $i+1)
...
@@ -145,7 +144,7 @@ class DashboardController extends Controller
...
@@ -145,7 +144,7 @@ class DashboardController extends Controller
//sample dulu
//sample dulu
$phase
=
1
;
$phase
=
2
;
$month
=
date
(
'n'
);
$month
=
date
(
'n'
);
$year
=
date
(
'Y'
);
$year
=
date
(
'Y'
);
$day
=
date
(
'j'
);
$day
=
date
(
'j'
);
...
@@ -218,6 +217,17 @@ class DashboardController extends Controller
...
@@ -218,6 +217,17 @@ class DashboardController extends Controller
// $data -> tm_chargeable_hrs = $request -> tm_chargeable_hrs;
// $data -> tm_chargeable_hrs = $request -> tm_chargeable_hrs;
// $data -> save();
// $data -> save();
// return redirect('home');
// return redirect('home');
}
}
// public function phase1($phase)
// {
// $phase = $phase + 1;
// return view('timesheet::dashboard.borangBolehCaj', compact('phase'));
// }
// public function phase2($phase)
// {
// $phase = $phase - 1;
// return view('timesheet::dashboard.borangBolehCaj', compact('phase'));
// }
}
}
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