<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>GEWS 2.0</title>
 
<link href="css1.css" rel="stylesheet" type="text/css" />
 
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script type="text/javascript" src="ckeditor/adapters/jquery.js"></script>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script src="ckeditor/sample.js" type="text/javascript"></script>
<link href="ckeditor/sample.css" rel="stylesheet" type="text/css" />




<script language="JavaScript">

janela1 = null;
function setor1()  {
janela1=window.open('<?php include ("stp.php"); echo'uploadfotos.php?usr='.$usr.''; ?>','sprito','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=180,left=420,width=300,height=270'); }

janela2 = null;
function setor2()  {
janela2=window.open('<?php include ("stp.php"); echo'uploaddocs.php?usr='.$usr.''; ?>','sprito','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=180,left=420,width=300,height=270'); }

janela3 = null;
function setor3()  {
janela3=window.open('<?php include ("stp.php"); echo'uploadaudio.php?usr='.$usr.''; ?>','sprito','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=180,left=420,width=300,height=270'); }

janela4 = null;
function setor4()  {
janela4=window.open('<?php include ("stp.php"); echo'uploadvideos.php?usr='.$usr.''; ?>','sprito','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=180,left=420,width=300,height=270'); }

janela5 = null;
function setor5()  {
janela5=window.open('paleta.php','sprito','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=180,left=420,width=300,height=200'); }

janela6 = null;
function setor6()  {
janela6=window.open('http://www.<?php include ("stp.php"); echo''.$site.''; ?>','sprito','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=180,left=420,width=800,height=500'); }

janela7 = null;
function setor7()  {
janela7=window.open('mod_perguntas.php','sprito','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=180,left=420,width=330,height=290'); }

janela8 = null;
function setor8()  {
janela8=window.open('paleta.php','sprito','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=180,left=420,width=300,height=200'); }

</script>




<link rel="stylesheet" media="all" type="text/css" href="menu_style.css" />
<!--[if IE]>
<link rel="stylesheet" media="all" type="text/css" href="ie.css" />
<![endif]-->





<script language="javascript" type="text/javascript"> 
    function ExpandirCategoria(Idcategoria)
    {
        var lnk = document.getElementById( "hyCateg" + Idcategoria );
        var pn = document.getElementById( "pnCateg" + Idcategoria );
 
        if(lnk.style.backgroundImage.indexOf("../../img/ico/expand.gif") > 0)
        {
            pn.style.display = "block";
            lnk.style.backgroundImage='url(../../img/ico/collapse.gif)';
        }
        else
        {
            pn.style.display = "none";
            lnk.style.backgroundImage='url(../../img/ico/expand.gif)';
        }
    }
</script>





<?php 

include ("stp.php");

?>




	<script type="text/javascript">
	<![CDATA[
 
$(function()
{
	var config = {
		toolbar:
		[
			['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink'],
			['UIColor']
		]
	};
 
	// Initialize the editor.
	// Callback function can be passed and executed after full instance creation.
	$('.jquery_ckeditor').ckeditor(config);
});
 
	]]>
	</script>



<script language="Javascript1.2"><!-- // load htmlarea
_editor_url = "";                     // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
  document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
  document.write(' language="Javascript1.2"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>



<script language="JavaScript">

janela1 = null;
function setor1()  {
janela1=window.open('/upload.php','sprito','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=180,left=420,width=300,height=200'); }

janela2 = null;
function setor2()  {
janela2=window.open('paleta.php','sprito','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=180,left=420,width=398,height=345'); }

</script>

</head>
<body>




<table width="100%">
<tr>
<td valign="top">


</td>
<td valign="top">


<?php

include ("stp.php");

  if($opcao=='criar')
  {	            
$comando = "drop table if exists menu_vert";
$banco = mysql_select_db($base);
      if($pesquisa = mysql_query($comando,$conecta))		 
echo 'Tabela excluida com sucesso...<br>';

$comando = "create table menu_vert ( 
cod_item integer not null primary key auto_increment, 

item_menu varchar (50),
id varchar (10),
url varchar (250),
nome varchar (100))"; 

$banco = mysql_select_db($base);
      if($pesquisa = mysql_query($comando,$conecta))		 
echo 'Tabela criada com sucesso...<br>';
  }  









if($opcao=='inserircategoria')
  {
	if(empty($item_menu))
	{
	
include ("form_novomenuvert.php");
 		

	}
   	
else
	{
     	  
$comando = "insert into menu_vert values (0,

'".$item_menu."',
'".$id."',
'".$url."',
'".$nome."' )";

$banco = mysql_select_db($base);
      if($pesquisa = mysql_query($comando,$conecta))

echo '

<center>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
O item foi inclu&iacute;do com sucesso... <br><br>

<a href="lista_menus.php?usr='.$usr.'&list=pmenu&menu='.$nome.'" target="listas">

<img src="images/icone_voltar.jpg" border="0">

</a>


';


	}
  }










if($opcao=='inserir')
  {
	if(empty($item_menu))
	{
	
include ("form_novoitemmenuvert.php");
 		

	}
   	
else
	{
     	  
$comando = "insert into menu_vert values (0,

'".$item_menu."',
'".$id."',
'".$url."',
'".$nome."' )";

$banco = mysql_select_db($base);
      if($pesquisa = mysql_query($comando,$conecta))

echo '

<center>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
O item foi incluido com sucesso... <br/><br/>

<a href="lista_menusVert.php?usr='.$usr.'&list=pmenu&menu='.$nome.'" target="listas">

<img src="images/icone_voltar.jpg" border="0">

</a>



';


	}
  }









  if($opcao=='visualizar')
  {
      $comando = "select * from menu_vert order by cod_item asc";
      $banco = mysql_select_db($base);
      if($pesquisa = mysql_query($comando,$conecta))
      while($valor = mysql_fetch_array($pesquisa))
	  {

echo '


<table border="0" width="100%" bgcolor="#CCCCCC">
<tr>
<td width="15%" align="right">


</td>
<td width="36%">&nbsp;</td>
<td width="5%">&nbsp;</td>
</tr>
<tr>
<td width="5%" align="right">



<font face="Verdana" size="2">
Item '.$valor["cod_mp"].' 
</font>


</td>
<td width="90%">
<a href="index.php?opcao=altera&cod='.$valor["cod_item"].'">


'.$valor["item_menu"].'


</a>
</td>
<td width="5%">&nbsp;</td>
</tr>
<tr>
<td width="5%" align="right" valign="top">
<font face="Arial Narrow" size="2"><b>

URL:

<br><br>


</b></font></td>
<td width="90%" align="left" valign="top">
<font face="Arial Narrow" size="1">

'.$valor["url"].'


<br><br>

</font>
</td>
<td width="5%">&nbsp;</td>
</tr>
</table>

';

		 		 
echo '
<A HREF="?usr='.$usr.'&adm=menuvert&opcao=altera&cod='.$valor["cod_item"].'">

Alterar

</A>&nbsp;&nbsp;
		 

<A HREF="?usr='.$usr.'&adm=menuvert&opcao=excluir&cod='.$valor["cod_item"].'">

Excluir

</A>&nbsp;&nbsp; 
		 
<br><br>';

	  }
  }












  if($opcao=='altera')
  {
    
	if($flag!='gravar')
	{
	  
      $comando = "select * from menu_vert where cod_item = ".$cod;
      $banco = mysql_select_db($base);
      if($pesquisa = mysql_query($comando,$conecta))
	  {
        $valor = mysql_fetch_array($pesquisa);

   	   
	    
include ("form_altmenuvert.php");

	    	    
	  }
	}

    if($flag=='gravar')
    {
	  


$comando = "update menu_vert set 


item_menu = '".$item_menu."',
id = '".$id."',
url = '".$url."',
nome = '".$nome."' 

where cod_item = ".$cod;

      $banco = mysql_select_db($base);
      if($pesquisa = mysql_query($comando,$conecta))

      
echo '

<center>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
O item foi alterado com sucesso... <br/><br/>

<a href="lista_menusVert.php?usr='.$usr.'&list=pmenu&menu='.$nome.'" target="listas">

<img src="images/icone_voltar.jpg" border="0">

</a>';


	}


  }

  if($opcao=='excluir')
  {
    


	if(empty($flag))
	  
echo 'Deseja mesmo excluir os valores?<br>
<A href="index.php?usr='.$usr.'&adm=menuvert&opcao=excluir&flag=sim&cod='.$cod.'" target="conteudo">

Sim

</A>&nbsp;&nbsp;&nbsp;
<A href="index.php?usr='.$usr.'&adm=menuvert&opcao=excluir&flag=nao" target="conteudo">

N&atilde;o

</A>';



	if($flag=='sim')
	{
      $comando = "delete from menu_vert where cod_item = ".$cod;
      $banco = mysql_select_db($base);
      if($pesquisa = mysql_query($comando,$conecta))
      echo '
<center>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
O item foi excluido com sucesso... <br/><br/>

<a href="lista_menusVert.php?usr='.$usr.'&list=pmenu&menu='.$nome.'" target="listas">

<img src="images/icone_voltar.jpg" border="0">

</a>


';
	}
	if($flag=='nao')
	  {
		echo 'O menu permanece inalterado';
	  }
  }



?> 

</td>
</tr>

</body>
</html>
