<?php
class Services_model extends CI_Model
{
  function __construct()
  {
    parent::__construct();
  }

  public function select_services($columns='*',$data='')
  {
    $this->db->select($columns)->from('service_departments s');
    if(!empty($data)){
      $this->db->where($data);
    }
    $this->db->where('s.delete_status',0);
    $this->db->order_by('s.service_id','desc');
    $query = $this->db->get();
    return $query;
  }
  public function insert_service($data){
    $query = $this->db->insert('service_departments', $data);
    $result=array();
    $result['insert_id']=$this->db->insert_id();
    $result['status']=$query;
    return $result;
  }
  public function update_service($data)
  {
    $this->db->where('service_id', $data['service_id']);
    $query=$this->db->update('service_departments', $data);
    return $query;
  }


  public function select_service_types($columns='*',$data='')
  {
    $this->db->select($columns)->from('service_types s');
    if(!empty($data)){
      $this->db->where($data);
    }
    $query = $this->db->get();
    return $query;
  }
  public function insert_service_type($data){
    $query = $this->db->insert('service_types', $data);
    $result=array();
    $result['insert_id']=$this->db->insert_id();
    $result['status']=$query;
    return $result;
  }
  public function update_service_type($data)
  {
    $this->db->where('stype_id', $data['stype_id']);
    $query=$this->db->update('service_types', $data);
    return $query;
  }
}
?>
