Commit 12266a5c by Azhan Hannan

fixing date timesheet overhead and chargeable form

parent 20814cee
......@@ -279,24 +279,34 @@ input[type=number] {
@endif
@endfor
{{-- @foreach($lat as $key => $date)
@if(data_get($date,'attendance_status') == 1)
@else
@for($i = 15+count($lat); $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">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
{{ $i+1 }}
</th>
@else
<th class="center aligned" style="background-color: #DCDCDC;">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th>
@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
@endforeach --}}
{{-- @for($i = count($lat); $i < 15 ; $i++)
<th class="center aligned">{{$i+1}}</th>
@endfor --}}
@else
@for($i = 15+count($lat); $i < $daymonth; $i++)
<th class="center aligned">{{$i+1}}</th>
@endfor
@endif
@else
......@@ -360,7 +370,31 @@ input[type=number] {
@else
@for($i = 15+count($lat); $i < $daymonth; $i++)
<th class="center aligned">{{ $strdays[$i] }}</th>
{{-- <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
......
......@@ -302,7 +302,32 @@ input[type=number] {
@endfor
@else
@for($i = 15+count($lat); $i < $daymonth; $i++)
<th class="center aligned">{{$i+1}}</th>
{{-- <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
......@@ -358,7 +383,32 @@ input[type=number] {
@endfor
@else
@for($i = 15+count($lat); $i < $daymonth; $i++)
<th class="center aligned">{{ $strdays[$i] }}</th>
{{-- <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
......
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