<?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">
<li class="nivel00">
<a href="adm_itens.php?lg='.$lg.'&opcao=novoitem&cat=0" onclick="window.open(this.href, \'Editor\', \'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=yes,dependent=no,width=830,left=200,height=800,top=100\'); return false;"> 
<span style="font-size: 10px;">+ ITEM</span>
</a>
</li>';

$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">

<a href="adm_itens.php?lg='.$lg.'&opcao=editaritem&cod='.$valor["cod_item"].'" onclick="window.open(this.href, \'Editor\', \'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=yes,dependent=no,width=830,left=200,height=800,top=100\'); return false;">
/~ <span style="font-size: 10px;">EDITAR</span></a>
 '.$valor["item"].'';












$catnivel01 = $valor["cod_item"];

echo'
<ul class="catnivel01">
<li class="nivel01">
<a href="adm_itens.php?lg='.$lg.'&opcao=novoitem&cat='.$catnivel01.'" onclick="window.open(this.href, \'Editor\', \'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=yes,dependent=no,width=830,left=200,height=800,top=100\'); return false;"> 
<span style="font-size: 10px;">+&nbsp; ITEM NESTE N&Iacute;VEL</span>
</a>
</li>';

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

echo'
<li class="nivel01">
<a href="adm_itens.php?lg='.$lg.'&opcao=editaritem&cod='.$valor["cod_item"].'" onclick="window.open(this.href, \'Editor\', \'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=yes,dependent=no,width=830,left=200,height=800,top=100\'); return false;"> 
/~ <span style="font-size: 10px;">EDITAR</span>
</a>
 '.$valor["item"].'';











$catnivel02 = $valor["cod_item"];

echo'
<ul class="catnivel02">
<li class="nivel02">
<a href="adm_itens.php?lg='.$lg.'&opcao=novoitem&cat='.$catnivel02.'" onclick="window.open(this.href, \'Editor\', \'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=yes,dependent=no,width=830,left=200,height=800,top=100\'); return false;"> 
<span style="font-size: 10px;">+&nbsp; ITEM NESTE N&Iacute;VEL</span>
</a>
</li>';

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

echo'
<li class="nivel02">
<a href="adm_itens.php?lg='.$lg.'&opcao=editaritem&cod='.$valor["cod_item"].'" onclick="window.open(this.href, \'Editor\', \'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=yes,dependent=no,width=830,left=200,height=800,top=100\'); return false;"> 
/~ <span style="font-size: 10px;">EDITAR</span>
</a>
 '.$valor["item"].'';









$catnivel03 = $valor["cod_item"];

echo'
<ul class="catnivel03">
<li class="nivel03">
<a href="adm_itens.php?lg='.$lg.'&opcao=novoitem&cat='.$catnivel03.'" onclick="window.open(this.href, \'Editor\', \'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=yes,dependent=no,width=830,left=200,height=800,top=100\'); return false;"> 
<span style="font-size: 10px;">+&nbsp; ITEM NESTA LISTA</span>
</a>
</li>';

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

echo'
<li>
<a href="adm_itens.php?lg='.$lg.'&opcao=editaritem&cod='.$valor["cod_item"].'" onclick="window.open(this.href, \'Editor\', \'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=yes,dependent=no,width=830,left=200,height=800,top=100\'); return false;">  
/~ <span style="font-size: 10px;">EDITAR</span>
</a>
 '.$valor["item"].'';








$catnivel04 = $valor["cod_item"];

echo'
<ul class="catnivel04">

<li class="nivel04">
<a href="adm_itens.php?lg='.$lg.'&opcao=novoitem&cat='.$catnivel04.'" onclick="window.open(this.href, \'Editor\', \'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=yes,dependent=no,width=830,left=200,height=800,top=100\'); return false;"> 
<span style="font-size: 10px;">+&nbsp; ITEM NESTA LISTA</span>
</a>
</li>';

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

echo'
<li class="nivel04">


<a href="adm_itens.php?lg='.$lg.'&opcao=novoitem&cat='.$valor["cod_item"].'" onclick="window.open(this.href, \'Editor\', \'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=yes,dependent=no,width=830,left=200,height=800,top=100\'); return false;"> 
<span style="font-size: 10px;">+&nbsp; ITEM NESTA LISTA</span>
</a>
<p>
<a href="adm_itens.php?opcao=editaritem&cod='.$valor["cod_item"].'" onclick="window.open(this.href, \'Editor\', \'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=yes,dependent=no,width=830,left=200,height=800,top=100\'); return false;"> 
/~ <span style="font-size: 10px;">EDITAR</span>
</a>
</p>
 '.$valor["item"].'';

echo'
</li>';
     }

echo'
</ul>



</li>';
     }

echo'
</ul>';



echo'
</li>';
     }

echo'
</ul>';



echo'
</li>';
     }

echo'
</ul>';



echo'
</li>';
        }
     }

echo'
</ul>

</div>';




?>