Exemplo n.º 1
0
 public function postPrintLaporan()
 {
     $pdf = new HTML2PDF();
     $data = ['num' => 1, 'diklat' => Diklat::find(request()->get('diklat')), 'periode' => Periode::find(request()->get('periode')), 'gelombang' => Gelombang::find(request()->get('gelombang'))];
     // Data Peserta
     $html = view('backend.pages.reports.periode', $data)->render();
     $pdf->writeHTML($html);
     // Data PrePost
     $html = view('backend.pages.reports.prepost', $data)->render();
     $pdf->writeHTML($html);
     // Data Kuesioner
     $html = view('backend.pages.reports.kuesioner', $data)->render();
     $pdf->writeHTML($html);
     $pdf->Output();
 }
Exemplo n.º 2
0
 public function responseEdit($id)
 {
     $response = parent::responseEdit($id);
     $validation = $response['validation'];
     unset($response['validation']);
     if ($response['initial'] == true) {
         // Pas form baru kebuka
         $response['errors'] = [];
         $d = Gelombang::find($id);
         $response['fields'] = $d->toArray();
         $response['fields']['periode_id'] = $d->periode_id;
         $response['fields']['diklat_id'] = $d->periode->diklat_id;
         $response['output'] = view($this->formView, $response)->render();
     } elseif ($validation->passes()) {
         // Pas validasi berhasil
         $response['status'] = true;
         Gelombang::addOrModify($response['data'], $id);
     } else {
         // Pas validasi gagal
         $response['fields'] = $response['data'];
         $response['output'] = view($this->formView, $response)->render();
     }
     return $response;
 }
Exemplo n.º 3
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');
     });
 }