<?
include_once("../../../cisweb_manual/valida_sessao.php");
protegePagina(); 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Sistema de Conteúdo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<link href="../../../cisweb_manual/CisManual/css/estilo.css" rel="stylesheet" type="text/css" />
<link href="../../../cisweb_manual/CisManual/css/menu.css" rel="stylesheet" type="text/css" />
<link href="../../../cisweb_manual/CisManual/css/jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="../../../cisweb_manual/CisManual/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="../../../cisweb_manual/CisManual/js/busca.js"></script>
<script type="text/javascript" src="../../../cisweb_manual/CisManual/js/validacao.js"></script>
<script type="text/javascript" src="../../../cisweb_manual/CisManual/js/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src="../../../cisweb_manual/CisManual/ckeditor/ckeditor.js"></script>

</head>
<body>


  <div id="topo">
  <img src="<? echo $url ?>../../img/manual/admlogo.png" align="left" />
  <strong><? echo $_SESSION['usuarioNome']; ?></strong> ,
  <img src="../../../cisweb_manual/img/bem_vindo.jpg" align="absmiddle" />  
  </div>
		
<div id="local">
Você está em:

<?php
include("../../../cisweb_manual/CisManual/config.php");
include("../../../cisweb_manual/CisManual/utf8.php");

if (isset($_POST['submit'])) {
$id = $_POST['id'];
$idpag = $_POST['idpag'];
$OB_TEXTO = $_POST['OB_TEXTO'];

   include("utf8.php");
   $update = "UPDATE observacoes SET OB_TEXTO = '$OB_TEXTO' WHERE OB_COD = $id";
   mysql_query($update, $conn);
   mysql_close($conn);
 
   $local = "publicar_pagina.php?id=".$idpag."&alterado=1";
   echo "<script>location.href='adm_pagina.php';</script>";
   
?>

<?php
} else {
	
$id = $_GET['id'];
$idpag = $_GET['idpag'];

$qry = "SELECT * FROM observacoes WHERE OB_COD = $id";
$consulta = mysql_query($qry, $conn);
$registro = mysql_fetch_array($consulta);
?>

<form name="frmobs" method="POST" action="<?=$_SERVER['PHP_SELF']?>" onSubmit="return valida_obs(this);">
Revisão <br />
<textarea cols="40" rows="5" name="OB_TEXTO"><?=$registro['OB_TEXTO']?></textarea>
<br /><br />
            <input type="hidden" value="<?=$id?>" name="id" />
            <input type="hidden" value="<?=$idpag?>" name="idpag" />
              <p align="center">
              <input type="button" value="Voltar" class="botao" name="voltar" onclick="location.href='adm_pagina.php'">
              <input type="submit" value="Salvar" class="botao" name="submit"></p>
</form>
<?php
}
mysql_close($conn);
?>

<? include_once("../../../cisweb_manual/CisManual/adm_foot.php"); ?>