Пример #1
0
 public function init()
 {
     $gel = Gelombang::getActive();
     $gelTitle = $gel ? ' - Gelombang ' . $gel->label . ' ' . $gel->periode->tahun : '';
     $this->setTitle('Rekapitulasi Nilai' . $gelTitle);
     $this->data['gel'] = $gel;
 }
Пример #2
0
 public function getIndex()
 {
     if (\Request::ajax()) {
         $data = ['group' => GroupNilai::all(), 'gelombang' => Gelombang::getActive()];
         return $this->render('backend.pages.dashboard', $data);
     }
     return view('frontend.home');
 }
Пример #3
0
 public function getReload()
 {
     $gel = Gelombang::getActive();
     $this->setTitle('Pengolahan Nilai', 'Pre-Test & Post-Test');
     $data = ['gelombang' => $gel, 'groupNilai' => GroupNilai::all(), 'peserta' => Participation::whereHas('kelas', function ($query) use($gel) {
         $query->where('gelombang_id', $gel->id);
     })->get()];
     return $this->render('backend.pages.olahdata.prepost.prepost', $data);
 }
Пример #4
0
 public function getDetailChart($type)
 {
     $data = ['chartType' => ''];
     $g = Gelombang::getActive();
     if ($type == 'fasilitas') {
         $data['kuesioner'] = $g->getFasilitas();
     } else {
         $data['kuesioner'] = $g->getSmileyFace();
     }
     $data['chartType'] = $type == 'fasilitas' ? "Detail Penilaian Fasilitas" : "Detail Smiley Face";
     return view('backend.pages.detail-chart', $data)->render();
 }
Пример #5
0
 public function getI($id, $i)
 {
     $gel = Gelombang::getActive();
     $k = $gel->indikatorG()->where('indikator_id', $id)->first();
     if (!$k) {
         $k = $gel->indikator()->attach($id, ['status' => $i]);
     } else {
         $k->status = $i;
         $k->save();
     }
     return $this->redirectAjax('olahdata/materi');
 }
Пример #6
0
 public function getPerHari($hari)
 {
     $gelombang = Gelombang::getActive();
     $gelTitle = $gelombang ? ' - ' . $gelombang->label : '';
     $this->setTitle('Pengolahan Nilai', 'Nilai Harian' . $gelTitle);
     $data = ['gelombang' => $gelombang, 'hari' => $hari, 'groupNilai' => GroupNilai::all(), 'peserta' => Participation::whereHas('kelas', function ($query) use($gelombang) {
         $query->where('gelombang_id', $gelombang->id);
     })->get()];
     if ($hari != -1) {
         return $this->render('backend.pages.olahdata.harian.perhari', $data);
     }
     return $this->render('backend.pages.olahdata.harian.total', $data);
 }
Пример #7
0
 public static function newKuesioner($data)
 {
     $k = new static();
     $k->title = $data['title'];
     $k->user_id = auth()->user()->id;
     $k->gelombang_id = Gelombang::getActive()->id;
     $k->save();
     $i = 1;
     foreach ($data['pertanyaan'] as $q) {
         $p = new KuesionerItem();
         $p->label = $q;
         $p->type = 'input';
         $p->priority = $i;
         $k->items()->save($p);
         $i++;
     }
 }
Пример #8
0
 public function postTable()
 {
     $filters = [];
     $user = auth()->user();
     $filters['@or'] = function ($query) use($user) {
         $gelombang = Gelombang::whereHas('kelas', function ($query2) use($user) {
             $query2->whereHas('siswa', function ($q2) use($user) {
                 $q2->where('user_id', $user->id);
             });
         })->get();
         if (sizeof($gelombang) > 0) {
             foreach ($gelombang as $g) {
                 $query->orWhere('gelombang_id', $g->id);
             }
         } else {
             $query->where('gelombang_id', -1);
         }
     };
     $this->setupTable('Kuesioner', $this->structs, $filters);
     return parent::postTable();
 }
Пример #9
0
 public function postTable()
 {
     $filters = [];
     if ($gel = Gelombang::getActive()) {
         $filters['gelombang_id'] = $gel->id;
     }
     $this->setupTable('Kuesioner', $this->structs, $filters);
     return parent::postTable();
 }
Пример #10
0
 public function getGelombang($periode_id)
 {
     return \App\Models\Gelombang::options('label', 'id', ['filters' => ['periode_id' => $periode_id]]);
 }
Пример #11
0
 public function getAktivasi($id)
 {
     $gel = Gelombang::switchActive($id);
     return response()->json(['status' => true]);
 }
Пример #12
0
 public function sendEmail($mail, $gid)
 {
     $data = ['g' => Gelombang::find($gid)];
     \Mail::send('backend.pages.undangan.format-undangan', $data, function ($m) use($mail) {
         $m->from('*****@*****.**', 'SimonevDiklat Auto Mail');
         $m->to($mail)->subject('Verifikasi Akun');
     });
 }