<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Companyinfo_model extends CI_Model {
    
    public function __construct() {
            parent::__construct();
    }

    function getcompanyinfo($id){
                $this->db->select('ID, COMPANYNAME, ADDRESS1, ADDRESS2, CITY, POSTAL, REGION, COUNTRY, PHONE1, PHONE2, FAX, EMAIL, WEBSITE, CURRENCY, TAXID,DISPLAYLOGO,PRINTLOGO');
            $this->db->where('ID', $id);
            $q = $this->db->get('COMPANYINFO');
            return $q->row();

    }

    function updatecompanyinfo($data, $id) {
            $this->db->where('ID', $id);
            return ($this->db->update('COMPANYINFO', $data)) ? true : false;
    }

    function getlocaleinfo(){
        $this->db->select('POTERMS,NEXTBARCODE,COUNTRY, FORMATINTEGER, FORMATDOUBLE, FORMATCURRENCY, FORMATPERCENT, FORMATDATE, FORMATTIME, FORMATDATETIME,TIMEZONE,LOCATION');
        //$this->db->where('ID', $id);
        $q = $this->db->get('CONFIGURATION');
        return $q->row();
    }

    function updatelocaleinfo($data) {
//          $this->db->where('ID', $id);
        return ($this->db->update('CONFIGURATION', $data)) ? true : false;
    }
}
