}
    foot();
} elseif ($exec == "delete_all") {
    for ($i = 0; $i < count($selected) - 1; $i++) {
        $temp = mysql_fetch_array(mysql_query("select * from {$t_board}" . "_{$id} where no='{$selected[$i]}'"));
        // 답글이 없을때
        if (!$temp[child]) {
            // 글삭제
            mysql_query("delete from {$t_board}" . "_{$id} where no='{$selected[$i]}'") or Error(mysql_error());
            // 카테고리에서 숫자 하나 뺌
            mysql_query("update {$t_category}" . "_{$id} set num=num-1 where no='{$temp['category']}'", $connect);
            // 파일삭제
            @z_unlink("./" . $temp[file_name1]);
            @z_unlink("./" . $temp[file_name2]);
            // Divison 정리
            minus_division($temp[division]);
            // 이전, 다음글에 대한 정리
            if ($temp[depth] == 0) {
                // 이전글이 있으면 빈자리 메꿈;;;
                if ($temp[prev_no]) {
                    mysql_query("update {$t_board}" . "_{$id} set next_no='{$temp['next_no']}' where next_no='{$temp['no']}'");
                }
                // 다음글이 있으면 빈자리 메꿈;;;
                if ($temp[next_no]) {
                    mysql_query("update {$t_board}" . "_{$id} set prev_no='{$temp['prev_no']}' where prev_no='{$temp['no']}'");
                }
            } else {
                $temp2 = mysql_fetch_array(mysql_query("select count(*) from {$t_board}" . "_{$id} where father='{$temp['father']}'"));
                // 원본글이 있으면 원본글의 자식 글을 없앰;;;
                if (!$temp2[0]) {
                    mysql_query("update {$t_board}" . "_{$id} set child='0' where no='{$temp['father']}'");
    } else {
        if ($s_data[ismember] != $member[no]) {
            Error("비밀번호를 입력하여 주십시요");
        }
    }
}
/////////////////////////////////////////////////////////////////////////////////////////////
// 글삭제일때
////////////////////////////////////////////////////////////////////////////////////////////
if (!$s_data[child]) {
    mysql_query("delete from {$t_board}" . "_{$id} where no='{$no}'") or Error(mysql_error());
    // 글삭제
    // 파일삭제
    @z_unlink("./" . $s_data[file_name1]);
    @z_unlink("./" . $s_data[file_name2]);
    minus_division($s_data[division]);
    if ($s_data[depth] == 0) {
        if ($s_data[prev_no]) {
            mysql_query("update {$t_board}" . "_{$id} set next_no='{$s_data['next_no']}' where next_no='{$s_data['no']}'");
        }
        // 이전글이 있으면 빈자리 메꿈;;;
        if ($s_data[next_no]) {
            mysql_query("update {$t_board}" . "_{$id} set prev_no='{$s_data['prev_no']}' where prev_no='{$s_data['no']}'");
        }
        // 다음글이 있으면 빈자리 메꿈;;;
    } else {
        $temp = mysql_fetch_array(mysql_query("select count(*) from {$t_board}" . "_{$id} where father='{$s_data['father']}'"));
        if (!$temp[0]) {
            mysql_query("update {$t_board}" . "_{$id} set child='0' where no='{$s_data['father']}'");
        }
        // 원본글이 있으면 원본글의 자식글을 없앰;;;