<?php

/**
 * @author Sumon Naskar
 */
class Leads_Model extends CI_Model
{
	
	function __construct()
	{
		
	}

	public function get_active_fb_forms(){
		$query = $this->db->where('status',1)->get('fb_form_details');
		return $query->result();
	}

	public function checkalreadyInsertedLeads($check_data, $table){
		$query = $this->db->where($check_data)->get($table);
		return $query->num_rows();
	}

	public function insertData($data,$table){
		$insert = $this->db->insert($table,$data);
		return $insert;
	}

	public function get_fb_not_transferred_leads(){
		$query = $this->db->where('is_transfer',0)->order_by('id')->limit(100)->get('fb_leads');
		return $query->result();
	}

	public function update_tbl_data($cond_data,$update_data,$table){
		$update = $this->db->where($cond_data)->update($table,$update_data);
		return $update;
	}
}