select() ->where('companyId = ?', $companyId) ->where('lang = ?', $Language); $result = $this->getAdapter()->fetchAll($sql); return ($result); } public function getReportByIdAndType($companyId, $type, $Language) { if($type == 'CR') { $where = 'type="FU" OR type="CO" OR type="CR"'; }else if ($type == 'CO') { $where = 'type="FU" OR type="CO"'; } else $where = 'type = "FU"'; $sql = $this->select() ->where('companyId = ?', $companyId) ->where($where) ->where('lang = ?', $Language); $result = $this->getAdapter()->fetchRow($sql); /*if($type == 'FU') { $where = $this->getAdapter()->quoteInto('companyId = ? AND type = "CR" OR type = "CO"' , $companyId); //var_dump($where);exit; $this->delete($where); } else if($type == 'CO') { $where = $this->getAdapter()->quoteInto('companyId = ? and type = "CR"', $companyId); $this->delete($where); }*/ return ($result['report']); } public function getReportDate($companyId, $type) { $sql = $this->select('date') ->where('companyId = ?', $companyId) ->where('type = ?', $type); $result = $this->getAdapter()->fetchAll($sql); return ($result); } } ?>