
<?
// 기본 설정 로딩
require_once('config.php');
require_once('function.php');
require_once('lib.php');
?>
<!--
<script>
$(document).ready(function(){
    $("ul#tabs li").click(function(e){
        if (!$(this).hasClass("active")) {
            var tabNum = $(this).index();
  //          var nthChild = tabNum+1;
            $("ul#tabs li.active").removeClass("active");
            $(this).addClass("active");
            $("ul#tab li.active").removeClass("active");
//            $("ul#tab li:nth-child("+nthChild+")").addClass("active");
        }
    });
});
</script>
-->
<style>
ul#tabs {
    list-style-type: none;
    padding: 0;
/*    text-align: center;*/
}
ul#tabs li {
    display: inline-block;
    background-color: #32c896;
    border-bottom: solid 5px #238b68;
    padding: 5px 20px;
    margin-bottom: 4px;
    color: #fff;
    cursor: pointer;
}
ul#tabs li:hover {
    background-color: #238b68;
}
ul#tabs li.active {
    background-color: #238b68;
}
ul#tab {
    list-style-type: none;
    margin: 0;
    padding: 0;
}
ul#tab li {
    display: none;
}
ul#tab li.active {
    display: block;
}
</style>
<?
$zonequery="select * from defensemk where depth = '1' order by idx asc";
$zoneresult = @mysql_query($zonequery , $db_connect) or die($db_q_error);
$zone_num = mysql_num_rows($zoneresult);
?>
<ul id="tabs">
<?
for ($i=0;$i<$zone_num;$i++){
        $zonedata=mysql_fetch_assoc($zoneresult);
?>
<li onclick="location.href='/DefenseInfoMK.sev?zone=<?=$zonedata[zone]?>';"><?=$zonedata[zone]?></li>
<? } ?>
</ul>

<?
$parentsquery="select * from defensemk where depth = '2' and zone = '".$_GET['zone']."' order by parents asc";
$parentsresult = @mysql_query($parentsquery , $db_connect) or die($db_q_error);
$parents_num = mysql_num_rows($parentsresult);
for ($j=0;$j<$parents_num;$j++){
	$parentsdata=mysql_fetch_assoc($parentsresult);
?>
	<strong>* <?=$parentsdata[parents]?> - <?=$parentsdata[real_address]?> - <a href=/DefenseNewMK.sev?zone=<?=$_GET['zone']?>&parents=<?=$parentsdata[parents]?>>등록</a></strong><br>
<?
	$childquery="select * from defensemk where depth = '3' and zone = '".$_GET['zone']."' and parents = '".$parentsdata[parents]."' order by parents asc";
	$childresult = @mysql_query($childquery , $db_connect) or die($db_q_error);
	$child_num = mysql_num_rows($childresult);
?>

<?
	for ($k=0;$k<$child_num;$k++){
		$childdata=mysql_fetch_assoc($childresult);
		$childidx=$childdata[idx];
?>
	<?=$childdata[child]?>- <a href=/DefenseModifyMK.sev?child=<?=$childidx?>>수정</a><br>
<? } ?>

<!--
		<td><?=$parentsdata[parents]?></td>
		<td><?=$parentsdata[acl_address]?></td>
		<td><?=$parentsdata[real_address]?></td>
-->			

<? } ?>

	





MODIFY
<!--
<ul id="tab">
    <li class="active">
        <h2>This is the first tab</h2>
    </li>
</ul>
-->


<?
//DB닫기
mysql_close($db_connect);
?>