Exemplo n.º 1
0
 protected function processDatatables($datatables)
 {
     $id = auth()->user()->pns ? auth()->user()->pns->id : null;
     return $datatables->editColumn('kuantitas', function ($data) {
         return $data->kuantitas . ' ' . $data->satuan_kuantitas;
     })->editColumn('kualitas', function ($data) {
         return $data->kualitas . ' ' . $data->satuan_kualitas;
     })->editColumn('waktu', function ($data) {
         return $data->waktu . ' ' . $data->satuan_waktu;
     })->editColumn('biaya', function ($data) {
         return $data->biaya . ' ' . $data->satuan_biaya;
     })->addColumn('penilaian_kuantitas', function ($data) {
         if ($data->penilaian) {
             return $data->penilaian->kuantitas . ' ' . $data->satuan_kuantitas;
         }
         return '-';
     })->addColumn('penilaian_kualitas', function ($data) {
         if ($data->penilaian) {
             return $data->penilaian->kualitas . ' ' . $data->satuan_kualitas;
         }
         return '-';
     })->addColumn('penilaian_waktu', function ($data) {
         if ($data->penilaian) {
             return $data->penilaian->waktu . ' ' . $data->satuan_waktu;
         }
         return '-';
     })->addColumn('penilaian_biaya', function ($data) {
         if ($data->penilaian) {
             return $data->penilaian->biaya . ' ' . $data->satuan_biaya;
         }
         return '-';
     })->addColumn('nomor', function ($data) {
         return AutoNumbering::getNumber();
     })->addColumn('nilai', function ($data) {
         return $data->nilai ?: '-';
     })->addColumn('keterangan', function ($data) {
         return $data->getKeterangan($data->nilai);
     })->editColumn('menu', function ($data) use($id) {
         if (!$id) {
             return '-';
         }
         if ($data->skp->pns->id == $id) {
             return '<a href="' . action($this->baseClass . '@getEdit', [$data->{$this->model->getKeyName()}]) . '" class="btn btn-small btn-link"><i class="fa fa-xs fa-pencil"></i> Edit</a> ' . Form::open(['style' => 'display: inline!important', 'method' => 'delete', 'action' => [$this->baseClass . '@deleteHapus', $data->{$this->model->getKeyName()}]]) . '  <button type="submit" onClick="return confirm(\'Yakin mau menghapus?\');" class="btn btn-small btn-link"><i class="fa fa-xs fa-trash-o"></i> Delete</button></form>';
         }
         return '<a href="/penilaian/' . $data->id . '   " class="btn btn-small btn-link"><i class="fa fa-xs fa-check"></i> Beri Nilai</a>';
     });
 }
Exemplo n.º 2
0
 protected function processDatatables($datatables)
 {
     return $datatables->addColumn('nomor', function ($data) {
         return AutoNumbering::getNumber();
     })->addColumn('pns', function ($data) {
         $pns = $data->targetKerja->skp->pns;
         return $pns->nama . ' - ' . $pns->nip;
     })->addColumn('tugas', function ($data) {
         return $data->targetKerja->tugas;
     })->addColumn('angka_kredit', function ($data) {
         return $data->targetKerja->angka_kredit;
     })->addColumn('total_nilai', function ($data) {
         return $data->total_nilai;
     })->addColumn('keterangan', function ($data) {
         return $data->getKeterangan($data->targetKerja->nilai);
     })->editColumn('nilai', function ($data) {
         return $data->targetKerja->nilai;
     });
 }