public function _storeData() { #setup some variables $user_id = $_SESSION['use_id']; $this->_isUpd(); #get fields $this->fields = $this->is_update ? dbfn::_getupdatefields($this->table) : dbfn::_getinsertfields($this->table); #build query $query = $this->is_update ? dbfn::_buildupdate($this->fields, $this->table, $this->prikey) : dbfn::_buildinsert($this->fields, $this->table); #get changes to the data $this->_getDataChanges(); #execute query $oResult = new db($query); $this->rowid = $this->is_update ? $this->rowid : $oResult->insert_id; #format output $output = $oResult->ret; #determine if operation was a success and store in history if ($output['msg_class'] == "success") { aimsys::_history($query, $this->changes, $this->table, $this->rowid); $output['js'] = $this->is_update || req::_('popup') != 0 ? "" : "Tabs.activeTab.new2view('{$this->table}','{$this->rowid}');"; //additional javascript to run for new records $output['rowid'] = $this->rowid; } return $output; }