<?

    include("authentication.php");

	include("conexao_e_agenda.php");

	include("funcoes.php");

	

 if (isset($_GET['codigo'])) {

   $codigo=$_GET['codigo'];

   }else{

   $codigo=" ";

   } 





  $sql="SELECT * FROM livro WHERE id='$codigo'";

  $result=mysqli_query($conexao,$sql);

  $linha = mysqli_fetch_array($result);



 ?> 

<html>

<head>

<title><? echo $empresa; ?></title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="estilo.css" rel="stylesheet" type="text/css">

</head>



<body></center>

<script language="JavaScript">

<!--





function txtBoxFormat(objForm, strField, sMask, evtKeyPress) {

      var i, nCount, sValue, fldLen, mskLen,bolMask, sCod, nTecla;



      if(document.all) { // Internet Explorer

        nTecla = evtKeyPress.keyCode; }

      else if(document.layers) { // Nestcape

        nTecla = evtKeyPress.which;

      }



      sValue = objForm[strField].value;



      // Limpa todos os caracteres de formatação que

      // já estiverem no campo.

      sValue = sValue.toString().replace( "-", "" );

      sValue = sValue.toString().replace( "-", "" );

      sValue = sValue.toString().replace( ".", "" );

      sValue = sValue.toString().replace( ".", "" );

      sValue = sValue.toString().replace( "/", "" );

      sValue = sValue.toString().replace( "/", "" );

      sValue = sValue.toString().replace( "(", "" );

      sValue = sValue.toString().replace( "(", "" );

      sValue = sValue.toString().replace( ")", "" );

      sValue = sValue.toString().replace( ")", "" );

      sValue = sValue.toString().replace( " ", "" );

      sValue = sValue.toString().replace( " ", "" );

      sValue = sValue.toString().replace( ":", "" );

      sValue = sValue.toString().replace( ":", "" );

      fldLen = sValue.length;

      mskLen = sMask.length;



      i = 0;

      nCount = 0;

      sCod = "";

      mskLen = fldLen;



      while (i <= mskLen) {

        bolMask = ((sMask.charAt(i) == "-") || (sMask.charAt(i) == ".") || (sMask.charAt(i) == "/"))

        bolMask = bolMask || ((sMask.charAt(i) == "(") || (sMask.charAt(i) == ")") || (sMask.charAt(i) == " ") || (sMask.charAt(i) == ":"))



        if (bolMask) {

          sCod += sMask.charAt(i);

          mskLen++; }

        else {

          sCod += sValue.charAt(nCount);

          nCount++;

        }



        i++;

      }



      objForm[strField].value = sCod;



      if (nTecla != 8) { // backspace

        if (sMask.charAt(i-1) == "9") { // apenas números...

          return ((nTecla > 47) && (nTecla < 58)); } // números de 0 a 9

        else { // qualquer caracter...

          return true;

        } }

      else {

        return true;

      }

    }

//-->

</script>

            

<table width="100%" height="0" border="0" align="center" cellpadding="0" cellspacing="0">

<tr valign="top"> 

                <td height="165"> <div align="center">

        <? include("cabecalho_e_clube.php");?>

        <br>

                  <form name="form1" method="post" action="update_livrovisita.php">

                <input type="hidden" name="codigo" id="codigo" value="<? echo $codigo; ?>">

          <table width="615" border="0" cellspacing="0" cellpadding="0">

            <tr bgcolor="#006699"> 

              <td width="595" bgcolor="#666666" class="texto"><div align="center"><font color="#FFFFFF"><strong>LIVRO 

              DE VISITAS</strong></font></div></td>

              <td width="20"><a href="listagem_comentarios.php"><img src="fechaform.gif" width="20" height="20" border="0"></a></td>

            </tr>

          </table>

          <table width="615" height="363" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#DADADA" class="cant_cinza">

            <tr> 

              <td height="20" colspan="3" class="verdana_preto_10"> <div align="center" class="texto"><font color="#FFFFFF"></font></div></td>

            </tr>

            <tr> 

              <td width="124" height="25" class="verdana_preto_10">

                <div align="right">Nome 

                Completo:&nbsp;&nbsp;</div></td>

              <td width="451" class="verdana_preto_10" bgcolor="#d6d6d6"> <? echo $linha['nome']; ?></td>

              <td >&nbsp;</td>

            </tr>

            <tr> 

              <td height="6" class="verdana_preto_10">

              <div align="right">E-mail:&nbsp;&nbsp;</div></td>

              <td class="verdana_preto_10" bgcolor="#d6d6d6"> <? echo $linha['email']; ?></td>

              <td >&nbsp;</td>

            </tr>

            <tr> 

              <td height="7" class="verdana_preto_10">

              <div align="right">Cidade:&nbsp;&nbsp;</div></td>

              <td class="verdana_preto_10" bgcolor="#d6d6d6"><? echo $linha['cidade']; ?></td>

              <td >&nbsp;</td>

            </tr>

            <tr> 

              <td height="12" class="verdana_preto_10">

              <div align="right">Estado:&nbsp;&nbsp;</div></td>

              <td class="verdana_preto_10" bgcolor="#d6d6d6"><? echo $linha['estado']; ?></td>

              <td >&nbsp;</td>

            </tr>

            <tr class="verdana_preto_10"> 

              <td>

              <div align="right">Mensagem:&nbsp;&nbsp;</div></td>

              <td bgcolor="#d6d6d6"> <textarea name="texto" cols="50" rows="15" wrap="PHYSICAL" id="textarea"><? echo $linha['texto']; ?></textarea></td>

              <td width="38">&nbsp;</td>

            </tr>

            <tr class="verdana_preto_10"> 

              <td height="25">

              <div align="right">Data postagem:&nbsp;&nbsp;</div></td>

              <td height="25" bgcolor="#d6d6d6"><? echo $linha['data_mostra']; ?></td>

              <td height="25">&nbsp;</td>

            </tr>

            <tr class="verdana_preto_10"> 

              <td height="20">

              <div align="right">Hora postagem:&nbsp;&nbsp;</div></td>

              <td height="20" bgcolor="#d6d6d6"><? echo $linha['hora']; ?></td>

              <td height="12">&nbsp;</td>

            </tr>

            <tr class="verdana_preto_10"> 

              <td height="20" colspan="2">&nbsp;&nbsp;Situa&ccedil;&atilde;o do 

                Livro de visitas: Liberado [ <? echo $linha['liberado']; ?> ]</td>

              <td height="13">&nbsp;</td>

            </tr>

            <tr class="verdana_preto_10"> 

              <td height="25" colspan="3">&nbsp;&nbsp;Liberar para ser visualizado 

                no livro de visitas 

                <input name="liberado" style="border:none" type="checkbox" id="liberado" value="sim"> 

              </td>

            </tr>

            <tr class="verdana_preto_10"> 

              <td height="25" colspan="3">&nbsp;&nbsp;Excluir do livro de visitas 

                <input name="excluir" style="border:none" type="checkbox" id="excluir" value="sim"></td>

            </tr>

            <tr class="verdana_preto_10"> 

              <td height="25" colspan="2"> <div align="right"> &nbsp;&nbsp; 

                  <input name="Submit" type="submit" class="caixa_buttun_preto_9" style="cursor:hand" value="Executar">

                </div></td>

              <td height="25">&nbsp;</td>

            </tr>

            <tr class="verdana_preto_10"> 

              <td colspan="2">&nbsp;</td>

              <td height="20">&nbsp;</td>

            </tr>

          </table>

        </form>

        <br>

            </div></td>

              </tr>

            </table>     

</body>

</html>

