Skip to content
Snippets Groups Projects
Commit a5cf0542 authored by gazandi's avatar gazandi
Browse files

debug jumlah tps tambah terus

parent b2b68ca6
Branches
No related merge requests found
Pipeline #1741 skipped
...@@ -144,17 +144,19 @@ class ScheduleController extends Controller ...@@ -144,17 +144,19 @@ class ScheduleController extends Controller
} }
else if ($this->has_role('edit_schedule')) else if ($this->has_role('edit_schedule'))
{ {
$sched->is_done = Input::get('is_done'); if($sched->is_done!=Input::get('is_done')){
$sched->save(); $sched->is_done = Input::get('is_done');
$tps = Tps::find($sched->id_tps); $sched->save();
$tps->capacity_now += $sched->amount; $tps = Tps::find($sched->id_tps);
if ($tps->capacity_now >= $tps->capacity_full) $tps->capacity_now += $sched->amount;
{ if ($tps->capacity_now >= $tps->capacity_full)
$this->notify('TPS '.$tps->nama.' penuh'); {
$tps->capacity_now = $tps->capacity_full; $this->notify('TPS '.$tps->nama.' penuh');
$tps->is_full = 1; $tps->capacity_now = $tps->capacity_full;
} $tps->is_full = 1;
$tps->save(); }
$tps->save();
}
return redirect('/schedule'); return redirect('/schedule');
} }
......
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