Commit 9b69e786 by Azhan Hannan

fixing timesheet overhead and chargeable form

parent f9fe6c4b
...@@ -369,7 +369,7 @@ input[type=number] { ...@@ -369,7 +369,7 @@ input[type=number] {
@endfor @endfor
@else @else
@for($i = 15+count($lat); $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
{{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}} {{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}}
@php @php
...@@ -473,9 +473,13 @@ input[type=number] { ...@@ -473,9 +473,13 @@ input[type=number] {
@endfor @endfor
@else @else
@for($i = 15+count($lat); $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
<?php
$valuehour = ''; $valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
...@@ -488,11 +492,25 @@ input[type=number] { ...@@ -488,11 +492,25 @@ input[type=number] {
$total += data_get($valuehour,'td_hours'); $total += data_get($valuehour,'td_hours');
} }
?> @endphp
<td> @if($filteredData->isEmpty())
<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']}}');">
</td>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<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
<td class="center aligned" style="background-color: #DCDCDC;">
<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>
@endif
@endforeach
@endif
@endfor @endfor
@endif @endif
@else @else
......
...@@ -382,7 +382,7 @@ input[type=number] { ...@@ -382,7 +382,7 @@ input[type=number] {
@endif @endif
@endfor @endfor
@else @else
@for($i = 15+count($lat); $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
{{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}} {{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}}
@php @php
...@@ -438,6 +438,7 @@ input[type=number] { ...@@ -438,6 +438,7 @@ input[type=number] {
</td> </td>
@if(count($lat) > 0) @if(count($lat) > 0)
@if($phase == 1) @if($phase == 1)
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
...@@ -481,8 +482,13 @@ input[type=number] { ...@@ -481,8 +482,13 @@ input[type=number] {
@endif @endif
@endfor @endfor
@else @else
@for($i = 15+count($lat); $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<?php
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
$valuehour = ''; $valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
...@@ -495,10 +501,25 @@ input[type=number] { ...@@ -495,10 +501,25 @@ input[type=number] {
$total += data_get($valuehour,'td_hours'); $total += data_get($valuehour,'td_hours');
} }
?> @endphp
<td>
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $strdays[$i] }}
</th>
@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']}}');"> <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> </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 @endfor
@endif @endif
@else @else
......
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