<?php

class Datamodel extends CI_Model {

 function __construct() {
        parent::__construct();
        $this->load->database('');
    }
//welcome note

   function get_welcome() {
        $query = $this->db->get('welcome_note');
        return $query->result();
    }

//projects

   function get_projects() {
        $query = $this->db->get('projects');
        return $query->result();
    }
    
    
//seo

 function get_seo() {
       $result = $this->db->where('page_name', 'home')->get('seo')->first_row();
        return $result;
    }
    
function get_seo_aboutus() {
       $result = $this->db->where('page_name', 'aboutus')->get('seo')->first_row();
        return $result;
    }   
    
function get_seo_bollards() {
       $result = $this->db->where('page_name', 'bollards')->get('seo')->first_row();
        return $result;
    }        

function get_seo_tactileindicators() {
       $result = $this->db->where('page_name', 'tactileindicators')->get('seo')->first_row();
        return $result;
    } 


function get_seo_vinylproducts() {
       $result = $this->db->where('page_name', 'vinylproducts')->get('seo')->first_row();
        return $result;
    } 
    
    
function get_seo_stairnoses() {
       $result = $this->db->where('page_name', 'stairnoses')->get('seo')->first_row();
        return $result;
    }     
    
function get_seo_trafficsafetyproducts() {
       $result = $this->db->where('page_name', 'trafficsafetyproducts')->get('seo')->first_row();
        return $result;
    }     

function get_seo_gallery() {
       $result = $this->db->where('page_name', 'gallery')->get('seo')->first_row();
        return $result;
    } 
    
function get_seo_contactus() {
       $result = $this->db->where('page_name', 'contactus')->get('seo')->first_row();
        return $result;
    }  
    
    
//seo-posters

   function get_seo_posters() {
       
        $this->db->select("*");
        $this->db->from("smo-posters");
        $this->db->order_by("id", "desc");
        $query = $this->db->get();
        return $query->result();
        
    }    


//bollards

   function get_bollards($id) {
       $result = $this->db->where('pid', $id)->get('products')->first_row();
        return $result;
    }


 //wheel stopper

   function get_wheel($id) {
       $result = $this->db->where('pid', $id)->get('products')->first_row();
        return $result;
    }   


   //sub products

   function get_subpdt($id) {
       $result = $this->db->where('pid', $id)->get('sub_products')->first_row();
        return $result;
    }   
    
   function get_subpdts($id) {
       $result = $this->db->where('sid', $id)->get('sub_products')->first_row();
        return $result;
    }   


     function get_prdtdetail($id) {
       $result = $this->db->where('sid', $id)->get('sub_product_details')->first_row();
        return $result;
    }   
    
    function get_imgs($id) {
      
       
       $this->db->select("*");
        $this->db->from("product_moreimages");
        $this->db->where('pid', $id);
        $this->db->order_by("mid", "desc");
        $query = $this->db->get();
        return $query->result();
    }    


}//main loop