Ejemplo n.º 1
0
 public function test()
 {
     $year = date('Y');
     $c = FormKA6DisposisiHelper::count($year);
     $get = FormKA6DisposisiHelper::getDisposisiForm($year);
     echo $c;
     var_dump($get);
 }
Ejemplo n.º 2
0
 public static function deleteNotif($form_id)
 {
     //notifikasi
     $user = Auth::user();
     $user_from_id = $user->id;
     $user_to = User::where('level', '=', 'admin')->get();
     foreach ($user_to as $u) {
         NotifikasiFormHelper::formDelete($user_from_id, $u->id, $form_id);
     }
     $disposisi = FormKA6DisposisiHelper::getDisposisiKA5($form_id);
     foreach ($disposisi as $dis) {
         if ($dis->id != $user_from_id) {
             //jika bukan diri sendiri
             $user_to_id = $dis->id;
             NotifikasiFormHelper::formDelete($user_from_id, $user_to_id, $form_id);
         }
     }
 }
Ejemplo n.º 3
0
 public function delete($id)
 {
     //notifikasi
     FormKA6DisposisiHelper::deleteNotif($id);
     $fm = Form::find($id);
     $anak = $fm->anak->first();
     $forms = $anak->form;
     //delete semua form yang berkaitan
     foreach ($forms as $form) {
         if ($form->nama == "ka6" || $form->nama == "ka7") {
             FormDAO::delete($form->id);
         }
     }
     //delete data pendampingan
     $pendamping = $anak->pendampingan;
     foreach ($pendamping as $pd) {
         PendampinganDAO::delete($pd->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/formka6');
 }