<?php 
defined('BASEPATH') OR exit('No direct script access allowed');

class AuthModel extends CI_Model {

    public function __construct(){
		parent::__construct();
		$this->load->database();
    }
    
    var $auth_key = "simplerestapi";

	public function get_row($where)
    {
		$sql = "select * from admin_tb".$where;
		$query = $this->db->query($sql);
		return $query->row_array();
	}

	public function update_row($update_data, $id)
	{
		$this->db->update('admin_tb', $update_data, $id);
	}	

	public function get_guest_row($where)
    {
		$sql = "select * from guest_tb".$where;
	
		$query = $this->db->query($sql);
		return $query->row_array();
	}

	public function insert_guest_row($insert_data)
	{
		$this->db->insert('guest_tb', $insert_data);
		$insert_id = $this->db->insert_id();
		return $insert_id;
	}

	public function update_guest_row($update_data, $id)
	{
		$this->db->update('guest_tb', $update_data, $id);
		
	}	
}