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] {
<form class="ui form" action="{{ route('timesheet::form.savechargeablehours' )}}" method="POST">
{{csrf_field()}}
<!-- <input type="text" disabled="disabled" name="" value="{{$year}}"> -->
<input type="hidden" name="userId" value="{{$userId}}">
<input type="hidden" name="year" value="{{$year}}">
<input type="hidden" name="month" value="{{$month}}">
<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
@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>
<th class="">Project Code</th>
<th class="">Project Name</th>
@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>
<?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)
<div class="table-responsive" style="overflow-x: auto; height: 400px; white-space: nowrap;">
<table id="table-chargeable-form" 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
@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>
<th class="">Project Code</th>
<th class="">Project Name</th>
@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>
<?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('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('tm_phase',$phase)
->first();
$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
@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('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; $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>
$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
@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('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; $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>
</div>
<?php
// dd(count($projectlist));
?>
......@@ -616,9 +620,6 @@ input[type=number] {
</script>
<script>
$().ready(function() {
});
function limiter(input,pid) {
......@@ -652,6 +653,4 @@ input[type=number] {
document.getElementById('total-'+pid).value = currenttotal.toFixed(1);
}
</script>
@endpush
\ No newline at end of file
</script>
\ No newline at end of file
......@@ -247,334 +247,336 @@ input[type=number] {
<input type="hidden" name="month" value="{{$month}}">
<input type="hidden" name="phase" value="{{$phase}}">
<table class="ui celled structured unstackable table" >
<thead>
<tr>
<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
<!-- <button type="submit" class="fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i>
Save as Draft
</button> -->
</th>
</tr>
<tr>
@if(count($lat) > 0)
{{-- @foreach($lat 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 --}}
@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
@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
<div class="table-responsive" style="overflow-x: auto; height: 400px; white-space: nowrap;">
<table class="ui celled structured unstackable table" >
<thead>
<tr>
<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
<!-- <button type="submit" class="fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i>
Save as Draft
</button> -->
</th>
</tr>
<tr>
@if(count($lat) > 0)
{{-- @foreach($lat 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 --}}
@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>
<th class="center aligned">
{{ $i+1 }}
</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>
<th class="center aligned">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th>
@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>
<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++)
@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;
});
$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>
<th class="center aligned">
{{ $i+1 }}
</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>
<th class="center aligned">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th>
@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>
<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++)
<?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>
@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) {
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
// dd(data_get($checkoverhead,'tm_timesheet_master_sts'));
......
......@@ -62,13 +62,13 @@
}
.langdisp
{
background-color: unset !important;
border-radius: unset !important;
margin: unset !important;
padding: unset !important;
{
background-color: unset !important;
border-radius: unset !important;
margin: unset !important;
padding: unset !important;
}
}
}
</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