Example #1
0
             $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;
     }
     if (!isset($fid)) {
         $r = $db->get_one("SELECT min(itemid) AS fid FROM {$DT_PRE}gift");
         $fid = $r['fid'] ? $r['fid'] : 0;
     }
     isset($sid) or $sid = $fid;
     if (!isset($tid)) {
         $r = $db->get_one("SELECT max(itemid) AS tid FROM {$DT_PRE}gift");
         $tid = $r['tid'] ? $r['tid'] : 0;
     }