Exemple #1
0
         $do->edit($post);
         dmsg('更新成功', $forward);
     } else {
         if ($areaid) {
             @extract($do->get_one());
         } else {
             $areaid = $listorder = 0;
             $name = $style = $letter = $domain = $iparea = $template = $seo_title = $seo_keywords = $seo_description = '';
         }
         include tpl('city_edit');
     }
     break;
 case 'letter':
     $result = $db->query("SELECT * FROM {$DT_PRE}city WHERE letter=''");
     while ($r = $db->fetch_array($result)) {
         $letter = $do->letter($r['name']);
         $db->query("UPDATE {$DT_PRE}city SET letter='{$letter}' WHERE areaid={$r['areaid']}");
     }
     dmsg('更新成功', '?file=' . $file);
     break;
 case 'delete':
     if ($areaid) {
         $areaids = $areaid;
     }
     $areaids or msg();
     $do->delete($areaids);
     dmsg('删除成功', '?file=' . $file);
     break;
 case 'update':
     foreach ($post as $v) {
         $do->update($v);