Ejemplo n.º 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;
 }
Ejemplo n.º 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');
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 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');
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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++;
     }
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 9
0
 public function postTable()
 {
     $filters = [];
     if ($gel = Gelombang::getActive()) {
         $filters['gelombang_id'] = $gel->id;
     }
     $this->setupTable('Kuesioner', $this->structs, $filters);
     return parent::postTable();
 }
Ejemplo n.º 10
0
 public function getGelombang($periode_id)
 {
     return \App\Models\Gelombang::options('label', 'id', ['filters' => ['periode_id' => $periode_id]]);
 }
Ejemplo n.º 11
0
 public function getAktivasi($id)
 {
     $gel = Gelombang::switchActive($id);
     return response()->json(['status' => true]);
 }
Ejemplo n.º 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');
     });
 }