public function _insert() { $r= new JTUser($_SESSION['login_user_id']); JUtil::empty2null($_POST['id']); $r->setFields($_POST); $id = $r->insert(); $this->addAlert(new JAlert('新增完成','告知訊息',"./?action=edit&id={$id}")); $this->action('edit', $id); }
public function _update() { $r= new JTAdvisory($_SESSION['login_user_id']); JUtil::empty2null($_POST['price']); $r->select($_POST['id']); $r->setFields($_POST); $r->update(); $this->addAlert(new JAlert('更新完成','告知訊息',"./?action=edit&id={$_POST['id']}")); $this->action('edit', $_POST['id']); }