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
4e0e491e
Commit
4e0e491e
authored
Jun 02, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Total up hours for each project/rows
parent
df23dbc0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
8 deletions
+70
-8
packages/portal/timesheet/resources/views/dashboard/borangBolehCaj.blade.php
+70
-8
No files found.
packages/portal/timesheet/resources/views/dashboard/borangBolehCaj.blade.php
View file @
4e0e491e
...
@@ -22,7 +22,7 @@ input[type=number] {
...
@@ -22,7 +22,7 @@ input[type=number] {
User Id =
{
{$userId}
}
User Id =
{
{$userId}
}
<hr>
<hr>
Day =
{
{$day}
}
Day =
{
{$day}
}
@if(
$day
==
1
)
@if(
$day
==
2
)
naisu
naisu
@endif
@endif
{
{$sampleTimesheet_dtl[0]['td_date']}
}
{
{$sampleTimesheet_dtl[0]['td_date']}
}
...
@@ -79,21 +79,21 @@ input[type=number] {
...
@@ -79,21 +79,21 @@ 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
type="
text
" onkeypress="
onlynumber
(
event
)
" name="
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
);" readonly="readonly">
<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">
@
else
@
else
<
input
type
=
"text"
onkeypress
=
"onlynumber(event)"
name
=
"hour[
{
{$project['td_project']}}][{{$i+1}
}
]"
value
=
""
min
=
"0"
max
=
"24"
style
=
"padding:2px;margin:unset"
onchange
=
"limiter(this
);"
>
<
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']}
}
'
);"
>
@
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);"
>
<
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']}
}
'
);"
>
</
td
>
</
td
>
@
endfor
@
endfor
@
endif
@
endif
<
td
>
<
td
>
<
input
type
=
"number"
onkeypress
=
"onlynumber(event)"
name
=
"total
"
style
=
"padding-right: 4px;padding-left: 4px;"
onchange
=
"limiter(this
);"
readonly
=
""
>
<
input
type
=
"number"
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
=
""
>
</
td
>
</
td
>
</
tr
>
</
tr
>
@
endforeach
@
endforeach
...
@@ -108,6 +108,18 @@ input[type=number] {
...
@@ -108,6 +108,18 @@ input[type=number] {
@
push
(
'script'
)
@
push
(
'script'
)
<
script
>
<
script
>
function
findTotal
(){
// var arr = document.getElementsByName('hour[{{$project['td_project']}}][{{$i+1}}]');
// var tot=0;
// for(var i=0;i<arr.length;i++){
// if(parseInt(arr[i].value))
// tot += parseInt(arr[i].value);
// }
// document.getElementById('total').value = tot;
}
</
script
>
<
script
>
function
onlynumber
(
evt
)
function
onlynumber
(
evt
)
{
{
var
theEvent
=
evt
||
window
.
event
;
var
theEvent
=
evt
||
window
.
event
;
...
@@ -127,9 +139,58 @@ input[type=number] {
...
@@ -127,9 +139,58 @@ input[type=number] {
</
script
>
</
script
>
<
script
>
<
script
>
function
limiter
(
input
)
{
$
(
document
)
.
ready
(
function
()
{
if
(
input
.
value
<
0
)
input
.
value
=
0
;
if
(
input
.
value
>
24
)
input
.
value
=
24
;
});
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
>
</
script
>
@
endpush
@
endpush
\ 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