function getMenuXls($site, $table, $j, $parent, $depth, $uid, $mset, $code) { global $g, $r; static $j, $string; $xdepth = $depth + 1; $CD = getDbSelect($table, ($site ? 'site=' . $site . ' and ' : '') . 'depth=' . $xdepth . ' and parent=' . $parent . ' order by gid asc', '*'); while ($C = db_fetch_array($CD)) { $j++; $code = $code . $C['id'] . '/'; $_code = substr($code, 0, strlen($code) - 1); $string .= '<tr>'; $string .= '<td>' . $xdepth . '</td>'; $string .= '<td>' . ($xdepth == 1 ? $C['name'] : '') . '</td>'; $string .= '<td>' . ($xdepth == 2 ? $C['name'] : '') . '</td>'; $string .= '<td>' . ($xdepth == 3 ? $C['name'] : '') . '</td>'; $string .= '<td>' . ($xdepth == 4 ? $C['name'] : '') . '</td>'; $string .= '<td>' . ($xdepth == 5 ? $C['name'] : '') . '</td>'; $string .= '<td>' . $C['uid'] . '</td>'; $string .= '<td>' . $C['id'] . '</td>'; $string .= '<td>' . RW('c=' . $_code) . '</td>'; $string .= '<td>' . $g['s'] . '/index.php?r=' . $r . '&c=' . $_code . '</td>'; $string .= '<td>' . $mset[$C['menutype']] . '</td>'; $string .= '<td>' . ($C['mobile'] ? 'Y' : '') . '</td>'; $string .= '<td>' . ($C['target'] ? 'Y' : '') . '</td>'; $string .= '<td>' . ($C['hidden'] ? 'Y' : '') . '</td>'; $string .= '<td>' . ($C['reject'] ? 'Y' : '') . '</td>'; $string .= '<td>' . ($C['redirect'] ? 'Y' : '') . '</td>'; $string .= '<td>' . $C['joint'] . '</td>'; $string .= '</tr>'; if ($C['isson']) { getMenuXls($site, $table, $j, $C['uid'], $C['depth'], $uid, $mset, $code); } $code = ''; } return $string; }
echo '<th>2차메뉴</th>'; echo '<th>3차메뉴</th>'; echo '<th>4차메뉴</th>'; echo '<th>5차메뉴</th>'; echo '<th>고유키(PK)</th>'; echo '<th>메뉴코드</th>'; echo '<th>현재주소</th>'; echo '<th>물리주소</th>'; echo '<th>메뉴형식</th>'; echo '<th>모바일</th>'; echo '<th>새창</th>'; echo '<th>숨김</th>'; echo '<th>차단</th>'; echo '<th>리다이렉트</th>'; echo '<th>연결주소</th>'; echo '</thead>'; echo '<tbody>'; echo getMenuXls($s, $table['s_menu'], 0, 0, 0, 0, array('', '모듈', '위젯', '코딩'), ''); echo '</tbody>'; echo '</table>'; exit; } else { header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=menu_" . $_HS['id'] . ".txt"); header("Content-Description: PHP4 Generated Data"); echo $_HS['name'] . "-메뉴구조\r\n"; echo "-------------------------------------------------------------------------\r\n\r\n"; echo getMenuTxt($s, $table['s_menu'], 0, 0, 0, 0, ''); exit; } }