Commit 9b69e786 by Azhan Hannan

fixing timesheet overhead and chargeable form

parent f9fe6c4b
......@@ -369,7 +369,7 @@ input[type=number] {
@endfor
@else
@for($i = 15+count($lat); $i < $daymonth; $i++)
@for($i = 15; $i < $daymonth; $i++)
{{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}}
@php
......@@ -450,8 +450,8 @@ input[type=number] {
->first();
$total += data_get($valuehour,'td_hours');
}
@endphp
}
@endphp
@if($filteredData->isEmpty())
<td>
......@@ -473,26 +473,44 @@ input[type=number] {
@endfor
@else
@for($i = 15+count($lat); $i < $daymonth; $i++)
<?php
$valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
@for($i = 15; $i < $daymonth; $i++)
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
if($hour)
{
$valuehour = $hour->where('td_date','=',$date)
->where('td_project',$project['td_project'])
->where('tm_phase',$phase)
->first();
$valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$total += data_get($valuehour,'td_hours');
}
?>
if($hour)
{
$valuehour = $hour->where('td_date','=',$date)
->where('td_project',$project['td_project'])
->where('tm_phase',$phase)
->first();
<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>
$total += data_get($valuehour,'td_hours');
}
@endphp
@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']}}');">
</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
@endif
@else
......
......@@ -382,7 +382,7 @@ input[type=number] {
@endif
@endfor
@else
@for($i = 15+count($lat); $i < $daymonth; $i++)
@for($i = 15; $i < $daymonth; $i++)
{{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}}
@php
......@@ -438,6 +438,7 @@ input[type=number] {
</td>
@if(count($lat) > 0)
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
......@@ -481,24 +482,44 @@ input[type=number] {
@endif
@endfor
@else
@for($i = 15+count($lat); $i < $daymonth; $i++)
<?php
$valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
@for($i = 15; $i < $daymonth; $i++)
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
if($hour)
{
$valuehour = $hour->where('td_date','=',$date)
->where('fk_o_id',$project['td_project'])
->where('tm_phase',$phase)
->first();
$valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$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>
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())
<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']}}');">
</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
......
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