<?php

class M_verify extends CI_Model{

	

	function view($unik)

		{  

			$this->db->select('*');

			$this->db->where('unik', $unik);

			$this->db->where('sts',1);

			$this->db->join('tbl_acara','tbl_registrasi.id_acara=tbl_acara.id_acara','left');

			$query = $this->db->get('tbl_registrasi');

			return $query->row();

		}

		

	function cari()

		{  

			$unik=$this->input->post('no_sertifikat');

			

			$this->db->select('*');

			$this->db->where('unik', $unik);
			$this->db->or_where('no_register', $unik);

			$this->db->where('sts',1);

			$this->db->join('tbl_acara','tbl_registrasi.id_acara=tbl_acara.id_acara','left');

			$query = $this->db->get('tbl_registrasi');

			return $query->row();

		}

		function cari_sert()

		{  

			$cari=$this->input->post('cari');

			$this->db->select('*');
			$this->db->like('nama',$cari);
			$this->db->or_like('nip',$cari);
			$this->db->or_like('nuptk',$cari);
			$this->db->join('tbl_acara','tbl_registrasi.id_acara=tbl_acara.id_acara','left');
			$this->db->where('tbl_registrasi.sts',1);
			$query = $this->db->get('tbl_registrasi');
			return $query->result();

		}

}

?>