load->database(); $this->load->library('pdf'); } //ambil data data public function listing() { $this->db->select('*'); $this->db->from('v_rpt_data_pengumuman'); $this->db->order_by('tanggal_pengumuman','desc'); $query = $this->db->get(); return $query->result(); } //ambil detail data data public function detail($no_pendaftaran) { $this->db->select('*'); $this->db->from('v_rpt_data_pengumuman'); //where $this->db->where('no_pendaftaran', $no_pendaftaran); $this->db->order_by('no_pendaftaran','desc'); $query = $this->db->get(); return $query->row(); } // Total nilai lulus public function lulus() { $this->db->select('*'); $this->db->from('v_rpt_data_pengumuman'); //where $this->db->where('status','LULUS'); $this->db->order_by('no_pendaftaran','desc'); $query = $this->db->get(); return $query->result(); } //ambil detail data data public function setting() { $this->db->select('*'); $this->db->from('setting'); $this->db->order_by('id','desc'); $query = $this->db->get(); return $query->result(); } //hitung total data public function total() { $this->db->select('COUNT(*) AS total'); $this->db->from('v_rpt_data_pengumuman'); //where $this->db->where('status','LULUS'); $this->db->order_by('no_pendaftaran','desc'); $query = $this->db->get(); return $query->row(); } //fungsi edit public function edit($data) { $this->db->where('no_pendaftaran', $data['no_pendaftaran']); $this->db->update('pengumuman', $data); } //fungsi delete public function delete($data) { $this->db->where('no_pendaftaran', $data['no_pendaftaran']); $this->db->delete('pengumuman', $data); } //fungsi delete public function delete2($data2) { $this->db->where('userid', $data2['userid']); $this->db->delete('user2', $data2); } //tambah user public function tambah($data) { $this->db->insert('pengumuman', $data); } //tambah user public function tambah2($data2) { $this->db->insert('user2', $data2); } }