Ejemplo n.º 1
0
 public static function addNotif($form_id)
 {
     //notifikasi
     $user = Auth::user();
     $user_from_id = $user->id;
     $user_to = User::where('level', '=', 'admin')->get();
     foreach ($user_to as $u) {
         NotifikasiFormHelper::formCreate($user_from_id, $u->id, $form_id);
     }
 }
 public static function formCreate($form_id)
 {
     $user_from_id = Auth::user()->id;
     $form = Form::find($form_id);
     $fa = $form->anak->first();
     $anak = Anak::find($fa->id);
     $formLKA = $anak->form->first();
     $user = $formLKA->user->first();
     $uf_id = $user_from_id;
     $ut_id = $user->id;
     NotifikasiFormHelper::formCreate($uf_id, $ut_id, $form_id);
 }
Ejemplo n.º 3
0
 public static function addNotif($form_id)
 {
     //notifikasi ke admin
     $user = Auth::user();
     $user_from_id = $user->id;
     $user_to = User::where('level', '=', 'admin')->get();
     foreach ($user_to as $u) {
         NotifikasiFormHelper::formCreate($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::formCreate($user_from_id, $user_to_id, $form_id);
         }
     }
 }