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

class Services_model extends CI_Model {

    public function __construct(){
        parent::__construct();
    }


    public function get_all_services(){
        $query = $this->db->get('services');
        return $query->result();
    }

    public function get_service_by_id($id){
        $query = $this->db->get_where('services', array('id' => $id));
        return $query->result();
    }

    public function get_service_name_by_id($id){
        $query = $this->db->get_where('services', array('id' => $id));
        $service = $query->result();
        return $service->name;
    }

    public function count_all()
    {
        return $this->db->count_all('services');
    }

    public function count_row_for_query($query)
    {
        return $query->num_rows();
    }
    
}

?>