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
81ce52fd
Commit
81ce52fd
authored
Jul 04, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
overhead notes with button using semantic
parent
410b316d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
155 additions
and
26 deletions
+155
-26
packages/portal/timesheet/resources/views/ajax/senarainotes.blade.php
+20
-0
packages/portal/timesheet/resources/views/form/overheadForm.blade.php
+113
-22
packages/portal/timesheet/routes/web.php
+1
-0
packages/portal/timesheet/src/Http/Controllers/FormController.php
+21
-4
No files found.
packages/portal/timesheet/resources/views/ajax/senarainotes.blade.php
0 → 100644
View file @
81ce52fd
{
!!
Suitable
::
source
(
$viewDesc
)
->
title
(
__
(
'View Overhead Description'
))
->
columns
([
new
\Laravolt\Suitable\Columns\Numbering
(
__
(
'No'
)),
[
'header'
=>
__
(
'date'
),
'field'
=>
'td_date'
],
[
'header'
=>
__
(
'task'
),
'field'
=>
'td_overhead_desc'
],
[
'header'
=>
__
(
'notes'
),
'field'
=>
'td_overhead_note'
],
[
'header'
=>
__
(
'action'
),
'raw'
=>
function
(
$list
)
{
return
"
$list->id
<i class='bordered yellow pencil icon edit_button'></i>
"
;
}
]
])
->
render
()
!!
}
\ No newline at end of file
packages/portal/timesheet/resources/views/form/overheadForm.blade.php
View file @
81ce52fd
...
@@ -16,19 +16,43 @@ input[type=number] {
...
@@ -16,19 +16,43 @@ input[type=number] {
}
}
</
style
>
</
style
>
<!--
<
div
class
="
ui
tiny
modal
edit_desciption
">
<div class="
header
">
Edit Description
</div>
<div class="
content
">
<form class="
ui
form
" action="" 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
}}
">
<div class="
two
fields
">
<div class="
six
wide
field
">
<label>Task</label>
<select class="" name="
task
" >
<option value="">Task</option>
</select>
</div>
<div class="
five
wide
field
">
<label>Date</label>
<input type="
date
" name="
editdate
">
</div>
</div>
<div class="
field
">
<label>Description</label>
<textarea rows="
3
" name="
editdesc
"></textarea>
</div>
<button class="
ui
close
button
">Cancel</button>
<button class="
ui
blue
button
" type="
submit
">Submit</button>
</form>
</div>
</div> -->
<div class="
ui
small
modal
view
">
<div class="
ui
small
modal
view
">
{!!
<div id="
zone2
">
Suitable::source(
$viewDesc
)
->title(__('View Overhead Description'))
</div>
->columns([
new \Laravolt\Suitable\Columns\Numbering(__('No')),
['header' => __('date'), 'field' => 'td_date'],
['header' => __('task'), 'field' => 'td_overhead_desc'],
['header' => __('notes'), 'field' => 'td_overhead_note'],
['header' => __('action'), ]
])
->render()
!!}
</div>
</div>
<div class="
ui
tiny
modal
description
">
<div class="
ui
tiny
modal
description
">
...
@@ -107,7 +131,7 @@ input[type=number] {
...
@@ -107,7 +131,7 @@ input[type=number] {
<thead>
<thead>
<tr>
<tr>
<th>Overhead</th>
<th>Overhead</th>
<th colspan="
@
if
(
$phase
==
1
)
16
@
else
{{
$daymonth
-
1
6
}}
@
endif
" class="
center
aligned
">Date</th>
<th colspan="
@
if
(
$phase
==
1
)
16
@
else
{{
$daymonth
-
1
4
}}
@
endif
" class="
center
aligned
">Date</th>
<th>
<th>
<button type="
submit
" class="
fluid
center
aligned
ui
blue
compact
labeled
icon
button
">
<button type="
submit
" class="
fluid
center
aligned
ui
blue
compact
labeled
icon
button
">
<i class="
save
icon
"></i>
<i class="
save
icon
"></i>
...
@@ -123,10 +147,10 @@ input[type=number] {
...
@@ -123,10 +147,10 @@ input[type=number] {
<th>
{
{$i+1}
}
</th>
<th>
{
{$i+1}
}
</th>
@endfor
@endfor
@else
@else
{{
$daymonth
}}
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th>
{
{$i+1}
}
</th>
<th>
{
{$i+1}
}
</th>
@endfor
@endfor
@endif
@endif
<th>Description</th>
<th>Description</th>
<th>Total Hours</th>
<th>Total Hours</th>
...
@@ -166,28 +190,26 @@ input[type=number] {
...
@@ -166,28 +190,26 @@ input[type=number] {
@endfor
@endfor
<?php
<?php
if (
$hour
) {
if (
$hour
) {
$note
=
$hour->where
('td_overhead_desc',
$project['td_project_name']
)
$note
=
$hour->where
('td_overhead_desc',
$project['td_project_name']
)
->where('tm_phase',
$phase
)
->where('tm_phase',
$phase
)
->where('td_overhead_note', '!=', null)
->where('td_overhead_note', '!=', null)
->first();
->first();
# code...
} else {
} else {
$note
= null;
$note
= null;
}
}
// dd(
$note
);
?>
?>
<td class="
ui
center
aligned
">
<td class="
ui
center
aligned
">
@if(
$note
)
@if(
$note
)
<i class="
bordered
green
eye
icon
" id="
view
"></i>
<i class="
bordered
green
eye
icon
view_button
" data-overheadid="
{{
$project
[
'td_project'
]
}}
" data-month="
{{
$month
}}
" data-year="
{{
$year
}}
" data-tmstaffid="
{{
$userId
}}
" data-phase="
{{
$phase
}}
"></i>
<i class="
bordered
yellow
pencil
icon
"></i>
@else
@else
<i class="
bordered
disabled
red
eye
slash
icon
"></i>
<i class="
bordered
disabled
red
eye
slash
icon
"></i>
@endif
@endif
</td>
</td>
@else
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
<?php
...
@@ -209,9 +231,26 @@ input[type=number] {
...
@@ -209,9 +231,26 @@ input[type=number] {
<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
']}}'
);
">
</td>
</td>
@endfor
@endfor
<td>
display desc phase 2
<?php
if (
$hour
) {
$note
=
$hour->where
('td_overhead_desc',
$project['td_project_name']
)
->where('tm_phase',
$phase
)
->where('td_overhead_note', '!=', null)
->first();
} else {
$note
= null;
}
?>
<td class="
ui
center
aligned
">
@if(
$note
)
<i class="
bordered
green
eye
icon
view_button
" data-overheadid="
{{
$project
[
'td_project'
]
}}
" data-month="
{{
$month
}}
" data-year="
{{
$year
}}
" data-tmstaffid="
{{
$userId
}}
"></i>
@else
<i class="
bordered
disabled
red
eye
slash
icon
"></i>
@endif
</td>
</td>
@endif
@endif
<td>
<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}
}
>
<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}
}
>
...
@@ -240,6 +279,58 @@ input[type=number] {
...
@@ -240,6 +279,58 @@ input[type=number] {
@push('script')
@push('script')
<!-- <script>
$(document).ready(function()
{
$('edit_button').click(function()
{
$('edit_desciption').modal(
{
blurring:true
}).modal('show');
var id = ;
})
})
</script> -->
<script>
$(document).ready(function()
{
$('.view_button').click(function()
{
$('.view').modal(
{
blurring: true
}).modal('show');
var id = $(this).data('overheadid');
var month = $(this).data('month');
var year = $(this).data('year');
var phase = $(this).data('phase');
var staffid = $(this).data('tmstaffid');
$.ajax(
{
type: "
GET
",
url: "
{{
URL
::
to
(
'ajax/overheadnote'
)}}
"+"
/
"+id+"
/
"+month+"
/
"+year+"
/
"+staffid+"
/
"+phase,
beforeSend: function ()
{
document.getElementById('zone2').style.display = "
block
";
},
success: function(html)
{
document.getElementById('zone2').style.display = "
block
";
$('#zone2').html( html );
// window.location.replace("
{{
URL
::
to
(
'ad/typeanjuran'
)}}
")
}
});
});
});
</script>
<script>
<script>
$(function(){
$(function(){
$("
#view").click(function()
$("
#view").click(function()
...
...
packages/portal/timesheet/routes/web.php
View file @
81ce52fd
...
@@ -58,6 +58,7 @@ Route::group(
...
@@ -58,6 +58,7 @@ Route::group(
//php_sqlsrv_80_ts_x86.dll
//php_sqlsrv_80_ts_x86.dll
Route
::
get
(
'ajax/stafflist/{dept}'
,[
'uses'
=>
'MaintenanceController@loadstaff'
,
'as'
=>
'maintenance.loadstaff'
]);
Route
::
get
(
'ajax/stafflist/{dept}'
,[
'uses'
=>
'MaintenanceController@loadstaff'
,
'as'
=>
'maintenance.loadstaff'
]);
Route
::
get
(
'ajax/overheadnote/{overhead}/{month}/{year}/{staffid}/{phase}'
,[
'uses'
=>
'FormController@loadnotes'
,
'as'
=>
'form.loadnotes'
]);
}
}
);
);
...
...
packages/portal/timesheet/src/Http/Controllers/FormController.php
View file @
81ce52fd
...
@@ -596,10 +596,7 @@ class FormController extends Controller
...
@@ -596,10 +596,7 @@ class FormController extends Controller
$hour
=
null
;
$hour
=
null
;
}
}
$viewDesc
=
Ts_detail
::
where
(
'td_overhead_note'
,
'!='
,
null
)
return
view
(
'timesheet::form.overheadForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
,
'project'
));
->
paginate
(
8
);
return
view
(
'timesheet::form.overheadForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
,
'project'
,
'viewDesc'
));
}
}
public
function
saveoverheadhours
(
Request
$request
)
public
function
saveoverheadhours
(
Request
$request
)
...
@@ -795,7 +792,26 @@ class FormController extends Controller
...
@@ -795,7 +792,26 @@ class FormController extends Controller
// $data = new ODesc;
// $data = new ODesc;
}
// public function loadnotes(Request $request)
public
function
loadnotes
(
$overhead
,
$month
,
$year
,
$staffid
,
$phase
)
{
$viewDesc
=
Ts_detail
::
where
(
'td_overhead_note'
,
'!='
,
null
)
->
where
(
'fk_o_id'
,
$overhead
)
->
where
(
'tm_month'
,
$month
)
->
where
(
'tm_phase'
,
$phase
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_staff_id'
,
$staffid
)
->
paginate
(
8
);
// foreach ($Desc as $key => $value) {
// dd($key);
// $viewDesc = $value;
// }
return
view
(
'timesheet::ajax.senarainotes'
,
compact
(
'viewDesc'
));
}
}
}
}
\ 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