Exemplo n.º 1
0
        $do->repair();
        dmsg('更新成功', $this_forward);
        break;
    case 'delete':
        if ($areaid) {
            $areaids = $areaid;
        }
        $areaids or msg();
        $do->delete($areaids);
        dmsg('删除成功', $this_forward);
        break;
    case 'update':
        if (!$area || !is_array($area)) {
            msg();
        }
        $do->update($area);
        dmsg('更新成功', $this_forward);
        break;
    default:
        $DAREA = array();
        $condition = $keyword ? "areaname LIKE '%{$keyword}%'" : "parentid={$parentid}";
        $result = $db->query("SELECT * FROM {$table} WHERE {$condition} ORDER BY listorder,areaid");
        while ($r = $db->fetch_array($result)) {
            $r['childs'] = substr_count($r['arrchildid'], ',');
            $DAREA[$r['areaid']] = $r;
        }
        include tpl('area');
        break;
}
class area
{