Commit 2c941372 by Azhan Hannan

log pia #166 -> SCENARIO: -KEY IN DAYS -CLICK BUTTON ‘SAVE’ -KEY IN HOURS pada…

log pia #166 -> SCENARIO: -KEY IN DAYS -CLICK BUTTON ‘SAVE’ -KEY IN HOURS pada days yg telah diisi -CLICK BUTTON ‘SAVE’
parent 2a2b8aad
......@@ -76,7 +76,7 @@
</table>
<button class="ui blue button" type="submit">Save</button>
<button class="ui green button" type="button" onclick="window.location.href='{{ route('timesheet::maintenance.senaraiProject') }} ';">Back</button>
<button class="ui green button" type="button" onclick="window.location.href='{{ route('timesheet::maintenance.senaraiProject') }} ';">Baasack</button>
</form>
</div>
......@@ -132,10 +132,15 @@
}
totdays = document.getElementById('totaldays');
if (isNaN(totdays)) {
totdays = 0;
}
totdays.value = totaldays;
tothours = document.getElementById('totalhours');
if (isNaN(tothours)) {
tothours = 0;
}
tothours.value = totaldays * 8;
}
......@@ -161,20 +166,24 @@
if (isNaN(currhours)) {
currhours = 0;
}
totalhours += currhours;
}
}
tothours = document.getElementById('totalhours');
if (isNaN(tothours)) {
tothours = 0;
}
tothours.value = totalhours;
totdays = document.getElementById('totaldays');
if (isNaN(totdays)) {
totdays = 0;
}
totdays.value = totalhours/8;
}
</script>
@endpush
\ No newline at end of file
......@@ -318,8 +318,13 @@ class MaintenanceController extends Controller
->first();
if ($datas)
{
$datas->pm_days = $value;
$datas->pm_hours = $value*8;
if ($value == 'NaN') {
$datas->pm_days = 0;
$datas->pm_hours = 0;
} else {
$datas->pm_days = $value;
$datas->pm_hours = $value*8;
}
$datas->updated_by = $staffid;
$datas->save();
}
......
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