<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
	class Home_model extends CI_Model
	{
		function __construct()
		{
			parent::__construct();
		}
		
		function jenis_layanan($id_jenis_layanan){
			return $this->db->query("SELECT * FROM ptsp_layanan WHERE id_jenis_layanan='$id_jenis_layanan' ")->row();
		}
		
		function data_layanan($id_jenis_layanan){
			return $this->db->query("SELECT * FROM ptsp_layanan WHERE id_jenis_layanan='$id_jenis_layanan' ")->result();
		}
		
		function insert($data)
		{
			$this->db->insert('ptsp_pengunjung', $data);
		}
		
		function update($id, $data)
		{
			$this->db->where('id', $id);
			$this->db->update('ptsp_pengunjung', $data);
		}
		
		function get_layanan_id($id,$p_id){
			return $this->db->query("SELECT * FROM ptsp_pengunjung WHERE md5(id) = '$id' AND p_id = '$p_id' ")->row();
		}
		
		function ptsp_pengunjung_id($id,$p_id){
			return $this->db->query("SELECT * FROM ptsp_pengunjung WHERE id = '$id' AND p_id = '$p_id' ")->row();
		}
		
		function ptsp_hubungi_id($bantuan){
			return $this->db->query("SELECT * FROM ptsp_hubungi WHERE id = '$bantuan'")->row();
		}
		
		function ptsp_hubungi_id2($bantuan){
			return $this->db->query("SELECT * FROM ptsp_hubungi_kesekretariatan WHERE id = '$bantuan'")->row();
		}
		
	}
