function approve($id) { if ($_POST) { $rs = new Information($id); $rs->from_array($_POST); $rs->save(); } }
function approve($id) { if ($_POST) { $information = new Information($id); $_POST['approve_id'] = $this->session->userdata('id'); $information->approve_date = date("Y-m-d H:i:s"); $information->from_array($_POST); $information->save(); echo approve_comment($information); } }
function save($id = FALSE) { if ($_POST) { $information = new Information($id); $_POST['title'] = lang_encode($_POST['title']); $_POST['intro'] = lang_encode($_POST['intro']); $_POST['detail'] = lang_encode($_POST['detail']); if (!$id) { $_POST['user_id'] = $this->session->userdata('id'); } if ($_FILES['image']['name']) { if ($id) { $information->delete_file('uploads/information/thumbnail', 'image'); } $information->image = $information->upload($_FILES['image'], 'uploads/information/thumbnail', 77, 64); } $information->from_array($_POST); $information->save(); set_notify('success', lang('save_data_complete')); } redirect($_POST['referer']); }