Commit a805fc71 by windychikita20

update if value jumlah kosong

parent 2e44ecdd
...@@ -91,7 +91,8 @@ class LembarInstrumentMonitoringController extends Controller ...@@ -91,7 +91,8 @@ class LembarInstrumentMonitoringController extends Controller
//dd($request->all()); //dd($request->all());
foreach ($request->input('jumlah_pernyataan_instrument') as $index => $value) foreach ($request->input('jumlah_pernyataan_instrument') as $index => $value)
{ {
if(!empty($request->jumlah_pernyataan_instrument[$index]))
{
$post = Hasil_Instrument::updateOrCreate( $post = Hasil_Instrument::updateOrCreate(
[ [
'id_pernyataan_instrument' => $request->id_pernyataan_instrument[$index], 'id_pernyataan_instrument' => $request->id_pernyataan_instrument[$index],
...@@ -102,6 +103,7 @@ class LembarInstrumentMonitoringController extends Controller ...@@ -102,6 +103,7 @@ class LembarInstrumentMonitoringController extends Controller
[ [
'jumlah' => $request->jumlah_pernyataan_instrument[$index] 'jumlah' => $request->jumlah_pernyataan_instrument[$index]
]); ]);
}
} }
...@@ -115,7 +117,8 @@ class LembarInstrumentMonitoringController extends Controller ...@@ -115,7 +117,8 @@ class LembarInstrumentMonitoringController extends Controller
foreach ($value1 as $idfakultas => $value2) foreach ($value1 as $idfakultas => $value2)
{ {
if(!empty($value2))
{
$post = Hasil_Instrument::updateOrCreate( $post = Hasil_Instrument::updateOrCreate(
[ [
'id_pernyataan_instrument' => $idparent, 'id_pernyataan_instrument' => $idparent,
...@@ -129,6 +132,7 @@ class LembarInstrumentMonitoringController extends Controller ...@@ -129,6 +132,7 @@ class LembarInstrumentMonitoringController extends Controller
'jumlah' => $value2, 'jumlah' => $value2,
]); ]);
} }
}
} }
......
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