<?php


class Calculator_model extends CI_Model
{
    public function getCalculatorResultData($where=null)
	{
        $this->db
        ->select('t1.*,t2.fullname')
        ->from('calculator t1')
        ->join('staff t2', 't2.id = t1.staff_id','left');

        if(isset($where) && $where!==null){
            $this->db->where($where);
        }
        $query = $this->db->get();
		return $query->result_array();
	}
    public function getCalculatorOfferingsResultData($calculator_id)
	{
        $this->db
        ->select('t1.*,t2.name')
        ->from('calculator_offerings t1')
        ->join('offering t2','t2.id = t1.offering_id','left')
        ->where('t1.calculator_id',$calculator_id);
        $query = $this->db->get();
		return $query->result_array();
	}
}

?>