_orderId = $orderId; $this->_data =null; } function __construct() { parent::__construct(); $this->setDBO(VoxelCareDB::getDatabase()); global $mainframe,$option; } function setMaxVisibilityLevel($level) { $this->_maxVisibilityLevel = $level; } function _buildQuery() { $where = array(); $where[] = " ol.orderid=".$this->_orderId; $where[] = " ol.visibility_level <= ". $this->_maxVisibilityLevel; $where =( count($where) ) ? ' WHERE ' . implode( ' AND ', $where ) : ''; $orderby = " ORDER BY ol.id DESC"; $this->_query = " SELECT ol.id id,ol.state state, ol.userid user, ol.info info, ol.visibility_level visibility_level, ol.logdate logdate, os.nameid statenameid, os.name statename, u.name username " . ' FROM #__vxc_orderlog ol LEFT JOIN #__vxc_user u ON u.id = ol.userid LEFT JOIN #__vxc_orderstate os ON os.id = ol.state ' . $where . $orderby ; return $this->_query; } function getData() { if (empty($this->_data)) { $query = $this->_buildQuery(); $this->_db->setQuery($query); $this->_data = $this->_db->loadObjectList(); } return $this->_data; } function getList() { $lists=array(); return $lists; } function getTotal() { // Load the content if it doesn't already exist if (empty($this->_total)) { $query = $this->_buildQuery(); $this->_total = $this->_getListCount($query); } return $this->_total; } }// class