예제 #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');
 }
예제 #2
0
 public static function update($an)
 {
     $anak = Anak::find($an['id']);
     $anak = AnakDAO::exchangeArray($anak, $an);
     $anak_desa = Desa::find($an['desa']);
     $anak->desa()->associate($anak_desa);
     $anak->update();
     return $anak;
 }
예제 #3
0
 public function delete($id)
 {
     //notifikasi
     NotifikasiFormLKAHelper::deleteNotif($id);
     $fm = Form::find($id);
     $anak = $fm->anak->first();
     $forms = $anak->form;
     //delete semua form yang berkaitan
     foreach ($forms as $form) {
         FormDAO::delete($form->id);
     }
     $pendampingan = $anak->pendampingan;
     if ($pendampingan) {
         foreach ($pendampingan as $pen) {
             PendampinganDAO::delete($pen->id);
         }
     }
     $files = $anak->files;
     if ($files) {
         foreach ($files as $fl) {
             FilesDAO::delete($fl->id);
         }
     }
     $pelapor = $anak->pelapor->first();
     if ($pelapor) {
         $pelapor->delete();
     }
     $keluarga = $anak->keluarga;
     if ($keluarga) {
         $keluarga->delete();
     }
     $fisik = $anak->gambaran_fisik;
     if ($fisik) {
         $fisik->delete();
     }
     $identifikasi = $anak->identifikasi_masalah;
     if ($identifikasi) {
         $identifikasi->delete();
     }
     $psiko = $anak->kondisi_psikososial;
     if ($psiko) {
         $psiko->delete();
     }
     $contact = $anak->contact_person;
     if ($contact) {
         $contact->delete();
     }
     $jenis = $anak->jenis_kasus;
     if ($jenis) {
         foreach ($jenis as $jn) {
             if ($jn->other == "T") {
                 JenisKasusDAO::delete($jn->id);
             }
         }
     }
     //delete data anak
     AnakDAO::delete($anak->id);
     if ($fm) {
         Session::flash('message', "Form with {$id} has been deleted!");
     } else {
         Session::flash('message', "Error, Form with {$id} not found!");
     }
     return Redirect::to('/dash/formka1');
 }
예제 #4
0
 public function delete($id, $enc_lka)
 {
     //notifikasi
     NotifikasiFormLKAHelper::deleteNotif($id);
     $fm = Form::find($id);
     $anak = $fm->anak->first();
     $forms = $anak->form;
     //delete semua form yang berkaitan
     foreach ($forms as $form) {
         FormDAO::delete($form->id);
     }
     //delete data anak
     AnakDAO::delete($anak->id);
     $lka = base64_decode($enc_lka);
     //synchornize multiple total and sequence multiview
     FormMultiHelper::synchronize($lka);
     if ($fm) {
         Session::flash('message', "Form with {$id} has been deleted!");
     } else {
         Session::flash('message', "Error, Form with {$id} not found!");
     }
     return Redirect::to('/dash/formka1multi/view/' . $enc_lka);
 }
예제 #5
0
 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');
 }
예제 #6
0
 public function delete($id)
 {
     //notifikasi
     NotifikasiFormLKAHelper::deleteNotif($id);
     $fm = Form::find($id);
     $anak = $fm->anak->first();
     $forms = $anak->form;
     //delete semua form yang berkaitan
     foreach ($forms as $form) {
         FormDAO::delete($form->id);
     }
     //delete data anak
     AnakDAO::delete($anak->id);
     if ($fm) {
         Session::flash('message', "Form with {$id} has been deleted!");
     } else {
         Session::flash('message', "Error, Form with {$id} not found!");
     }
     return Redirect::to('/dash/formka2');
 }