| Server IP : 68.178.202.69 / Your IP : 216.73.216.122 Web Server : Apache System : Linux 69.202.178.68.host.secureserver.net 3.10.0-1160.139.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Nov 3 13:30:41 UTC 2025 x86_64 User : ikioworld ( 1005) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/ikioworld/www/application/models/ |
Upload File : |
<?php
class Homemodel extends CI_Model
{
function __construct()
{
parent::__construct();{
$this->load->database();
$this->proTable = 'product';
$this->custTable = 'customers';
$this->ordTable = 'orders';
$this->ordItemsTable = 'order_items';
}
}
function get_detail($slug){
$this->db->select(['*',$this->table_name.'.slug as slug']);
$this->db->where($this->table_name.'.slug',$slug);
$query=$this->db->get($this->table_name);
return $query->row();
}
function getCategory()
{
$this->db->where("status='active'");
$query = $this->db->get('category');
return $query->result();
}
function getChannel()
{
$this->db->select('*');
$this->db->from('channel');
$this->db->where('status','active');
$this->db->order_by('position', 'ASC');
$query = $this->db->get();
return $query->result_array();
}
function getStrategic()
{
$this->db->select('*');
$this->db->from('strategic');
$this->db->where('status','active');
$this->db->order_by('position', 'ASC');
$query = $this->db->get();
return $query->result_array();
}
function getClients()
{
$this->db->select('*');
$this->db->from('clients');
$this->db->where('status','active');
$this->db->order_by('position', 'ASC');
$query = $this->db->get();
return $query->result_array();
}
function getClearancetable()
{
$this->db->select('*');
$this->db->from('clearancetable');
$query = $this->db->get();
return $query->result_array();
}
function getSubCategory()
{
$this->db->where("status='active'");
$query = $this->db->get('subcategory');
return $query->result();
}
function getApplication()
{
$this->db->where("status='active'");
$query = $this->db->get('application');
return $query->result();
}
function getSlider()
{
$this->db->select('*');
$this->db->from('slider');
$this->db->where('status','active');
$this->db->order_by('slider_priority', 'ASC');
$query = $this->db->get();
return $query->result_array();
}
function getTestimonial()
{
$this->db->select('*');
$this->db->from('testimonial');
$this->db->where('status','active');
$this->db->order_by('id', 'DESC');
$query = $this->db->get();
return $query->result_array();
}
function getSustain()
{
$this->db->select('*');
$this->db->from('sustainability');
$this->db->where('status','active');
$this->db->order_by('id', 'DESC');
$query = $this->db->get();
return $query->result_array();
}
function getBlogs()
{
$this->db->select('*');
$this->db->select('blog.slug as blogid');
$this->db->select('blog.featured_image as image');
$this->db->from('blog');
$this->db->where("blog.is_featured='yes'");
$this->db->where("blog.status='active'");
$this->db->order_by('id', 'DESC');
$query = $this->db->get();
return $query->result();
}
function getProducts()
{
$this->db->select('*');
$this->db->select('product.slug as prodID');
$this->db->select('product.featured_image as image');
$this->db->from('product');
$this->db->where("product.is_featured='yes'");
$this->db->where("product.status='active'");
$this->db->order_by('product.id','DESC');
$this->db->limit(12);
$query = $this->db->get();
return $query->result();
}
function getNews()
{
$this->db->select('*');
$this->db->select('news.featured_image as image');
$this->db->from('news');
$this->db->where("news.status='active'");
$this->db->order_by('news.id','DESC');
$this->db->limit(2);
$query = $this->db->get();
return $query->result();
}
function get_blog_details($id){
$this->db->select('blog.*');
$this->db->select('blog_images.image');
$this->db->from('blog');
$this->db->join('blog_images',"blog.id=blog_images.blog_id and blog_images.features='yes'");
$this->db->where('blog.id',$id);
$this->db->where('blog_images.blog_id',$id);
$query = $this->db->get();
return $query->result();
}
function get_details($id){
$this->db->select('product.*');
$this->db->select('product_images.image');
$this->db->from('product');
$this->db->join('product_images',"product.id=product_images.product_id");
$this->db->where('product.id',$id);
$this->db->where('product_images.product_id',$id);
$query = $this->db->get();
return $query->result();
}
function getAllImages(){
$this->db->select('product.*');
$this->db->select('product.featured_image as image');
$this->db->select('product_images.image');
$this->db->from('product');
$this->db->join('product_images',"product.id=product_images.product_id");
$query = $this->db->get();
return $query->result();
}
function addNewsletter($data){
if(!empty($data)){
unset($data['sbt']);
$this->db->insert('newsletter',$data);
$insert_id = $this->db->insert_id();
return $insert_id;
//echo $this->db->last_query(); die;
}
}
}