<?php

include ("stp.php");

echo'
<br /><br />
<center>
<a href="mod_AltItensMap.php?lg='.$lg.'">
EDITAR 
</a>
&nbsp;
|
&nbsp;
<a href="mod_ItensMap.php?lg='.$lg.'">
VISUALIZAR
</a>
</center>

<br /><br /><br />



<div id="CATS">

<ul class="catnivel00">';

$sql = "select * from itens where lista = 0 order by id_item ASC";
$result = mysql_query ($sql);
while ( $valor = mysql_fetch_array($result) )
     {
        if($result == TRUE)
        {

echo '
<li class="nivel00">


 '.$valor["item"].'';








$catnivel01 = $valor["cod_item"];

echo'
<ul class="catnivel01">';

$sql = "select * from itens where lista = '$catnivel01' order by id_item ASC";
$result01 = mysql_query ($sql);
while ( $valor = mysql_fetch_array($result01) )
     {

echo'
<li class="nivel01">

 '.$valor["item"].'';








$catnivel02 = $valor["cod_item"];

echo'
<ul class="catnivel02">';

$sql = "select * from itens where lista = '$catnivel02' order by id_item ASC";
$result02 = mysql_query ($sql);
while ( $valor = mysql_fetch_array($result02) )
     {

echo'
<li class="nivel02">

 '.$valor["assunto"].'';









$catnivel03 = $valor["cod_item"];

echo'
<ul class="catnivel03">';

$sql = "select * from itens where lista = '$catnivel03' order by id_item ASC";
$result03 = mysql_query ($sql);
while ( $valor = mysql_fetch_array($result03) )
     {

echo'
<li>

 '.$valor["assunto"].'';








$catnivel04 = $valor["cod_item"];

echo'
<ul class="catnivel04">';

$sql = "select * from itens where lista = '$catnivel04' order by id_item ASC";
$result04 = mysql_query ($sql);
while ( $valor = mysql_fetch_array($result04) )
     {

echo'
<li class="nivel04">


 '.$valor["item"].'';

echo'
</li>';
     }

echo'
</ul>



</li>';
     }

echo'
</ul>';



echo'
</li>';
     }

echo'
</ul>';



echo'
</li>';
     }

echo'
</ul>';



echo'
</li>';
        }
     }

echo'
</ul>

</div>';




?>