Exemple #1
0
 public function update()
 {
     $an = Input::get('anak');
     $anak = AnakDAO::saveOrUpdate($an);
     Session::flash('message', "Anak with Nama {$anak->nama} has been updated!");
     return Redirect::to('/dash/anak');
 }
 public function update()
 {
     $fm = Input::get('form');
     $pel = Input::get('pelapor');
     $an = Input::get('anak');
     $ct = Input::get('contact');
     $user = Auth::user();
     $sign = ['penerima' => $user, 'pelapor' => $pel['nama']];
     $sign = json_encode($sign);
     $fm['sign'] = $sign;
     //get no lka and tanggal for update
     $form = Form::find($fm['id']);
     $no_lka = $form->no_lka;
     // inject lka if not set
     if (!isset($fm['no_lka'])) {
         $fm['no_lka'] = $form->no_lka;
     }
     // inject tanggal if not set
     if (!isset($fm['tanggal'])) {
         $fm['tanggal'] = $form->tanggal;
     }
     $form = FormDAO::saveOrUpdate($fm);
     $anak = AnakDAO::saveOrUpdate($an);
     $pelapor = PelaporDAO::saveOrUpdate($pel, $anak);
     $ct = ContactPersonDAO::saveOrUpdate($ct, $anak);
     //notifikasi
     NotifikasiFormLKAHelper::updateNotif($form->id);
     Session::flash('message', "Form with No LKA {$no_lka} has been updated!");
     return Redirect::to('dash/formka1');
 }
 public function update()
 {
     $fm = Input::get('form');
     $pel = Input::get('pelapor');
     $an = Input::get('anak');
     $ct = Input::get('contact');
     // inject tanggal if not set
     if (!isset($fm['tanggal'])) {
         $fm['tanggal'] = $fm['tanggal_old'];
     }
     $user = Auth::user();
     $sign = ['penerima' => $user, 'pelapor' => $pel['nama']];
     $sign = json_encode($sign);
     $fm['sign'] = $sign;
     $form = FormDAO::saveOrUpdate($fm);
     $anak = AnakDAO::saveOrUpdate($an);
     $pelapor = PelaporDAO::saveOrUpdate($pel, $anak);
     $ct = ContactPersonDAO::saveOrUpdate($ct, $anak);
     //synchornize multiple total and sequence multiview
     FormMultiHelper::synchronize($fm['no_lka']);
     //notifikasi
     NotifikasiFormLKAHelper::updateNotif($form->id);
     $lka = base64_encode($fm['no_lka']);
     Session::flash('message', "Form with No LKA {$form->no_lka} has been updated!");
     return Redirect::to('dash/formka1multi/view/' . $lka);
 }
 public function update()
 {
     $fm = Input::get('form');
     $an = Input::get('anak');
     $fsk = Input::get('fisik');
     $kl = Input::get('keluarga');
     $ayh = Input::get('ayah');
     $ib = Input::get('ibu');
     $ms = Input::get('masalah');
     $ps = Input::get('psiko');
     $pn = Input::get('penanganan');
     $as = Input::get('assesor');
     $sign = ['penanganan' => $pn, 'assesor' => $as];
     $sign = json_encode($sign);
     $fm['sign'] = $sign;
     // inject lka if not set
     if (!isset($fm['no_lka'])) {
         $form = Anak::find($an['id'])->form->first();
         $fm['no_lka'] = $form->no_lka;
     }
     // inject tanggal if not set
     if (!isset($fm['tanggal'])) {
         $fm['tanggal'] = date('Y-m-d');
     }
     $form = FormDAO::saveOrUpdate($fm);
     $anak = AnakDAO::saveOrUpdate($an);
     $fisik = GambaranFisikDAO::saveOrUpdate($fsk, $anak);
     $masalah = IdentifikasiMasalahDAO::saveOrUpdate($ms, $anak);
     $psiko = KondisiPsikososialDAO::saveOrUpdate($ps, $anak);
     $keluarga = KeluargaDAO::saveOrUpdate($kl, $anak);
     $ayah = AyahDAO::saveOrUpdate($ayh, $keluarga);
     $ibu = IbuDAO::saveOrUpdate($ib, $keluarga);
     $form = Form::find($form->id);
     //notifikasi
     FormKA4DisposisiHelper::updateNotif($form->id);
     Session::flash('message', "Form with No LKA {$form->no_lka} has been updated!");
     return Redirect::to('/dash/formka4');
 }