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

class route_model extends CI_Model 
{

	function __construct()
    {
        parent::__construct();
        
    }
    function allroute_details(){ 
        $this->db->select('name,id,');
        $this->db->from('route');
        $this->db->where('status','1');
        $this->db->where('is_delete','0');
        $this->db->order_by("name", "asc");
        $query=$this->db->get();
        return $query->result_array();
    }
   
    function addroute($data){
        $this->db->insert('route', $data);   
        return $this->db->insert_id();
    }
    function editroute($data){
        $this->db->update("route", $data, array('id' => $data['id']));
        return $this->db->affected_rows();
    }
    function single_route_details($routeid){ 
        $this->db->select('*');
        $this->db->from('route');
        $this->db->where('status','1');
        $this->db->where('is_delete','0');
        $this->db->where("id", $routeid);
        $query=$this->db->get();
        return $query->row_array();
    }
    
       
}
?>
