$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(); dmsg('更新成功', $forward); break; case 'html': if (!isset($num)) { $num = 50; }
$TYPE = get_type('gift', 1); require MD_ROOT . '/gift.class.php'; $do = new gift(); $typeid = isset($typeid) ? intval($typeid) : 0; switch ($action) { case 'my': login(); $condition = "username='******'"; $lists = $do->get_my_order($condition); $head_title = $L['gift_my_order'] . $DT['seo_delimiter'] . $L['gift_title']; break; case 'order': login(); $itemid or dheader($MOD['gift_url']); $do->itemid = $itemid; $item = $do->get_one(); $item or dheader($MOD['gift_url']); extract($item); $left = $amount - $orders > 0 ? $amount - $orders : 0; $process = $left ? get_process($fromtime, $totime) : 4; if ($process == 1) { dalert($L['gift_error_1'], $linkurl); } if ($process == 3) { dalert($L['gift_error_3'], $linkurl); } if ($process == 4) { dalert($L['gift_error_4'], $linkurl); } if ($_credit < $credit) { dalert($L['gift_error_5'], $linkurl);