Commit 33596dac by Azhan Hannan

fix: ui -> en rashdan (Staff key in timesheet, allow user scroll vertically)

parent 8762b4db
...@@ -220,362 +220,366 @@ input[type=number] { ...@@ -220,362 +220,366 @@ input[type=number] {
<form class="ui form" action="{{ route('timesheet::form.savechargeablehours' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::form.savechargeablehours' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<!-- <input type="text" disabled="disabled" name="" value="{{$year}}"> --> <!-- <input type="text" disabled="disabled" name="" value="{{$year}}"> -->
<input type="hidden" name="userId" value="{{$userId}}"> <input type="hidden" name="userId" value="{{$userId}}">
<input type="hidden" name="year" value="{{$year}}"> <input type="hidden" name="year" value="{{$year}}">
<input type="hidden" name="month" value="{{$month}}"> <input type="hidden" name="month" value="{{$month}}">
<input type="hidden" name="phase" value="{{$phase}}"> <input type="hidden" name="phase" value="{{$phase}}">
<table class="ui celled structured table unstackable">
<thead>
<tr>
<?php
// dd(data_get($check,'tm_timesheet_master_sts'));
?>
<th colspan="2" rowspan="2" class="center aligned" style="width: 23%;">Chargeable</th>
<!-- <th colspan="{{count($lat)}}" class="center aligned">Date</th> -->
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th rowspan="2" class="center aligned">Total
<!-- @if($projectlist == [])
<button type="submit" class="ui disabled fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i>
Save
</button>
@else
<button type="submit" class="fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i>
Save as Draft
</button>
@endif -->
</th>
</tr>
<tr>
@if(count($lat) > 0)
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
@endphp
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $i+1 }}
</th>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<th class="center aligned">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th>
@else
<th class="center aligned" style="background-color: #DCDCDC;">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th>
@endif
@endforeach
@endif
@endfor
@else <div class="table-responsive" style="overflow-x: auto; height: 400px; white-space: nowrap;">
@for($i = 15; $i < $daymonth; $i++) <table id="table-chargeable-form" class="ui celled structured table unstackable">
{{-- <th class="center aligned">{{$i+1}}</th> --}} <thead>
<tr>
@php <?php
$filteredData = $lat->filter(function ($item) use ($i) { // dd(data_get($check,'tm_timesheet_master_sts'));
return date('d', strtotime($item['DATE'])) == $i+1; ?>
}); <th colspan="2" rowspan="2" class="center aligned" style="width: 23%;">Chargeable</th>
@endphp <!-- <th colspan="{{count($lat)}}" class="center aligned">Date</th> -->
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
@if($filteredData->isEmpty()) <th rowspan="2" class="center aligned">Total
<th class="center aligned"> <!-- @if($projectlist == [])
{{ $i+1 }} <button type="submit" class="ui disabled fluid center aligned ui blue compact labeled icon button">
</th> <i class="save icon"></i>
@else Save
@foreach($filteredData as $key => $date) </button>
@if(data_get($date,'attendance_status') == 1) @else
<th class="center aligned"> <button type="submit" class="fluid center aligned ui blue compact labeled icon button">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }} <i class="save icon"></i>
</th> Save as Draft
@else </button>
<th class="center aligned" style="background-color: #DCDCDC;"> @endif -->
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }} </th>
</th> </tr>
@endif <tr>
@endforeach @if(count($lat) > 0)
@endif @if($phase == 1)
@endfor @for($i = 0; $i < 15 ; $i++)
@endif
@else @php
@if($phase == 1) $filteredData = $lat->filter(function ($item) use ($i) {
@for($i = 0; $i < 15 ; $i++) return date('d', strtotime($item['DATE'])) == $i+1;
<th class="center aligned">{{$i+1}}</th> });
@endfor @endphp
@else
@for($i = 15; $i < $daymonth; $i++) @if($filteredData->isEmpty())
<th class="center aligned">{{$i+1}}</th> <th class="center aligned">
@endfor {{ $i+1 }}
@endif </th>
@endif @else
</tr> @foreach($filteredData as $key => $date)
<tr> @if(data_get($date,'attendance_status') == 1)
<th class="">Project Code</th> <th class="center aligned">
<th class="">Project Name</th> {{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
@if(count($lat) > 0) </th>
@else
{{-- @foreach($lat as $key => $date) <th class="center aligned" style="background-color: #DCDCDC;">
@if(data_get($date,'attendance_status') == 1) {{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
<th class="center aligned"> </th>
{{ date('D', strtotime(data_get($date,'DATE')) ) }} @endif
</th> @endforeach
@else @endif
<th class="center aligned" style="background-color: #DCDCDC;"> @endfor
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th> @else
@endif @for($i = 15; $i < $daymonth; $i++)
@endforeach --}} {{-- <th class="center aligned">{{$i+1}}</th> --}}
@php
@if($phase == 1) $filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
@for($i = 0; $i < 15 ; $i++) });
@endphp
@php
$filteredData = $lat->filter(function ($item) use ($i) { @if($filteredData->isEmpty())
return date('d', strtotime($item['DATE'])) == $i+1; <th class="center aligned">
}); {{ $i+1 }}
@endphp </th>
@else
@if($filteredData->isEmpty()) @foreach($filteredData as $key => $date)
<th class="center aligned"> @if(data_get($date,'attendance_status') == 1)
{{ $strdays[$i] }} <th class="center aligned">
</th> {{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
@else </th>
@foreach($filteredData as $key => $date) @else
@if(data_get($date,'attendance_status') == 1) <th class="center aligned" style="background-color: #DCDCDC;">
<th class="center aligned"> {{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
{{ date('D', strtotime(data_get($date,'DATE')) ) }} </th>
</th> @endif
@else @endforeach
<th class="center aligned" style="background-color: #DCDCDC;"> @endif
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th> @endfor
@endif @endif
@endforeach @else
@endif @if($phase == 1)
@endfor @for($i = 0; $i < 15 ; $i++)
<th class="center aligned">{{$i+1}}</th>
@else @endfor
@for($i = 15; $i < $daymonth; $i++) @else
{{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}} @for($i = 15; $i < $daymonth; $i++)
<th class="center aligned">{{$i+1}}</th>
@php @endfor
$filteredData = $lat->filter(function ($item) use ($i) { @endif
return date('d', strtotime($item['DATE'])) == $i+1; @endif
}); </tr>
@endphp <tr>
<th class="">Project Code</th>
@if($filteredData->isEmpty()) <th class="">Project Name</th>
<th class="center aligned"> @if(count($lat) > 0)
{{ $strdays[$i] }}
</th> {{-- @foreach($lat as $key => $date)
@else @if(data_get($date,'attendance_status') == 1)
@foreach($filteredData as $key => $date) <th class="center aligned">
@if(data_get($date,'attendance_status') == 1) {{ date('D', strtotime(data_get($date,'DATE')) ) }}
<th class="center aligned"> </th>
{{ date('D', strtotime(data_get($date,'DATE')) ) }} @else
</th> <th class="center aligned" style="background-color: #DCDCDC;">
@else {{ date('D', strtotime(data_get($date,'DATE')) ) }}
<th class="center aligned" style="background-color: #DCDCDC;"> </th>
{{ date('D', strtotime(data_get($date,'DATE')) ) }} @endif
</th> @endforeach --}}
@endif
@endforeach
@endif @if($phase == 1)
@endfor
@for($i = 0; $i < 15 ; $i++)
@endif
@else @php
@if($phase == 1) $filteredData = $lat->filter(function ($item) use ($i) {
@for($i = 0; $i < 15 ; $i++) return date('d', strtotime($item['DATE'])) == $i+1;
<th class="center aligned">{{ $strdays[$i] }}</th> });
@endfor @endphp
@else
@for($i = 15; $i < $daymonth; $i++) @if($filteredData->isEmpty())
<th class="center aligned">{{ $strdays[$i] }}</th> <th class="center aligned">
@endfor {{ $strdays[$i] }}
</th>
@endif @else
@endif @foreach($filteredData as $key => $date)
<th class="center aligned">Hours</th> @if(data_get($date,'attendance_status') == 1)
</tr> <th class="center aligned">
</thead> {{ date('D', strtotime(data_get($date,'DATE')) ) }}
<tbody> </th>
<?php @else
$all = 0; <th class="center aligned" style="background-color: #DCDCDC;">
$lasttd = count($projectlist); {{ date('D', strtotime(data_get($date,'DATE')) ) }}
?> </th>
@if(count($projectlist) > 0) @endif
@foreach($projectlist as $key => $project) @endforeach
<?php $total = 0;?> @endif
<tr> @endfor
<td class="">
{{$project['td_project_code']}} @else
</td> @for($i = 15; $i < $daymonth; $i++)
<td class=""> {{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}}
{{$project['td_project_name']}}
</td> @php
$filteredData = $lat->filter(function ($item) use ($i) {
@if(count($lat) > 0) return date('d', strtotime($item['DATE'])) == $i+1;
@if($phase == 1) });
@for($i = 0; $i < 15 ; $i++) @endphp
@php @if($filteredData->isEmpty())
$filteredData = $lat->filter(function ($item) use ($i) { <th class="center aligned">
return date('d', strtotime($item['DATE'])) == $i+1; {{ $strdays[$i] }}
}); </th>
@else
$valuehour = ''; @foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); <th class="center aligned">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
if($hour) </th>
{ @else
$valuehour = $hour->where('td_date','=',$date) <th class="center aligned" style="background-color: #DCDCDC;">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@endif
@endforeach
@endif
@endfor
@endif
@else
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th class="center aligned">{{ $strdays[$i] }}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th class="center aligned">{{ $strdays[$i] }}</th>
@endfor
@endif
@endif
<th class="center aligned">Hours</th>
</tr>
</thead>
<tbody>
<?php
$all = 0;
$lasttd = count($projectlist);
?>
@if(count($projectlist) > 0)
@foreach($projectlist as $key => $project)
<?php $total = 0;?>
<tr>
<td class="">
{{$project['td_project_code']}}
</td>
<td class="">
{{$project['td_project_name']}}
</td>
@if(count($lat) > 0)
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
$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 += data_get($valuehour,'td_hours');
}
@endphp
@if($filteredData->isEmpty())
<td>
<input class="center aligned" 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:2px;margin:unset" onchange="limiter(this,'{{ $project['td_project'] }}');">
</td>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<td class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{ $project['td_project'] }}');">
</td>
@else
<td class="center aligned" style="background-color: #DCDCDC;">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{ $project['td_project'] }}');">
</td>
@endif
@endforeach
@endif
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
$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('td_project',$project['td_project'])
->where('tm_phase',$phase) ->where('tm_phase',$phase)
->first(); ->first();
$total += data_get($valuehour,'td_hours'); $total += data_get($valuehour,'td_hours');
} }
@endphp @endphp
@if($filteredData->isEmpty()) @if($filteredData->isEmpty())
<td> <td class="center aligned">
<input class="center aligned" 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:2px;margin:unset" onchange="limiter(this,'{{ $project['td_project'] }}');"> <input class="center aligned" 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:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td> </td>
@else @else
@foreach($filteredData as $key => $date) @foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1) @if(data_get($date,'attendance_status') == 1)
<td class="center aligned"> <td class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{ $project['td_project'] }}');"> <input class="center aligned" 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:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td> </td>
@else @else
<td class="center aligned" style="background-color: #DCDCDC;"> <td class="center aligned" style="background-color: #DCDCDC;">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{ $project['td_project'] }}');"> <input class="center aligned" 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:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{$project['td_project']}}');">
</td> </td>
@endif @endif
@endforeach @endforeach
@endif @endif
@endfor
@endfor @endif
@else @else
@for($i = 15; $i < $daymonth; $i++) @if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
@php
$filteredData = $lat->filter(function ($item) use ($i) { <?php
return date('d', strtotime($item['DATE'])) == $i+1; $valuehour = '';
});
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); if($hour)
{
if($hour) $valuehour = $hour->where('td_date','=',$date)
{ ->where('td_project',$project['td_project'])
$valuehour = $hour->where('td_date','=',$date) ->where('tm_phase',$phase)
->where('td_project',$project['td_project']) ->first();
->where('tm_phase',$phase)
->first(); $total += data_get($valuehour,'td_hours');
}
$total += data_get($valuehour,'td_hours'); ?>
}
@endphp <td>
<input class="center aligned" 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:2px;margin:unset" onchange="limiter(this,'{{ $project['td_project'] }}');">
@if($filteredData->isEmpty()) </td>
<td class="center aligned"> @endfor
<input class="center aligned" 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:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');"> @else
</td> @for($i = 15; $i < $daymonth; $i++)
@else
@foreach($filteredData as $key => $date) <?php
@if(data_get($date,'attendance_status') == 1) $valuehour = '';
<td class="center aligned"> $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
<input class="center aligned" 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:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td> if($hour)
@else {
<td class="center aligned" style="background-color: #DCDCDC;"> $valuehour = $hour->where('td_date','=',$date)
<input class="center aligned" 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:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{$project['td_project']}}');"> ->where('td_project',$project['td_project'])
</td> ->where('tm_phase',$phase)
@endif ->first();
@endforeach
@endif $total += data_get($valuehour,'td_hours');
@endfor }
@endif ?>
@else
@if($phase == 1) <td>
@for($i = 0; $i < 15 ; $i++) <input class="center aligned" 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:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
<?php @endfor
$valuehour = ''; @endif
@endif
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); <td>
<input class="center aligned" type="text" name="total-{{$project['td_project']}}" id="total-{{$project['td_project']}}" style="padding-right: 4px;padding-left: 4px;" onchange="limiter(this,'{{$project['td_project']}}');" readonly="readonly" value="{{number_format($total,'1','.','')}}">
if($hour) </td>
{ </tr>
$valuehour = $hour->where('td_date','=',$date) <?php $all += $total; ?>
->where('td_project',$project['td_project']) @endforeach
->where('tm_phase',$phase) @else
->first(); <tr>
<td class="center aligned" colspan="@if($phase == 1){{ 15+3 }}@else {{ ($daymonth-15)+3 }} @endif">
$total += data_get($valuehour,'td_hours'); No Project Added
} </td>
?> </tr>
@endif
<td> </tbody>
<input class="center aligned" 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:2px;margin:unset" onchange="limiter(this,'{{ $project['td_project'] }}');"> </table>
</td> </div>
@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 += data_get($valuehour,'td_hours');
}
?>
<td>
<input class="center aligned" 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:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@endfor
@endif
@endif
<td>
<input class="center aligned" type="text" name="total-{{$project['td_project']}}" id="total-{{$project['td_project']}}" style="padding-right: 4px;padding-left: 4px;" onchange="limiter(this,'{{$project['td_project']}}');" readonly="readonly" value="{{number_format($total,'1','.','')}}">
</td>
</tr>
<?php $all += $total; ?>
@endforeach
@else
<tr>
<td class="center aligned" colspan="@if($phase == 1){{ 15+3 }}@else {{ ($daymonth-15)+3 }} @endif">
No Project Added
</td>
</tr>
@endif
</tbody>
</table>
<?php <?php
// dd(count($projectlist)); // dd(count($projectlist));
?> ?>
...@@ -616,9 +620,6 @@ input[type=number] { ...@@ -616,9 +620,6 @@ input[type=number] {
</script> </script>
<script> <script>
$().ready(function() {
});
function limiter(input,pid) { function limiter(input,pid) {
...@@ -652,6 +653,4 @@ input[type=number] { ...@@ -652,6 +653,4 @@ input[type=number] {
document.getElementById('total-'+pid).value = currenttotal.toFixed(1); document.getElementById('total-'+pid).value = currenttotal.toFixed(1);
} }
</script> </script>
\ No newline at end of file
@endpush
\ No newline at end of file
...@@ -247,334 +247,336 @@ input[type=number] { ...@@ -247,334 +247,336 @@ input[type=number] {
<input type="hidden" name="month" value="{{$month}}"> <input type="hidden" name="month" value="{{$month}}">
<input type="hidden" name="phase" value="{{$phase}}"> <input type="hidden" name="phase" value="{{$phase}}">
<table class="ui celled structured unstackable table" > <div class="table-responsive" style="overflow-x: auto; height: 400px; white-space: nowrap;">
<thead> <table class="ui celled structured unstackable table" >
<tr> <thead>
<th rowspan="3" class="center aligned" style="width: 27%;">Overhead</th> <tr>
<!-- <th colspan="{{count($lat)}}" class="center aligned">Date</th> --> <th rowspan="3" class="center aligned" style="width: 27%;">Overhead</th>
<!-- <th colspan="{{count($lat)}}" class="center aligned">Date</th> -->
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th rowspan="2" class="center aligned" style="width: 10%;">Total <th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<!-- <button type="submit" class="fluid center aligned ui blue compact labeled icon button"> <th rowspan="2" class="center aligned" style="width: 10%;">Total
<i class="save icon"></i> <!-- <button type="submit" class="fluid center aligned ui blue compact labeled icon button">
Save as Draft <i class="save icon"></i>
</button> --> Save as Draft
</th> </button> -->
</tr> </th>
<tr> </tr>
@if(count($lat) > 0) <tr>
{{-- @foreach($lat as $key => $date) @if(count($lat) > 0)
@if(data_get($date,'attendance_status') == 1) {{-- @foreach($lat as $key => $date)
<th class="center aligned"> @if(data_get($date,'attendance_status') == 1)
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }} <th class="center aligned">
</th> {{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
@else </th>
<th class="center aligned" style="background-color: #DCDCDC;"> @else
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }} <th class="center aligned" style="background-color: #DCDCDC;">
</th> {{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
@endif </th>
@endforeach --}} @endif
@if($phase == 1) @endforeach --}}
@for($i = 0; $i < 15 ; $i++) @if($phase == 1)
@php @for($i = 0; $i < 15 ; $i++)
$filteredData = $lat->filter(function ($item) use ($i) { @php
return date('d', strtotime($item['DATE'])) == $i+1;
});
@endphp
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $i+1 }}
</th>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<th class="center aligned">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th>
@else
<th class="center aligned" style="background-color: #DCDCDC;">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th>
@endif
@endforeach
@endif
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
{{-- <th class="center aligned">{{$i+1}}</th> --}}
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
@endphp
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $i+1 }}
</th>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<th class="center aligned">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th>
@else
<th class="center aligned" style="background-color: #DCDCDC;">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th>
@endif
@endforeach
@endif
@endfor
@endif
@else
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th class="center aligned">{{$i+1}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th class="center aligned">{{$i+1}}</th>
@endfor
@endif
@endif
</tr>
<tr>
@if(count($lat) > 0)
{{-- @foreach($lat as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<th class="center aligned">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@else
<th class="center aligned" style="background-color: #DCDCDC;">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@endif
@endforeach --}}
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
@endphp
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $strdays[$i] }}
</th>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<th class="center aligned">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@else
<th class="center aligned" style="background-color: #DCDCDC;">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@endif
@endforeach
@endif
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
{{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}}
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
@endphp
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $strdays[$i] }}
</th>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<th class="center aligned">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@else
<th class="center aligned" style="background-color: #DCDCDC;">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@endif
@endforeach
@endif
@endfor
@endif
@else
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th class="center aligned">{{ $strdays[$i] }}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th class="center aligned">{{ $strdays[$i] }}</th>
@endfor
@endif
@endif
<th class="center aligned">Hours</th>
</tr>
</thead>
<tbody>
@foreach($projectlist as $key => $project)
<?php $total = 0; ?>
<tr>
<td>
{{$project['td_project_name']}}
</td>
@if(count($lat) > 0)
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
@php
$filteredData = $lat->filter(function ($item) use ($i) { $filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1; return date('d', strtotime($item['DATE'])) == $i+1;
}); });
$valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($hour)
{
$valuehour = $hour->where('td_date','=',$date)
->where('fk_o_id',$project['td_project'])
->where('tm_phase',$phase)
->first();
$total += data_get($valuehour,'td_hours');
}
@endphp @endphp
@if($filteredData->isEmpty()) @if($filteredData->isEmpty())
<td class="center aligned"> <th class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');"> {{ $i+1 }}
</td> </th>
@else @else
@foreach($filteredData as $key => $date) @foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1) @if(data_get($date,'attendance_status') == 1)
<td class="center aligned"> <th class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{ $project['td_project'] }}');"> {{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</td> </th>
@else @else
<td class="center aligned" style="background-color: #DCDCDC;"> <th class="center aligned" style="background-color: #DCDCDC;">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{ $project['td_project'] }}');"> {{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</td> </th>
@endif @endif
@endforeach @endforeach
@endif @endif
@endfor @endfor
@else @else
@for($i = 15; $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
{{-- <th class="center aligned">{{$i+1}}</th> --}}
@php @php
$filteredData = $lat->filter(function ($item) use ($i) { $filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1; return date('d', strtotime($item['DATE'])) == $i+1;
}); });
$valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($hour)
{
$valuehour = $hour->where('td_date','=',$date)
->where('fk_o_id',$project['td_project'])
->where('tm_phase',$phase)
->first();
$total += data_get($valuehour,'td_hours');
}
@endphp @endphp
@if($filteredData->isEmpty()) @if($filteredData->isEmpty())
<td class="center aligned"> <th class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');"> {{ $i+1 }}
</td> </th>
@else @else
@foreach($filteredData as $key => $date) @foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1) @if(data_get($date,'attendance_status') == 1)
<td class="center aligned"> <th class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');"> {{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</td> </th>
@else @else
<td class="center aligned" style="background-color: #DCDCDC;"> <th class="center aligned" style="background-color: #DCDCDC;">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{$project['td_project']}}');"> {{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</td> </th>
@endif @endif
@endforeach @endforeach
@endif @endif
@endfor
@endif @endfor
@else @endif
@if($phase == 1) @else
@for($i = 0; $i < 15 ; $i++) @if($phase == 1)
<?php @for($i = 0; $i < 15 ; $i++)
$valuehour = ''; <th class="center aligned">{{$i+1}}</th>
@endfor
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); @else
@for($i = 15; $i < $daymonth; $i++)
<th class="center aligned">{{$i+1}}</th>
if($hour) @endfor
{ @endif
@endif
$valuehour = $hour->where('td_date','=',$date) </tr>
->where('fk_o_id',$project['td_project']) <tr>
->where('tm_phase',$phase) @if(count($lat) > 0)
->first(); {{-- @foreach($lat as $key => $date)
@if(data_get($date,'attendance_status') == 1)
$total += data_get($valuehour,'td_hours'); <th class="center aligned">
} {{ date('D', strtotime(data_get($date,'DATE')) ) }}
?> </th>
<td > @else
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');"> <th class="center aligned" style="background-color: #DCDCDC;">
</td> {{ date('D', strtotime(data_get($date,'DATE')) ) }}
@endfor </th>
@else @endif
@for($i = 15; $i < $daymonth; $i++) @endforeach --}}
<?php @if($phase == 1)
$valuehour = ''; @for($i = 0; $i < 15 ; $i++)
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); @php
$filteredData = $lat->filter(function ($item) use ($i) {
if($hour) return date('d', strtotime($item['DATE'])) == $i+1;
{ });
$valuehour = $hour->where('td_date','=',$date) @endphp
->where('fk_o_id',$project['td_project'])
->where('tm_phase',$phase) @if($filteredData->isEmpty())
->first(); <th class="center aligned">
{{ $strdays[$i] }}
$total += data_get($valuehour,'td_hours'); </th>
} @else
?> @foreach($filteredData as $key => $date)
<td> @if(data_get($date,'attendance_status') == 1)
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');"> <th class="center aligned">
</td> {{ date('D', strtotime(data_get($date,'DATE')) ) }}
@endfor </th>
@endif @else
@endif <th class="center aligned" style="background-color: #DCDCDC;">
<td> {{ date('D', strtotime(data_get($date,'DATE')) ) }}
<input type="text" class="text-center" 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="" value="{{number_format($total, '1', '.', '')}}"> </th>
</td> @endif
</tr> @endforeach
@endforeach @endif
</tbody> @endfor
</table> @else
@for($i = 15; $i < $daymonth; $i++)
{{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}}
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
@endphp
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $strdays[$i] }}
</th>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<th class="center aligned">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@else
<th class="center aligned" style="background-color: #DCDCDC;">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@endif
@endforeach
@endif
@endfor
@endif
@else
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th class="center aligned">{{ $strdays[$i] }}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th class="center aligned">{{ $strdays[$i] }}</th>
@endfor
@endif
@endif
<th class="center aligned">Hours</th>
</tr>
</thead>
<tbody>
@foreach($projectlist as $key => $project)
<?php $total = 0; ?>
<tr>
<td>
{{$project['td_project_name']}}
</td>
@if(count($lat) > 0)
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
$valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($hour)
{
$valuehour = $hour->where('td_date','=',$date)
->where('fk_o_id',$project['td_project'])
->where('tm_phase',$phase)
->first();
$total += data_get($valuehour,'td_hours');
}
@endphp
@if($filteredData->isEmpty())
<td class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<td class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{ $project['td_project'] }}');">
</td>
@else
<td class="center aligned" style="background-color: #DCDCDC;">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{ $project['td_project'] }}');">
</td>
@endif
@endforeach
@endif
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
$valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($hour)
{
$valuehour = $hour->where('td_date','=',$date)
->where('fk_o_id',$project['td_project'])
->where('tm_phase',$phase)
->first();
$total += data_get($valuehour,'td_hours');
}
@endphp
@if($filteredData->isEmpty())
<td class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<td class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@else
<td class="center aligned" style="background-color: #DCDCDC;">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@endif
@endforeach
@endif
@endfor
@endif
@else
@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('fk_o_id',$project['td_project'])
->where('tm_phase',$phase)
->first();
$total += data_get($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){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;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('fk_o_id',$project['td_project'])
->where('tm_phase',$phase)
->first();
$total += data_get($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){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@endfor
@endif
@endif
<td>
<input type="text" class="text-center" 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="" value="{{number_format($total, '1', '.', '')}}">
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<?php <?php
// dd(data_get($checkoverhead,'tm_timesheet_master_sts')); // dd(data_get($checkoverhead,'tm_timesheet_master_sts'));
......
...@@ -62,13 +62,13 @@ ...@@ -62,13 +62,13 @@
} }
.langdisp .langdisp
{ {
background-color: unset !important; background-color: unset !important;
border-radius: unset !important; border-radius: unset !important;
margin: unset !important; margin: unset !important;
padding: unset !important; padding: unset !important;
} }
} }
</style> </style>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment