<?php

class Aspek_kinerja_m extends CI_Model {

    public function data() {
        $data       = [];
        $actual_arr = $this->input->post('actual');
        $id_arr     = $this->input->post('id');
        foreach($id_arr as $key => $id) {
            $data[] = [
                'id_pi_trx'            => $id,
                'actual_poin_approval' => $actual_arr[$key]
            ];
        }
        return $data;
    }

    public function validasi() {
        $this->db->where('actual_poin_approval', 0);
        $this->db->where("id_karyawan", htmlentities($this->input->post('karyawan')));
        $this->db->where("tahun", htmlentities($this->input->post('tahun')));
        $this->db->where("bulan", htmlentities($this->input->post('bulan')));
        return $this->db->count_all_results('kpi_aspek_kinerja_trx');
    }

}