<?php

class View_data extends CI_Model
{
    
    function getprofile()
    {
        return $this->db->select('*')
                    ->from('company_profile')
                    ->get()->result();
    }
     function get_gallery_id($gt_id)
   {
  return $this->db->select('*')
                   ->from('gallery')
              ->where('g_status','1')
                 ->where('gt_id',$gt_id)
          
          ->get()->result();
   }
    function get_gtype_home()
   {
  return $this->db->select('*')
                    ->from('gallery_type')
          ->where('gt_status','1')
          ->where('gt_type !=','Other')
          ->order_by('gt_id','DESC')
          ->get()->result();
   }
   function get_gtype_id($gt_id)
   {
  return $this->db->select('*')
                    ->from('gallery_type')
                     ->where('gt_id',$gt_id)
          ->where('gt_status','1')
          ->get()->result();
   }
    function get_service_join($sid){
    $this->db->select('s.*');
      $this->db->from('service s');
      //$this->db->join('product p', 'p.pt_id = s.pt_id', 'inner');
      $this->db->where('s.s_id', $sid);
      $this->db->order_by('s.s_id', 'ASE');
      $query = $this->db->get();    
      return $query->result();
    }

    
    
    function get_jobs()
    {
        return $this->db->select('*')
                    ->from('jobs')
                    ->order_by('date', 'DESC')
                    ->get()->result();
    }
    function getslider()
    {
        return $this->db->select('*')
                    ->from('slider')
                    ->get()->result();
    }
	function about()
    {
        return $this->db->select('*')
                    ->from('about')                    
                    ->get()->result();
    
    }
    function infrastructure()
    {
        return $this->db->select('*')
                      ->from('articles')
          ->where('a_title','Infrastructure')
                    ->get()->result();
    
    }
    function project_gallery()
    {
        return $this->db->select('*')
                      ->from('project_gallery')
          ->where('g_status','1')
->order_by('g_id','RANDOM')
          ->limit('8')
                    ->get()->result();
    
    }

    
     function terms_conditions()
    {
        return $this->db->select('*')
                      ->from('articles')
          ->where('a_title','Terms')
                    ->get()->result();
    
    }

     function disclaimer()
    {
        return $this->db->select('*')
                      ->from('articles')
          ->where('a_title','Disclaimer')
                    ->get()->result();
    
    }

    
	function get_vission()
    {
        return $this->db->select('*')
                    ->from('pages')
					->where('p_name','Vission')
                    ->get()->result();
    
    }
	function get_company()
    {
        return $this->db->select('*')
                    ->from('pages')
					->where('p_name','Company Profile')
                    ->get()->result();
    
    }
	function getinfra()
   {
    return $this->db->select('*')                    
                    ->from('infrastucture')
					->where('in_status','1')
                    ->get()->result();
   }
   
	 function getinfra_id($in_id)
   {
    return $this->db->select('*')                    
                    ->from('infrastucture')
					->where('in_status','1')
					->where('in_id',$in_id)
                    ->get()->result();
   }
     function get_gallery()
   {
	return $this->db->select('*')
                    ->from('gallery')
					->where('g_status','1')
					->get()->result();
   }
   function get_gtype()
   {
	return $this->db->select('*')
                    ->from('gallery_type')
					->where('gt_status','1')
					->get()->result();
   }
    function get_video()
   {
	return $this->db->select('*')
                ->from('video')
				->where('v_status','1')
				
				->get()->result();
   }
   function get_video_home()
   {
  return $this->db->select('*')
                ->from('video')
        ->where('v_status','1')
        ->order_by('v_id','RANDOME')
        ->limit(4)
        ->get()->result();
   }
     function get_testmonial()
   {
	return $this->db->select('*')
                ->from('testimonials')
				->where('t_status','1')
				
				->get()->result();
   }
    function get_testmonial_home()
   {
  return $this->db->select('*')
                ->from('testimonials')
        ->where('t_status','1')
        ->order_by('t_id', 'RANDOM')
        ->limit('6')
        ->get()->result();
   }
 function get_client_home()
   {
  return $this->db->select('*')
                ->from('clients')
        ->where('cl_status','1')
        ->order_by('cl_id', 'RANDOM')
        ->limit('12')
        ->get()->result();
   }

   function get_clients()
   {
  return $this->db->select('*')
                    ->from('clients')
          ->where('cl_status','1')
          ->get()->result();
   }
   function get_pcategory()
   {
	     return $this->db->select('pt_name, pt_id')
                ->from('product')
				->where('pt_status','1')
				->get()->result();
   }
    function get_pcategory_header()
   {
  return $this->db->select('pt_name, pt_id')
                ->from('product')
        ->where('pt_status','1')
        ->order_by('pt_id', 'ASE')
        //->limit('8')
        ->get()->result();
   }
   function get_pcategory_home()
   {
  return $this->db->select('pt_name, pt_id, pt_description')
                ->from('product')
        ->where('pt_status','1')
        ->order_by('pt_id', 'RANDOM')
        ->limit('8')
        ->get()->result();
   }

   function select_service()
   {
  return $this->db->select('*')
                ->from('service')
        ->where('s_status','1')
        ->get()->result();
   }

    function select_headerservice()
   {
  return $this->db->select('*')
                ->from('service')
        ->where('s_status','1')
        ->get()->result();
   }

   function getservice_id($s_id)
   {
  return $this->db->select('*')
                ->from('service')
        ->where('s_id',$s_id)
        ->where('s_status','1')
        ->get()->result();
   }

   
   function get_pcat_id($pt_id)
   {
	return $this->db->select('*')
                ->from('product')
				->where('pt_id',$pt_id)
				->where('pt_status','1')
				->get()->result();
   }
   function get_productid($pt_id)
   {
	return $this->db->select('*')
                ->from('product')
				->where('pt_id',$pt_id)
        ->where('pt_status','1')
				->get()->result();
   }
     function get_product()
   {
	return $this->db->select('*')
                ->from('sub_product')
				->where('p_status','1')
				
				->get()->result();
   }
    function getmenusub_products()
   {
    return $this->db->select('pt_id, p_id, p_name')                    
                    ->from('sub_product')
          ->where('p_status','1')
          ->get()->result();
   }

   function getall_products_id($pt_id)
   {
    return $this->db->select('*')                    
                    ->from('sub_product')
          ->where('pt_id',$pt_id)
          ->where('p_status','1')
          ->get()->result();
   }

    function getsub_products()
   {
    return $this->db->select('*')                    
                    ->from('sub_product')
					->where('p_status','1')
					->get()->result();
   }
     function getsub_products_home()
   {
    return $this->db->select('*')                    
                    ->from('sub_product')
          ->where('p_status','1')
          ->order_by('pt_id', 'RANDOM')
          ->limit('12')
          ->get()->result();
   }
    function getsub_products_id($p_id)
   {
    return $this->db->select('*')                    
                    ->from('sub_product')
					->where('p_status','1')
					->where('p_id',$p_id)
					
                    ->get()->result();
   }
  function get_news()
   {
	return $this->db->select('*')
                ->from('news')
				->where('n_status','1')
				
				->get()->result();
   }
   function get_news_id($n_id)
   {
	return $this->db->select('*')
                ->from('news')
				->where('n_status','1')
				->where('n_id',$n_id)
				->get()->result();
   }
   function get_pdf()
   {
	return $this->db->select('*')
                ->from('pdf')
				->where('p_status','1')
				
				->get()->result();
   }
}
?>