0
So, the data from is coming right, but it’s not being shown. I tested it without css and it worked. The problem is in the 3 Ivs, someone can identify why? (EXTREMELY URGENT).
// essas tres divs
<div class="container-fluid">
<div class="col-md-7 col-centered">
<h1 class="h1-large text-center">Mensagens</h1>
<div id = "b" class="well">
<?php
session_start();
require_once './banco-mensagens.php';
require_once './conexao.php';
require_once './banco-chamado.php';
$cpf = $_SESSION['cpfTecLog'];
if (isset($_GET['msg'])) {
$id = $_GET['msg'];
if (isset($_SESSION['cpfCliMsg' . $id])) {
$cpfCli = $_SESSION['cpfCliMsg' . $id];
$nome = pegarNomeCli($conexao, $cpfCli);
echo '<div class="mensagens">'
. '<p>Contato: ' . $nome . ' </p>'
. '<a href="pag_perfilAbertoCli.php">Visitar perfil</a>';
$dom = new DOMDocument("1.0", "ISO-8859-7");
$root = lerXML($dom, $conexao, $cpfCli, $cpf, 1);
$dom = $_SESSION['dom'];
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$mensagem = $_POST['txtMsg'];
$msg = addMensagem($dom, $mensagem, $cpf);
$root->appendChild($msg);
$dom->appendChild($root);
# Para salvar o arquivo, descomente a linha
$dom->save($_SESSION['nomeXML']);
$_POST['txtMsg'] = null;
unset($msg);
$root = lerXML($dom, $conexao, $cpfCli, $cpf, 1);
$dom = $_SESSION['dom'];
}
// $dom = $_SESSION['dom'];
$ver = simplexml_import_dom($dom);
foreach ($ver as $xml):
if ($xml->cpf_origem == 1234) {
echo '<p align="center">' . $xml->mensagem . '</p>';
} else if ($xml->cpf_origem == $cpf) {
echo '<p align="right">' . $xml->mensagem . '</p>';
echo '<p align="right">' . $xml->data_envio . '</p>';
} else {
echo '<p align="left">' . $xml->mensagem . '</p>';
echo '<p align="left">' . $xml->data_envio . '</p>';
}
endforeach;
$_SESSION['cpfCliTec'] = $cpfCli;
$_SESSION['abrirPerfilCliente'] = 'comentario';
?>
</div>
<form method = "POST" action = "pag_comentarios.php?msg=<?php echo $id; ?>">
<input class="form-control" type = "text" name="txtMsg">
<input class="btn btn-primary btn-lg p-large botao" type = "submit" value = "Enviar">
</form>
// são fechadas aqui
</div>
</div>
</div>
<?php
} else {
echo '<center>Erro ao abrir comentários!</center>';
}
}
I was able to find the error, apparently inside the if do get was not finding the message class (being that it is in the code.
– Leandro
In the code is
mensagens
not "message".– Sam