} else { foreach ($do->fields as $v) { isset(${$v}) or ${$v} = ''; } $groupid = '5,6,7'; $addtime = timetodate($DT_TIME); $menuid = 0; include tpl('gift_edit', $module); } break; case 'edit': $itemid or msg(); $do->itemid = $itemid; if ($submit) { if ($do->pass($post)) { $do->edit($post); dmsg('修改成功', $forward); } else { msg($do->errmsg); } } else { extract($do->get_one()); $addtime = timetodate($addtime); $fromtime = $fromtime ? timetodate($fromtime, 3) : ''; $totime = $totime ? timetodate($totime, 3) : ''; $menuid = 1; include tpl('gift_edit', $module); } break; case 'update': $do->update();