Commit 43cb2d4d by Azhan Hannan

chargeable page - checking and notes for no project added

parent 4b14d2a2
...@@ -150,148 +150,155 @@ input[type=number] { ...@@ -150,148 +150,155 @@ input[type=number] {
$lasttd = count($projectlist); $lasttd = count($projectlist);
// dd($lat); // dd($lat);
?> ?>
@if(count($projectlist) > 0)
@foreach($projectlist as $key => $project) @foreach($projectlist as $key => $project)
<?php $total = 0;?> <?php $total = 0;?>
<tr> <tr>
<td class="single line"> <td class="single line">
{{$project['td_project_code']}} {{$project['td_project_code']}}
</td> </td>
<td class="single line"> <td class="single line">
{{$project['td_project_name']}} {{$project['td_project_name']}}
</td> </td>
@if(count($lat) > 0) @if(count($lat) > 0)
@foreach($lat as $key => $value) @foreach($lat as $key => $value)
<?php <?php
// dd($value); // dd($value);
$day = date_parse_from_format('Y-m-d', data_get($value,'DATE'))['day']; $day = date_parse_from_format('Y-m-d', data_get($value,'DATE'))['day'];
// dd($day); // dd($day);
$valuehour = ''; $valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $day); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $day);
if($hour) if($hour)
{ {
$valuehour = $hour->where('td_date','=',$date) $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');
} }
?> ?>
@if(data_get($value,'attendance_status') == 1) @if(data_get($value,'attendance_status') == 1)
<td class="center aligned"> <td class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$day}}]" name="hour[{{$project['td_project']}}][{{$day}}]" 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']}}][{{$day}}]" name="hour[{{$project['td_project']}}][{{$day}}]" 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 @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']}}][{{$day}}]" name="hour[{{$project['td_project']}}][{{$day}}]" 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 type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$day}}]" name="hour[{{$project['td_project']}}][{{$day}}]" 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> </td>
@endif @endif
@endforeach @endforeach
@if($phase == 1) @if($phase == 1)
@for($i = count($lat); $i < 15 ; $i++) @for($i = count($lat); $i < 15 ; $i++)
<?php <?php
$valuehour = ''; $valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($hour) if($hour)
{ {
$valuehour = $hour->where('td_date','=',$date) $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
@else
@for($i = 15+count($lat); $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('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');
} }
?> ?>
<td> <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'] }}');"> <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>
@endfor @endfor
@else @endif
@for($i = 15+count($lat); $i < $daymonth; $i++) @else
@if($phase == 1)
<?php @for($i = 0; $i < 15 ; $i++)
$valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); <?php
$valuehour = '';
if($hour)
{ $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$valuehour = $hour->where('td_date','=',$date)
->where('td_project',$project['td_project']) if($hour)
->where('tm_phase',$phase) {
->first(); $valuehour = $hour->where('td_date','=',$date)
->where('td_project',$project['td_project'])
$total += data_get($valuehour,'td_hours'); ->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 <td>
@endif <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>
@if($phase == 1) @endfor
@for($i = 0; $i < 15 ; $i++) @else
@for($i = 15; $i < $daymonth; $i++)
<?php
$valuehour = ''; <?php
$valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($hour) if($hour)
{ {
$valuehour = $hour->where('td_date','=',$date) $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');
} }
?> ?>
<td> <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'] }}');"> <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>
@endfor @endfor
@else @endif
@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
@endif <td>
<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','.','')}}">
<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>
</td> </tr>
</tr> <?php $all += $total; ?>
<?php $all += $total; ?> @endforeach
@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> </tbody>
</table> </table>
<?php <?php
......
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