コード例 #1
0
 public function remove($id)
 {
     try {
         $this->_db->beginTransaction();
         $data = $this->select('SELECT id FROM ' . $this->_table . ' WHERE id<>' . $id);
         if (count($data) == 0) {
             return;
         }
         $pengganti = $data[0]['id'];
         //ubah pic assesment ke pic admin yg ada
         $asses = new TesAssesment($this->registry);
         $asses->select('UPDATE tes_asses SET metode=' . $pengganti . ' WHERE 1');
         $this->_db->commit();
     } catch (PDOException $ex) {
         //Something went wrong rollback!
         $db->rollBack();
         echo $ex->getMessage();
     }
     $this->_db->delete($this->_table, 'id=' . $id);
 }
コード例 #2
0
 public function laporan($id_asses)
 {
     $assesment = new Assesment($this->registry);
     $data = $assesment->get($id_asses);
     $this->view->data_asses = $data;
     $tesasses = new TesAssesment($this->registry);
     $data = $tesasses->get_join($id_asses);
     $this->view->data_jenis_tes_asses = $data;
     $this->view->jumlah_jenis_tes_asses = count($data);
     $nilaites = new NilaiTes($this->registry);
     $data = $nilaites->get_nilai_assesment($id_asses);
     //var_dump($data);
     $this->view->data = $data;
     $this->view->jumlah_data = count($data);
     $this->view->aksi = 'report';
     $this->view->render('assesment/laporan');
 }
コード例 #3
0
 public function hapusTesAsses($id)
 {
     $tesa = new TesAssesment($this->registry);
     $tesa->remove($id);
     header('location:' . URL . 'referensi/tesAsses');
 }
コード例 #4
0
ファイル: NilaiTes.php プロジェクト: beruxganteng/apnthc
 public function get_nilai_assesment($id_asses)
 {
     $return = array();
     // TODO
     // dapatkan peserta
     $peserta = new Peserta($this->registry);
     $data = $peserta->get_peserta_assesment($id_asses);
     //id peserta, nama, nip, kantor
     foreach ($data as $key => $value) {
         $return[$value['id']]['id'] = $value['id'];
         $return[$value['id']]['nama'] = $value['pegawai'];
         $return[$value['id']]['nip'] = $value['nip'];
         $return[$value['id']]['kantor'] = $value['unit'];
     }
     // jenis tes assesment
     $tesasses = new TesAssesment($this->registry);
     $data_tes_asses = $tesasses->get_join($id_asses);
     foreach ($return as $key => $value) {
         $data = $this->get_nilai_peserta($id_asses, $value['id']);
         $tes_asses = '';
         $i = 0;
         //data nilai
         foreach ($data as $k => $v) {
             //=============
             $sub_total = 0;
             // TODO cari jumlah HC tidak lulus
             // dan status kelulusan
             if ($v['id_tes_asses'] != $tes_asses) {
                 $tes_asses = $v['id_tes_asses'];
                 $return[$value['id']]['nilai'][$i] = array();
                 $return[$value['id']]['nilai'][$i]['id_tes_asses'] = $v['id_tes_asses'];
                 $return[$value['id']]['nilai'][$i]['singkat'] = $v['singkat'];
                 $return[$value['id']]['nilai'][$i]['nilai'] = $v['nilai'];
                 $return[$value['id']]['nilai'][$i]['bobot_tes'] = $v['bobot_tes'];
                 $return[$value['id']]['nilai'][$i]['nilai_bobot'] = $v['nilai_bobot'];
                 $return[$value['id']]['nilai'][$i]['pass_grade'] = $v['pass_grade'];
                 $lulus = FALSE;
                 if ((double) $v['nilai'] >= (double) $v['pass_grade']) {
                     $lulus = TRUE;
                 }
                 $return[$value['id']]['nilai'][$i]['lulus'] = $lulus;
                 //var_dump($return[$value['id']]['nama']);
                 //var_dump($return[$value['id']]['nilai'][$i]);
                 $i++;
             }
             //===============
         }
     }
     // join nilai dari sub tes ke jenis tes dan cek passing grade
     // nilai tsb dikalikan bobot jenis tes
     // nilai terbobot dijumlahkan
     // nilai penjumlahan terbobot (HC) kalikan 60% -> fix ditetapkan
     // nilai SC kalikan 40%
     // jumlahkan nilai HC dan SC sebagai nilai akhir
     // simpulkan
     //var_dump($return);
     return $return;
 }