function setconfig($key, $value) { $c = new cauhinh(); $c->where('fieldname', $key); $c->get(); if (!$c->exists()) { show_error('Could not find config field ' . $key); } $c->value = $value; $c->save(); }
function delete() { $id = $this->uri->segment(4); $cauhinh = new cauhinh($id); if (!$cauhinh->exists()) { show_404(); } $cauhinh->delete(); redirect($this->admin . 'cauhinhs/list_all/'); }