tableName}.*, {$this->tableName}Section.title as section_title, {$this->tableName}Section.important_note as section_important_note FROM {$this->tableNameDB} AS {$this->tableName} JOIN {$this->tableNameDB}Section as {$this->tableName}Section ON {$this->tableName}Section.id = {$this->tableName}.id_section WHERE 1 ORDER BY {$this->tableName}Section.sorter, {$this->tableName}.item_index "; $res = $this->db->queryAll($sql); require_once('app/Settings/Settings.php'); $res['options'] = unserialize(Settings::get('dues_calculator_options')); $this->arrayParseTag2Url(&$res); return $res; } function update($data = null, $files = null) { if (!is_null($data)) { $this->initFromArray($data, $files); } /* $this->_initTable(); if (!is_array($this->_data['amount']) || empty($this->_data['amount'])) { return false; } foreach ($this->_data['amount'] as $id_section => $section) { foreach ($section as $item_index => $amount) { $this->table->update( array('amount'=>$this->db->quote($amount, 'float')), 'id_section = '. $this->db->quote($id_section, 'integer') .' AND item_index = '. $this->db->quote($item_index, 'integer') ); } } $this->handleFiles(); */ $sql = " UPDATE {$this->db->tblzz_Settings} SET value = ".$this->db->quote(serialize($this->_data), 'text')." WHERE name = 'dues_calculator_options' LIMIT 1 "; $res = $this->db->query($sql); $this->_sqlError($res); return true; } }