<?php


echo'
<form method="post" action="adm_materias.php?lg='.$lg.'&sec='.$sec.'&form=basico&opcao=altera&flag=gravar">

<INPUT TYPE="hidden" name="cod" value="'.$valor["cod_materia"].'">

<INPUT TYPE="hidden" name="titulo" value="'.$valor["titulo"].'">

<INPUT TYPE="hidden" name="titulo_onoff" value="'.$valor["titulo_onoff"].'">

<INPUT TYPE="hidden" name="cont2" value="'.$valor["cont2"].'">

<INPUT type="hidden" name="estagio" value="'.$valor["estagio"].'">
<INPUT type="hidden" name="pchave" value="'.$valor["pchave"].'">

<INPUT type="hidden" name="link_retorno" value="'.$valor["link_auto"].'">
<INPUT type="hidden" name="link_alter" value="'.$valor["link_alter"].'">
<INPUT type="hidden" name="url_alter" value="'.$valor["url_alter"].'">





<div>
<div id="mat_info">
<h2 style="margin-bottom: 0px;">
Informa&ccedil;&otilde;es B&aacute;sicas da Mat&eacute;ria

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


<a href="adm_materias.php?lg='.$lg.'&sec='.$sec.'&form=editor&opcao=altera&cod='.$cod.'">
ABRIR EDITOR
</a>



<input type="submit" value="SALVAR"/>


</h2>
</div>';
?>

<div style="visibility: hidden; position: absolute; top: -1000px;">

      <textarea  cols="80" rows="10" id="cont1" name="cont1"> 

<?php 

echo'
'.$valor["cont1"].'
';
?>

      </textarea>

</div>

      <script type="text/javascript">
        CKEDITOR.replace( 'cont1' );
      </script>


<?php
echo'
<div id="mat_info">
Identifica&ccedil;&atilde;o:<br/>
<INPUT type="text" name="nome" value="'.$valor["nome"].'" size="40">
</div>


<div id="mat_info">
Ordem:<br/>
<input type="text" name="id" value="'.$valor["id"].'" size="2">
</div>';


$s = $valor["secao"];

$l = $valor["pagina"];




echo'
<div id="mat_info">
<h3>
Conte&uacute;do Simples:
</h3>
<SELECT name="secao">';

$sql = "select * from secoes where cod_secao = ".$s;
$result1 = mysql_query ($sql);
while ( $valor = mysql_fetch_array($result1) )
     {
echo'
<OPTION value="'.$valor["cod_secao"].'" selected>
'.$valor["nome_secao"].'
</OPTION>';
     }

echo'
<option style="background-color: #BBB; color: white;">
P&Aacute;GINAS
</option>';

$sql = "select * from secoes where cont_secao = 'pg' order by id_secao  ASC";
$result4 = mysql_query ($sql);
while ( $valor = mysql_fetch_array($result4) )
     {
echo '
<OPTION value="'.$valor["cod_secao"].'">
'.$valor["nome_secao"].'
</OPTION>';
     }

echo'
<option style="background-color: #999; color: white;">
M&Oacute;DULOS
</option>';

$sql = "select * from secoes where cont_secao = 'mod' order by id_secao  ASC";
$result5 = mysql_query ($sql);
while ( $valor = mysql_fetch_array($result5) )
     {
echo '
<OPTION value="'.$valor["cod_secao"].'">
'.$valor["nome_secao"].'
</OPTION>';
     }

echo '
<OPTION value="NENHUM">
NENHUM
</OPTION>
</SELECT>
</div>






<div id="mat_info">
<h3>
Conte&uacute;do em Listas:
</h3>

<SELECT name="pagina">';

$sql = "select * from listas where cod_lista = ".$l;
$result6 = mysql_query ($sql);
while ( $valor = mysql_fetch_array($result6) )
     {
echo'
<OPTION value="'.$valor["cod_lista"].'" selected>
'.$valor["nome_lista"].'
</OPTION>';
     }

echo'
<option style="background-color: #BBB; color: white;">
P&Aacute;GINAS
</option>';

$sql = "select * from listas where cont_lista = 'pg' order by id_lista  ASC";
$result8 = mysql_query ($sql);
while ( $valor = mysql_fetch_array($result8) )
     {
echo '
<OPTION value="'.$valor["cod_lista"].'">
'.$valor["nome_lista"].'
</OPTION>';
     }

echo'
<option style="background-color: #BBB; color: white;">
M&Oacute;DULOS
</option>';

$sql = "select * from listas where cont_lista = 'mod' order by id_lista  ASC";
$result9 = mysql_query ($sql);
while ( $valor = mysql_fetch_array($result9) )
     {
echo '
<OPTION value="'.$valor["cod_lista"].'">
'.$valor["nome_lista"].'
</OPTION>';
     }


echo '
<OPTION value="NENHUM">
NENHUM
</OPTION>

</SELECT>
</div>';









?>
      
</div>
</form>

