Ejemplo n.º 1
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 = FormKA7DisposisiHelper::getDisposisiKA5($form_id);
     var_dump($disposisi);
     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.º 2
0
 public function delete($id)
 {
     //notifikasi
     FormKA7DisposisiHelper::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 == "ka7") {
             FormDAO::delete($form->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/formka7');
 }